summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 19:01:15 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 19:01:15 (GMT)
commit12166aa342f7c8d905097e43a1f50e0775503069 (patch)
tree73a6e7296fbf9898633a02c2503a3e959789d8c3
parentd4d595fa7fb12903db9227d33d48b2b00120dbd1 (diff)
downloadblt-12166aa342f7c8d905097e43a1f50e0775503069.zip
blt-12166aa342f7c8d905097e43a1f50e0775503069.tar.gz
blt-12166aa342f7c8d905097e43a1f50e0775503069.tar.bz2
Initial commit
-rw-r--r--ds9/cmaps/ch05m151008.sao11
-rw-r--r--ds9/cmaps/ch05m151010.sao11
-rw-r--r--ds9/cmaps/ch05m151012.sao11
-rw-r--r--ds9/cmaps/ch05m151410.sao11
-rw-r--r--ds9/cmaps/ch05p151010.sao11
-rw-r--r--ds9/cmaps/ch20m151010.sao11
-rw-r--r--ds9/cmaps/cubehelix0.sao319
-rw-r--r--ds9/cmaps/cubehelix1.sao319
-rw-r--r--ds9/cmaps/gist_earth.sao11
-rw-r--r--ds9/cmaps/gist_gray.sao11
-rw-r--r--ds9/cmaps/gist_heat.sao11
-rw-r--r--ds9/cmaps/gist_ncar.sao11
-rw-r--r--ds9/cmaps/gist_rainbow.sao11
-rw-r--r--ds9/cmaps/gist_stern.sao11
-rw-r--r--ds9/cmaps/gist_yarg.sao11
-rw-r--r--ds9/cmaps/h5_autumn.sao11
-rw-r--r--ds9/cmaps/h5_bluered.sao11
-rw-r--r--ds9/cmaps/h5_bone.sao11
-rw-r--r--ds9/cmaps/h5_cool.sao11
-rw-r--r--ds9/cmaps/h5_copper.sao11
-rw-r--r--ds9/cmaps/h5_dkbluered.sao11
-rw-r--r--ds9/cmaps/h5_gray.sao11
-rw-r--r--ds9/cmaps/h5_green.sao11
-rw-r--r--ds9/cmaps/h5_hot.sao11
-rw-r--r--ds9/cmaps/h5_hsv.sao11
-rw-r--r--ds9/cmaps/h5_jet.sao11
-rw-r--r--ds9/cmaps/h5_pink.sao11
-rw-r--r--ds9/cmaps/h5_spring.sao11
-rw-r--r--ds9/cmaps/h5_summer.sao11
-rw-r--r--ds9/cmaps/h5_winter.sao11
-rw-r--r--ds9/cmaps/h5_yarg.sao11
-rw-r--r--ds9/cmaps/h5_yellow.sao11
-rw-r--r--ds9/cmaps/tpglarf.sao11
-rw-r--r--ds9/cmaps/tpglarm.sao11
-rw-r--r--ds9/cmaps/tpglhcf.sao11
-rw-r--r--ds9/cmaps/tpglhcm.sao11
-rw-r--r--ds9/cmaps/tpglhwf.sao11
-rw-r--r--ds9/cmaps/tpglhwm.sao11
-rw-r--r--ds9/cmaps/tpglpof.sao11
-rw-r--r--ds9/cmaps/tpglpom.sao11
-rw-r--r--ds9/cmaps/tpsfhf.sao11
-rw-r--r--ds9/cmaps/tpsfhm.sao11
-rw-r--r--ds9/cmaps/tpusarf.sao11
-rw-r--r--ds9/cmaps/tpusarm.sao11
-rw-r--r--ds9/cmaps/tpushuf.sao11
-rw-r--r--ds9/cmaps/tpushum.sao11
-rw-r--r--ds9/cmaps/viridis.lut257
-rw-r--r--ds9/doc/acknowledgment.html33
-rw-r--r--ds9/doc/faq.html805
-rw-r--r--ds9/doc/helpdesk.html28
-rw-r--r--ds9/doc/install.html71
-rw-r--r--ds9/doc/new.html333
-rw-r--r--ds9/doc/ref/3d.html80
-rw-r--r--ds9/doc/ref/analysis.html878
-rw-r--r--ds9/doc/ref/backup.html60
-rw-r--r--ds9/doc/ref/bin.html53
-rw-r--r--ds9/doc/ref/catalog.html147
-rw-r--r--ds9/doc/ref/colorbar.html71
-rw-r--r--ds9/doc/ref/command.html5025
-rw-r--r--ds9/doc/ref/contour.html189
-rw-r--r--ds9/doc/ref/file.html825
-rw-r--r--ds9/doc/ref/grid.html90
-rw-r--r--ds9/doc/ref/how.html159
-rw-r--r--ds9/doc/ref/img/asinh.pngbin0 -> 7902 bytes
-rw-r--r--ds9/doc/ref/img/gauss.pngbin0 -> 9339 bytes
-rw-r--r--ds9/doc/ref/img/log.pngbin0 -> 7836 bytes
-rw-r--r--ds9/doc/ref/img/pow.pngbin0 -> 6969 bytes
-rw-r--r--ds9/doc/ref/img/saolog.pngbin0 -> 7579 bytes
-rw-r--r--ds9/doc/ref/img/sinh.pngbin0 -> 7768 bytes
-rw-r--r--ds9/doc/ref/img/sqrt.pngbin0 -> 6931 bytes
-rw-r--r--ds9/doc/ref/img/square.pngbin0 -> 6859 bytes
-rw-r--r--ds9/doc/ref/index.html105
-rw-r--r--ds9/doc/ref/iraf.html179
-rw-r--r--ds9/doc/ref/keyboard.html230
-rw-r--r--ds9/doc/ref/prefs.html34
-rw-r--r--ds9/doc/ref/print.html57
-rw-r--r--ds9/doc/ref/region.html808
-rw-r--r--ds9/doc/ref/samp.html6367
-rw-r--r--ds9/doc/ref/vo.html69
-rw-r--r--ds9/doc/ref/xpa.html6216
-rw-r--r--ds9/doc/release/r1.5.html76
-rw-r--r--ds9/doc/release/r1.6.html26
-rw-r--r--ds9/doc/release/r1.7.html98
-rw-r--r--ds9/doc/release/r1.8.html417
-rw-r--r--ds9/doc/release/r1.9.html302
-rw-r--r--ds9/doc/release/r2.0.html34
-rw-r--r--ds9/doc/release/r2.1.html529
-rw-r--r--ds9/doc/release/r2.2.html488
-rw-r--r--ds9/doc/release/r2.3.html78
-rw-r--r--ds9/doc/release/r3.0.html726
-rw-r--r--ds9/doc/release/r4.0.html424
-rw-r--r--ds9/doc/release/r5.0.html449
-rw-r--r--ds9/doc/release/r6.0.html175
-rw-r--r--ds9/doc/release/r7.0.html739
-rw-r--r--ds9/doc/story.html59
-rw-r--r--ds9/doc/sun.gifbin0 -> 3618 bytes
-rw-r--r--ds9/doc/tutorial.html28
-rw-r--r--ds9/doc/user/binning/binmenu.pngbin0 -> 5904 bytes
-rw-r--r--ds9/doc/user/binning/binpar.pngbin0 -> 8358 bytes
-rw-r--r--ds9/doc/user/binning/binpar2.pngbin0 -> 8552 bytes
-rw-r--r--ds9/doc/user/binning/block4.pngbin0 -> 175189 bytes
-rw-r--r--ds9/doc/user/binning/cubebox.pngbin0 -> 4789 bytes
-rw-r--r--ds9/doc/user/binning/cubeimg.pngbin0 -> 20434 bytes
-rw-r--r--ds9/doc/user/binning/defaults.pngbin0 -> 71428 bytes
-rw-r--r--ds9/doc/user/binning/detimage.pngbin0 -> 135356 bytes
-rw-r--r--ds9/doc/user/binning/filterimg.pngbin0 -> 46264 bytes
-rw-r--r--ds9/doc/user/binning/index.html367
-rw-r--r--ds9/doc/user/binning/jupiter.mpgbin0 -> 172004 bytes
-rw-r--r--ds9/doc/user/binning/largebuffer.pngbin0 -> 73843 bytes
-rw-r--r--ds9/doc/user/binning/smallbuffer.pngbin0 -> 36162 bytes
-rw-r--r--ds9/doc/user/binning/thread.xml358
-rw-r--r--ds9/doc/user/catalogs/2masscat.pngbin0 -> 150571 bytes
-rw-r--r--ds9/doc/user/catalogs/2masssort.pngbin0 -> 151014 bytes
-rw-r--r--ds9/doc/user/catalogs/2masssrc.pngbin0 -> 201559 bytes
-rw-r--r--ds9/doc/user/catalogs/addlabels.pngbin0 -> 46468 bytes
-rw-r--r--ds9/doc/user/catalogs/addlabelsds9.pngbin0 -> 208461 bytes
-rw-r--r--ds9/doc/user/catalogs/cscsrc.pngbin0 -> 210635 bytes
-rw-r--r--ds9/doc/user/catalogs/editjmag14.pngbin0 -> 40669 bytes
-rw-r--r--ds9/doc/user/catalogs/editjmag14ds9.pngbin0 -> 176743 bytes
-rw-r--r--ds9/doc/user/catalogs/editjmagrange.pngbin0 -> 182689 bytes
-rw-r--r--ds9/doc/user/catalogs/index.html414
-rw-r--r--ds9/doc/user/catalogs/jmag14.pngbin0 -> 179884 bytes
-rw-r--r--ds9/doc/user/catalogs/jmagrange.pngbin0 -> 186326 bytes
-rw-r--r--ds9/doc/user/contour/a2142.reg544
-rw-r--r--ds9/doc/user/contour/dialog.pngbin0 -> 8790 bytes
-rw-r--r--ds9/doc/user/contour/ds9.con2682
-rw-r--r--ds9/doc/user/contour/dsscontour.pngbin0 -> 236788 bytes
-rw-r--r--ds9/doc/user/contour/dssdialog.pngbin0 -> 6958 bytes
-rw-r--r--ds9/doc/user/contour/index.html269
-rw-r--r--ds9/doc/user/contour/thread.xml258
-rw-r--r--ds9/doc/user/contour/xraycontour.pngbin0 -> 86191 bytes
-rw-r--r--ds9/doc/user/gui/button.pngbin0 -> 1589 bytes
-rw-r--r--ds9/doc/user/gui/color.pngbin0 -> 435 bytes
-rw-r--r--ds9/doc/user/gui/components.pngbin0 -> 210961 bytes
-rw-r--r--ds9/doc/user/gui/frame.pngbin0 -> 50729 bytes
-rw-r--r--ds9/doc/user/gui/index.html351
-rw-r--r--ds9/doc/user/gui/info.pngbin0 -> 3167 bytes
-rw-r--r--ds9/doc/user/gui/mag.pngbin0 -> 2614 bytes
-rw-r--r--ds9/doc/user/gui/menu.pngbin0 -> 964 bytes
-rw-r--r--ds9/doc/user/gui/menutear.pngbin0 -> 192086 bytes
-rw-r--r--ds9/doc/user/gui/panner.pngbin0 -> 2566 bytes
-rw-r--r--ds9/doc/user/gui/prefs.pngbin0 -> 12127 bytes
-rw-r--r--ds9/doc/user/gui/thread.xml325
-rw-r--r--ds9/doc/user/gui/vertical.pngbin0 -> 207038 bytes
-rw-r--r--ds9/doc/user/index.html68
-rw-r--r--ds9/doc/user/rgb/color.pngbin0 -> 248723 bytes
-rw-r--r--ds9/doc/user/rgb/ds9.pngbin0 -> 155858 bytes
-rw-r--r--ds9/doc/user/rgb/filtered.pngbin0 -> 216857 bytes
-rw-r--r--ds9/doc/user/rgb/grid.pngbin0 -> 8355 bytes
-rw-r--r--ds9/doc/user/rgb/index.html431
-rw-r--r--ds9/doc/user/rgb/lock.pngbin0 -> 4287 bytes
-rw-r--r--ds9/doc/user/rgb/rgb.pngbin0 -> 3836 bytes
-rw-r--r--ds9/doc/user/rgb/scale.pngbin0 -> 250506 bytes
-rw-r--r--ds9/doc/user/rgb/smooth.pngbin0 -> 319530 bytes
-rw-r--r--ds9/doc/user/rgb/thread.xml412
-rw-r--r--ds9/doc/user/scripts/contour.pngbin0 -> 387031 bytes
-rw-r--r--ds9/doc/user/scripts/contourdss.pngbin0 -> 367684 bytes
-rw-r--r--ds9/doc/user/scripts/index.html363
-rw-r--r--ds9/doc/user/scripts/thread.xml330
-rw-r--r--ds9/library/2mass.tcl141
-rw-r--r--ds9/library/3d.tcl534
-rw-r--r--ds9/library/Makefile188
-rw-r--r--ds9/library/analysis.tcl1958
-rw-r--r--ds9/library/analysisparam.tcl176
-rw-r--r--ds9/library/annulus.tcl182
-rw-r--r--ds9/library/ar.tcl208
-rw-r--r--ds9/library/array.tcl167
-rw-r--r--ds9/library/backup.tcl802
-rw-r--r--ds9/library/bin.tcl830
-rw-r--r--ds9/library/block.tcl356
-rw-r--r--ds9/library/box.tcl126
-rw-r--r--ds9/library/boxannulus.tcl28
-rw-r--r--ds9/library/bpanda.tcl36
-rw-r--r--ds9/library/buttons.tcl310
-rw-r--r--ds9/library/cat.tcl1799
-rw-r--r--ds9/library/catcds.tcl246
-rw-r--r--ds9/library/catcdssrch.tcl471
-rw-r--r--ds9/library/catcdssrchdialog.tcl474
-rw-r--r--ds9/library/catcmd.tcl764
-rw-r--r--ds9/library/catcxc.tcl390
-rw-r--r--ds9/library/catdialog.tcl1302
-rw-r--r--ds9/library/catflt.tcl133
-rw-r--r--ds9/library/catmatch.tcl711
-rw-r--r--ds9/library/catned.tcl212
-rw-r--r--ds9/library/catopt.tcl57
-rw-r--r--ds9/library/catplot.tcl216
-rw-r--r--ds9/library/catreg.tcl395
-rw-r--r--ds9/library/catsdss.tcl176
-rw-r--r--ds9/library/catsimbad.tcl236
-rw-r--r--ds9/library/catskybot.tcl158
-rw-r--r--ds9/library/catsym.tcl502
-rw-r--r--ds9/library/catvot.tcl70
-rw-r--r--ds9/library/centroid.tcl115
-rw-r--r--ds9/library/circle.tcl108
-rw-r--r--ds9/library/colorbar.tcl1449
-rw-r--r--ds9/library/comm.tcl386
-rw-r--r--ds9/library/command.tcl918
-rw-r--r--ds9/library/compass.tcl99
-rw-r--r--ds9/library/composite.tcl136
-rw-r--r--ds9/library/contour.tcl1418
-rw-r--r--ds9/library/convert.tcl215
-rw-r--r--ds9/library/coord.tcl204
-rw-r--r--ds9/library/cpanda.tcl132
-rw-r--r--ds9/library/crop.tcl467
-rw-r--r--ds9/library/crosshair.tcl310
-rw-r--r--ds9/library/cube.tcl843
-rw-r--r--ds9/library/debug.tcl285
-rw-r--r--ds9/library/dialog.tcl585
-rwxr-xr-xds9/library/ds9.tcl603
-rw-r--r--ds9/library/ellipse.tcl126
-rw-r--r--ds9/library/ellipseannulus.tcl28
-rw-r--r--ds9/library/envi.tcl96
-rw-r--r--ds9/library/epanda.tcl38
-rw-r--r--ds9/library/error.tcl73
-rw-r--r--ds9/library/eso.tcl170
-rw-r--r--ds9/library/examine.tcl319
-rw-r--r--ds9/library/export.tcl398
-rw-r--r--ds9/library/external.tcl61
-rw-r--r--ds9/library/file.tcl307
-rw-r--r--ds9/library/fits.tcl408
-rw-r--r--ds9/library/frame.tcl2667
-rw-r--r--ds9/library/graph.tcl419
-rw-r--r--ds9/library/grid.tcl1550
-rw-r--r--ds9/library/group.tcl208
-rw-r--r--ds9/library/header.tcl195
-rw-r--r--ds9/library/help.tcl85
-rw-r--r--ds9/library/htp.tcl22
-rw-r--r--ds9/library/http.tcl54
-rw-r--r--ds9/library/hv.tcl931
-rw-r--r--ds9/library/hvform.tcl525
-rw-r--r--ds9/library/hvsup.tcl2089
-rw-r--r--ds9/library/iexam.tcl189
-rw-r--r--ds9/library/iis.tcl398
-rw-r--r--ds9/library/ime.tcl609
-rw-r--r--ds9/library/imgsvr.tcl585
-rw-r--r--ds9/library/import.tcl230
-rw-r--r--ds9/library/info.tcl1177
-rw-r--r--ds9/library/layout.tcl1086
-rw-r--r--ds9/library/line.tcl121
-rw-r--r--ds9/library/load.tcl534
-rw-r--r--ds9/library/macosx.tcl82
-rw-r--r--ds9/library/magnifier.tcl187
-rw-r--r--ds9/library/manalysis.tcl602
-rw-r--r--ds9/library/marker.tcl2076
-rw-r--r--ds9/library/markeranalysishist.tcl116
-rw-r--r--ds9/library/markeranalysispanda.tcl160
-rw-r--r--ds9/library/markeranalysisplot2d.tcl273
-rw-r--r--ds9/library/markeranalysisplot3d.tcl231
-rw-r--r--ds9/library/markeranalysisradial.tcl177
-rw-r--r--ds9/library/markeranalysisstats.tcl102
-rw-r--r--ds9/library/markerbase.tcl313
-rw-r--r--ds9/library/markerbaseannulus.tcl274
-rw-r--r--ds9/library/markerbaseannulusrect.tcl188
-rw-r--r--ds9/library/markerbasecenter.tcl91
-rw-r--r--ds9/library/markerbaseline.tcl99
-rw-r--r--ds9/library/markerbasepanda.tcl216
-rw-r--r--ds9/library/markerbasepandarect.tcl130
-rw-r--r--ds9/library/markerdialog.tcl292
-rw-r--r--ds9/library/mask.tcl297
-rw-r--r--ds9/library/mbin.tcl341
-rw-r--r--ds9/library/mcolor.tcl498
-rw-r--r--ds9/library/mecube.tcl133
-rw-r--r--ds9/library/medit.tcl321
-rw-r--r--ds9/library/menu.tcl586
-rw-r--r--ds9/library/mfile.tcl688
-rw-r--r--ds9/library/mframe.tcl1226
-rw-r--r--ds9/library/mhelp.tcl165
-rw-r--r--ds9/library/mosaic.tcl34
-rw-r--r--ds9/library/mosaicimage.tcl37
-rw-r--r--ds9/library/mosaicimageiraf.tcl87
-rw-r--r--ds9/library/mosaicimagewcs.tcl141
-rw-r--r--ds9/library/mosaicimagewfpc2.tcl93
-rw-r--r--ds9/library/mosaiciraf.tcl87
-rw-r--r--ds9/library/mosaicwcs.tcl148
-rw-r--r--ds9/library/movie.tcl534
-rw-r--r--ds9/library/mregion.tcl1103
-rw-r--r--ds9/library/mscale.tcl441
-rw-r--r--ds9/library/multiframe.tcl179
-rw-r--r--ds9/library/mview.tcl358
-rw-r--r--ds9/library/mwcs.tcl140
-rw-r--r--ds9/library/mzoom.tcl412
-rw-r--r--ds9/library/nameres.tcl254
-rw-r--r--ds9/library/nrrd.tcl142
-rw-r--r--ds9/library/nsvr.tcl287
-rw-r--r--ds9/library/nvss.tcl162
-rw-r--r--ds9/library/open.tcl119
-rw-r--r--ds9/library/pagesetup.tcl208
-rw-r--r--ds9/library/panner.tcl296
-rw-r--r--ds9/library/panzoom.tcl823
-rw-r--r--ds9/library/photo.tcl300
-rw-r--r--ds9/library/pixel.tcl295
-rw-r--r--ds9/library/plot.tcl1360
-rw-r--r--ds9/library/plotbar.tcl201
-rw-r--r--ds9/library/plotdialog.tcl511
-rw-r--r--ds9/library/plotelement.tcl17
-rw-r--r--ds9/library/plotline.tcl281
-rw-r--r--ds9/library/plotprint.tcl114
-rw-r--r--ds9/library/plotprocess.tcl1217
-rw-r--r--ds9/library/plotscatter.tcl256
-rw-r--r--ds9/library/point.tcl111
-rw-r--r--ds9/library/polygon.tcl84
-rw-r--r--ds9/library/prefs.tcl1004
-rw-r--r--ds9/library/prefsdialog.tcl317
-rw-r--r--ds9/library/print.tcl612
-rw-r--r--ds9/library/projection.tcl128
-rw-r--r--ds9/library/rgb.tcl365
-rw-r--r--ds9/library/rgbarray.tcl185
-rw-r--r--ds9/library/rgbcube.tcl163
-rw-r--r--ds9/library/rgbimage.tcl181
-rw-r--r--ds9/library/ruler.tcl117
-rw-r--r--ds9/library/samp.tcl1730
-rw-r--r--ds9/library/sao.tcl158
-rw-r--r--ds9/library/save.tcl251
-rw-r--r--ds9/library/saveimage.tcl271
-rw-r--r--ds9/library/scale.tcl1053
-rw-r--r--ds9/library/segment.tcl74
-rw-r--r--ds9/library/sfits.tcl64
-rw-r--r--ds9/library/shm.tcl251
-rw-r--r--ds9/library/sia.tcl499
-rw-r--r--ds9/library/siadialog.tcl488
-rw-r--r--ds9/library/skyview.tcl619
-rw-r--r--ds9/library/slider.tcl72
-rw-r--r--ds9/library/smooth.tcl304
-rw-r--r--ds9/library/smosaic.tcl25
-rw-r--r--ds9/library/smosaiciraf.tcl70
-rw-r--r--ds9/library/smosaicwcs.tcl70
-rw-r--r--ds9/library/source.tcl195
-rw-r--r--ds9/library/srgbcube.tcl68
-rw-r--r--ds9/library/starbase.tcl547
-rw-r--r--ds9/library/stdfbox.tcl547
-rw-r--r--ds9/library/stsci.tcl182
-rw-r--r--ds9/library/template.tcl130
-rw-r--r--ds9/library/text.tcl93
-rw-r--r--ds9/library/tkfbox.tcl1247
-rw-r--r--ds9/library/tsv.tcl162
-rw-r--r--ds9/library/url.tcl334
-rw-r--r--ds9/library/util.tcl1555
-rw-r--r--ds9/library/var.tcl21
-rw-r--r--ds9/library/vector.tcl165
-rw-r--r--ds9/library/vla.tcl173
-rw-r--r--ds9/library/vlss.tcl132
-rw-r--r--ds9/library/vo.tcl613
-rw-r--r--ds9/library/vot.tcl386
-rw-r--r--ds9/library/wcs.tcl1296
-rwxr-xr-xds9/library/win32.tcl27
-rw-r--r--ds9/library/xmfbox.tcl998
-rw-r--r--ds9/library/xmlrpc.tcl875
-rw-r--r--ds9/library/xpa.tcl2251
-rw-r--r--ds9/macosx/Makefile.in201
-rw-r--r--ds9/macosx/README5
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tcl.framework/Resources/keepme0
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tk.framework/Resources/keepme0
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tksao.framework/Resources/Info.plist64
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Info.plist69
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/MacOS/keepme0
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Resources/App.icnsbin0 -> 47991 bytes
-rw-r--r--ds9/macosx/SAOImage DS9.app/Contents/Resources/fits.icnsbin0 -> 48529 bytes
-rwxr-xr-xds9/macosx/aclocal.m49
-rwxr-xr-xds9/macosx/configure10291
-rwxr-xr-xds9/macosx/configure.in188
-rw-r--r--ds9/macosx/ds9.C232
-rw-r--r--ds9/macosx/tclconfig/ChangeLog980
-rw-r--r--ds9/macosx/tclconfig/README.txt26
-rwxr-xr-xds9/macosx/tclconfig/install-sh528
-rw-r--r--ds9/macosx/tclconfig/tcl.m44150
-rw-r--r--ds9/msgs/cs.msg867
-rw-r--r--ds9/msgs/da.msg867
-rw-r--r--ds9/msgs/de.msg867
-rw-r--r--ds9/msgs/es.msg867
-rw-r--r--ds9/msgs/fr.msg867
-rw-r--r--ds9/msgs/ja.msg867
-rw-r--r--ds9/msgs/pt.msg867
-rw-r--r--ds9/msgs/zh.msg867
-rw-r--r--ds9/template/chandra/acis/acis-i.tpl18
-rw-r--r--ds9/template/chandra/acis/acis-is.tpl30
-rw-r--r--ds9/template/chandra/acis/acis-s.tpl22
-rw-r--r--ds9/template/chandra/acis/acis-si.tpl30
-rw-r--r--ds9/template/chandra/hrc/hrc-i.tpl13
-rw-r--r--ds9/template/chandra/hrc/hrc-s.tpl25
-rw-r--r--ds9/template/heasarc/suzaku/hxd.tpl9
-rw-r--r--ds9/template/heasarc/suzaku/xis.tpl5
-rw-r--r--ds9/template/heasarc/suzaku/xrs.tpl34
-rw-r--r--ds9/template/mmt/binospec.tpl6
-rw-r--r--ds9/template/mmt/hecto/hectochelle.tpl6
-rw-r--r--ds9/template/mmt/hecto/hectospec.tpl6
-rw-r--r--ds9/template/mmt/megacam/megacam-amp-guide.tpl153
-rw-r--r--ds9/template/mmt/megacam/megacam-amp.tpl150
-rw-r--r--ds9/template/mmt/megacam/megacam-chip-guide.tpl82
-rw-r--r--ds9/template/mmt/megacam/megacam-chip.tpl78
-rw-r--r--ds9/template/mmt/mmirs/image.tpl14
-rw-r--r--ds9/template/mmt/mmirs/longslit.tpl14
-rw-r--r--ds9/template/mmt/mmirs/mask.tpl14
-rw-r--r--ds9/template/mmt/swirc.tpl42
-rw-r--r--ds9/template/xmm/epicmos1.tpl20
-rw-r--r--ds9/template/xmm/epicmos2.tpl20
-rw-r--r--ds9/template/xmm/epicpn.tpl31
-rw-r--r--ds9/unix/Makefile.in214
-rwxr-xr-xds9/unix/aclocal.m49
-rwxr-xr-xds9/unix/configure10330
-rwxr-xr-xds9/unix/configure.in198
-rw-r--r--ds9/unix/ds9.C247
-rw-r--r--ds9/unix/tclconfig/ChangeLog980
-rw-r--r--ds9/unix/tclconfig/README.txt26
-rwxr-xr-xds9/unix/tclconfig/install-sh528
-rw-r--r--ds9/unix/tclconfig/tcl.m44150
-rw-r--r--ds9/unix/tkAppInit.c156
-rw-r--r--ds9/util/mergedict.tcl68
-rwxr-xr-xds9/win/Makefile.in158
-rw-r--r--ds9/win/Makefile.old120
-rw-r--r--ds9/win/about.txt4
-rwxr-xr-xds9/win/aclocal.m49
-rw-r--r--ds9/win/buttons.bmpbin0 -> 846 bytes
-rwxr-xr-xds9/win/configure9621
-rwxr-xr-xds9/win/configure.in186
-rw-r--r--ds9/win/ds9.C248
-rw-r--r--ds9/win/ds9.icobin0 -> 191054 bytes
-rw-r--r--ds9/win/ds9.rc134
-rw-r--r--ds9/win/install.vbs15
-rw-r--r--ds9/win/message.txt1
-rw-r--r--ds9/win/tclconfig/ChangeLog980
-rw-r--r--ds9/win/tclconfig/README.txt26
-rwxr-xr-xds9/win/tclconfig/install-sh528
-rw-r--r--ds9/win/tclconfig/tcl.m44150
423 files changed, 173787 insertions, 0 deletions
diff --git a/ds9/cmaps/ch05m151008.sao b/ds9/cmaps/ch05m151008.sao
new file mode 100644
index 0000000..04e1282
--- /dev/null
+++ b/ds9/cmaps/ch05m151008.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch05m151008
+# created by cptutils 1.46
+# Wed Aug 15 23:30:54 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0.011765)(0.0078,0.023529)(0.0118,0.035294)(0.0157,0.043137)(0.0196,0.054902)(0.0235,0.062745)(0.0275,0.070588)(0.0314,0.078431)(0.0353,0.086275)(0.0392,0.090196)(0.0431,0.098039)(0.0471,0.10588)(0.051,0.1098)(0.0549,0.11765)(0.0588,0.12157)(0.0627,0.12549)(0.0667,0.12941)(0.0706,0.13333)(0.0745,0.14118)(0.0784,0.14118)(0.0824,0.1451)(0.0863,0.14902)(0.0902,0.15294)(0.0941,0.15294)(0.098,0.15686)(0.102,0.16078)(0.1059,0.16078)(0.1098,0.16078)(0.1137,0.16471)(0.1176,0.16471)(0.1216,0.16471)(0.1255,0.16863)(0.1294,0.16863)(0.1333,0.16863)(0.1373,0.16863)(0.1412,0.16863)(0.1451,0.16863)(0.149,0.16863)(0.1529,0.16863)(0.1569,0.16863)(0.1608,0.16471)(0.1647,0.16471)(0.1686,0.16471)(0.1725,0.16471)(0.1765,0.16471)(0.1804,0.16471)(0.1843,0.16078)(0.1882,0.16078)(0.1922,0.16078)(0.1961,0.16078)(0.2,0.16078)(0.2039,0.16078)(0.2078,0.16078)(0.2118,0.15686)(0.2157,0.15686)(0.2196,0.15686)(0.2235,0.15686)(0.2275,0.15686)(0.2314,0.16078)(0.2353,0.16078)(0.2392,0.16078)(0.2431,0.16078)(0.2471,0.16078)(0.251,0.16471)(0.2549,0.16471)(0.2588,0.16471)(0.2627,0.16863)(0.2667,0.16863)(0.2706,0.17255)(0.2745,0.17647)(0.2784,0.18039)(0.2824,0.18039)(0.2863,0.18431)(0.2902,0.18824)(0.2941,0.19216)(0.298,0.19608)(0.302,0.20392)(0.3059,0.20784)(0.3098,0.21176)(0.3137,0.21961)(0.3176,0.22353)(0.3216,0.23137)(0.3255,0.23529)(0.3294,0.24314)(0.3333,0.25098)(0.3373,0.25882)(0.3412,0.26667)(0.3451,0.27451)(0.349,0.28235)(0.3529,0.2902)(0.3569,0.29804)(0.3608,0.30588)(0.3647,0.31765)(0.3686,0.32549)(0.3725,0.33333)(0.3765,0.3451)(0.3804,0.35294)(0.3843,0.36471)(0.3882,0.37647)(0.3922,0.38431)(0.3961,0.39608)(0.4,0.40784)(0.4039,0.41961)(0.4078,0.43137)(0.4118,0.44314)(0.4157,0.45098)(0.4196,0.46275)(0.4235,0.47451)(0.4275,0.48627)(0.4314,0.49804)(0.4353,0.5098)(0.4392,0.52157)(0.4431,0.53333)(0.4471,0.5451)(0.451,0.56078)(0.4549,0.57255)(0.4588,0.58431)(0.4627,0.59608)(0.4667,0.60392)(0.4706,0.61569)(0.4745,0.62745)(0.4784,0.63922)(0.4824,0.65098)(0.4863,0.66275)(0.4902,0.67451)(0.4941,0.68235)(0.498,0.69412)(0.502,0.70588)(0.5059,0.71373)(0.5098,0.72549)(0.5137,0.73333)(0.5176,0.7451)(0.5216,0.75294)(0.5255,0.76471)(0.5294,0.77255)(0.5333,0.78039)(0.5373,0.78824)(0.5412,0.79608)(0.5451,0.80392)(0.549,0.81176)(0.5529,0.81961)(0.5569,0.82353)(0.5608,0.83137)(0.5647,0.83922)(0.5686,0.84314)(0.5725,0.84706)(0.5765,0.8549)(0.5804,0.85882)(0.5843,0.86275)(0.5882,0.86667)(0.5922,0.87059)(0.5961,0.87451)(0.6,0.87843)(0.6039,0.87843)(0.6078,0.88235)(0.6118,0.88627)(0.6157,0.88627)(0.6196,0.88627)(0.6235,0.8902)(0.6275,0.8902)(0.6314,0.8902)(0.6353,0.8902)(0.6392,0.8902)(0.6431,0.8902)(0.6471,0.8902)(0.651,0.8902)(0.6549,0.8902)(0.6588,0.88627)(0.6627,0.88627)(0.6667,0.88235)(0.6706,0.88235)(0.6745,0.88235)(0.6784,0.87843)(0.6824,0.87451)(0.6863,0.87451)(0.6902,0.87059)(0.6941,0.86667)(0.698,0.86667)(0.702,0.86275)(0.7059,0.85882)(0.7098,0.8549)(0.7137,0.85098)(0.7176,0.85098)(0.7216,0.84706)(0.7255,0.84314)(0.7294,0.83922)(0.7333,0.83529)(0.7373,0.83137)(0.7412,0.82745)(0.7451,0.82745)(0.749,0.82353)(0.7529,0.81961)(0.7569,0.81569)(0.7608,0.81569)(0.7647,0.81176)(0.7686,0.80784)(0.7725,0.80784)(0.7765,0.80392)(0.7804,0.8)(0.7843,0.8)(0.7882,0.79608)(0.7922,0.79608)(0.7961,0.79608)(0.8,0.79216)(0.8039,0.79216)(0.8078,0.79216)(0.8118,0.79216)(0.8157,0.79216)(0.8196,0.78824)(0.8235,0.79216)(0.8275,0.79216)(0.8314,0.79216)(0.8353,0.79216)(0.8392,0.79216)(0.8431,0.79608)(0.8471,0.79608)(0.851,0.79608)(0.8549,0.8)(0.8588,0.80392)(0.8627,0.80392)(0.8667,0.80784)(0.8706,0.81176)(0.8745,0.81569)(0.8784,0.81569)(0.8824,0.81961)(0.8863,0.82353)(0.8902,0.83137)(0.8941,0.83529)(0.898,0.83922)(0.902,0.84314)(0.9059,0.84706)(0.9098,0.8549)(0.9137,0.85882)(0.9176,0.86667)(0.9216,0.87059)(0.9255,0.87843)(0.9294,0.88235)(0.9333,0.8902)(0.9373,0.89412)(0.9412,0.90196)(0.9451,0.90588)(0.949,0.91373)(0.9529,0.92157)(0.9569,0.92549)(0.9608,0.93333)(0.9647,0.94118)(0.9686,0.9451)(0.9725,0.95294)(0.9765,0.96078)(0.9804,0.96471)(0.9843,0.97255)(0.9882,0.98039)(0.9922,0.98431)(0.9961,0.99216)(1,1)
+GREEN:
+(0,0)(0.0039,0.0078431)(0.0078,0.015686)(0.0118,0.019608)(0.0157,0.027451)(0.0196,0.031373)(0.0235,0.039216)(0.0275,0.043137)(0.0314,0.047059)(0.0353,0.054902)(0.0392,0.058824)(0.0431,0.062745)(0.0471,0.066667)(0.051,0.07451)(0.0549,0.078431)(0.0588,0.082353)(0.0627,0.086275)(0.0667,0.094118)(0.0706,0.098039)(0.0745,0.10196)(0.0784,0.1098)(0.0824,0.11373)(0.0863,0.11765)(0.0902,0.12549)(0.0941,0.12941)(0.098,0.13725)(0.102,0.14118)(0.1059,0.14902)(0.1098,0.15294)(0.1137,0.16078)(0.1176,0.16471)(0.1216,0.17255)(0.1255,0.18039)(0.1294,0.18431)(0.1333,0.19216)(0.1373,0.2)(0.1412,0.20392)(0.1451,0.21176)(0.149,0.21961)(0.1529,0.22745)(0.1569,0.23137)(0.1608,0.23922)(0.1647,0.24706)(0.1686,0.2549)(0.1725,0.26275)(0.1765,0.26667)(0.1804,0.27451)(0.1843,0.28235)(0.1882,0.2902)(0.1922,0.29804)(0.1961,0.30588)(0.2,0.31373)(0.2039,0.31765)(0.2078,0.32549)(0.2118,0.33333)(0.2157,0.34118)(0.2196,0.34902)(0.2235,0.35686)(0.2275,0.36471)(0.2314,0.36863)(0.2353,0.37647)(0.2392,0.38431)(0.2431,0.39216)(0.2471,0.39608)(0.251,0.40392)(0.2549,0.41176)(0.2588,0.41961)(0.2627,0.42353)(0.2667,0.43137)(0.2706,0.43529)(0.2745,0.44314)(0.2784,0.44706)(0.2824,0.4549)(0.2863,0.45882)(0.2902,0.46667)(0.2941,0.47059)(0.298,0.47843)(0.302,0.48235)(0.3059,0.48627)(0.3098,0.4902)(0.3137,0.49804)(0.3176,0.50196)(0.3216,0.50588)(0.3255,0.5098)(0.3294,0.51373)(0.3333,0.51765)(0.3373,0.52157)(0.3412,0.52549)(0.3451,0.52549)(0.349,0.52941)(0.3529,0.53333)(0.3569,0.53725)(0.3608,0.53725)(0.3647,0.54118)(0.3686,0.54118)(0.3725,0.5451)(0.3765,0.5451)(0.3804,0.54902)(0.3843,0.54902)(0.3882,0.55294)(0.3922,0.55294)(0.3961,0.55294)(0.4,0.55294)(0.4039,0.55686)(0.4078,0.55686)(0.4118,0.55686)(0.4157,0.55686)(0.4196,0.55686)(0.4235,0.55686)(0.4275,0.55686)(0.4314,0.55686)(0.4353,0.55686)(0.4392,0.55686)(0.4431,0.55686)(0.4471,0.55686)(0.451,0.55686)(0.4549,0.55686)(0.4588,0.55686)(0.4627,0.55294)(0.4667,0.55294)(0.4706,0.55294)(0.4745,0.55294)(0.4784,0.55294)(0.4824,0.54902)(0.4863,0.54902)(0.4902,0.54902)(0.4941,0.54902)(0.498,0.54902)(0.502,0.5451)(0.5059,0.5451)(0.5098,0.5451)(0.5137,0.5451)(0.5176,0.5451)(0.5216,0.5451)(0.5255,0.5451)(0.5294,0.5451)(0.5333,0.5451)(0.5373,0.5451)(0.5412,0.5451)(0.5451,0.5451)(0.549,0.5451)(0.5529,0.5451)(0.5569,0.5451)(0.5608,0.5451)(0.5647,0.5451)(0.5686,0.5451)(0.5725,0.54902)(0.5765,0.54902)(0.5804,0.54902)(0.5843,0.54902)(0.5882,0.55294)(0.5922,0.55294)(0.5961,0.55686)(0.6,0.55686)(0.6039,0.56078)(0.6078,0.56078)(0.6118,0.56471)(0.6157,0.56863)(0.6196,0.57255)(0.6235,0.57255)(0.6275,0.57647)(0.6314,0.58039)(0.6353,0.58431)(0.6392,0.58824)(0.6431,0.59216)(0.6471,0.59608)(0.651,0.6)(0.6549,0.60392)(0.6588,0.60784)(0.6627,0.61176)(0.6667,0.61569)(0.6706,0.62353)(0.6745,0.62745)(0.6784,0.63137)(0.6824,0.63922)(0.6863,0.64314)(0.6902,0.64706)(0.6941,0.6549)(0.698,0.65882)(0.702,0.66667)(0.7059,0.67059)(0.7098,0.67843)(0.7137,0.68627)(0.7176,0.6902)(0.7216,0.69804)(0.7255,0.70196)(0.7294,0.7098)(0.7333,0.71765)(0.7373,0.72157)(0.7412,0.72941)(0.7451,0.73725)(0.749,0.74118)(0.7529,0.74902)(0.7569,0.75686)(0.7608,0.76078)(0.7647,0.76863)(0.7686,0.77647)(0.7725,0.78039)(0.7765,0.78824)(0.7804,0.79608)(0.7843,0.8)(0.7882,0.80784)(0.7922,0.81569)(0.7961,0.81961)(0.8,0.82745)(0.8039,0.83137)(0.8078,0.83922)(0.8118,0.84314)(0.8157,0.85098)(0.8196,0.8549)(0.8235,0.86275)(0.8275,0.86667)(0.8314,0.87451)(0.8353,0.87843)(0.8392,0.88235)(0.8431,0.8902)(0.8471,0.89412)(0.851,0.89804)(0.8549,0.90588)(0.8588,0.9098)(0.8627,0.91373)(0.8667,0.91765)(0.8706,0.92157)(0.8745,0.92549)(0.8784,0.92941)(0.8824,0.93333)(0.8863,0.93725)(0.8902,0.94118)(0.8941,0.9451)(0.898,0.94902)(0.902,0.94902)(0.9059,0.95294)(0.9098,0.95686)(0.9137,0.96078)(0.9176,0.96078)(0.9216,0.96471)(0.9255,0.96863)(0.9294,0.96863)(0.9333,0.97255)(0.9373,0.97255)(0.9412,0.97647)(0.9451,0.97647)(0.949,0.98039)(0.9529,0.98039)(0.9569,0.98431)(0.9608,0.98431)(0.9647,0.98431)(0.9686,0.98824)(0.9725,0.98824)(0.9765,0.98824)(0.9804,0.99216)(0.9843,0.99216)(0.9882,0.99608)(0.9922,0.99608)(0.9961,0.99608)(1,1)
+BLUE:
+(0,0)(0.0039,0.011765)(0.0078,0.023529)(0.0118,0.035294)(0.0157,0.043137)(0.0196,0.054902)(0.0235,0.062745)(0.0275,0.07451)(0.0314,0.082353)(0.0353,0.094118)(0.0392,0.10196)(0.0431,0.1098)(0.0471,0.12157)(0.051,0.12941)(0.0549,0.14118)(0.0588,0.14902)(0.0627,0.16078)(0.0667,0.16863)(0.0706,0.17647)(0.0745,0.18824)(0.0784,0.19608)(0.0824,0.20392)(0.0863,0.21569)(0.0902,0.22353)(0.0941,0.23137)(0.098,0.23922)(0.102,0.24706)(0.1059,0.25882)(0.1098,0.26667)(0.1137,0.27451)(0.1176,0.28235)(0.1216,0.28627)(0.1255,0.29412)(0.1294,0.30196)(0.1333,0.3098)(0.1373,0.31373)(0.1412,0.32157)(0.1451,0.32941)(0.149,0.33333)(0.1529,0.33725)(0.1569,0.3451)(0.1608,0.34902)(0.1647,0.35294)(0.1686,0.35686)(0.1725,0.36078)(0.1765,0.36471)(0.1804,0.36863)(0.1843,0.37255)(0.1882,0.37255)(0.1922,0.37647)(0.1961,0.37647)(0.2,0.38039)(0.2039,0.38039)(0.2078,0.38039)(0.2118,0.38431)(0.2157,0.38431)(0.2196,0.38431)(0.2235,0.38431)(0.2275,0.38431)(0.2314,0.38431)(0.2353,0.38039)(0.2392,0.38039)(0.2431,0.38039)(0.2471,0.37647)(0.251,0.37647)(0.2549,0.37255)(0.2588,0.37255)(0.2627,0.36863)(0.2667,0.36471)(0.2706,0.36078)(0.2745,0.36078)(0.2784,0.35686)(0.2824,0.35294)(0.2863,0.34902)(0.2902,0.3451)(0.2941,0.34118)(0.298,0.33725)(0.302,0.33333)(0.3059,0.32941)(0.3098,0.32549)(0.3137,0.32157)(0.3176,0.31765)(0.3216,0.31373)(0.3255,0.3098)(0.3294,0.30588)(0.3333,0.30196)(0.3373,0.29804)(0.3412,0.29804)(0.3451,0.29412)(0.349,0.2902)(0.3529,0.28627)(0.3569,0.28235)(0.3608,0.27843)(0.3647,0.27843)(0.3686,0.27451)(0.3725,0.27059)(0.3765,0.27059)(0.3804,0.26667)(0.3843,0.26667)(0.3882,0.26667)(0.3922,0.26275)(0.3961,0.26275)(0.4,0.26275)(0.4039,0.26275)(0.4078,0.26275)(0.4118,0.26275)(0.4157,0.26275)(0.4196,0.26275)(0.4235,0.26667)(0.4275,0.26667)(0.4314,0.26667)(0.4353,0.27059)(0.4392,0.27451)(0.4431,0.27451)(0.4471,0.27843)(0.451,0.28235)(0.4549,0.28627)(0.4588,0.2902)(0.4627,0.29804)(0.4667,0.30196)(0.4706,0.30588)(0.4745,0.31373)(0.4784,0.31765)(0.4824,0.32549)(0.4863,0.33333)(0.4902,0.34118)(0.4941,0.3451)(0.498,0.35294)(0.502,0.36471)(0.5059,0.37255)(0.5098,0.38039)(0.5137,0.38824)(0.5176,0.4)(0.5216,0.40784)(0.5255,0.41961)(0.5294,0.42745)(0.5333,0.43922)(0.5373,0.45098)(0.5412,0.45882)(0.5451,0.47059)(0.549,0.48235)(0.5529,0.49412)(0.5569,0.50588)(0.5608,0.51765)(0.5647,0.52941)(0.5686,0.54118)(0.5725,0.55294)(0.5765,0.56471)(0.5804,0.57647)(0.5843,0.58824)(0.5882,0.6)(0.5922,0.61176)(0.5961,0.62745)(0.6,0.63922)(0.6039,0.65098)(0.6078,0.66275)(0.6118,0.67451)(0.6157,0.68627)(0.6196,0.69804)(0.6235,0.7098)(0.6275,0.72157)(0.6314,0.73333)(0.6353,0.7451)(0.6392,0.75686)(0.6431,0.76863)(0.6471,0.78039)(0.651,0.78824)(0.6549,0.8)(0.6588,0.81176)(0.6627,0.81961)(0.6667,0.83137)(0.6706,0.83922)(0.6745,0.85098)(0.6784,0.85882)(0.6824,0.86667)(0.6863,0.87451)(0.6902,0.88627)(0.6941,0.89412)(0.698,0.90196)(0.702,0.90588)(0.7059,0.91373)(0.7098,0.92157)(0.7137,0.92941)(0.7176,0.93333)(0.7216,0.94118)(0.7255,0.9451)(0.7294,0.94902)(0.7333,0.95294)(0.7373,0.96078)(0.7412,0.96471)(0.7451,0.96863)(0.749,0.96863)(0.7529,0.97255)(0.7569,0.97647)(0.7608,0.98039)(0.7647,0.98039)(0.7686,0.98431)(0.7725,0.98431)(0.7765,0.98431)(0.7804,0.98824)(0.7843,0.98824)(0.7882,0.98824)(0.7922,0.98824)(0.7961,0.98824)(0.8,0.98824)(0.8039,0.98824)(0.8078,0.98824)(0.8118,0.98824)(0.8157,0.98824)(0.8196,0.98431)(0.8235,0.98431)(0.8275,0.98431)(0.8314,0.98039)(0.8353,0.98039)(0.8392,0.98039)(0.8431,0.97647)(0.8471,0.97647)(0.851,0.97255)(0.8549,0.97255)(0.8588,0.96863)(0.8627,0.96863)(0.8667,0.96471)(0.8706,0.96471)(0.8745,0.96078)(0.8784,0.96078)(0.8824,0.96078)(0.8863,0.95686)(0.8902,0.95686)(0.8941,0.95686)(0.898,0.95294)(0.902,0.95294)(0.9059,0.95294)(0.9098,0.95294)(0.9137,0.94902)(0.9176,0.94902)(0.9216,0.94902)(0.9255,0.94902)(0.9294,0.94902)(0.9333,0.94902)(0.9373,0.95294)(0.9412,0.95294)(0.9451,0.95294)(0.949,0.95686)(0.9529,0.95686)(0.9569,0.95686)(0.9608,0.96078)(0.9647,0.96471)(0.9686,0.96471)(0.9725,0.96863)(0.9765,0.97255)(0.9804,0.97647)(0.9843,0.98039)(0.9882,0.98431)(0.9922,0.98824)(0.9961,0.99216)(1,1)
diff --git a/ds9/cmaps/ch05m151010.sao b/ds9/cmaps/ch05m151010.sao
new file mode 100644
index 0000000..bc7ef78
--- /dev/null
+++ b/ds9/cmaps/ch05m151010.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch05m151010
+# created by cptutils 1.46
+# Wed Aug 15 23:30:54 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0.0039216)(0.0078,0.011765)(0.0118,0.015686)(0.0157,0.023529)(0.0196,0.031373)(0.0235,0.035294)(0.0275,0.039216)(0.0314,0.047059)(0.0353,0.05098)(0.0392,0.054902)(0.0431,0.058824)(0.0471,0.066667)(0.051,0.070588)(0.0549,0.07451)(0.0588,0.078431)(0.0627,0.078431)(0.0667,0.082353)(0.0706,0.086275)(0.0745,0.090196)(0.0784,0.090196)(0.0824,0.094118)(0.0863,0.094118)(0.0902,0.098039)(0.0941,0.098039)(0.098,0.098039)(0.102,0.10196)(0.1059,0.10196)(0.1098,0.10196)(0.1137,0.10196)(0.1176,0.10196)(0.1216,0.10196)(0.1255,0.10196)(0.1294,0.10196)(0.1333,0.10196)(0.1373,0.10196)(0.1412,0.10196)(0.1451,0.098039)(0.149,0.098039)(0.1529,0.098039)(0.1569,0.098039)(0.1608,0.094118)(0.1647,0.094118)(0.1686,0.094118)(0.1725,0.090196)(0.1765,0.090196)(0.1804,0.090196)(0.1843,0.090196)(0.1882,0.086275)(0.1922,0.086275)(0.1961,0.086275)(0.2,0.082353)(0.2039,0.082353)(0.2078,0.082353)(0.2118,0.082353)(0.2157,0.082353)(0.2196,0.082353)(0.2235,0.078431)(0.2275,0.078431)(0.2314,0.078431)(0.2353,0.082353)(0.2392,0.082353)(0.2431,0.082353)(0.2471,0.082353)(0.251,0.082353)(0.2549,0.086275)(0.2588,0.086275)(0.2627,0.086275)(0.2667,0.090196)(0.2706,0.090196)(0.2745,0.094118)(0.2784,0.098039)(0.2824,0.10196)(0.2863,0.10588)(0.2902,0.10588)(0.2941,0.1098)(0.298,0.11765)(0.302,0.12157)(0.3059,0.12549)(0.3098,0.12941)(0.3137,0.13725)(0.3176,0.14118)(0.3216,0.14902)(0.3255,0.15294)(0.3294,0.16078)(0.3333,0.16863)(0.3373,0.17647)(0.3412,0.18431)(0.3451,0.19216)(0.349,0.2)(0.3529,0.20784)(0.3569,0.21569)(0.3608,0.22353)(0.3647,0.23529)(0.3686,0.24314)(0.3725,0.2549)(0.3765,0.26275)(0.3804,0.27451)(0.3843,0.28235)(0.3882,0.29412)(0.3922,0.30588)(0.3961,0.31765)(0.4,0.32549)(0.4039,0.33725)(0.4078,0.34902)(0.4118,0.36078)(0.4157,0.37255)(0.4196,0.38431)(0.4235,0.39608)(0.4275,0.40784)(0.4314,0.41961)(0.4353,0.43137)(0.4392,0.44314)(0.4431,0.4549)(0.4471,0.47059)(0.451,0.48235)(0.4549,0.49412)(0.4588,0.50588)(0.4627,0.51765)(0.4667,0.52941)(0.4706,0.54118)(0.4745,0.55294)(0.4784,0.56471)(0.4824,0.57647)(0.4863,0.58824)(0.4902,0.6)(0.4941,0.60784)(0.498,0.61961)(0.502,0.63137)(0.5059,0.64314)(0.5098,0.65098)(0.5137,0.66275)(0.5176,0.67059)(0.5216,0.68235)(0.5255,0.6902)(0.5294,0.69804)(0.5333,0.7098)(0.5373,0.71765)(0.5412,0.72549)(0.5451,0.73333)(0.549,0.74118)(0.5529,0.74902)(0.5569,0.75686)(0.5608,0.76078)(0.5647,0.76863)(0.5686,0.77647)(0.5725,0.78039)(0.5765,0.78824)(0.5804,0.79216)(0.5843,0.79608)(0.5882,0.8)(0.5922,0.80392)(0.5961,0.80784)(0.6,0.81176)(0.6039,0.81569)(0.6078,0.81961)(0.6118,0.81961)(0.6157,0.82353)(0.6196,0.82745)(0.6235,0.82745)(0.6275,0.82745)(0.6314,0.83137)(0.6353,0.83137)(0.6392,0.83137)(0.6431,0.83137)(0.6471,0.83137)(0.651,0.83137)(0.6549,0.83137)(0.6588,0.83137)(0.6627,0.82745)(0.6667,0.82745)(0.6706,0.82745)(0.6745,0.82353)(0.6784,0.82353)(0.6824,0.82353)(0.6863,0.81961)(0.6902,0.81569)(0.6941,0.81569)(0.698,0.81176)(0.702,0.81176)(0.7059,0.80784)(0.7098,0.80392)(0.7137,0.80392)(0.7176,0.8)(0.7216,0.79608)(0.7255,0.79608)(0.7294,0.79216)(0.7333,0.78824)(0.7373,0.78824)(0.7412,0.78431)(0.7451,0.78039)(0.749,0.78039)(0.7529,0.77647)(0.7569,0.77255)(0.7608,0.77255)(0.7647,0.76863)(0.7686,0.76863)(0.7725,0.76471)(0.7765,0.76471)(0.7804,0.76078)(0.7843,0.76078)(0.7882,0.76078)(0.7922,0.75686)(0.7961,0.75686)(0.8,0.75686)(0.8039,0.75686)(0.8078,0.75686)(0.8118,0.75686)(0.8157,0.75686)(0.8196,0.75686)(0.8235,0.75686)(0.8275,0.75686)(0.8314,0.76078)(0.8353,0.76078)(0.8392,0.76471)(0.8431,0.76471)(0.8471,0.76863)(0.851,0.76863)(0.8549,0.77255)(0.8588,0.77647)(0.8627,0.78039)(0.8667,0.78431)(0.8706,0.78431)(0.8745,0.79216)(0.8784,0.79608)(0.8824,0.8)(0.8863,0.80392)(0.8902,0.80784)(0.8941,0.81569)(0.898,0.81961)(0.902,0.82353)(0.9059,0.83137)(0.9098,0.83529)(0.9137,0.84314)(0.9176,0.85098)(0.9216,0.8549)(0.9255,0.86275)(0.9294,0.87059)(0.9333,0.87451)(0.9373,0.88235)(0.9412,0.8902)(0.9451,0.89804)(0.949,0.90588)(0.9529,0.9098)(0.9569,0.91765)(0.9608,0.92549)(0.9647,0.93333)(0.9686,0.94118)(0.9725,0.94902)(0.9765,0.95686)(0.9804,0.96078)(0.9843,0.96863)(0.9882,0.97647)(0.9922,0.98431)(0.9961,0.99216)(1,1)
+GREEN:
+(0,0)(0.0039,0)(0.0078,0.0039216)(0.0118,0.0039216)(0.0157,0.0078431)(0.0196,0.0078431)(0.0235,0.011765)(0.0275,0.015686)(0.0314,0.015686)(0.0353,0.019608)(0.0392,0.023529)(0.0431,0.023529)(0.0471,0.027451)(0.051,0.031373)(0.0549,0.035294)(0.0588,0.039216)(0.0627,0.043137)(0.0667,0.043137)(0.0706,0.047059)(0.0745,0.05098)(0.0784,0.054902)(0.0824,0.058824)(0.0863,0.066667)(0.0902,0.070588)(0.0941,0.07451)(0.098,0.078431)(0.102,0.082353)(0.1059,0.086275)(0.1098,0.094118)(0.1137,0.098039)(0.1176,0.10196)(0.1216,0.1098)(0.1255,0.11373)(0.1294,0.12157)(0.1333,0.12549)(0.1373,0.13333)(0.1412,0.13725)(0.1451,0.1451)(0.149,0.14902)(0.1529,0.15686)(0.1569,0.16078)(0.1608,0.16863)(0.1647,0.17647)(0.1686,0.18039)(0.1725,0.18824)(0.1765,0.19608)(0.1804,0.20392)(0.1843,0.20784)(0.1882,0.21569)(0.1922,0.22353)(0.1961,0.22745)(0.2,0.23529)(0.2039,0.24314)(0.2078,0.25098)(0.2118,0.25882)(0.2157,0.26275)(0.2196,0.27059)(0.2235,0.27843)(0.2275,0.28627)(0.2314,0.2902)(0.2353,0.29804)(0.2392,0.30588)(0.2431,0.3098)(0.2471,0.31765)(0.251,0.32549)(0.2549,0.32941)(0.2588,0.33725)(0.2627,0.3451)(0.2667,0.34902)(0.2706,0.35686)(0.2745,0.36078)(0.2784,0.36863)(0.2824,0.37255)(0.2863,0.38039)(0.2902,0.38431)(0.2941,0.38824)(0.298,0.39608)(0.302,0.4)(0.3059,0.40392)(0.3098,0.40784)(0.3137,0.41569)(0.3176,0.41961)(0.3216,0.42353)(0.3255,0.42745)(0.3294,0.43137)(0.3333,0.43529)(0.3373,0.43922)(0.3412,0.44314)(0.3451,0.44706)(0.349,0.44706)(0.3529,0.45098)(0.3569,0.4549)(0.3608,0.4549)(0.3647,0.45882)(0.3686,0.46275)(0.3725,0.46275)(0.3765,0.46667)(0.3804,0.46667)(0.3843,0.47059)(0.3882,0.47059)(0.3922,0.47059)(0.3961,0.47451)(0.4,0.47451)(0.4039,0.47451)(0.4078,0.47451)(0.4118,0.47843)(0.4157,0.47843)(0.4196,0.47843)(0.4235,0.47843)(0.4275,0.47843)(0.4314,0.47843)(0.4353,0.47843)(0.4392,0.47843)(0.4431,0.47843)(0.4471,0.47843)(0.451,0.47843)(0.4549,0.47843)(0.4588,0.47843)(0.4627,0.47843)(0.4667,0.47843)(0.4706,0.47451)(0.4745,0.47451)(0.4784,0.47451)(0.4824,0.47451)(0.4863,0.47451)(0.4902,0.47451)(0.4941,0.47451)(0.498,0.47451)(0.502,0.47451)(0.5059,0.47059)(0.5098,0.47059)(0.5137,0.47059)(0.5176,0.47059)(0.5216,0.47059)(0.5255,0.47059)(0.5294,0.47059)(0.5333,0.47059)(0.5373,0.47059)(0.5412,0.47059)(0.5451,0.47451)(0.549,0.47451)(0.5529,0.47451)(0.5569,0.47451)(0.5608,0.47451)(0.5647,0.47843)(0.5686,0.47843)(0.5725,0.47843)(0.5765,0.48235)(0.5804,0.48235)(0.5843,0.48627)(0.5882,0.48627)(0.5922,0.4902)(0.5961,0.4902)(0.6,0.49412)(0.6039,0.49804)(0.6078,0.49804)(0.6118,0.50196)(0.6157,0.50588)(0.6196,0.5098)(0.6235,0.51373)(0.6275,0.51373)(0.6314,0.51765)(0.6353,0.52157)(0.6392,0.52941)(0.6431,0.53333)(0.6471,0.53725)(0.651,0.54118)(0.6549,0.5451)(0.6588,0.54902)(0.6627,0.55686)(0.6667,0.56078)(0.6706,0.56471)(0.6745,0.57255)(0.6784,0.57647)(0.6824,0.58431)(0.6863,0.58824)(0.6902,0.59608)(0.6941,0.60392)(0.698,0.60784)(0.702,0.61569)(0.7059,0.61961)(0.7098,0.62745)(0.7137,0.63529)(0.7176,0.64314)(0.7216,0.64706)(0.7255,0.6549)(0.7294,0.66275)(0.7333,0.67059)(0.7373,0.67451)(0.7412,0.68235)(0.7451,0.6902)(0.749,0.69804)(0.7529,0.70588)(0.7569,0.71373)(0.7608,0.71765)(0.7647,0.72549)(0.7686,0.73333)(0.7725,0.74118)(0.7765,0.74902)(0.7804,0.75686)(0.7843,0.76078)(0.7882,0.76863)(0.7922,0.77647)(0.7961,0.78431)(0.8,0.79216)(0.8039,0.79608)(0.8078,0.80392)(0.8118,0.81176)(0.8157,0.81569)(0.8196,0.82353)(0.8235,0.83137)(0.8275,0.83529)(0.8314,0.84314)(0.8353,0.84706)(0.8392,0.8549)(0.8431,0.85882)(0.8471,0.86667)(0.851,0.87059)(0.8549,0.87843)(0.8588,0.88235)(0.8627,0.88627)(0.8667,0.89412)(0.8706,0.89804)(0.8745,0.90196)(0.8784,0.90588)(0.8824,0.9098)(0.8863,0.91373)(0.8902,0.92157)(0.8941,0.92549)(0.898,0.92941)(0.902,0.93333)(0.9059,0.93725)(0.9098,0.94118)(0.9137,0.94118)(0.9176,0.9451)(0.9216,0.94902)(0.9255,0.95294)(0.9294,0.95686)(0.9333,0.95686)(0.9373,0.96078)(0.9412,0.96471)(0.9451,0.96863)(0.949,0.96863)(0.9529,0.97255)(0.9569,0.97255)(0.9608,0.97647)(0.9647,0.98039)(0.9686,0.98039)(0.9725,0.98431)(0.9765,0.98431)(0.9804,0.98824)(0.9843,0.98824)(0.9882,0.99216)(0.9922,0.99216)(0.9961,0.99608)(1,1)
+BLUE:
+(0,0)(0.0039,0.0039216)(0.0078,0.011765)(0.0118,0.015686)(0.0157,0.023529)(0.0196,0.031373)(0.0235,0.035294)(0.0275,0.043137)(0.0314,0.05098)(0.0353,0.058824)(0.0392,0.066667)(0.0431,0.07451)(0.0471,0.082353)(0.051,0.090196)(0.0549,0.098039)(0.0588,0.10588)(0.0627,0.11373)(0.0667,0.12157)(0.0706,0.12941)(0.0745,0.13725)(0.0784,0.1451)(0.0824,0.15294)(0.0863,0.16078)(0.0902,0.16863)(0.0941,0.17647)(0.098,0.18431)(0.102,0.18824)(0.1059,0.19608)(0.1098,0.20392)(0.1137,0.21176)(0.1176,0.21961)(0.1216,0.22353)(0.1255,0.23137)(0.1294,0.23529)(0.1333,0.24314)(0.1373,0.24706)(0.1412,0.2549)(0.1451,0.25882)(0.149,0.26275)(0.1529,0.27059)(0.1569,0.27451)(0.1608,0.27843)(0.1647,0.28235)(0.1686,0.28627)(0.1725,0.2902)(0.1765,0.2902)(0.1804,0.29412)(0.1843,0.29804)(0.1882,0.29804)(0.1922,0.30196)(0.1961,0.30196)(0.2,0.30196)(0.2039,0.30588)(0.2078,0.30588)(0.2118,0.30588)(0.2157,0.30588)(0.2196,0.30588)(0.2235,0.30588)(0.2275,0.30588)(0.2314,0.30196)(0.2353,0.30196)(0.2392,0.30196)(0.2431,0.29804)(0.2471,0.29804)(0.251,0.29412)(0.2549,0.29412)(0.2588,0.2902)(0.2627,0.28627)(0.2667,0.28627)(0.2706,0.28235)(0.2745,0.27843)(0.2784,0.27451)(0.2824,0.27059)(0.2863,0.26667)(0.2902,0.26275)(0.2941,0.25882)(0.298,0.25882)(0.302,0.2549)(0.3059,0.25098)(0.3098,0.24706)(0.3137,0.23922)(0.3176,0.23529)(0.3216,0.23137)(0.3255,0.22745)(0.3294,0.22745)(0.3333,0.22353)(0.3373,0.21961)(0.3412,0.21569)(0.3451,0.21176)(0.349,0.20784)(0.3529,0.20392)(0.3569,0.2)(0.3608,0.2)(0.3647,0.19608)(0.3686,0.19216)(0.3725,0.19216)(0.3765,0.18824)(0.3804,0.18824)(0.3843,0.18431)(0.3882,0.18431)(0.3922,0.18431)(0.3961,0.18039)(0.4,0.18039)(0.4039,0.18039)(0.4078,0.18039)(0.4118,0.18039)(0.4157,0.18431)(0.4196,0.18431)(0.4235,0.18431)(0.4275,0.18824)(0.4314,0.18824)(0.4353,0.19216)(0.4392,0.19608)(0.4431,0.19608)(0.4471,0.2)(0.451,0.20392)(0.4549,0.20784)(0.4588,0.21569)(0.4627,0.21961)(0.4667,0.22353)(0.4706,0.23137)(0.4745,0.23529)(0.4784,0.24314)(0.4824,0.25098)(0.4863,0.2549)(0.4902,0.26275)(0.4941,0.27059)(0.498,0.27843)(0.502,0.2902)(0.5059,0.29804)(0.5098,0.30588)(0.5137,0.31765)(0.5176,0.32549)(0.5216,0.33725)(0.5255,0.3451)(0.5294,0.35686)(0.5333,0.36863)(0.5373,0.37647)(0.5412,0.38824)(0.5451,0.4)(0.549,0.41176)(0.5529,0.42353)(0.5569,0.43529)(0.5608,0.44706)(0.5647,0.45882)(0.5686,0.47059)(0.5725,0.48627)(0.5765,0.49804)(0.5804,0.5098)(0.5843,0.52157)(0.5882,0.53333)(0.5922,0.54902)(0.5961,0.56078)(0.6,0.57255)(0.6039,0.58431)(0.6078,0.6)(0.6118,0.61176)(0.6157,0.62353)(0.6196,0.63529)(0.6235,0.64706)(0.6275,0.66275)(0.6314,0.67451)(0.6353,0.68627)(0.6392,0.69804)(0.6431,0.7098)(0.6471,0.72157)(0.651,0.72941)(0.6549,0.74118)(0.6588,0.75294)(0.6627,0.76471)(0.6667,0.77255)(0.6706,0.78431)(0.6745,0.79608)(0.6784,0.80392)(0.6824,0.81176)(0.6863,0.82353)(0.6902,0.83137)(0.6941,0.83922)(0.698,0.84706)(0.702,0.8549)(0.7059,0.86275)(0.7098,0.87059)(0.7137,0.87843)(0.7176,0.88627)(0.7216,0.8902)(0.7255,0.89804)(0.7294,0.90196)(0.7333,0.90588)(0.7373,0.91373)(0.7412,0.91765)(0.7451,0.92157)(0.749,0.92549)(0.7529,0.92941)(0.7569,0.93333)(0.7608,0.93725)(0.7647,0.93725)(0.7686,0.94118)(0.7725,0.9451)(0.7765,0.9451)(0.7804,0.94902)(0.7843,0.94902)(0.7882,0.94902)(0.7922,0.95294)(0.7961,0.95294)(0.8,0.95294)(0.8039,0.95294)(0.8078,0.95294)(0.8118,0.95294)(0.8157,0.95294)(0.8196,0.95294)(0.8235,0.95294)(0.8275,0.95294)(0.8314,0.94902)(0.8353,0.94902)(0.8392,0.94902)(0.8431,0.94902)(0.8471,0.9451)(0.851,0.9451)(0.8549,0.9451)(0.8588,0.9451)(0.8627,0.94118)(0.8667,0.94118)(0.8706,0.94118)(0.8745,0.93725)(0.8784,0.93725)(0.8824,0.93725)(0.8863,0.93725)(0.8902,0.93725)(0.8941,0.93333)(0.898,0.93333)(0.902,0.93333)(0.9059,0.93333)(0.9098,0.93333)(0.9137,0.93333)(0.9176,0.93333)(0.9216,0.93333)(0.9255,0.93725)(0.9294,0.93725)(0.9333,0.93725)(0.9373,0.94118)(0.9412,0.94118)(0.9451,0.94118)(0.949,0.9451)(0.9529,0.94902)(0.9569,0.94902)(0.9608,0.95294)(0.9647,0.95686)(0.9686,0.96078)(0.9725,0.96471)(0.9765,0.96863)(0.9804,0.97255)(0.9843,0.97647)(0.9882,0.98039)(0.9922,0.98824)(0.9961,0.99216)(1,1)
diff --git a/ds9/cmaps/ch05m151012.sao b/ds9/cmaps/ch05m151012.sao
new file mode 100644
index 0000000..be4b35a
--- /dev/null
+++ b/ds9/cmaps/ch05m151012.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch05m151012
+# created by cptutils 1.46
+# Wed Aug 15 23:30:53 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0.0039216)(0.0078,0.0078431)(0.0118,0.011765)(0.0157,0.015686)(0.0196,0.019608)(0.0235,0.023529)(0.0275,0.027451)(0.0314,0.031373)(0.0353,0.035294)(0.0392,0.039216)(0.0431,0.039216)(0.0471,0.043137)(0.051,0.047059)(0.0549,0.047059)(0.0588,0.05098)(0.0627,0.054902)(0.0667,0.054902)(0.0706,0.054902)(0.0745,0.058824)(0.0784,0.058824)(0.0824,0.058824)(0.0863,0.062745)(0.0902,0.062745)(0.0941,0.062745)(0.098,0.062745)(0.102,0.062745)(0.1059,0.062745)(0.1098,0.062745)(0.1137,0.062745)(0.1176,0.062745)(0.1216,0.058824)(0.1255,0.058824)(0.1294,0.058824)(0.1333,0.058824)(0.1373,0.054902)(0.1412,0.054902)(0.1451,0.054902)(0.149,0.05098)(0.1529,0.05098)(0.1569,0.047059)(0.1608,0.047059)(0.1647,0.043137)(0.1686,0.043137)(0.1725,0.039216)(0.1765,0.039216)(0.1804,0.039216)(0.1843,0.035294)(0.1882,0.035294)(0.1922,0.031373)(0.1961,0.031373)(0.2,0.027451)(0.2039,0.027451)(0.2078,0.027451)(0.2118,0.023529)(0.2157,0.023529)(0.2196,0.023529)(0.2235,0.023529)(0.2275,0.023529)(0.2314,0.019608)(0.2353,0.019608)(0.2392,0.019608)(0.2431,0.019608)(0.2471,0.023529)(0.251,0.023529)(0.2549,0.023529)(0.2588,0.023529)(0.2627,0.027451)(0.2667,0.027451)(0.2706,0.031373)(0.2745,0.031373)(0.2784,0.035294)(0.2824,0.039216)(0.2863,0.039216)(0.2902,0.043137)(0.2941,0.047059)(0.298,0.05098)(0.302,0.054902)(0.3059,0.062745)(0.3098,0.066667)(0.3137,0.070588)(0.3176,0.078431)(0.3216,0.082353)(0.3255,0.090196)(0.3294,0.094118)(0.3333,0.10196)(0.3373,0.1098)(0.3412,0.11765)(0.3451,0.12549)(0.349,0.13333)(0.3529,0.14118)(0.3569,0.14902)(0.3608,0.15686)(0.3647,0.16863)(0.3686,0.17647)(0.3725,0.18824)(0.3765,0.19608)(0.3804,0.20784)(0.3843,0.21569)(0.3882,0.22745)(0.3922,0.23922)(0.3961,0.25098)(0.4,0.25882)(0.4039,0.27059)(0.4078,0.28235)(0.4118,0.29412)(0.4157,0.30588)(0.4196,0.31765)(0.4235,0.32941)(0.4275,0.34118)(0.4314,0.35294)(0.4353,0.36471)(0.4392,0.37647)(0.4431,0.39216)(0.4471,0.40392)(0.451,0.41569)(0.4549,0.42745)(0.4588,0.43922)(0.4627,0.45098)(0.4667,0.46275)(0.4706,0.47451)(0.4745,0.48627)(0.4784,0.49804)(0.4824,0.5098)(0.4863,0.52157)(0.4902,0.53333)(0.4941,0.5451)(0.498,0.55686)(0.502,0.56471)(0.5059,0.57647)(0.5098,0.58824)(0.5137,0.59608)(0.5176,0.60784)(0.5216,0.61569)(0.5255,0.62745)(0.5294,0.63529)(0.5333,0.64706)(0.5373,0.6549)(0.5412,0.66275)(0.5451,0.67059)(0.549,0.67843)(0.5529,0.68627)(0.5569,0.69412)(0.5608,0.70196)(0.5647,0.7098)(0.5686,0.71373)(0.5725,0.72157)(0.5765,0.72549)(0.5804,0.73333)(0.5843,0.73725)(0.5882,0.74118)(0.5922,0.7451)(0.5961,0.74902)(0.6,0.75294)(0.6039,0.75686)(0.6078,0.76078)(0.6118,0.76471)(0.6157,0.76863)(0.6196,0.76863)(0.6235,0.77255)(0.6275,0.77255)(0.6314,0.77255)(0.6353,0.77647)(0.6392,0.77647)(0.6431,0.77647)(0.6471,0.77647)(0.651,0.77647)(0.6549,0.77647)(0.6588,0.77647)(0.6627,0.77647)(0.6667,0.77647)(0.6706,0.77647)(0.6745,0.77255)(0.6784,0.77255)(0.6824,0.77255)(0.6863,0.76863)(0.6902,0.76863)(0.6941,0.76471)(0.698,0.76471)(0.702,0.76078)(0.7059,0.76078)(0.7098,0.75686)(0.7137,0.75686)(0.7176,0.75294)(0.7216,0.75294)(0.7255,0.74902)(0.7294,0.74902)(0.7333,0.7451)(0.7373,0.74118)(0.7412,0.74118)(0.7451,0.73725)(0.749,0.73725)(0.7529,0.73333)(0.7569,0.73333)(0.7608,0.72941)(0.7647,0.72941)(0.7686,0.72941)(0.7725,0.72549)(0.7765,0.72549)(0.7804,0.72549)(0.7843,0.72157)(0.7882,0.72157)(0.7922,0.72157)(0.7961,0.72157)(0.8,0.72157)(0.8039,0.72157)(0.8078,0.72157)(0.8118,0.72157)(0.8157,0.72549)(0.8196,0.72549)(0.8235,0.72549)(0.8275,0.72941)(0.8314,0.72941)(0.8353,0.73333)(0.8392,0.73333)(0.8431,0.73725)(0.8471,0.74118)(0.851,0.74118)(0.8549,0.7451)(0.8588,0.74902)(0.8627,0.75294)(0.8667,0.75686)(0.8706,0.76078)(0.8745,0.76863)(0.8784,0.77255)(0.8824,0.77647)(0.8863,0.78431)(0.8902,0.78824)(0.8941,0.79216)(0.898,0.8)(0.902,0.80784)(0.9059,0.81176)(0.9098,0.81961)(0.9137,0.82745)(0.9176,0.83529)(0.9216,0.83922)(0.9255,0.84706)(0.9294,0.8549)(0.9333,0.86275)(0.9373,0.87059)(0.9412,0.87843)(0.9451,0.88627)(0.949,0.89412)(0.9529,0.90196)(0.9569,0.9098)(0.9608,0.91765)(0.9647,0.92549)(0.9686,0.93333)(0.9725,0.94118)(0.9765,0.94902)(0.9804,0.96078)(0.9843,0.96863)(0.9882,0.97647)(0.9922,0.98431)(0.9961,0.99216)(1,1)
+GREEN:
+(0,0)(0.0039,0)(0.0078,0)(0.0118,0)(0.0157,0)(0.0196,0)(0.0235,0)(0.0275,0)(0.0314,0)(0.0353,0.0039216)(0.0392,0.0039216)(0.0431,0.0039216)(0.0471,0.0078431)(0.051,0.0078431)(0.0549,0.011765)(0.0588,0.011765)(0.0627,0.015686)(0.0667,0.015686)(0.0706,0.019608)(0.0745,0.023529)(0.0784,0.023529)(0.0824,0.027451)(0.0863,0.031373)(0.0902,0.035294)(0.0941,0.039216)(0.098,0.043137)(0.102,0.047059)(0.1059,0.05098)(0.1098,0.054902)(0.1137,0.058824)(0.1176,0.062745)(0.1216,0.066667)(0.1255,0.070588)(0.1294,0.078431)(0.1333,0.082353)(0.1373,0.086275)(0.1412,0.090196)(0.1451,0.098039)(0.149,0.10196)(0.1529,0.1098)(0.1569,0.11373)(0.1608,0.11765)(0.1647,0.12549)(0.1686,0.13333)(0.1725,0.13725)(0.1765,0.1451)(0.1804,0.14902)(0.1843,0.15686)(0.1882,0.16078)(0.1922,0.16863)(0.1961,0.17647)(0.2,0.18039)(0.2039,0.18824)(0.2078,0.19216)(0.2118,0.2)(0.2157,0.20784)(0.2196,0.21176)(0.2235,0.21961)(0.2275,0.22745)(0.2314,0.23137)(0.2353,0.23922)(0.2392,0.24706)(0.2431,0.25098)(0.2471,0.25882)(0.251,0.26275)(0.2549,0.27059)(0.2588,0.27451)(0.2627,0.28235)(0.2667,0.28627)(0.2706,0.29412)(0.2745,0.29804)(0.2784,0.30588)(0.2824,0.3098)(0.2863,0.31373)(0.2902,0.32157)(0.2941,0.32549)(0.298,0.32941)(0.302,0.33725)(0.3059,0.34118)(0.3098,0.3451)(0.3137,0.34902)(0.3176,0.35294)(0.3216,0.35686)(0.3255,0.36078)(0.3294,0.36471)(0.3333,0.36863)(0.3373,0.37255)(0.3412,0.37647)(0.3451,0.38039)(0.349,0.38039)(0.3529,0.38431)(0.3569,0.38824)(0.3608,0.38824)(0.3647,0.39216)(0.3686,0.39608)(0.3725,0.39608)(0.3765,0.4)(0.3804,0.4)(0.3843,0.40392)(0.3882,0.40392)(0.3922,0.40392)(0.3961,0.40784)(0.4,0.40784)(0.4039,0.40784)(0.4078,0.40784)(0.4118,0.41176)(0.4157,0.41176)(0.4196,0.41176)(0.4235,0.41176)(0.4275,0.41176)(0.4314,0.41176)(0.4353,0.41176)(0.4392,0.41176)(0.4431,0.41176)(0.4471,0.41176)(0.451,0.41176)(0.4549,0.41176)(0.4588,0.41176)(0.4627,0.41176)(0.4667,0.41176)(0.4706,0.41176)(0.4745,0.41176)(0.4784,0.41176)(0.4824,0.40784)(0.4863,0.40784)(0.4902,0.40784)(0.4941,0.40784)(0.498,0.40784)(0.502,0.40784)(0.5059,0.40784)(0.5098,0.40784)(0.5137,0.40784)(0.5176,0.40784)(0.5216,0.40784)(0.5255,0.40784)(0.5294,0.40784)(0.5333,0.40784)(0.5373,0.40784)(0.5412,0.41176)(0.5451,0.41176)(0.549,0.41176)(0.5529,0.41176)(0.5569,0.41176)(0.5608,0.41569)(0.5647,0.41569)(0.5686,0.41569)(0.5725,0.41961)(0.5765,0.41961)(0.5804,0.42353)(0.5843,0.42353)(0.5882,0.42745)(0.5922,0.43137)(0.5961,0.43137)(0.6,0.43529)(0.6039,0.43922)(0.6078,0.44314)(0.6118,0.44314)(0.6157,0.44706)(0.6196,0.45098)(0.6235,0.4549)(0.6275,0.45882)(0.6314,0.46275)(0.6353,0.46667)(0.6392,0.47451)(0.6431,0.47843)(0.6471,0.48235)(0.651,0.48627)(0.6549,0.49412)(0.6588,0.49804)(0.6627,0.50196)(0.6667,0.5098)(0.6706,0.51373)(0.6745,0.52157)(0.6784,0.52549)(0.6824,0.53333)(0.6863,0.54118)(0.6902,0.5451)(0.6941,0.55294)(0.698,0.56078)(0.702,0.56863)(0.7059,0.57255)(0.7098,0.58039)(0.7137,0.58824)(0.7176,0.59608)(0.7216,0.60392)(0.7255,0.61176)(0.7294,0.61569)(0.7333,0.62353)(0.7373,0.63137)(0.7412,0.63922)(0.7451,0.64706)(0.749,0.6549)(0.7529,0.66275)(0.7569,0.67059)(0.7608,0.67843)(0.7647,0.68627)(0.7686,0.69412)(0.7725,0.70196)(0.7765,0.7098)(0.7804,0.71765)(0.7843,0.72549)(0.7882,0.73333)(0.7922,0.74118)(0.7961,0.74902)(0.8,0.75686)(0.8039,0.76078)(0.8078,0.76863)(0.8118,0.77647)(0.8157,0.78431)(0.8196,0.79216)(0.8235,0.8)(0.8275,0.80392)(0.8314,0.81176)(0.8353,0.81961)(0.8392,0.82353)(0.8431,0.83137)(0.8471,0.83922)(0.851,0.84314)(0.8549,0.85098)(0.8588,0.8549)(0.8627,0.86275)(0.8667,0.86667)(0.8706,0.87451)(0.8745,0.87843)(0.8784,0.88235)(0.8824,0.8902)(0.8863,0.89412)(0.8902,0.89804)(0.8941,0.90588)(0.898,0.9098)(0.902,0.91373)(0.9059,0.91765)(0.9098,0.92157)(0.9137,0.92549)(0.9176,0.92941)(0.9216,0.93333)(0.9255,0.93725)(0.9294,0.94118)(0.9333,0.9451)(0.9373,0.94902)(0.9412,0.95294)(0.9451,0.95686)(0.949,0.96078)(0.9529,0.96078)(0.9569,0.96471)(0.9608,0.96863)(0.9647,0.97255)(0.9686,0.97647)(0.9725,0.97647)(0.9765,0.98039)(0.9804,0.98431)(0.9843,0.98824)(0.9882,0.98824)(0.9922,0.99216)(0.9961,0.99608)(1,1)
+BLUE:
+(0,0)(0.0039,0)(0.0078,0.0039216)(0.0118,0.0078431)(0.0157,0.015686)(0.0196,0.019608)(0.0235,0.023529)(0.0275,0.031373)(0.0314,0.035294)(0.0353,0.043137)(0.0392,0.047059)(0.0431,0.054902)(0.0471,0.058824)(0.051,0.066667)(0.0549,0.07451)(0.0588,0.078431)(0.0627,0.086275)(0.0667,0.094118)(0.0706,0.098039)(0.0745,0.10588)(0.0784,0.11373)(0.0824,0.12157)(0.0863,0.12549)(0.0902,0.13333)(0.0941,0.14118)(0.098,0.1451)(0.102,0.15294)(0.1059,0.16078)(0.1098,0.16471)(0.1137,0.17255)(0.1176,0.17647)(0.1216,0.18431)(0.1255,0.18824)(0.1294,0.19216)(0.1333,0.2)(0.1373,0.20392)(0.1412,0.20784)(0.1451,0.21176)(0.149,0.21569)(0.1529,0.21961)(0.1569,0.22353)(0.1608,0.22745)(0.1647,0.23137)(0.1686,0.23529)(0.1725,0.23922)(0.1765,0.23922)(0.1804,0.24314)(0.1843,0.24314)(0.1882,0.24706)(0.1922,0.24706)(0.1961,0.24706)(0.2,0.24706)(0.2039,0.25098)(0.2078,0.25098)(0.2118,0.25098)(0.2157,0.24706)(0.2196,0.24706)(0.2235,0.24706)(0.2275,0.24706)(0.2314,0.24314)(0.2353,0.24314)(0.2392,0.24314)(0.2431,0.23922)(0.2471,0.23529)(0.251,0.23529)(0.2549,0.23137)(0.2588,0.22745)(0.2627,0.22745)(0.2667,0.22353)(0.2706,0.21961)(0.2745,0.21569)(0.2784,0.21176)(0.2824,0.20784)(0.2863,0.20392)(0.2902,0.2)(0.2941,0.19608)(0.298,0.19216)(0.302,0.18824)(0.3059,0.18431)(0.3098,0.18039)(0.3137,0.17647)(0.3176,0.17255)(0.3216,0.16863)(0.3255,0.16471)(0.3294,0.16078)(0.3333,0.15686)(0.3373,0.15294)(0.3412,0.14902)(0.3451,0.1451)(0.349,0.14118)(0.3529,0.13725)(0.3569,0.13333)(0.3608,0.13333)(0.3647,0.12941)(0.3686,0.12549)(0.3725,0.12549)(0.3765,0.12157)(0.3804,0.12157)(0.3843,0.11765)(0.3882,0.11765)(0.3922,0.11765)(0.3961,0.11373)(0.4,0.11373)(0.4039,0.11373)(0.4078,0.11373)(0.4118,0.11373)(0.4157,0.11765)(0.4196,0.11765)(0.4235,0.11765)(0.4275,0.12157)(0.4314,0.12157)(0.4353,0.12549)(0.4392,0.12941)(0.4431,0.12941)(0.4471,0.13333)(0.451,0.13725)(0.4549,0.1451)(0.4588,0.14902)(0.4627,0.15294)(0.4667,0.15686)(0.4706,0.16471)(0.4745,0.17255)(0.4784,0.17647)(0.4824,0.18431)(0.4863,0.19216)(0.4902,0.2)(0.4941,0.20784)(0.498,0.21569)(0.502,0.22353)(0.5059,0.23137)(0.5098,0.24314)(0.5137,0.25098)(0.5176,0.26275)(0.5216,0.27059)(0.5255,0.28235)(0.5294,0.29412)(0.5333,0.30588)(0.5373,0.31373)(0.5412,0.32549)(0.5451,0.33725)(0.549,0.34902)(0.5529,0.36078)(0.5569,0.37255)(0.5608,0.38824)(0.5647,0.4)(0.5686,0.41176)(0.5725,0.42353)(0.5765,0.43529)(0.5804,0.45098)(0.5843,0.46275)(0.5882,0.47451)(0.5922,0.4902)(0.5961,0.50196)(0.6,0.51373)(0.6039,0.52941)(0.6078,0.54118)(0.6118,0.55294)(0.6157,0.56863)(0.6196,0.58039)(0.6235,0.59216)(0.6275,0.60392)(0.6314,0.61569)(0.6353,0.63137)(0.6392,0.64314)(0.6431,0.6549)(0.6471,0.66667)(0.651,0.67843)(0.6549,0.6902)(0.6588,0.70196)(0.6627,0.7098)(0.6667,0.72157)(0.6706,0.73333)(0.6745,0.7451)(0.6784,0.75294)(0.6824,0.76471)(0.6863,0.77255)(0.6902,0.78039)(0.6941,0.79216)(0.698,0.8)(0.702,0.80784)(0.7059,0.81569)(0.7098,0.82353)(0.7137,0.83137)(0.7176,0.83922)(0.7216,0.84314)(0.7255,0.85098)(0.7294,0.85882)(0.7333,0.86275)(0.7373,0.87059)(0.7412,0.87451)(0.7451,0.87843)(0.749,0.88235)(0.7529,0.88627)(0.7569,0.8902)(0.7608,0.89412)(0.7647,0.89804)(0.7686,0.90196)(0.7725,0.90588)(0.7765,0.90588)(0.7804,0.9098)(0.7843,0.9098)(0.7882,0.91373)(0.7922,0.91373)(0.7961,0.91765)(0.8,0.91765)(0.8039,0.91765)(0.8078,0.91765)(0.8118,0.92157)(0.8157,0.92157)(0.8196,0.92157)(0.8235,0.92157)(0.8275,0.92157)(0.8314,0.92157)(0.8353,0.92157)(0.8392,0.92157)(0.8431,0.91765)(0.8471,0.91765)(0.851,0.91765)(0.8549,0.91765)(0.8588,0.91765)(0.8627,0.91765)(0.8667,0.91765)(0.8706,0.91765)(0.8745,0.91765)(0.8784,0.91373)(0.8824,0.91373)(0.8863,0.91373)(0.8902,0.91373)(0.8941,0.91373)(0.898,0.91373)(0.902,0.91373)(0.9059,0.91765)(0.9098,0.91765)(0.9137,0.91765)(0.9176,0.91765)(0.9216,0.92157)(0.9255,0.92157)(0.9294,0.92157)(0.9333,0.92549)(0.9373,0.92549)(0.9412,0.92941)(0.9451,0.93333)(0.949,0.93333)(0.9529,0.93725)(0.9569,0.94118)(0.9608,0.9451)(0.9647,0.94902)(0.9686,0.95294)(0.9725,0.95686)(0.9765,0.96471)(0.9804,0.96863)(0.9843,0.97255)(0.9882,0.98039)(0.9922,0.98431)(0.9961,0.99216)(1,1)
diff --git a/ds9/cmaps/ch05m151410.sao b/ds9/cmaps/ch05m151410.sao
new file mode 100644
index 0000000..d5d64a0
--- /dev/null
+++ b/ds9/cmaps/ch05m151410.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch05m151410
+# created by cptutils 1.46
+# Wed Aug 15 23:30:53 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0.0039216)(0.0078,0.011765)(0.0118,0.019608)(0.0157,0.027451)(0.0196,0.035294)(0.0235,0.039216)(0.0275,0.047059)(0.0314,0.054902)(0.0353,0.058824)(0.0392,0.062745)(0.0431,0.066667)(0.0471,0.07451)(0.051,0.078431)(0.0549,0.082353)(0.0588,0.086275)(0.0627,0.086275)(0.0667,0.090196)(0.0706,0.094118)(0.0745,0.094118)(0.0784,0.098039)(0.0824,0.098039)(0.0863,0.098039)(0.0902,0.098039)(0.0941,0.10196)(0.098,0.10196)(0.102,0.10196)(0.1059,0.098039)(0.1098,0.098039)(0.1137,0.098039)(0.1176,0.098039)(0.1216,0.094118)(0.1255,0.094118)(0.1294,0.090196)(0.1333,0.090196)(0.1373,0.086275)(0.1412,0.086275)(0.1451,0.082353)(0.149,0.078431)(0.1529,0.07451)(0.1569,0.07451)(0.1608,0.070588)(0.1647,0.066667)(0.1686,0.062745)(0.1725,0.058824)(0.1765,0.058824)(0.1804,0.054902)(0.1843,0.05098)(0.1882,0.047059)(0.1922,0.043137)(0.1961,0.043137)(0.2,0.039216)(0.2039,0.035294)(0.2078,0.031373)(0.2118,0.031373)(0.2157,0.027451)(0.2196,0.027451)(0.2235,0.023529)(0.2275,0.023529)(0.2314,0.019608)(0.2353,0.019608)(0.2392,0.019608)(0.2431,0.015686)(0.2471,0.015686)(0.251,0.015686)(0.2549,0.015686)(0.2588,0.019608)(0.2627,0.019608)(0.2667,0.019608)(0.2706,0.019608)(0.2745,0.023529)(0.2784,0.027451)(0.2824,0.027451)(0.2863,0.031373)(0.2902,0.035294)(0.2941,0.039216)(0.298,0.043137)(0.302,0.047059)(0.3059,0.054902)(0.3098,0.058824)(0.3137,0.066667)(0.3176,0.070588)(0.3216,0.078431)(0.3255,0.086275)(0.3294,0.094118)(0.3333,0.10196)(0.3373,0.1098)(0.3412,0.12157)(0.3451,0.12941)(0.349,0.14118)(0.3529,0.14902)(0.3569,0.16078)(0.3608,0.17255)(0.3647,0.18431)(0.3686,0.19608)(0.3725,0.20784)(0.3765,0.21961)(0.3804,0.23137)(0.3843,0.24314)(0.3882,0.25882)(0.3922,0.27059)(0.3961,0.28627)(0.4,0.29804)(0.4039,0.31373)(0.4078,0.32941)(0.4118,0.34118)(0.4157,0.35686)(0.4196,0.37255)(0.4235,0.38824)(0.4275,0.4)(0.4314,0.41569)(0.4353,0.43137)(0.4392,0.44706)(0.4431,0.46275)(0.4471,0.47843)(0.451,0.49412)(0.4549,0.5098)(0.4588,0.52549)(0.4627,0.54118)(0.4667,0.55294)(0.4706,0.56863)(0.4745,0.58431)(0.4784,0.6)(0.4824,0.61176)(0.4863,0.62745)(0.4902,0.64314)(0.4941,0.6549)(0.498,0.67059)(0.502,0.68235)(0.5059,0.69804)(0.5098,0.7098)(0.5137,0.72157)(0.5176,0.73333)(0.5216,0.7451)(0.5255,0.75686)(0.5294,0.76863)(0.5333,0.78039)(0.5373,0.78824)(0.5412,0.8)(0.5451,0.80784)(0.549,0.81961)(0.5529,0.82745)(0.5569,0.83529)(0.5608,0.84314)(0.5647,0.85098)(0.5686,0.85882)(0.5725,0.86667)(0.5765,0.87059)(0.5804,0.87843)(0.5843,0.88235)(0.5882,0.88627)(0.5922,0.8902)(0.5961,0.89412)(0.6,0.89804)(0.6039,0.90196)(0.6078,0.90588)(0.6118,0.90588)(0.6157,0.90588)(0.6196,0.9098)(0.6235,0.9098)(0.6275,0.9098)(0.6314,0.9098)(0.6353,0.9098)(0.6392,0.9098)(0.6431,0.90588)(0.6471,0.90588)(0.651,0.90588)(0.6549,0.90196)(0.6588,0.89804)(0.6627,0.89804)(0.6667,0.89412)(0.6706,0.8902)(0.6745,0.88627)(0.6784,0.88235)(0.6824,0.87843)(0.6863,0.87451)(0.6902,0.87059)(0.6941,0.86275)(0.698,0.85882)(0.702,0.8549)(0.7059,0.85098)(0.7098,0.84314)(0.7137,0.83922)(0.7176,0.83529)(0.7216,0.82745)(0.7255,0.82353)(0.7294,0.81569)(0.7333,0.81176)(0.7373,0.80784)(0.7412,0.8)(0.7451,0.79608)(0.749,0.79216)(0.7529,0.78431)(0.7569,0.78039)(0.7608,0.77647)(0.7647,0.77255)(0.7686,0.76863)(0.7725,0.76471)(0.7765,0.76078)(0.7804,0.75686)(0.7843,0.75294)(0.7882,0.74902)(0.7922,0.7451)(0.7961,0.74118)(0.8,0.74118)(0.8039,0.73725)(0.8078,0.73725)(0.8118,0.73333)(0.8157,0.73333)(0.8196,0.73333)(0.8235,0.73333)(0.8275,0.73333)(0.8314,0.73333)(0.8353,0.73333)(0.8392,0.73333)(0.8431,0.73333)(0.8471,0.73725)(0.851,0.73725)(0.8549,0.74118)(0.8588,0.74118)(0.8627,0.7451)(0.8667,0.74902)(0.8706,0.75294)(0.8745,0.75686)(0.8784,0.76078)(0.8824,0.76471)(0.8863,0.77255)(0.8902,0.77647)(0.8941,0.78431)(0.898,0.78824)(0.902,0.79608)(0.9059,0.8)(0.9098,0.80784)(0.9137,0.81569)(0.9176,0.82353)(0.9216,0.83137)(0.9255,0.83922)(0.9294,0.84706)(0.9333,0.8549)(0.9373,0.86275)(0.9412,0.87059)(0.9451,0.87843)(0.949,0.88627)(0.9529,0.89412)(0.9569,0.90588)(0.9608,0.91373)(0.9647,0.92157)(0.9686,0.92941)(0.9725,0.93725)(0.9765,0.94902)(0.9804,0.95686)(0.9843,0.96471)(0.9882,0.97255)(0.9922,0.98039)(0.9961,0.98824)(1,1)
+GREEN:
+(0,0)(0.0039,0)(0.0078,0)(0.0118,0.0039216)(0.0157,0.0039216)(0.0196,0.0039216)(0.0235,0.0078431)(0.0275,0.0078431)(0.0314,0.011765)(0.0353,0.015686)(0.0392,0.015686)(0.0431,0.019608)(0.0471,0.019608)(0.051,0.023529)(0.0549,0.027451)(0.0588,0.031373)(0.0627,0.035294)(0.0667,0.035294)(0.0706,0.039216)(0.0745,0.043137)(0.0784,0.047059)(0.0824,0.05098)(0.0863,0.058824)(0.0902,0.062745)(0.0941,0.066667)(0.098,0.070588)(0.102,0.07451)(0.1059,0.082353)(0.1098,0.086275)(0.1137,0.094118)(0.1176,0.098039)(0.1216,0.10588)(0.1255,0.1098)(0.1294,0.11765)(0.1333,0.12157)(0.1373,0.12941)(0.1412,0.13725)(0.1451,0.1451)(0.149,0.14902)(0.1529,0.15686)(0.1569,0.16471)(0.1608,0.17255)(0.1647,0.18039)(0.1686,0.18824)(0.1725,0.19608)(0.1765,0.20392)(0.1804,0.21176)(0.1843,0.21961)(0.1882,0.22745)(0.1922,0.23529)(0.1961,0.24314)(0.2,0.25098)(0.2039,0.25882)(0.2078,0.26667)(0.2118,0.27451)(0.2157,0.28235)(0.2196,0.29412)(0.2235,0.30196)(0.2275,0.3098)(0.2314,0.31765)(0.2353,0.32549)(0.2392,0.33333)(0.2431,0.34118)(0.2471,0.34902)(0.251,0.35686)(0.2549,0.36078)(0.2588,0.36863)(0.2627,0.37647)(0.2667,0.38431)(0.2706,0.39216)(0.2745,0.39608)(0.2784,0.40392)(0.2824,0.41176)(0.2863,0.41569)(0.2902,0.42353)(0.2941,0.42745)(0.298,0.43529)(0.302,0.43922)(0.3059,0.44706)(0.3098,0.45098)(0.3137,0.4549)(0.3176,0.45882)(0.3216,0.46275)(0.3255,0.46667)(0.3294,0.47059)(0.3333,0.47451)(0.3373,0.47843)(0.3412,0.48235)(0.3451,0.48627)(0.349,0.4902)(0.3529,0.4902)(0.3569,0.49412)(0.3608,0.49412)(0.3647,0.49804)(0.3686,0.49804)(0.3725,0.50196)(0.3765,0.50196)(0.3804,0.50196)(0.3843,0.50196)(0.3882,0.50588)(0.3922,0.50588)(0.3961,0.50588)(0.4,0.50588)(0.4039,0.50588)(0.4078,0.50588)(0.4118,0.50196)(0.4157,0.50196)(0.4196,0.50196)(0.4235,0.50196)(0.4275,0.49804)(0.4314,0.49804)(0.4353,0.49804)(0.4392,0.49412)(0.4431,0.49412)(0.4471,0.4902)(0.451,0.4902)(0.4549,0.48627)(0.4588,0.48627)(0.4627,0.48235)(0.4667,0.48235)(0.4706,0.47843)(0.4745,0.47843)(0.4784,0.47451)(0.4824,0.47451)(0.4863,0.47059)(0.4902,0.46667)(0.4941,0.46667)(0.498,0.46275)(0.502,0.46275)(0.5059,0.45882)(0.5098,0.45882)(0.5137,0.4549)(0.5176,0.4549)(0.5216,0.45098)(0.5255,0.45098)(0.5294,0.45098)(0.5333,0.44706)(0.5373,0.44706)(0.5412,0.44706)(0.5451,0.44314)(0.549,0.44314)(0.5529,0.44314)(0.5569,0.44314)(0.5608,0.44314)(0.5647,0.44314)(0.5686,0.44314)(0.5725,0.44314)(0.5765,0.44314)(0.5804,0.44314)(0.5843,0.44706)(0.5882,0.44706)(0.5922,0.44706)(0.5961,0.45098)(0.6,0.45098)(0.6039,0.4549)(0.6078,0.4549)(0.6118,0.45882)(0.6157,0.46275)(0.6196,0.46667)(0.6235,0.46667)(0.6275,0.47059)(0.6314,0.47451)(0.6353,0.47843)(0.6392,0.48235)(0.6431,0.48627)(0.6471,0.49412)(0.651,0.49804)(0.6549,0.50196)(0.6588,0.5098)(0.6627,0.51373)(0.6667,0.52157)(0.6706,0.52549)(0.6745,0.53333)(0.6784,0.53725)(0.6824,0.5451)(0.6863,0.55294)(0.6902,0.56078)(0.6941,0.56471)(0.698,0.57255)(0.702,0.58039)(0.7059,0.58824)(0.7098,0.59608)(0.7137,0.60392)(0.7176,0.61176)(0.7216,0.61961)(0.7255,0.62745)(0.7294,0.63529)(0.7333,0.64314)(0.7373,0.65098)(0.7412,0.66275)(0.7451,0.67059)(0.749,0.67843)(0.7529,0.68627)(0.7569,0.69412)(0.7608,0.70196)(0.7647,0.71373)(0.7686,0.72157)(0.7725,0.72941)(0.7765,0.73725)(0.7804,0.7451)(0.7843,0.75294)(0.7882,0.76078)(0.7922,0.77255)(0.7961,0.78039)(0.8,0.78824)(0.8039,0.79608)(0.8078,0.80392)(0.8118,0.81176)(0.8157,0.81961)(0.8196,0.82745)(0.8235,0.83137)(0.8275,0.83922)(0.8314,0.84706)(0.8353,0.8549)(0.8392,0.86275)(0.8431,0.86667)(0.8471,0.87451)(0.851,0.87843)(0.8549,0.88627)(0.8588,0.89412)(0.8627,0.89804)(0.8667,0.90196)(0.8706,0.9098)(0.8745,0.91373)(0.8784,0.91765)(0.8824,0.92549)(0.8863,0.92941)(0.8902,0.93333)(0.8941,0.93725)(0.898,0.94118)(0.902,0.9451)(0.9059,0.94902)(0.9098,0.95294)(0.9137,0.95686)(0.9176,0.95686)(0.9216,0.96078)(0.9255,0.96471)(0.9294,0.96863)(0.9333,0.96863)(0.9373,0.97255)(0.9412,0.97255)(0.9451,0.97647)(0.949,0.97647)(0.9529,0.98039)(0.9569,0.98039)(0.9608,0.98431)(0.9647,0.98431)(0.9686,0.98824)(0.9725,0.98824)(0.9765,0.98824)(0.9804,0.99216)(0.9843,0.99216)(0.9882,0.99216)(0.9922,0.99608)(0.9961,0.99608)(1,1)
+BLUE:
+(0,0)(0.0039,0.0039216)(0.0078,0.011765)(0.0118,0.019608)(0.0157,0.027451)(0.0196,0.035294)(0.0235,0.043137)(0.0275,0.05098)(0.0314,0.058824)(0.0353,0.070588)(0.0392,0.078431)(0.0431,0.086275)(0.0471,0.098039)(0.051,0.10588)(0.0549,0.11373)(0.0588,0.12549)(0.0627,0.13333)(0.0667,0.1451)(0.0706,0.15294)(0.0745,0.16078)(0.0784,0.17255)(0.0824,0.18039)(0.0863,0.19216)(0.0902,0.2)(0.0941,0.20784)(0.098,0.21569)(0.102,0.22745)(0.1059,0.23529)(0.1098,0.24314)(0.1137,0.25098)(0.1176,0.25882)(0.1216,0.26667)(0.1255,0.27451)(0.1294,0.28235)(0.1333,0.28627)(0.1373,0.29412)(0.1412,0.29804)(0.1451,0.30588)(0.149,0.3098)(0.1529,0.31765)(0.1569,0.32157)(0.1608,0.32549)(0.1647,0.32941)(0.1686,0.33333)(0.1725,0.33725)(0.1765,0.33725)(0.1804,0.34118)(0.1843,0.34118)(0.1882,0.3451)(0.1922,0.3451)(0.1961,0.3451)(0.2,0.3451)(0.2039,0.3451)(0.2078,0.3451)(0.2118,0.3451)(0.2157,0.34118)(0.2196,0.34118)(0.2235,0.33725)(0.2275,0.33725)(0.2314,0.33333)(0.2353,0.32941)(0.2392,0.32549)(0.2431,0.32157)(0.2471,0.31765)(0.251,0.31373)(0.2549,0.3098)(0.2588,0.30588)(0.2627,0.29804)(0.2667,0.29412)(0.2706,0.28627)(0.2745,0.28235)(0.2784,0.27451)(0.2824,0.26667)(0.2863,0.26275)(0.2902,0.2549)(0.2941,0.24706)(0.298,0.24314)(0.302,0.23529)(0.3059,0.22745)(0.3098,0.21961)(0.3137,0.21176)(0.3176,0.20392)(0.3216,0.2)(0.3255,0.19216)(0.3294,0.18431)(0.3333,0.17647)(0.3373,0.17255)(0.3412,0.16471)(0.3451,0.15686)(0.349,0.15294)(0.3529,0.1451)(0.3569,0.14118)(0.3608,0.13333)(0.3647,0.12941)(0.3686,0.12549)(0.3725,0.11765)(0.3765,0.11373)(0.3804,0.1098)(0.3843,0.10588)(0.3882,0.10196)(0.3922,0.10196)(0.3961,0.098039)(0.4,0.094118)(0.4039,0.094118)(0.4078,0.090196)(0.4118,0.090196)(0.4157,0.090196)(0.4196,0.090196)(0.4235,0.090196)(0.4275,0.090196)(0.4314,0.094118)(0.4353,0.094118)(0.4392,0.098039)(0.4431,0.10196)(0.4471,0.10196)(0.451,0.10588)(0.4549,0.11373)(0.4588,0.11765)(0.4627,0.12157)(0.4667,0.12941)(0.4706,0.13333)(0.4745,0.14118)(0.4784,0.14902)(0.4824,0.15686)(0.4863,0.16471)(0.4902,0.17647)(0.4941,0.18431)(0.498,0.19216)(0.502,0.20392)(0.5059,0.21569)(0.5098,0.22745)(0.5137,0.23922)(0.5176,0.25098)(0.5216,0.26275)(0.5255,0.27451)(0.5294,0.28627)(0.5333,0.30196)(0.5373,0.31373)(0.5412,0.32941)(0.5451,0.3451)(0.549,0.35686)(0.5529,0.37255)(0.5569,0.38824)(0.5608,0.40392)(0.5647,0.41961)(0.5686,0.43529)(0.5725,0.45098)(0.5765,0.46667)(0.5804,0.48235)(0.5843,0.49804)(0.5882,0.51373)(0.5922,0.52941)(0.5961,0.54902)(0.6,0.56471)(0.6039,0.58039)(0.6078,0.59608)(0.6118,0.61176)(0.6157,0.62745)(0.6196,0.64314)(0.6235,0.65882)(0.6275,0.67451)(0.6314,0.6902)(0.6353,0.70588)(0.6392,0.72157)(0.6431,0.73725)(0.6471,0.74902)(0.651,0.76471)(0.6549,0.77647)(0.6588,0.79216)(0.6627,0.80392)(0.6667,0.81961)(0.6706,0.83137)(0.6745,0.84314)(0.6784,0.8549)(0.6824,0.86667)(0.6863,0.87843)(0.6902,0.8902)(0.6941,0.89804)(0.698,0.9098)(0.702,0.91765)(0.7059,0.92549)(0.7098,0.93725)(0.7137,0.9451)(0.7176,0.95294)(0.7216,0.96078)(0.7255,0.96471)(0.7294,0.97255)(0.7333,0.97647)(0.7373,0.98431)(0.7412,0.98824)(0.7451,0.99216)(0.749,0.99608)(0.7529,1)(0.7569,1)(0.7608,1)(0.7647,1)(0.7686,1)(0.7725,1)(0.7765,1)(0.7804,1)(0.7843,1)(0.7882,1)(0.7922,1)(0.7961,1)(0.8,1)(0.8039,1)(0.8078,1)(0.8118,1)(0.8157,1)(0.8196,1)(0.8235,1)(0.8275,1)(0.8314,1)(0.8353,0.99608)(0.8392,0.99216)(0.8431,0.99216)(0.8471,0.98824)(0.851,0.98431)(0.8549,0.98039)(0.8588,0.97647)(0.8627,0.97647)(0.8667,0.97255)(0.8706,0.96863)(0.8745,0.96471)(0.8784,0.96078)(0.8824,0.96078)(0.8863,0.95686)(0.8902,0.95294)(0.8941,0.95294)(0.898,0.94902)(0.902,0.94902)(0.9059,0.9451)(0.9098,0.9451)(0.9137,0.94118)(0.9176,0.94118)(0.9216,0.94118)(0.9255,0.94118)(0.9294,0.94118)(0.9333,0.94118)(0.9373,0.94118)(0.9412,0.94118)(0.9451,0.94118)(0.949,0.9451)(0.9529,0.9451)(0.9569,0.94902)(0.9608,0.94902)(0.9647,0.95294)(0.9686,0.95686)(0.9725,0.96078)(0.9765,0.96471)(0.9804,0.96863)(0.9843,0.97647)(0.9882,0.98039)(0.9922,0.98431)(0.9961,0.99216)(1,1)
diff --git a/ds9/cmaps/ch05p151010.sao b/ds9/cmaps/ch05p151010.sao
new file mode 100644
index 0000000..788a916
--- /dev/null
+++ b/ds9/cmaps/ch05p151010.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch05p151010
+# created by cptutils 1.46
+# Wed Aug 15 23:30:54 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0.0039216)(0.0078,0.011765)(0.0118,0.019608)(0.0157,0.027451)(0.0196,0.035294)(0.0235,0.039216)(0.0275,0.047059)(0.0314,0.054902)(0.0353,0.062745)(0.0392,0.070588)(0.0431,0.078431)(0.0471,0.086275)(0.051,0.090196)(0.0549,0.098039)(0.0588,0.10588)(0.0627,0.11373)(0.0667,0.12157)(0.0706,0.12549)(0.0745,0.13333)(0.0784,0.14118)(0.0824,0.1451)(0.0863,0.15294)(0.0902,0.16078)(0.0941,0.16471)(0.098,0.17255)(0.102,0.17647)(0.1059,0.18039)(0.1098,0.18824)(0.1137,0.19216)(0.1176,0.19608)(0.1216,0.2)(0.1255,0.20392)(0.1294,0.21176)(0.1333,0.21176)(0.1373,0.21569)(0.1412,0.21961)(0.1451,0.22353)(0.149,0.22745)(0.1529,0.22745)(0.1569,0.23137)(0.1608,0.23137)(0.1647,0.23529)(0.1686,0.23529)(0.1725,0.23922)(0.1765,0.23922)(0.1804,0.23922)(0.1843,0.23922)(0.1882,0.23922)(0.1922,0.23922)(0.1961,0.23922)(0.2,0.23922)(0.2039,0.23922)(0.2078,0.23922)(0.2118,0.23529)(0.2157,0.23529)(0.2196,0.23529)(0.2235,0.23137)(0.2275,0.23137)(0.2314,0.22745)(0.2353,0.22745)(0.2392,0.22353)(0.2431,0.22353)(0.2471,0.21961)(0.251,0.21569)(0.2549,0.21569)(0.2588,0.21176)(0.2627,0.20784)(0.2667,0.20784)(0.2706,0.20392)(0.2745,0.2)(0.2784,0.2)(0.2824,0.19608)(0.2863,0.19216)(0.2902,0.19216)(0.2941,0.18824)(0.298,0.18431)(0.302,0.18431)(0.3059,0.18039)(0.3098,0.18039)(0.3137,0.17647)(0.3176,0.17255)(0.3216,0.17255)(0.3255,0.17255)(0.3294,0.16863)(0.3333,0.16863)(0.3373,0.16863)(0.3412,0.16471)(0.3451,0.16471)(0.349,0.16471)(0.3529,0.16471)(0.3569,0.16471)(0.3608,0.16471)(0.3647,0.16471)(0.3686,0.16471)(0.3725,0.16863)(0.3765,0.16863)(0.3804,0.16863)(0.3843,0.17255)(0.3882,0.17647)(0.3922,0.17647)(0.3961,0.18039)(0.4,0.18431)(0.4039,0.18824)(0.4078,0.19216)(0.4118,0.19608)(0.4157,0.2)(0.4196,0.20392)(0.4235,0.20784)(0.4275,0.21569)(0.4314,0.21961)(0.4353,0.22745)(0.4392,0.23529)(0.4431,0.23922)(0.4471,0.24706)(0.451,0.2549)(0.4549,0.26275)(0.4588,0.27059)(0.4627,0.27843)(0.4667,0.28627)(0.4706,0.29804)(0.4745,0.30588)(0.4784,0.31373)(0.4824,0.32549)(0.4863,0.33333)(0.4902,0.3451)(0.4941,0.35294)(0.498,0.36471)(0.502,0.37647)(0.5059,0.38824)(0.5098,0.39608)(0.5137,0.40784)(0.5176,0.41961)(0.5216,0.43137)(0.5255,0.44314)(0.5294,0.4549)(0.5333,0.46667)(0.5373,0.47843)(0.5412,0.4902)(0.5451,0.50196)(0.549,0.51373)(0.5529,0.52549)(0.5569,0.54118)(0.5608,0.55294)(0.5647,0.56471)(0.5686,0.57647)(0.5725,0.58824)(0.5765,0.6)(0.5804,0.61176)(0.5843,0.62353)(0.5882,0.63529)(0.5922,0.64706)(0.5961,0.65882)(0.6,0.67059)(0.6039,0.67843)(0.6078,0.6902)(0.6118,0.70196)(0.6157,0.71373)(0.6196,0.72157)(0.6235,0.73333)(0.6275,0.74118)(0.6314,0.75294)(0.6353,0.76078)(0.6392,0.77255)(0.6431,0.78039)(0.6471,0.78824)(0.651,0.79608)(0.6549,0.80392)(0.6588,0.81176)(0.6627,0.81961)(0.6667,0.82745)(0.6706,0.83529)(0.6745,0.84314)(0.6784,0.84706)(0.6824,0.8549)(0.6863,0.85882)(0.6902,0.86667)(0.6941,0.87059)(0.698,0.87451)(0.702,0.87843)(0.7059,0.88627)(0.7098,0.8902)(0.7137,0.8902)(0.7176,0.89412)(0.7216,0.89804)(0.7255,0.90196)(0.7294,0.90588)(0.7333,0.90588)(0.7373,0.9098)(0.7412,0.9098)(0.7451,0.9098)(0.749,0.91373)(0.7529,0.91373)(0.7569,0.91373)(0.7608,0.91373)(0.7647,0.91373)(0.7686,0.91765)(0.7725,0.91765)(0.7765,0.91765)(0.7804,0.91373)(0.7843,0.91373)(0.7882,0.91373)(0.7922,0.91373)(0.7961,0.91373)(0.8,0.91373)(0.8039,0.9098)(0.8078,0.9098)(0.8118,0.9098)(0.8157,0.90588)(0.8196,0.90588)(0.8235,0.90588)(0.8275,0.90588)(0.8314,0.90196)(0.8353,0.90196)(0.8392,0.90196)(0.8431,0.89804)(0.8471,0.89804)(0.851,0.89804)(0.8549,0.89804)(0.8588,0.89412)(0.8627,0.89412)(0.8667,0.89412)(0.8706,0.89412)(0.8745,0.89412)(0.8784,0.89412)(0.8824,0.89412)(0.8863,0.89412)(0.8902,0.89412)(0.8941,0.89412)(0.898,0.89412)(0.902,0.89804)(0.9059,0.89804)(0.9098,0.89804)(0.9137,0.90196)(0.9176,0.90196)(0.9216,0.90588)(0.9255,0.90588)(0.9294,0.9098)(0.9333,0.91373)(0.9373,0.91765)(0.9412,0.91765)(0.9451,0.92157)(0.949,0.92549)(0.9529,0.92941)(0.9569,0.93725)(0.9608,0.94118)(0.9647,0.9451)(0.9686,0.94902)(0.9725,0.95686)(0.9765,0.96078)(0.9804,0.96471)(0.9843,0.97255)(0.9882,0.98039)(0.9922,0.98431)(0.9961,0.99216)(1,1)
+GREEN:
+(0,0)(0.0039,0)(0.0078,0.0039216)(0.0118,0.0039216)(0.0157,0.0078431)(0.0196,0.0078431)(0.0235,0.011765)(0.0275,0.011765)(0.0314,0.015686)(0.0353,0.015686)(0.0392,0.019608)(0.0431,0.023529)(0.0471,0.023529)(0.051,0.027451)(0.0549,0.027451)(0.0588,0.031373)(0.0627,0.035294)(0.0667,0.039216)(0.0706,0.039216)(0.0745,0.043137)(0.0784,0.047059)(0.0824,0.05098)(0.0863,0.054902)(0.0902,0.054902)(0.0941,0.058824)(0.098,0.062745)(0.102,0.066667)(0.1059,0.070588)(0.1098,0.07451)(0.1137,0.082353)(0.1176,0.086275)(0.1216,0.090196)(0.1255,0.094118)(0.1294,0.098039)(0.1333,0.10196)(0.1373,0.1098)(0.1412,0.11373)(0.1451,0.11765)(0.149,0.12549)(0.1529,0.12941)(0.1569,0.13725)(0.1608,0.14118)(0.1647,0.14902)(0.1686,0.15294)(0.1725,0.16078)(0.1765,0.16471)(0.1804,0.17255)(0.1843,0.18039)(0.1882,0.18431)(0.1922,0.19216)(0.1961,0.2)(0.2,0.20392)(0.2039,0.21176)(0.2078,0.21961)(0.2118,0.22745)(0.2157,0.23529)(0.2196,0.23922)(0.2235,0.24706)(0.2275,0.2549)(0.2314,0.26275)(0.2353,0.27059)(0.2392,0.27843)(0.2431,0.28235)(0.2471,0.2902)(0.251,0.29804)(0.2549,0.30588)(0.2588,0.31373)(0.2627,0.32157)(0.2667,0.32549)(0.2706,0.33333)(0.2745,0.34118)(0.2784,0.34902)(0.2824,0.35294)(0.2863,0.36078)(0.2902,0.36863)(0.2941,0.37647)(0.298,0.38039)(0.302,0.38824)(0.3059,0.39216)(0.3098,0.4)(0.3137,0.40784)(0.3176,0.41176)(0.3216,0.41961)(0.3255,0.42353)(0.3294,0.43137)(0.3333,0.43529)(0.3373,0.43922)(0.3412,0.44706)(0.3451,0.45098)(0.349,0.4549)(0.3529,0.45882)(0.3569,0.46275)(0.3608,0.46667)(0.3647,0.47451)(0.3686,0.47843)(0.3725,0.48235)(0.3765,0.48235)(0.3804,0.48627)(0.3843,0.4902)(0.3882,0.49412)(0.3922,0.49804)(0.3961,0.49804)(0.4,0.50196)(0.4039,0.50588)(0.4078,0.50588)(0.4118,0.5098)(0.4157,0.5098)(0.4196,0.51373)(0.4235,0.51373)(0.4275,0.51765)(0.4314,0.51765)(0.4353,0.51765)(0.4392,0.52157)(0.4431,0.52157)(0.4471,0.52157)(0.451,0.52157)(0.4549,0.52157)(0.4588,0.52549)(0.4627,0.52549)(0.4667,0.52549)(0.4706,0.52549)(0.4745,0.52549)(0.4784,0.52549)(0.4824,0.52549)(0.4863,0.52549)(0.4902,0.52549)(0.4941,0.52549)(0.498,0.52157)(0.502,0.52157)(0.5059,0.52157)(0.5098,0.52157)(0.5137,0.52157)(0.5176,0.52157)(0.5216,0.52157)(0.5255,0.52157)(0.5294,0.52157)(0.5333,0.51765)(0.5373,0.51765)(0.5412,0.51765)(0.5451,0.51765)(0.549,0.51765)(0.5529,0.51765)(0.5569,0.51765)(0.5608,0.51765)(0.5647,0.51765)(0.5686,0.51765)(0.5725,0.51765)(0.5765,0.51765)(0.5804,0.51765)(0.5843,0.51765)(0.5882,0.51765)(0.5922,0.52157)(0.5961,0.52157)(0.6,0.52157)(0.6039,0.52157)(0.6078,0.52549)(0.6118,0.52549)(0.6157,0.52549)(0.6196,0.52941)(0.6235,0.52941)(0.6275,0.53333)(0.6314,0.53333)(0.6353,0.53725)(0.6392,0.54118)(0.6431,0.54118)(0.6471,0.5451)(0.651,0.54902)(0.6549,0.54902)(0.6588,0.55294)(0.6627,0.55686)(0.6667,0.56078)(0.6706,0.56471)(0.6745,0.56863)(0.6784,0.57255)(0.6824,0.57647)(0.6863,0.58039)(0.6902,0.58824)(0.6941,0.59216)(0.698,0.59608)(0.702,0.6)(0.7059,0.60784)(0.7098,0.61176)(0.7137,0.61569)(0.7176,0.62353)(0.7216,0.62745)(0.7255,0.63529)(0.7294,0.63922)(0.7333,0.64706)(0.7373,0.65098)(0.7412,0.65882)(0.7451,0.66667)(0.749,0.67059)(0.7529,0.67843)(0.7569,0.68627)(0.7608,0.6902)(0.7647,0.69804)(0.7686,0.70588)(0.7725,0.7098)(0.7765,0.71765)(0.7804,0.72549)(0.7843,0.73333)(0.7882,0.73725)(0.7922,0.7451)(0.7961,0.75294)(0.8,0.76078)(0.8039,0.76863)(0.8078,0.77255)(0.8118,0.78039)(0.8157,0.78824)(0.8196,0.79216)(0.8235,0.8)(0.8275,0.80784)(0.8314,0.81569)(0.8353,0.81961)(0.8392,0.82745)(0.8431,0.83529)(0.8471,0.83922)(0.851,0.84706)(0.8549,0.85098)(0.8588,0.85882)(0.8627,0.86275)(0.8667,0.87059)(0.8706,0.87451)(0.8745,0.88235)(0.8784,0.88627)(0.8824,0.89412)(0.8863,0.89804)(0.8902,0.90196)(0.8941,0.9098)(0.898,0.91373)(0.902,0.91765)(0.9059,0.92157)(0.9098,0.92549)(0.9137,0.92941)(0.9176,0.93725)(0.9216,0.94118)(0.9255,0.9451)(0.9294,0.94902)(0.9333,0.95294)(0.9373,0.95294)(0.9412,0.95686)(0.9451,0.96078)(0.949,0.96471)(0.9529,0.96863)(0.9569,0.97255)(0.9608,0.97255)(0.9647,0.97647)(0.9686,0.98039)(0.9725,0.98039)(0.9765,0.98431)(0.9804,0.98824)(0.9843,0.98824)(0.9882,0.99216)(0.9922,0.99216)(0.9961,0.99608)(1,1)
+BLUE:
+(0,0)(0.0039,0.0039216)(0.0078,0.0078431)(0.0118,0.015686)(0.0157,0.019608)(0.0196,0.023529)(0.0235,0.027451)(0.0275,0.031373)(0.0314,0.035294)(0.0353,0.039216)(0.0392,0.043137)(0.0431,0.047059)(0.0471,0.047059)(0.051,0.05098)(0.0549,0.054902)(0.0588,0.054902)(0.0627,0.054902)(0.0667,0.058824)(0.0706,0.058824)(0.0745,0.058824)(0.0784,0.062745)(0.0824,0.062745)(0.0863,0.062745)(0.0902,0.062745)(0.0941,0.062745)(0.098,0.062745)(0.102,0.062745)(0.1059,0.062745)(0.1098,0.058824)(0.1137,0.058824)(0.1176,0.058824)(0.1216,0.058824)(0.1255,0.058824)(0.1294,0.054902)(0.1333,0.054902)(0.1373,0.054902)(0.1412,0.05098)(0.1451,0.05098)(0.149,0.05098)(0.1529,0.05098)(0.1569,0.047059)(0.1608,0.047059)(0.1647,0.047059)(0.1686,0.047059)(0.1725,0.043137)(0.1765,0.043137)(0.1804,0.043137)(0.1843,0.043137)(0.1882,0.043137)(0.1922,0.043137)(0.1961,0.043137)(0.2,0.043137)(0.2039,0.043137)(0.2078,0.043137)(0.2118,0.047059)(0.2157,0.047059)(0.2196,0.047059)(0.2235,0.05098)(0.2275,0.05098)(0.2314,0.054902)(0.2353,0.058824)(0.2392,0.058824)(0.2431,0.062745)(0.2471,0.066667)(0.251,0.070588)(0.2549,0.07451)(0.2588,0.078431)(0.2627,0.082353)(0.2667,0.090196)(0.2706,0.094118)(0.2745,0.098039)(0.2784,0.10588)(0.2824,0.1098)(0.2863,0.11765)(0.2902,0.12549)(0.2941,0.13333)(0.298,0.14118)(0.302,0.14902)(0.3059,0.15686)(0.3098,0.16471)(0.3137,0.17255)(0.3176,0.18431)(0.3216,0.19216)(0.3255,0.2)(0.3294,0.21176)(0.3333,0.22353)(0.3373,0.23137)(0.3412,0.24314)(0.3451,0.2549)(0.349,0.26667)(0.3529,0.27451)(0.3569,0.28627)(0.3608,0.29804)(0.3647,0.3098)(0.3686,0.32157)(0.3725,0.33333)(0.3765,0.34902)(0.3804,0.36078)(0.3843,0.37255)(0.3882,0.38431)(0.3922,0.39608)(0.3961,0.41176)(0.4,0.42353)(0.4039,0.43529)(0.4078,0.44706)(0.4118,0.46275)(0.4157,0.47451)(0.4196,0.48627)(0.4235,0.49804)(0.4275,0.5098)(0.4314,0.52549)(0.4353,0.53725)(0.4392,0.54902)(0.4431,0.56078)(0.4471,0.57255)(0.451,0.58431)(0.4549,0.59608)(0.4588,0.60784)(0.4627,0.61961)(0.4667,0.62745)(0.4706,0.63922)(0.4745,0.65098)(0.4784,0.65882)(0.4824,0.67059)(0.4863,0.67843)(0.4902,0.6902)(0.4941,0.69804)(0.498,0.70588)(0.502,0.71765)(0.5059,0.72549)(0.5098,0.73333)(0.5137,0.74118)(0.5176,0.7451)(0.5216,0.75294)(0.5255,0.76078)(0.5294,0.76471)(0.5333,0.77255)(0.5373,0.77647)(0.5412,0.78039)(0.5451,0.78824)(0.549,0.79216)(0.5529,0.79608)(0.5569,0.8)(0.5608,0.8)(0.5647,0.80392)(0.5686,0.80784)(0.5725,0.80784)(0.5765,0.81176)(0.5804,0.81176)(0.5843,0.81176)(0.5882,0.81569)(0.5922,0.81569)(0.5961,0.81569)(0.6,0.81569)(0.6039,0.81569)(0.6078,0.81176)(0.6118,0.81176)(0.6157,0.81176)(0.6196,0.80784)(0.6235,0.80784)(0.6275,0.80392)(0.6314,0.80392)(0.6353,0.8)(0.6392,0.79608)(0.6431,0.79608)(0.6471,0.79216)(0.651,0.78824)(0.6549,0.78431)(0.6588,0.78039)(0.6627,0.77647)(0.6667,0.77255)(0.6706,0.76863)(0.6745,0.76863)(0.6784,0.76471)(0.6824,0.76078)(0.6863,0.75686)(0.6902,0.74902)(0.6941,0.7451)(0.698,0.74118)(0.702,0.73725)(0.7059,0.73725)(0.7098,0.73333)(0.7137,0.72941)(0.7176,0.72549)(0.7216,0.72157)(0.7255,0.71765)(0.7294,0.71373)(0.7333,0.7098)(0.7373,0.7098)(0.7412,0.70588)(0.7451,0.70196)(0.749,0.70196)(0.7529,0.69804)(0.7569,0.69804)(0.7608,0.69412)(0.7647,0.69412)(0.7686,0.69412)(0.7725,0.6902)(0.7765,0.6902)(0.7804,0.6902)(0.7843,0.6902)(0.7882,0.6902)(0.7922,0.6902)(0.7961,0.6902)(0.8,0.69412)(0.8039,0.69412)(0.8078,0.69412)(0.8118,0.69804)(0.8157,0.69804)(0.8196,0.70196)(0.8235,0.70588)(0.8275,0.70588)(0.8314,0.7098)(0.8353,0.71373)(0.8392,0.71765)(0.8431,0.72157)(0.8471,0.72549)(0.851,0.73333)(0.8549,0.73725)(0.8588,0.74118)(0.8627,0.74902)(0.8667,0.75294)(0.8706,0.76078)(0.8745,0.76471)(0.8784,0.77255)(0.8824,0.77647)(0.8863,0.78431)(0.8902,0.79216)(0.8941,0.8)(0.898,0.80784)(0.902,0.81176)(0.9059,0.81961)(0.9098,0.82745)(0.9137,0.83529)(0.9176,0.84314)(0.9216,0.85098)(0.9255,0.85882)(0.9294,0.86667)(0.9333,0.87451)(0.9373,0.88235)(0.9412,0.8902)(0.9451,0.89804)(0.949,0.90588)(0.9529,0.91373)(0.9569,0.92157)(0.9608,0.92941)(0.9647,0.93725)(0.9686,0.9451)(0.9725,0.95294)(0.9765,0.96078)(0.9804,0.96471)(0.9843,0.97255)(0.9882,0.98039)(0.9922,0.98431)(0.9961,0.99216)(1,1)
diff --git a/ds9/cmaps/ch20m151010.sao b/ds9/cmaps/ch20m151010.sao
new file mode 100644
index 0000000..8de5952
--- /dev/null
+++ b/ds9/cmaps/ch20m151010.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ch20m151010
+# created by cptutils 1.46
+# Wed Aug 15 23:30:53 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0039,0)(0.0078,0)(0.0118,0.0039216)(0.0157,0.0039216)(0.0196,0.0039216)(0.0235,0.0078431)(0.0275,0.011765)(0.0314,0.011765)(0.0353,0.015686)(0.0392,0.019608)(0.0431,0.023529)(0.0471,0.023529)(0.051,0.027451)(0.0549,0.031373)(0.0588,0.035294)(0.0627,0.043137)(0.0667,0.047059)(0.0706,0.05098)(0.0745,0.054902)(0.0784,0.062745)(0.0824,0.066667)(0.0863,0.07451)(0.0902,0.078431)(0.0941,0.086275)(0.098,0.094118)(0.102,0.098039)(0.1059,0.10588)(0.1098,0.11373)(0.1137,0.12157)(0.1176,0.12941)(0.1216,0.13725)(0.1255,0.1451)(0.1294,0.15294)(0.1333,0.16078)(0.1373,0.16863)(0.1412,0.17647)(0.1451,0.18824)(0.149,0.19608)(0.1529,0.20392)(0.1569,0.21176)(0.1608,0.22353)(0.1647,0.23137)(0.1686,0.23922)(0.1725,0.25098)(0.1765,0.25882)(0.1804,0.26667)(0.1843,0.27451)(0.1882,0.28627)(0.1922,0.29412)(0.1961,0.30196)(0.2,0.31373)(0.2039,0.32157)(0.2078,0.32941)(0.2118,0.33725)(0.2157,0.3451)(0.2196,0.35294)(0.2235,0.36471)(0.2275,0.37255)(0.2314,0.38039)(0.2353,0.38431)(0.2392,0.39216)(0.2431,0.4)(0.2471,0.40784)(0.251,0.41569)(0.2549,0.41961)(0.2588,0.42745)(0.2627,0.43529)(0.2667,0.43922)(0.2706,0.44706)(0.2745,0.45098)(0.2784,0.4549)(0.2824,0.45882)(0.2863,0.46275)(0.2902,0.47059)(0.2941,0.47451)(0.298,0.47451)(0.302,0.47843)(0.3059,0.48235)(0.3098,0.48627)(0.3137,0.48627)(0.3176,0.4902)(0.3216,0.4902)(0.3255,0.49412)(0.3294,0.49412)(0.3333,0.49412)(0.3373,0.49412)(0.3412,0.49412)(0.3451,0.49412)(0.349,0.49412)(0.3529,0.49412)(0.3569,0.49412)(0.3608,0.49412)(0.3647,0.4902)(0.3686,0.4902)(0.3725,0.48627)(0.3765,0.48627)(0.3804,0.48235)(0.3843,0.48235)(0.3882,0.47843)(0.3922,0.47451)(0.3961,0.47059)(0.4,0.47059)(0.4039,0.46667)(0.4078,0.46275)(0.4118,0.45882)(0.4157,0.4549)(0.4196,0.45098)(0.4235,0.44706)(0.4275,0.44314)(0.4314,0.43922)(0.4353,0.43529)(0.4392,0.43137)(0.4431,0.42745)(0.4471,0.41961)(0.451,0.41569)(0.4549,0.41176)(0.4588,0.40784)(0.4627,0.40392)(0.4667,0.4)(0.4706,0.39608)(0.4745,0.39216)(0.4784,0.38824)(0.4824,0.38431)(0.4863,0.38039)(0.4902,0.37647)(0.4941,0.37647)(0.498,0.37255)(0.502,0.36863)(0.5059,0.36471)(0.5098,0.36471)(0.5137,0.36078)(0.5176,0.36078)(0.5216,0.35686)(0.5255,0.35686)(0.5294,0.35686)(0.5333,0.35294)(0.5373,0.35294)(0.5412,0.35294)(0.5451,0.35294)(0.549,0.35294)(0.5529,0.35294)(0.5569,0.35294)(0.5608,0.35686)(0.5647,0.35686)(0.5686,0.35686)(0.5725,0.36078)(0.5765,0.36078)(0.5804,0.36471)(0.5843,0.36863)(0.5882,0.37255)(0.5922,0.37647)(0.5961,0.38039)(0.6,0.38431)(0.6039,0.38824)(0.6078,0.39216)(0.6118,0.4)(0.6157,0.40392)(0.6196,0.40784)(0.6235,0.41569)(0.6275,0.42353)(0.6314,0.42745)(0.6353,0.43529)(0.6392,0.44314)(0.6431,0.45098)(0.6471,0.45882)(0.651,0.46667)(0.6549,0.47451)(0.6588,0.48235)(0.6627,0.49412)(0.6667,0.50196)(0.6706,0.5098)(0.6745,0.52157)(0.6784,0.52941)(0.6824,0.53725)(0.6863,0.54902)(0.6902,0.56078)(0.6941,0.56863)(0.698,0.58039)(0.702,0.58824)(0.7059,0.6)(0.7098,0.61176)(0.7137,0.61961)(0.7176,0.63137)(0.7216,0.64314)(0.7255,0.65098)(0.7294,0.66275)(0.7333,0.67451)(0.7373,0.68235)(0.7412,0.69412)(0.7451,0.70588)(0.749,0.71373)(0.7529,0.72549)(0.7569,0.73725)(0.7608,0.7451)(0.7647,0.75686)(0.7686,0.76471)(0.7725,0.77647)(0.7765,0.78431)(0.7804,0.79608)(0.7843,0.80392)(0.7882,0.81176)(0.7922,0.82353)(0.7961,0.83137)(0.8,0.83922)(0.8039,0.84706)(0.8078,0.8549)(0.8118,0.86275)(0.8157,0.87059)(0.8196,0.87843)(0.8235,0.88627)(0.8275,0.89412)(0.8314,0.89804)(0.8353,0.90588)(0.8392,0.9098)(0.8431,0.91765)(0.8471,0.92157)(0.851,0.92941)(0.8549,0.93333)(0.8588,0.93725)(0.8627,0.94118)(0.8667,0.9451)(0.8706,0.95294)(0.8745,0.95294)(0.8784,0.95686)(0.8824,0.96078)(0.8863,0.96471)(0.8902,0.96863)(0.8941,0.96863)(0.898,0.97255)(0.902,0.97647)(0.9059,0.97647)(0.9098,0.98039)(0.9137,0.98039)(0.9176,0.98039)(0.9216,0.98431)(0.9255,0.98431)(0.9294,0.98431)(0.9333,0.98824)(0.9373,0.98824)(0.9412,0.98824)(0.9451,0.98824)(0.949,0.98824)(0.9529,0.99216)(0.9569,0.99216)(0.9608,0.99216)(0.9647,0.99216)(0.9686,0.99216)(0.9725,0.99216)(0.9765,0.99216)(0.9804,0.99608)(0.9843,0.99608)(0.9882,0.99608)(0.9922,0.99608)(0.9961,0.99608)(1,1)
+GREEN:
+(0,0)(0.0039,0.0039216)(0.0078,0.0078431)(0.0118,0.015686)(0.0157,0.019608)(0.0196,0.027451)(0.0235,0.031373)(0.0275,0.035294)(0.0314,0.043137)(0.0353,0.047059)(0.0392,0.05098)(0.0431,0.058824)(0.0471,0.062745)(0.051,0.066667)(0.0549,0.070588)(0.0588,0.07451)(0.0627,0.078431)(0.0667,0.086275)(0.0706,0.090196)(0.0745,0.094118)(0.0784,0.098039)(0.0824,0.10196)(0.0863,0.10196)(0.0902,0.10588)(0.0941,0.1098)(0.098,0.11373)(0.102,0.11765)(0.1059,0.12157)(0.1098,0.12157)(0.1137,0.12549)(0.1176,0.12941)(0.1216,0.12941)(0.1255,0.13333)(0.1294,0.13333)(0.1333,0.13725)(0.1373,0.13725)(0.1412,0.14118)(0.1451,0.14118)(0.149,0.1451)(0.1529,0.1451)(0.1569,0.14902)(0.1608,0.14902)(0.1647,0.14902)(0.1686,0.15294)(0.1725,0.15294)(0.1765,0.15294)(0.1804,0.15294)(0.1843,0.15686)(0.1882,0.15686)(0.1922,0.15686)(0.1961,0.16078)(0.2,0.16078)(0.2039,0.16078)(0.2078,0.16078)(0.2118,0.16078)(0.2157,0.16471)(0.2196,0.16471)(0.2235,0.16471)(0.2275,0.16471)(0.2314,0.16863)(0.2353,0.16863)(0.2392,0.16863)(0.2431,0.17255)(0.2471,0.17255)(0.251,0.17255)(0.2549,0.17647)(0.2588,0.17647)(0.2627,0.17647)(0.2667,0.18039)(0.2706,0.18039)(0.2745,0.18431)(0.2784,0.18431)(0.2824,0.18824)(0.2863,0.18824)(0.2902,0.19216)(0.2941,0.19608)(0.298,0.19608)(0.302,0.2)(0.3059,0.20392)(0.3098,0.20784)(0.3137,0.20784)(0.3176,0.21176)(0.3216,0.21569)(0.3255,0.21961)(0.3294,0.22353)(0.3333,0.22745)(0.3373,0.23137)(0.3412,0.23529)(0.3451,0.23922)(0.349,0.24706)(0.3529,0.25098)(0.3569,0.2549)(0.3608,0.26275)(0.3647,0.26667)(0.3686,0.27059)(0.3725,0.27843)(0.3765,0.28235)(0.3804,0.2902)(0.3843,0.29412)(0.3882,0.30196)(0.3922,0.3098)(0.3961,0.31373)(0.4,0.32157)(0.4039,0.32941)(0.4078,0.33725)(0.4118,0.34118)(0.4157,0.34902)(0.4196,0.35686)(0.4235,0.36471)(0.4275,0.37255)(0.4314,0.38039)(0.4353,0.38824)(0.4392,0.39608)(0.4431,0.40392)(0.4471,0.41176)(0.451,0.41961)(0.4549,0.42745)(0.4588,0.43529)(0.4627,0.44314)(0.4667,0.45098)(0.4706,0.46275)(0.4745,0.47059)(0.4784,0.47843)(0.4824,0.48627)(0.4863,0.49412)(0.4902,0.50196)(0.4941,0.5098)(0.498,0.51765)(0.502,0.52549)(0.5059,0.53725)(0.5098,0.5451)(0.5137,0.55294)(0.5176,0.56078)(0.5216,0.56863)(0.5255,0.57647)(0.5294,0.58431)(0.5333,0.59216)(0.5373,0.6)(0.5412,0.60784)(0.5451,0.61176)(0.549,0.61961)(0.5529,0.62745)(0.5569,0.63529)(0.5608,0.64314)(0.5647,0.64706)(0.5686,0.6549)(0.5725,0.66275)(0.5765,0.66667)(0.5804,0.67451)(0.5843,0.67843)(0.5882,0.68627)(0.5922,0.6902)(0.5961,0.69804)(0.6,0.70196)(0.6039,0.70588)(0.6078,0.71373)(0.6118,0.71765)(0.6157,0.72157)(0.6196,0.72549)(0.6235,0.72941)(0.6275,0.73725)(0.6314,0.74118)(0.6353,0.7451)(0.6392,0.7451)(0.6431,0.74902)(0.6471,0.75294)(0.651,0.75686)(0.6549,0.76078)(0.6588,0.76471)(0.6627,0.76471)(0.6667,0.76863)(0.6706,0.77255)(0.6745,0.77255)(0.6784,0.77647)(0.6824,0.77647)(0.6863,0.78039)(0.6902,0.78039)(0.6941,0.78039)(0.698,0.78431)(0.702,0.78431)(0.7059,0.78824)(0.7098,0.78824)(0.7137,0.78824)(0.7176,0.78824)(0.7216,0.79216)(0.7255,0.79216)(0.7294,0.79216)(0.7333,0.79216)(0.7373,0.79608)(0.7412,0.79608)(0.7451,0.79608)(0.749,0.79608)(0.7529,0.79608)(0.7569,0.79608)(0.7608,0.8)(0.7647,0.8)(0.7686,0.8)(0.7725,0.8)(0.7765,0.8)(0.7804,0.8)(0.7843,0.80392)(0.7882,0.80392)(0.7922,0.80392)(0.7961,0.80392)(0.8,0.80392)(0.8039,0.80784)(0.8078,0.80784)(0.8118,0.80784)(0.8157,0.81176)(0.8196,0.81176)(0.8235,0.81176)(0.8275,0.81569)(0.8314,0.81569)(0.8353,0.81961)(0.8392,0.81961)(0.8431,0.82353)(0.8471,0.82353)(0.851,0.82745)(0.8549,0.82745)(0.8588,0.83137)(0.8627,0.83529)(0.8667,0.83529)(0.8706,0.83922)(0.8745,0.84314)(0.8784,0.84706)(0.8824,0.85098)(0.8863,0.8549)(0.8902,0.8549)(0.8941,0.85882)(0.898,0.86275)(0.902,0.86667)(0.9059,0.87059)(0.9098,0.87451)(0.9137,0.88235)(0.9176,0.88627)(0.9216,0.8902)(0.9255,0.89412)(0.9294,0.89804)(0.9333,0.90588)(0.9373,0.9098)(0.9412,0.91373)(0.9451,0.91765)(0.949,0.92549)(0.9529,0.92941)(0.9569,0.93725)(0.9608,0.94118)(0.9647,0.9451)(0.9686,0.95294)(0.9725,0.95686)(0.9765,0.96471)(0.9804,0.96863)(0.9843,0.97647)(0.9882,0.98039)(0.9922,0.98824)(0.9961,0.99216)(1,1)
+BLUE:
+(0,0)(0.0039,0)(0.0078,0)(0.0118,0.0039216)(0.0157,0.0039216)(0.0196,0.0039216)(0.0235,0.0078431)(0.0275,0.0078431)(0.0314,0.0078431)(0.0353,0.0078431)(0.0392,0.0078431)(0.0431,0.0078431)(0.0471,0.0078431)(0.051,0.0078431)(0.0549,0.0078431)(0.0588,0.0078431)(0.0627,0.0078431)(0.0667,0.0078431)(0.0706,0.0078431)(0.0745,0.0078431)(0.0784,0.0078431)(0.0824,0.0078431)(0.0863,0.0078431)(0.0902,0.0078431)(0.0941,0.0078431)(0.098,0.0078431)(0.102,0.011765)(0.1059,0.011765)(0.1098,0.011765)(0.1137,0.011765)(0.1176,0.011765)(0.1216,0.015686)(0.1255,0.015686)(0.1294,0.019608)(0.1333,0.019608)(0.1373,0.023529)(0.1412,0.023529)(0.1451,0.027451)(0.149,0.031373)(0.1529,0.031373)(0.1569,0.035294)(0.1608,0.039216)(0.1647,0.043137)(0.1686,0.047059)(0.1725,0.05098)(0.1765,0.058824)(0.1804,0.062745)(0.1843,0.066667)(0.1882,0.07451)(0.1922,0.078431)(0.1961,0.086275)(0.2,0.094118)(0.2039,0.098039)(0.2078,0.10588)(0.2118,0.11373)(0.2157,0.12157)(0.2196,0.12941)(0.2235,0.13725)(0.2275,0.1451)(0.2314,0.15686)(0.2353,0.16471)(0.2392,0.17255)(0.2431,0.18431)(0.2471,0.19216)(0.251,0.20392)(0.2549,0.21176)(0.2588,0.22353)(0.2627,0.23529)(0.2667,0.24314)(0.2706,0.2549)(0.2745,0.26667)(0.2784,0.27843)(0.2824,0.2902)(0.2863,0.30196)(0.2902,0.31373)(0.2941,0.32549)(0.298,0.33333)(0.302,0.3451)(0.3059,0.35686)(0.3098,0.36863)(0.3137,0.38431)(0.3176,0.39608)(0.3216,0.40784)(0.3255,0.41961)(0.3294,0.42745)(0.3333,0.43922)(0.3373,0.45098)(0.3412,0.46275)(0.3451,0.47451)(0.349,0.48627)(0.3529,0.49804)(0.3569,0.5098)(0.3608,0.51765)(0.3647,0.52941)(0.3686,0.54118)(0.3725,0.54902)(0.3765,0.56078)(0.3804,0.56863)(0.3843,0.58039)(0.3882,0.58824)(0.3922,0.59608)(0.3961,0.60784)(0.4,0.61569)(0.4039,0.62353)(0.4078,0.63137)(0.4118,0.63922)(0.4157,0.64314)(0.4196,0.65098)(0.4235,0.65882)(0.4275,0.66275)(0.4314,0.67059)(0.4353,0.67451)(0.4392,0.67843)(0.4431,0.68627)(0.4471,0.6902)(0.451,0.69412)(0.4549,0.69804)(0.4588,0.69804)(0.4627,0.70196)(0.4667,0.70588)(0.4706,0.70588)(0.4745,0.7098)(0.4784,0.7098)(0.4824,0.7098)(0.4863,0.71373)(0.4902,0.71373)(0.4941,0.71373)(0.498,0.71373)(0.502,0.7098)(0.5059,0.7098)(0.5098,0.7098)(0.5137,0.70588)(0.5176,0.70588)(0.5216,0.70196)(0.5255,0.70196)(0.5294,0.69804)(0.5333,0.69412)(0.5373,0.69412)(0.5412,0.6902)(0.5451,0.68627)(0.549,0.68235)(0.5529,0.67843)(0.5569,0.67451)(0.5608,0.67059)(0.5647,0.66667)(0.5686,0.66275)(0.5725,0.6549)(0.5765,0.65098)(0.5804,0.64706)(0.5843,0.64314)(0.5882,0.63922)(0.5922,0.63137)(0.5961,0.62745)(0.6,0.62353)(0.6039,0.61961)(0.6078,0.61176)(0.6118,0.60784)(0.6157,0.60392)(0.6196,0.6)(0.6235,0.59608)(0.6275,0.58824)(0.6314,0.58431)(0.6353,0.58039)(0.6392,0.57647)(0.6431,0.57255)(0.6471,0.56863)(0.651,0.56863)(0.6549,0.56471)(0.6588,0.56078)(0.6627,0.55686)(0.6667,0.55686)(0.6706,0.55294)(0.6745,0.54902)(0.6784,0.54902)(0.6824,0.54902)(0.6863,0.5451)(0.6902,0.5451)(0.6941,0.5451)(0.698,0.5451)(0.702,0.5451)(0.7059,0.5451)(0.7098,0.5451)(0.7137,0.5451)(0.7176,0.5451)(0.7216,0.54902)(0.7255,0.54902)(0.7294,0.55294)(0.7333,0.55686)(0.7373,0.55686)(0.7412,0.56078)(0.7451,0.56471)(0.749,0.56863)(0.7529,0.57255)(0.7569,0.57647)(0.7608,0.58039)(0.7647,0.58824)(0.7686,0.59216)(0.7725,0.59608)(0.7765,0.60392)(0.7804,0.60784)(0.7843,0.61569)(0.7882,0.62353)(0.7922,0.62745)(0.7961,0.63529)(0.8,0.64314)(0.8039,0.65098)(0.8078,0.65882)(0.8118,0.66667)(0.8157,0.67451)(0.8196,0.68235)(0.8235,0.6902)(0.8275,0.69804)(0.8314,0.7098)(0.8353,0.71765)(0.8392,0.72549)(0.8431,0.73333)(0.8471,0.7451)(0.851,0.75294)(0.8549,0.76078)(0.8588,0.76863)(0.8627,0.78039)(0.8667,0.78824)(0.8706,0.79608)(0.8745,0.80784)(0.8784,0.81569)(0.8824,0.82353)(0.8863,0.83137)(0.8902,0.83922)(0.8941,0.85098)(0.898,0.85882)(0.902,0.86667)(0.9059,0.87451)(0.9098,0.88235)(0.9137,0.8902)(0.9176,0.89804)(0.9216,0.90588)(0.9255,0.9098)(0.9294,0.91765)(0.9333,0.92549)(0.9373,0.92941)(0.9412,0.93725)(0.9451,0.9451)(0.949,0.94902)(0.9529,0.95294)(0.9569,0.96078)(0.9608,0.96471)(0.9647,0.96863)(0.9686,0.97255)(0.9725,0.97647)(0.9765,0.98039)(0.9804,0.98431)(0.9843,0.98824)(0.9882,0.99216)(0.9922,0.99216)(0.9961,0.99608)(1,1)
diff --git a/ds9/cmaps/cubehelix0.sao b/ds9/cmaps/cubehelix0.sao
new file mode 100644
index 0000000..f0e73a2
--- /dev/null
+++ b/ds9/cmaps/cubehelix0.sao
@@ -0,0 +1,319 @@
+#-----------------------------------------
+#cubehelixcolourschemeforsaoimage/DS9
+#
+#start....:0.5
+#rotations:-1.5
+#hue......:1.0
+#gamma....:1.0
+#
+#see:Green(2011),BASI,39,289.
+#-----------------------------------------
+#DaveGreen:dag@mrao.cam.ac.uk
+#-----------------------------------------
+PSEUDOCOLOR
+RED:
+(0.00,0.00)
+(0.01,0.02)
+(0.02,0.03)
+(0.03,0.05)
+(0.04,0.06)
+(0.05,0.07)
+(0.06,0.08)
+(0.07,0.09)
+(0.08,0.09)
+(0.09,0.10)
+(0.10,0.10)
+(0.11,0.10)
+(0.12,0.10)
+(0.13,0.10)
+(0.14,0.10)
+(0.15,0.10)
+(0.16,0.10)
+(0.17,0.09)
+(0.18,0.09)
+(0.19,0.09)
+(0.20,0.09)
+(0.21,0.08)
+(0.22,0.08)
+(0.23,0.08)
+(0.24,0.08)
+(0.25,0.08)
+(0.26,0.09)
+(0.27,0.09)
+(0.28,0.10)
+(0.29,0.11)
+(0.30,0.12)
+(0.31,0.13)
+(0.32,0.15)
+(0.33,0.16)
+(0.34,0.18)
+(0.35,0.20)
+(0.36,0.23)
+(0.37,0.25)
+(0.38,0.27)
+(0.39,0.30)
+(0.40,0.33)
+(0.41,0.36)
+(0.42,0.39)
+(0.43,0.42)
+(0.44,0.45)
+(0.45,0.48)
+(0.46,0.51)
+(0.47,0.54)
+(0.48,0.57)
+(0.49,0.60)
+(0.50,0.63)
+(0.51,0.65)
+(0.52,0.68)
+(0.53,0.70)
+(0.54,0.72)
+(0.55,0.75)
+(0.56,0.76)
+(0.57,0.78)
+(0.58,0.79)
+(0.59,0.80)
+(0.60,0.81)
+(0.61,0.82)
+(0.62,0.83)
+(0.63,0.83)
+(0.64,0.83)
+(0.65,0.83)
+(0.66,0.83)
+(0.67,0.83)
+(0.68,0.82)
+(0.69,0.82)
+(0.70,0.81)
+(0.71,0.81)
+(0.72,0.80)
+(0.73,0.79)
+(0.74,0.79)
+(0.75,0.78)
+(0.76,0.77)
+(0.77,0.77)
+(0.78,0.76)
+(0.79,0.76)
+(0.80,0.76)
+(0.81,0.76)
+(0.82,0.76)
+(0.83,0.76)
+(0.84,0.77)
+(0.85,0.77)
+(0.86,0.78)
+(0.87,0.79)
+(0.88,0.80)
+(0.89,0.81)
+(0.90,0.82)
+(0.91,0.84)
+(0.92,0.85)
+(0.93,0.87)
+(0.94,0.89)
+(0.95,0.91)
+(0.96,0.93)
+(0.97,0.95)
+(0.98,0.96)
+(0.99,0.98)
+(1.00,1.00)
+GREEN:
+(0.00,0.00)
+(0.01,0.01)
+(0.02,0.01)
+(0.03,0.02)
+(0.04,0.02)
+(0.05,0.03)
+(0.06,0.04)
+(0.07,0.05)
+(0.08,0.06)
+(0.09,0.07)
+(0.10,0.08)
+(0.11,0.10)
+(0.12,0.11)
+(0.13,0.12)
+(0.14,0.14)
+(0.15,0.15)
+(0.16,0.17)
+(0.17,0.19)
+(0.18,0.20)
+(0.19,0.22)
+(0.20,0.24)
+(0.21,0.26)
+(0.22,0.27)
+(0.23,0.29)
+(0.24,0.31)
+(0.25,0.32)
+(0.26,0.34)
+(0.27,0.36)
+(0.28,0.37)
+(0.29,0.39)
+(0.30,0.40)
+(0.31,0.41)
+(0.32,0.42)
+(0.33,0.43)
+(0.34,0.44)
+(0.35,0.45)
+(0.36,0.46)
+(0.37,0.46)
+(0.38,0.47)
+(0.39,0.47)
+(0.40,0.48)
+(0.41,0.48)
+(0.42,0.48)
+(0.43,0.48)
+(0.44,0.48)
+(0.45,0.48)
+(0.46,0.48)
+(0.47,0.48)
+(0.48,0.48)
+(0.49,0.48)
+(0.50,0.47)
+(0.51,0.47)
+(0.52,0.47)
+(0.53,0.47)
+(0.54,0.47)
+(0.55,0.48)
+(0.56,0.48)
+(0.57,0.48)
+(0.58,0.48)
+(0.59,0.49)
+(0.60,0.50)
+(0.61,0.50)
+(0.62,0.51)
+(0.63,0.52)
+(0.64,0.53)
+(0.65,0.54)
+(0.66,0.55)
+(0.67,0.57)
+(0.68,0.58)
+(0.69,0.60)
+(0.70,0.61)
+(0.71,0.63)
+(0.72,0.65)
+(0.73,0.67)
+(0.74,0.68)
+(0.75,0.70)
+(0.76,0.72)
+(0.77,0.74)
+(0.78,0.76)
+(0.79,0.77)
+(0.80,0.79)
+(0.81,0.81)
+(0.82,0.83)
+(0.83,0.84)
+(0.84,0.86)
+(0.85,0.87)
+(0.86,0.89)
+(0.87,0.90)
+(0.88,0.91)
+(0.89,0.92)
+(0.90,0.93)
+(0.91,0.94)
+(0.92,0.95)
+(0.93,0.96)
+(0.94,0.97)
+(0.95,0.97)
+(0.96,0.98)
+(0.97,0.98)
+(0.98,0.99)
+(0.99,0.99)
+(1.00,1.00)
+BLUE:
+(0.00,0.00)
+(0.01,0.02)
+(0.02,0.03)
+(0.03,0.05)
+(0.04,0.07)
+(0.05,0.09)
+(0.06,0.11)
+(0.07,0.13)
+(0.08,0.15)
+(0.09,0.17)
+(0.10,0.19)
+(0.11,0.21)
+(0.12,0.22)
+(0.13,0.24)
+(0.14,0.25)
+(0.15,0.27)
+(0.16,0.28)
+(0.17,0.29)
+(0.18,0.30)
+(0.19,0.30)
+(0.20,0.31)
+(0.21,0.31)
+(0.22,0.31)
+(0.23,0.31)
+(0.24,0.30)
+(0.25,0.30)
+(0.26,0.29)
+(0.27,0.28)
+(0.28,0.28)
+(0.29,0.27)
+(0.30,0.26)
+(0.31,0.25)
+(0.32,0.24)
+(0.33,0.23)
+(0.34,0.22)
+(0.35,0.21)
+(0.36,0.20)
+(0.37,0.19)
+(0.38,0.19)
+(0.39,0.19)
+(0.40,0.18)
+(0.41,0.18)
+(0.42,0.19)
+(0.43,0.19)
+(0.44,0.20)
+(0.45,0.21)
+(0.46,0.22)
+(0.47,0.23)
+(0.48,0.25)
+(0.49,0.27)
+(0.50,0.29)
+(0.51,0.31)
+(0.52,0.33)
+(0.53,0.36)
+(0.54,0.39)
+(0.55,0.42)
+(0.56,0.45)
+(0.57,0.48)
+(0.58,0.51)
+(0.59,0.54)
+(0.60,0.58)
+(0.61,0.61)
+(0.62,0.64)
+(0.63,0.67)
+(0.64,0.70)
+(0.65,0.73)
+(0.66,0.76)
+(0.67,0.78)
+(0.68,0.81)
+(0.69,0.83)
+(0.70,0.85)
+(0.71,0.87)
+(0.72,0.89)
+(0.73,0.91)
+(0.74,0.92)
+(0.75,0.93)
+(0.76,0.94)
+(0.77,0.94)
+(0.78,0.95)
+(0.79,0.95)
+(0.80,0.95)
+(0.81,0.95)
+(0.82,0.95)
+(0.83,0.95)
+(0.84,0.95)
+(0.85,0.95)
+(0.86,0.94)
+(0.87,0.94)
+(0.88,0.94)
+(0.89,0.94)
+(0.90,0.94)
+(0.91,0.94)
+(0.92,0.94)
+(0.93,0.94)
+(0.94,0.94)
+(0.95,0.95)
+(0.96,0.95)
+(0.97,0.96)
+(0.98,0.97)
+(0.99,0.99)
+(1.00,1.00)
diff --git a/ds9/cmaps/cubehelix1.sao b/ds9/cmaps/cubehelix1.sao
new file mode 100644
index 0000000..3494f37
--- /dev/null
+++ b/ds9/cmaps/cubehelix1.sao
@@ -0,0 +1,319 @@
+#-----------------------------------------
+# cubehelix colour scheme for saoimage/DS9
+#
+# start....: 0.5
+# rotations: -1.5
+# hue......: 2.0
+# gamma....: 1.0
+#
+# see: Green (2011), BASI, 39, 289.
+#-----------------------------------------
+# Dave Green: dag@mrao.cam.ac.uk
+#-----------------------------------------
+PSEUDOCOLOR
+RED:
+(0.00,0.00)
+(0.01,0.02)
+(0.02,0.04)
+(0.03,0.06)
+(0.04,0.08)
+(0.05,0.09)
+(0.06,0.10)
+(0.07,0.10)
+(0.08,0.11)
+(0.09,0.11)
+(0.10,0.10)
+(0.11,0.10)
+(0.12,0.09)
+(0.13,0.08)
+(0.14,0.07)
+(0.15,0.05)
+(0.16,0.04)
+(0.17,0.02)
+(0.18,0.00)
+(0.19,0.00)
+(0.20,0.00)
+(0.21,0.00)
+(0.22,0.00)
+(0.23,0.00)
+(0.24,0.00)
+(0.25,0.00)
+(0.26,0.00)
+(0.27,0.00)
+(0.28,0.00)
+(0.29,0.00)
+(0.30,0.00)
+(0.31,0.00)
+(0.32,0.00)
+(0.33,0.00)
+(0.34,0.03)
+(0.35,0.06)
+(0.36,0.09)
+(0.37,0.13)
+(0.38,0.17)
+(0.39,0.21)
+(0.40,0.26)
+(0.41,0.31)
+(0.42,0.36)
+(0.43,0.41)
+(0.44,0.46)
+(0.45,0.51)
+(0.46,0.56)
+(0.47,0.61)
+(0.48,0.66)
+(0.49,0.71)
+(0.50,0.76)
+(0.51,0.80)
+(0.52,0.84)
+(0.53,0.88)
+(0.54,0.91)
+(0.55,0.94)
+(0.56,0.97)
+(0.57,0.99)
+(0.58,1.00)
+(0.59,1.00)
+(0.60,1.00)
+(0.61,1.00)
+(0.62,1.00)
+(0.63,1.00)
+(0.64,1.00)
+(0.65,1.00)
+(0.66,1.00)
+(0.67,0.99)
+(0.68,0.97)
+(0.69,0.95)
+(0.70,0.93)
+(0.71,0.90)
+(0.72,0.88)
+(0.73,0.86)
+(0.74,0.83)
+(0.75,0.81)
+(0.76,0.79)
+(0.77,0.77)
+(0.78,0.75)
+(0.79,0.73)
+(0.80,0.72)
+(0.81,0.71)
+(0.82,0.70)
+(0.83,0.69)
+(0.84,0.69)
+(0.85,0.69)
+(0.86,0.70)
+(0.87,0.71)
+(0.88,0.72)
+(0.89,0.73)
+(0.90,0.75)
+(0.91,0.77)
+(0.92,0.79)
+(0.93,0.81)
+(0.94,0.84)
+(0.95,0.87)
+(0.96,0.89)
+(0.97,0.92)
+(0.98,0.95)
+(0.99,0.97)
+(1.00,1.00)
+GREEN:
+(0.00,0.00)
+(0.01,0.00)
+(0.02,0.00)
+(0.03,0.01)
+(0.04,0.01)
+(0.05,0.01)
+(0.06,0.02)
+(0.07,0.03)
+(0.08,0.04)
+(0.09,0.05)
+(0.10,0.07)
+(0.11,0.08)
+(0.12,0.10)
+(0.13,0.12)
+(0.14,0.14)
+(0.15,0.16)
+(0.16,0.18)
+(0.17,0.20)
+(0.18,0.23)
+(0.19,0.25)
+(0.20,0.28)
+(0.21,0.30)
+(0.22,0.33)
+(0.23,0.35)
+(0.24,0.38)
+(0.25,0.40)
+(0.26,0.42)
+(0.27,0.44)
+(0.28,0.46)
+(0.29,0.48)
+(0.30,0.50)
+(0.31,0.51)
+(0.32,0.53)
+(0.33,0.54)
+(0.34,0.55)
+(0.35,0.55)
+(0.36,0.56)
+(0.37,0.56)
+(0.38,0.56)
+(0.39,0.56)
+(0.40,0.55)
+(0.41,0.55)
+(0.42,0.54)
+(0.43,0.53)
+(0.44,0.52)
+(0.45,0.51)
+(0.46,0.50)
+(0.47,0.49)
+(0.48,0.47)
+(0.49,0.46)
+(0.50,0.45)
+(0.51,0.44)
+(0.52,0.43)
+(0.53,0.42)
+(0.54,0.41)
+(0.55,0.40)
+(0.56,0.40)
+(0.57,0.39)
+(0.58,0.39)
+(0.59,0.39)
+(0.60,0.39)
+(0.61,0.40)
+(0.62,0.40)
+(0.63,0.41)
+(0.64,0.42)
+(0.65,0.43)
+(0.66,0.45)
+(0.67,0.47)
+(0.68,0.48)
+(0.69,0.50)
+(0.70,0.53)
+(0.71,0.55)
+(0.72,0.57)
+(0.73,0.60)
+(0.74,0.63)
+(0.75,0.65)
+(0.76,0.68)
+(0.77,0.71)
+(0.78,0.73)
+(0.79,0.76)
+(0.80,0.78)
+(0.81,0.81)
+(0.82,0.83)
+(0.83,0.85)
+(0.84,0.87)
+(0.85,0.89)
+(0.86,0.91)
+(0.87,0.93)
+(0.88,0.94)
+(0.89,0.95)
+(0.90,0.96)
+(0.91,0.97)
+(0.92,0.98)
+(0.93,0.99)
+(0.94,0.99)
+(0.95,0.99)
+(0.96,1.00)
+(0.97,1.00)
+(0.98,1.00)
+(0.99,1.00)
+(1.00,1.00)
+BLUE:
+(0.00,0.00)
+(0.01,0.02)
+(0.02,0.05)
+(0.03,0.07)
+(0.04,0.10)
+(0.05,0.13)
+(0.06,0.16)
+(0.07,0.19)
+(0.08,0.22)
+(0.09,0.25)
+(0.10,0.28)
+(0.11,0.30)
+(0.12,0.33)
+(0.13,0.35)
+(0.14,0.37)
+(0.15,0.38)
+(0.16,0.40)
+(0.17,0.41)
+(0.18,0.41)
+(0.19,0.41)
+(0.20,0.41)
+(0.21,0.41)
+(0.22,0.40)
+(0.23,0.38)
+(0.24,0.37)
+(0.25,0.35)
+(0.26,0.32)
+(0.27,0.30)
+(0.28,0.27)
+(0.29,0.24)
+(0.30,0.21)
+(0.31,0.18)
+(0.32,0.15)
+(0.33,0.12)
+(0.34,0.09)
+(0.35,0.07)
+(0.36,0.04)
+(0.37,0.02)
+(0.38,0.00)
+(0.39,0.00)
+(0.40,0.00)
+(0.41,0.00)
+(0.42,0.00)
+(0.43,0.00)
+(0.44,0.00)
+(0.45,0.00)
+(0.46,0.00)
+(0.47,0.00)
+(0.48,0.01)
+(0.49,0.04)
+(0.50,0.07)
+(0.51,0.11)
+(0.52,0.15)
+(0.53,0.19)
+(0.54,0.24)
+(0.55,0.28)
+(0.56,0.33)
+(0.57,0.39)
+(0.58,0.44)
+(0.59,0.50)
+(0.60,0.55)
+(0.61,0.61)
+(0.62,0.66)
+(0.63,0.71)
+(0.64,0.76)
+(0.65,0.81)
+(0.66,0.86)
+(0.67,0.90)
+(0.68,0.94)
+(0.69,0.98)
+(0.70,1.00)
+(0.71,1.00)
+(0.72,1.00)
+(0.73,1.00)
+(0.74,1.00)
+(0.75,1.00)
+(0.76,1.00)
+(0.77,1.00)
+(0.78,1.00)
+(0.79,1.00)
+(0.80,1.00)
+(0.81,1.00)
+(0.82,1.00)
+(0.83,1.00)
+(0.84,1.00)
+(0.85,1.00)
+(0.86,1.00)
+(0.87,1.00)
+(0.88,1.00)
+(0.89,0.98)
+(0.90,0.97)
+(0.91,0.96)
+(0.92,0.95)
+(0.93,0.95)
+(0.94,0.94)
+(0.95,0.95)
+(0.96,0.95)
+(0.97,0.96)
+(0.98,0.97)
+(0.99,0.98)
+(1.00,1.00)
diff --git a/ds9/cmaps/gist_earth.sao b/ds9/cmaps/gist_earth.sao
new file mode 100644
index 0000000..aaf78b9
--- /dev/null
+++ b/ds9/cmaps/gist_earth.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# earth
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0042,0)(0.0084,0)(0.0126,0)(0.0167,0)(0.0209,0)(0.0251,0)(0.0293,0)(0.0335,0)(0.0377,0.0039216)(0.0418,0.0078431)(0.046,0.0078431)(0.0502,0.011765)(0.0544,0.015686)(0.0586,0.019608)(0.0628,0.019608)(0.0669,0.023529)(0.0711,0.027451)(0.0753,0.031373)(0.0795,0.031373)(0.0837,0.035294)(0.0879,0.039216)(0.0921,0.043137)(0.0962,0.043137)(0.1004,0.047059)(0.1046,0.05098)(0.1088,0.054902)(0.113,0.058824)(0.1172,0.058824)(0.1213,0.062745)(0.1255,0.066667)(0.1297,0.070588)(0.1339,0.070588)(0.1381,0.07451)(0.1423,0.078431)(0.1464,0.082353)(0.1506,0.086275)(0.1548,0.086275)(0.159,0.090196)(0.1632,0.094118)(0.1674,0.098039)(0.1715,0.10196)(0.1757,0.10196)(0.1799,0.10588)(0.1841,0.1098)(0.1883,0.11373)(0.1925,0.11765)(0.1967,0.12157)(0.2008,0.12157)(0.205,0.12549)(0.2092,0.12941)(0.2134,0.13333)(0.2176,0.13725)(0.2218,0.14118)(0.2259,0.14118)(0.2301,0.1451)(0.2343,0.14902)(0.2385,0.15294)(0.2427,0.15686)(0.2469,0.16078)(0.251,0.16078)(0.2552,0.16471)(0.2594,0.16863)(0.2636,0.17255)(0.2678,0.17647)(0.272,0.18039)(0.2762,0.18431)(0.2803,0.18824)(0.2845,0.18824)(0.2887,0.18824)(0.2929,0.19216)(0.2971,0.19216)(0.3013,0.19608)(0.3054,0.19608)(0.3096,0.2)(0.3138,0.2)(0.318,0.20392)(0.3222,0.20392)(0.3264,0.20784)(0.3305,0.20784)(0.3347,0.21176)(0.3389,0.21176)(0.3431,0.21569)(0.3473,0.21569)(0.3515,0.21961)(0.3556,0.21961)(0.3598,0.22353)(0.364,0.22353)(0.3682,0.22745)(0.3724,0.22745)(0.3766,0.23137)(0.3808,0.23137)(0.3849,0.23529)(0.3891,0.23922)(0.3933,0.23922)(0.3975,0.24314)(0.4017,0.24314)(0.4059,0.24706)(0.41,0.24706)(0.4142,0.25098)(0.4184,0.25098)(0.4226,0.2549)(0.4268,0.2549)(0.431,0.25882)(0.4351,0.26275)(0.4393,0.26275)(0.4435,0.26667)(0.4477,0.26667)(0.4519,0.27059)(0.4561,0.27059)(0.4603,0.27451)(0.4644,0.27843)(0.4686,0.28627)(0.4728,0.29804)(0.477,0.30588)(0.4812,0.31765)(0.4854,0.32549)(0.4895,0.33725)(0.4937,0.3451)(0.4979,0.35686)(0.5021,0.36863)(0.5063,0.37647)(0.5105,0.38824)(0.5146,0.39608)(0.5188,0.40784)(0.523,0.41569)(0.5272,0.42745)(0.5314,0.43529)(0.5356,0.44706)(0.5397,0.45882)(0.5439,0.46667)(0.5481,0.47451)(0.5523,0.47843)(0.5565,0.48627)(0.5607,0.49412)(0.5649,0.50196)(0.569,0.50588)(0.5732,0.51373)(0.5774,0.52157)(0.5816,0.52941)(0.5858,0.53333)(0.59,0.54118)(0.5941,0.54902)(0.5983,0.55294)(0.6025,0.56078)(0.6067,0.56863)(0.6109,0.57647)(0.6151,0.58431)(0.6192,0.58824)(0.6234,0.59608)(0.6276,0.60392)(0.6318,0.61176)(0.636,0.61569)(0.6402,0.62353)(0.6444,0.63137)(0.6485,0.63922)(0.6527,0.64706)(0.6569,0.65098)(0.6611,0.65882)(0.6653,0.66667)(0.6695,0.67451)(0.6736,0.68235)(0.6778,0.68627)(0.682,0.69412)(0.6862,0.70196)(0.6904,0.7098)(0.6946,0.71765)(0.6987,0.71765)(0.7029,0.72157)(0.7071,0.72157)(0.7113,0.72549)(0.7155,0.72549)(0.7197,0.72941)(0.7238,0.72941)(0.728,0.73333)(0.7322,0.73333)(0.7364,0.73333)(0.7406,0.73725)(0.7448,0.73725)(0.749,0.74118)(0.7531,0.74118)(0.7573,0.7451)(0.7615,0.7451)(0.7657,0.7451)(0.7699,0.74902)(0.7741,0.74902)(0.7782,0.75294)(0.7824,0.75294)(0.7866,0.75686)(0.7908,0.76471)(0.795,0.76863)(0.7992,0.77255)(0.8033,0.77647)(0.8075,0.78039)(0.8117,0.78824)(0.8159,0.79216)(0.8201,0.79608)(0.8243,0.8)(0.8285,0.80392)(0.8326,0.81176)(0.8368,0.81569)(0.841,0.81961)(0.8452,0.82353)(0.8494,0.82745)(0.8536,0.83529)(0.8577,0.83922)(0.8619,0.84314)(0.8661,0.84706)(0.8703,0.85098)(0.8745,0.85882)(0.8787,0.86275)(0.8828,0.86667)(0.887,0.87059)(0.8912,0.87451)(0.8954,0.88235)(0.8996,0.88627)(0.9038,0.8902)(0.9079,0.89412)(0.9121,0.89804)(0.9163,0.90588)(0.9205,0.9098)(0.9247,0.91373)(0.9289,0.91765)(0.9331,0.92157)(0.9372,0.92941)(0.9414,0.93333)(0.9456,0.93725)(0.9498,0.94118)(0.954,0.9451)(0.9582,0.95294)(0.9623,0.95686)(0.9665,0.96078)(0.9707,0.96471)(0.9749,0.96863)(0.9791,0.97647)(0.9833,0.98039)(0.9874,0.98431)(0.9916,0.98824)(0.9958,0.99216)(1,1)
+GREEN:
+(0,0)(0.0042,0)(0.0084,0)(0.0126,0)(0.0167,0)(0.0209,0)(0.0251,0)(0.0293,0)(0.0335,0.011765)(0.0377,0.023529)(0.0418,0.031373)(0.046,0.043137)(0.0502,0.05098)(0.0544,0.062745)(0.0586,0.070588)(0.0628,0.082353)(0.0669,0.090196)(0.0711,0.10196)(0.0753,0.1098)(0.0795,0.12157)(0.0837,0.12941)(0.0879,0.14118)(0.0921,0.14902)(0.0962,0.16078)(0.1004,0.16863)(0.1046,0.17647)(0.1088,0.18824)(0.113,0.19608)(0.1172,0.20392)(0.1213,0.21569)(0.1255,0.22353)(0.1297,0.23137)(0.1339,0.23922)(0.1381,0.25098)(0.1423,0.25882)(0.1464,0.26667)(0.1506,0.27451)(0.1548,0.28235)(0.159,0.2902)(0.1632,0.30196)(0.1674,0.3098)(0.1715,0.31765)(0.1757,0.32549)(0.1799,0.33333)(0.1841,0.34118)(0.1883,0.34902)(0.1925,0.35686)(0.1967,0.36471)(0.2008,0.37255)(0.205,0.38039)(0.2092,0.38824)(0.2134,0.39216)(0.2176,0.4)(0.2218,0.40784)(0.2259,0.41569)(0.2301,0.42353)(0.2343,0.42745)(0.2385,0.43529)(0.2427,0.44314)(0.2469,0.45098)(0.251,0.4549)(0.2552,0.46275)(0.2594,0.47059)(0.2636,0.47451)(0.2678,0.48235)(0.272,0.4902)(0.2762,0.49412)(0.2803,0.50196)(0.2845,0.50196)(0.2887,0.50588)(0.2929,0.50588)(0.2971,0.5098)(0.3013,0.51373)(0.3054,0.51373)(0.3096,0.51765)(0.3138,0.52157)(0.318,0.52157)(0.3222,0.52549)(0.3264,0.52549)(0.3305,0.52941)(0.3347,0.53333)(0.3389,0.53333)(0.3431,0.53725)(0.3473,0.54118)(0.3515,0.54118)(0.3556,0.5451)(0.3598,0.54902)(0.364,0.54902)(0.3682,0.55294)(0.3724,0.55294)(0.3766,0.55686)(0.3808,0.56078)(0.3849,0.56078)(0.3891,0.56471)(0.3933,0.56863)(0.3975,0.56863)(0.4017,0.57255)(0.4059,0.57255)(0.41,0.57647)(0.4142,0.58039)(0.4184,0.58039)(0.4226,0.58431)(0.4268,0.58824)(0.431,0.58824)(0.4351,0.59216)(0.4393,0.59216)(0.4435,0.59608)(0.4477,0.6)(0.4519,0.6)(0.4561,0.60392)(0.4603,0.60784)(0.4644,0.60784)(0.4686,0.61176)(0.4728,0.61176)(0.477,0.61569)(0.4812,0.61961)(0.4854,0.61961)(0.4895,0.62353)(0.4937,0.62745)(0.4979,0.62745)(0.5021,0.63137)(0.5063,0.63137)(0.5105,0.63529)(0.5146,0.63922)(0.5188,0.63922)(0.523,0.64314)(0.5272,0.64706)(0.5314,0.64706)(0.5356,0.65098)(0.5397,0.65098)(0.5439,0.6549)(0.5481,0.65882)(0.5523,0.65882)(0.5565,0.65882)(0.5607,0.66275)(0.5649,0.66275)(0.569,0.66667)(0.5732,0.66667)(0.5774,0.67059)(0.5816,0.67059)(0.5858,0.67451)(0.59,0.67451)(0.5941,0.67451)(0.5983,0.67843)(0.6025,0.67843)(0.6067,0.68235)(0.6109,0.68235)(0.6151,0.68627)(0.6192,0.68627)(0.6234,0.68627)(0.6276,0.6902)(0.6318,0.6902)(0.636,0.69412)(0.6402,0.69412)(0.6444,0.69804)(0.6485,0.69804)(0.6527,0.70196)(0.6569,0.70196)(0.6611,0.70196)(0.6653,0.70588)(0.6695,0.70588)(0.6736,0.7098)(0.6778,0.7098)(0.682,0.71373)(0.6862,0.71373)(0.6904,0.71765)(0.6946,0.71765)(0.6987,0.71373)(0.7029,0.7098)(0.7071,0.7098)(0.7113,0.70588)(0.7155,0.70196)(0.7197,0.69804)(0.7238,0.69412)(0.728,0.6902)(0.7322,0.68627)(0.7364,0.68235)(0.7406,0.67843)(0.7448,0.67451)(0.749,0.67059)(0.7531,0.66667)(0.7573,0.66275)(0.7615,0.65882)(0.7657,0.6549)(0.7699,0.65098)(0.7741,0.64706)(0.7782,0.64314)(0.7824,0.63922)(0.7866,0.63922)(0.7908,0.64314)(0.795,0.64314)(0.7992,0.64706)(0.8033,0.64706)(0.8075,0.65098)(0.8117,0.6549)(0.8159,0.6549)(0.8201,0.65882)(0.8243,0.66275)(0.8285,0.66667)(0.8326,0.67059)(0.8368,0.67451)(0.841,0.67843)(0.8452,0.68235)(0.8494,0.68627)(0.8536,0.6902)(0.8577,0.69412)(0.8619,0.69804)(0.8661,0.70196)(0.8703,0.7098)(0.8745,0.71373)(0.8787,0.72157)(0.8828,0.72549)(0.887,0.73333)(0.8912,0.73725)(0.8954,0.7451)(0.8996,0.75294)(0.9038,0.76078)(0.9079,0.76863)(0.9121,0.77647)(0.9163,0.78431)(0.9205,0.79216)(0.9247,0.8)(0.9289,0.80784)(0.9331,0.81569)(0.9372,0.82745)(0.9414,0.83529)(0.9456,0.84314)(0.9498,0.8549)(0.954,0.86667)(0.9582,0.87451)(0.9623,0.88627)(0.9665,0.89804)(0.9707,0.9098)(0.9749,0.92157)(0.9791,0.93333)(0.9833,0.9451)(0.9874,0.95686)(0.9916,0.97255)(0.9958,0.98431)(1,1)
+BLUE:
+(0,0)(0.0042,0.18039)(0.0084,0.22745)(0.0126,0.27059)(0.0167,0.31765)(0.0209,0.36078)(0.0251,0.40784)(0.0293,0.4549)(0.0335,0.4549)(0.0377,0.4549)(0.0418,0.4549)(0.046,0.4549)(0.0502,0.45882)(0.0544,0.45882)(0.0586,0.45882)(0.0628,0.45882)(0.0669,0.45882)(0.0711,0.46275)(0.0753,0.46275)(0.0795,0.46275)(0.0837,0.46275)(0.0879,0.46275)(0.0921,0.46667)(0.0962,0.46667)(0.1004,0.46667)(0.1046,0.46667)(0.1088,0.46667)(0.113,0.47059)(0.1172,0.47059)(0.1213,0.47059)(0.1255,0.47059)(0.1297,0.47059)(0.1339,0.47451)(0.1381,0.47451)(0.1423,0.47451)(0.1464,0.47451)(0.1506,0.47451)(0.1548,0.47843)(0.159,0.47843)(0.1632,0.47843)(0.1674,0.47843)(0.1715,0.47843)(0.1757,0.48235)(0.1799,0.48235)(0.1841,0.48235)(0.1883,0.48235)(0.1925,0.48235)(0.1967,0.48627)(0.2008,0.48627)(0.205,0.48627)(0.2092,0.48627)(0.2134,0.48627)(0.2176,0.4902)(0.2218,0.4902)(0.2259,0.4902)(0.2301,0.4902)(0.2343,0.4902)(0.2385,0.49412)(0.2427,0.49412)(0.2469,0.49412)(0.251,0.49412)(0.2552,0.49412)(0.2594,0.49804)(0.2636,0.49804)(0.2678,0.49804)(0.272,0.49804)(0.2762,0.49804)(0.2803,0.50196)(0.2845,0.49412)(0.2887,0.4902)(0.2929,0.48627)(0.2971,0.48235)(0.3013,0.47843)(0.3054,0.47059)(0.3096,0.46667)(0.3138,0.46275)(0.318,0.45882)(0.3222,0.45098)(0.3264,0.44706)(0.3305,0.44314)(0.3347,0.43529)(0.3389,0.43137)(0.3431,0.42745)(0.3473,0.42353)(0.3515,0.41569)(0.3556,0.41176)(0.3598,0.40784)(0.364,0.4)(0.3682,0.39608)(0.3724,0.39216)(0.3766,0.38431)(0.3808,0.38039)(0.3849,0.37647)(0.3891,0.36863)(0.3933,0.36471)(0.3975,0.36078)(0.4017,0.35294)(0.4059,0.34902)(0.41,0.3451)(0.4142,0.33725)(0.4184,0.33333)(0.4226,0.32941)(0.4268,0.32157)(0.431,0.31765)(0.4351,0.31373)(0.4393,0.30588)(0.4435,0.30196)(0.4477,0.29804)(0.4519,0.2902)(0.4561,0.28627)(0.4603,0.27843)(0.4644,0.27451)(0.4686,0.27843)(0.4728,0.28235)(0.477,0.28235)(0.4812,0.28627)(0.4854,0.28627)(0.4895,0.2902)(0.4937,0.29412)(0.4979,0.29412)(0.5021,0.29804)(0.5063,0.29804)(0.5105,0.30196)(0.5146,0.30196)(0.5188,0.30588)(0.523,0.3098)(0.5272,0.3098)(0.5314,0.31373)(0.5356,0.31373)(0.5397,0.31765)(0.5439,0.32157)(0.5481,0.32157)(0.5523,0.32157)(0.5565,0.32549)(0.5607,0.32549)(0.5649,0.32549)(0.569,0.32941)(0.5732,0.32941)(0.5774,0.32941)(0.5816,0.33333)(0.5858,0.33333)(0.59,0.33333)(0.5941,0.33725)(0.5983,0.33725)(0.6025,0.33725)(0.6067,0.34118)(0.6109,0.34118)(0.6151,0.34118)(0.6192,0.3451)(0.6234,0.3451)(0.6276,0.3451)(0.6318,0.34902)(0.636,0.34902)(0.6402,0.34902)(0.6444,0.35294)(0.6485,0.35294)(0.6527,0.35294)(0.6569,0.35686)(0.6611,0.35686)(0.6653,0.35686)(0.6695,0.36078)(0.6736,0.36078)(0.6778,0.36078)(0.682,0.36471)(0.6862,0.36471)(0.6904,0.36471)(0.6946,0.36863)(0.6987,0.36863)(0.7029,0.36863)(0.7071,0.37255)(0.7113,0.37255)(0.7155,0.37255)(0.7197,0.37647)(0.7238,0.37647)(0.728,0.38039)(0.7322,0.38039)(0.7364,0.38039)(0.7406,0.38431)(0.7448,0.38431)(0.749,0.38431)(0.7531,0.38824)(0.7573,0.38824)(0.7615,0.38824)(0.7657,0.39216)(0.7699,0.39216)(0.7741,0.39216)(0.7782,0.39608)(0.7824,0.39608)(0.7866,0.40784)(0.7908,0.41569)(0.795,0.42353)(0.7992,0.43529)(0.8033,0.44314)(0.8075,0.4549)(0.8117,0.46275)(0.8159,0.47451)(0.8201,0.48235)(0.8243,0.49412)(0.8285,0.50588)(0.8326,0.51373)(0.8368,0.52549)(0.841,0.53725)(0.8452,0.5451)(0.8494,0.55686)(0.8536,0.56863)(0.8577,0.58039)(0.8619,0.58824)(0.8661,0.6)(0.8703,0.61176)(0.8745,0.62353)(0.8787,0.63529)(0.8828,0.64706)(0.887,0.65882)(0.8912,0.66667)(0.8954,0.67843)(0.8996,0.6902)(0.9038,0.70196)(0.9079,0.71373)(0.9121,0.72549)(0.9163,0.74118)(0.9205,0.75294)(0.9247,0.76471)(0.9289,0.77647)(0.9331,0.78824)(0.9372,0.8)(0.9414,0.81176)(0.9456,0.82745)(0.9498,0.83922)(0.954,0.85098)(0.9582,0.86275)(0.9623,0.87843)(0.9665,0.8902)(0.9707,0.90196)(0.9749,0.91765)(0.9791,0.92941)(0.9833,0.9451)(0.9874,0.95686)(0.9916,0.97255)(0.9958,0.98431)(1,1)
diff --git a/ds9/cmaps/gist_gray.sao b/ds9/cmaps/gist_gray.sao
new file mode 100644
index 0000000..4dc2f50
--- /dev/null
+++ b/ds9/cmaps/gist_gray.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# gray
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0042,0.0039216)(0.0084,0.0078431)(0.0126,0.011765)(0.0167,0.015686)(0.0209,0.019608)(0.0251,0.023529)(0.0293,0.027451)(0.0335,0.035294)(0.0377,0.039216)(0.0418,0.043137)(0.046,0.047059)(0.0502,0.05098)(0.0544,0.054902)(0.0586,0.058824)(0.0628,0.062745)(0.0669,0.066667)(0.0711,0.070588)(0.0753,0.07451)(0.0795,0.078431)(0.0837,0.082353)(0.0879,0.086275)(0.0921,0.090196)(0.0962,0.098039)(0.1004,0.10196)(0.1046,0.10588)(0.1088,0.1098)(0.113,0.11373)(0.1172,0.11765)(0.1213,0.12157)(0.1255,0.12549)(0.1297,0.12941)(0.1339,0.13333)(0.1381,0.13725)(0.1423,0.14118)(0.1464,0.1451)(0.1506,0.14902)(0.1548,0.15294)(0.159,0.16078)(0.1632,0.16471)(0.1674,0.16863)(0.1715,0.17255)(0.1757,0.17647)(0.1799,0.18039)(0.1841,0.18431)(0.1883,0.18824)(0.1925,0.19216)(0.1967,0.19608)(0.2008,0.2)(0.205,0.20392)(0.2092,0.20784)(0.2134,0.21176)(0.2176,0.21569)(0.2218,0.22353)(0.2259,0.22745)(0.2301,0.23137)(0.2343,0.23529)(0.2385,0.23922)(0.2427,0.24314)(0.2469,0.24706)(0.251,0.25098)(0.2552,0.2549)(0.2594,0.25882)(0.2636,0.26275)(0.2678,0.26667)(0.272,0.27059)(0.2762,0.27451)(0.2803,0.27843)(0.2845,0.28627)(0.2887,0.2902)(0.2929,0.29412)(0.2971,0.29804)(0.3013,0.30196)(0.3054,0.30588)(0.3096,0.3098)(0.3138,0.31373)(0.318,0.31765)(0.3222,0.32157)(0.3264,0.32549)(0.3305,0.32941)(0.3347,0.33333)(0.3389,0.33725)(0.3431,0.34118)(0.3473,0.34902)(0.3515,0.35294)(0.3556,0.35686)(0.3598,0.36078)(0.364,0.36471)(0.3682,0.36863)(0.3724,0.37255)(0.3766,0.37647)(0.3808,0.38039)(0.3849,0.38431)(0.3891,0.38824)(0.3933,0.39216)(0.3975,0.39608)(0.4017,0.4)(0.4059,0.40392)(0.41,0.41176)(0.4142,0.41569)(0.4184,0.41961)(0.4226,0.42353)(0.4268,0.42745)(0.431,0.43137)(0.4351,0.43529)(0.4393,0.43922)(0.4435,0.44314)(0.4477,0.44706)(0.4519,0.45098)(0.4561,0.4549)(0.4603,0.45882)(0.4644,0.46275)(0.4686,0.46667)(0.4728,0.47451)(0.477,0.47843)(0.4812,0.48235)(0.4854,0.48627)(0.4895,0.4902)(0.4937,0.49412)(0.4979,0.49804)(0.5021,0.50196)(0.5063,0.50588)(0.5105,0.5098)(0.5146,0.51373)(0.5188,0.51765)(0.523,0.52157)(0.5272,0.52549)(0.5314,0.52941)(0.5356,0.53725)(0.5397,0.54118)(0.5439,0.5451)(0.5481,0.54902)(0.5523,0.55294)(0.5565,0.55686)(0.5607,0.56078)(0.5649,0.56471)(0.569,0.56863)(0.5732,0.57255)(0.5774,0.57647)(0.5816,0.58039)(0.5858,0.58431)(0.59,0.58824)(0.5941,0.59216)(0.5983,0.6)(0.6025,0.60392)(0.6067,0.60784)(0.6109,0.61176)(0.6151,0.61569)(0.6192,0.61961)(0.6234,0.62353)(0.6276,0.62745)(0.6318,0.63137)(0.636,0.63529)(0.6402,0.63922)(0.6444,0.64314)(0.6485,0.64706)(0.6527,0.65098)(0.6569,0.6549)(0.6611,0.66275)(0.6653,0.66667)(0.6695,0.67059)(0.6736,0.67451)(0.6778,0.67843)(0.682,0.68235)(0.6862,0.68627)(0.6904,0.6902)(0.6946,0.69412)(0.6987,0.69804)(0.7029,0.70196)(0.7071,0.70588)(0.7113,0.7098)(0.7155,0.71373)(0.7197,0.71765)(0.7238,0.72549)(0.728,0.72941)(0.7322,0.73333)(0.7364,0.73725)(0.7406,0.74118)(0.7448,0.7451)(0.749,0.74902)(0.7531,0.75294)(0.7573,0.75686)(0.7615,0.76078)(0.7657,0.76471)(0.7699,0.76863)(0.7741,0.77255)(0.7782,0.77647)(0.7824,0.78039)(0.7866,0.78824)(0.7908,0.79216)(0.795,0.79608)(0.7992,0.8)(0.8033,0.80392)(0.8075,0.80784)(0.8117,0.81176)(0.8159,0.81569)(0.8201,0.81961)(0.8243,0.82353)(0.8285,0.82745)(0.8326,0.83137)(0.8368,0.83529)(0.841,0.83922)(0.8452,0.84314)(0.8494,0.85098)(0.8536,0.8549)(0.8577,0.85882)(0.8619,0.86275)(0.8661,0.86667)(0.8703,0.87059)(0.8745,0.87451)(0.8787,0.87843)(0.8828,0.88235)(0.887,0.88627)(0.8912,0.8902)(0.8954,0.89412)(0.8996,0.89804)(0.9038,0.90196)(0.9079,0.90588)(0.9121,0.91373)(0.9163,0.91765)(0.9205,0.92157)(0.9247,0.92549)(0.9289,0.92941)(0.9331,0.93333)(0.9372,0.93725)(0.9414,0.94118)(0.9456,0.9451)(0.9498,0.94902)(0.954,0.95294)(0.9582,0.95686)(0.9623,0.96078)(0.9665,0.96471)(0.9707,0.96863)(0.9749,0.97647)(0.9791,0.98039)(0.9833,0.98431)(0.9874,0.98824)(0.9916,0.99216)(0.9958,0.99608)(1,1)
+GREEN:
+(0,0)(0.0042,0.0039216)(0.0084,0.0078431)(0.0126,0.011765)(0.0167,0.015686)(0.0209,0.019608)(0.0251,0.023529)(0.0293,0.027451)(0.0335,0.035294)(0.0377,0.039216)(0.0418,0.043137)(0.046,0.047059)(0.0502,0.05098)(0.0544,0.054902)(0.0586,0.058824)(0.0628,0.062745)(0.0669,0.066667)(0.0711,0.070588)(0.0753,0.07451)(0.0795,0.078431)(0.0837,0.082353)(0.0879,0.086275)(0.0921,0.090196)(0.0962,0.098039)(0.1004,0.10196)(0.1046,0.10588)(0.1088,0.1098)(0.113,0.11373)(0.1172,0.11765)(0.1213,0.12157)(0.1255,0.12549)(0.1297,0.12941)(0.1339,0.13333)(0.1381,0.13725)(0.1423,0.14118)(0.1464,0.1451)(0.1506,0.14902)(0.1548,0.15294)(0.159,0.16078)(0.1632,0.16471)(0.1674,0.16863)(0.1715,0.17255)(0.1757,0.17647)(0.1799,0.18039)(0.1841,0.18431)(0.1883,0.18824)(0.1925,0.19216)(0.1967,0.19608)(0.2008,0.2)(0.205,0.20392)(0.2092,0.20784)(0.2134,0.21176)(0.2176,0.21569)(0.2218,0.22353)(0.2259,0.22745)(0.2301,0.23137)(0.2343,0.23529)(0.2385,0.23922)(0.2427,0.24314)(0.2469,0.24706)(0.251,0.25098)(0.2552,0.2549)(0.2594,0.25882)(0.2636,0.26275)(0.2678,0.26667)(0.272,0.27059)(0.2762,0.27451)(0.2803,0.27843)(0.2845,0.28627)(0.2887,0.2902)(0.2929,0.29412)(0.2971,0.29804)(0.3013,0.30196)(0.3054,0.30588)(0.3096,0.3098)(0.3138,0.31373)(0.318,0.31765)(0.3222,0.32157)(0.3264,0.32549)(0.3305,0.32941)(0.3347,0.33333)(0.3389,0.33725)(0.3431,0.34118)(0.3473,0.34902)(0.3515,0.35294)(0.3556,0.35686)(0.3598,0.36078)(0.364,0.36471)(0.3682,0.36863)(0.3724,0.37255)(0.3766,0.37647)(0.3808,0.38039)(0.3849,0.38431)(0.3891,0.38824)(0.3933,0.39216)(0.3975,0.39608)(0.4017,0.4)(0.4059,0.40392)(0.41,0.41176)(0.4142,0.41569)(0.4184,0.41961)(0.4226,0.42353)(0.4268,0.42745)(0.431,0.43137)(0.4351,0.43529)(0.4393,0.43922)(0.4435,0.44314)(0.4477,0.44706)(0.4519,0.45098)(0.4561,0.4549)(0.4603,0.45882)(0.4644,0.46275)(0.4686,0.46667)(0.4728,0.47451)(0.477,0.47843)(0.4812,0.48235)(0.4854,0.48627)(0.4895,0.4902)(0.4937,0.49412)(0.4979,0.49804)(0.5021,0.50196)(0.5063,0.50588)(0.5105,0.5098)(0.5146,0.51373)(0.5188,0.51765)(0.523,0.52157)(0.5272,0.52549)(0.5314,0.52941)(0.5356,0.53725)(0.5397,0.54118)(0.5439,0.5451)(0.5481,0.54902)(0.5523,0.55294)(0.5565,0.55686)(0.5607,0.56078)(0.5649,0.56471)(0.569,0.56863)(0.5732,0.57255)(0.5774,0.57647)(0.5816,0.58039)(0.5858,0.58431)(0.59,0.58824)(0.5941,0.59216)(0.5983,0.6)(0.6025,0.60392)(0.6067,0.60784)(0.6109,0.61176)(0.6151,0.61569)(0.6192,0.61961)(0.6234,0.62353)(0.6276,0.62745)(0.6318,0.63137)(0.636,0.63529)(0.6402,0.63922)(0.6444,0.64314)(0.6485,0.64706)(0.6527,0.65098)(0.6569,0.6549)(0.6611,0.66275)(0.6653,0.66667)(0.6695,0.67059)(0.6736,0.67451)(0.6778,0.67843)(0.682,0.68235)(0.6862,0.68627)(0.6904,0.6902)(0.6946,0.69412)(0.6987,0.69804)(0.7029,0.70196)(0.7071,0.70588)(0.7113,0.7098)(0.7155,0.71373)(0.7197,0.71765)(0.7238,0.72549)(0.728,0.72941)(0.7322,0.73333)(0.7364,0.73725)(0.7406,0.74118)(0.7448,0.7451)(0.749,0.74902)(0.7531,0.75294)(0.7573,0.75686)(0.7615,0.76078)(0.7657,0.76471)(0.7699,0.76863)(0.7741,0.77255)(0.7782,0.77647)(0.7824,0.78039)(0.7866,0.78824)(0.7908,0.79216)(0.795,0.79608)(0.7992,0.8)(0.8033,0.80392)(0.8075,0.80784)(0.8117,0.81176)(0.8159,0.81569)(0.8201,0.81961)(0.8243,0.82353)(0.8285,0.82745)(0.8326,0.83137)(0.8368,0.83529)(0.841,0.83922)(0.8452,0.84314)(0.8494,0.85098)(0.8536,0.8549)(0.8577,0.85882)(0.8619,0.86275)(0.8661,0.86667)(0.8703,0.87059)(0.8745,0.87451)(0.8787,0.87843)(0.8828,0.88235)(0.887,0.88627)(0.8912,0.8902)(0.8954,0.89412)(0.8996,0.89804)(0.9038,0.90196)(0.9079,0.90588)(0.9121,0.91373)(0.9163,0.91765)(0.9205,0.92157)(0.9247,0.92549)(0.9289,0.92941)(0.9331,0.93333)(0.9372,0.93725)(0.9414,0.94118)(0.9456,0.9451)(0.9498,0.94902)(0.954,0.95294)(0.9582,0.95686)(0.9623,0.96078)(0.9665,0.96471)(0.9707,0.96863)(0.9749,0.97647)(0.9791,0.98039)(0.9833,0.98431)(0.9874,0.98824)(0.9916,0.99216)(0.9958,0.99608)(1,1)
+BLUE:
+(0,0)(0.0042,0.0039216)(0.0084,0.0078431)(0.0126,0.011765)(0.0167,0.015686)(0.0209,0.019608)(0.0251,0.023529)(0.0293,0.027451)(0.0335,0.035294)(0.0377,0.039216)(0.0418,0.043137)(0.046,0.047059)(0.0502,0.05098)(0.0544,0.054902)(0.0586,0.058824)(0.0628,0.062745)(0.0669,0.066667)(0.0711,0.070588)(0.0753,0.07451)(0.0795,0.078431)(0.0837,0.082353)(0.0879,0.086275)(0.0921,0.090196)(0.0962,0.098039)(0.1004,0.10196)(0.1046,0.10588)(0.1088,0.1098)(0.113,0.11373)(0.1172,0.11765)(0.1213,0.12157)(0.1255,0.12549)(0.1297,0.12941)(0.1339,0.13333)(0.1381,0.13725)(0.1423,0.14118)(0.1464,0.1451)(0.1506,0.14902)(0.1548,0.15294)(0.159,0.16078)(0.1632,0.16471)(0.1674,0.16863)(0.1715,0.17255)(0.1757,0.17647)(0.1799,0.18039)(0.1841,0.18431)(0.1883,0.18824)(0.1925,0.19216)(0.1967,0.19608)(0.2008,0.2)(0.205,0.20392)(0.2092,0.20784)(0.2134,0.21176)(0.2176,0.21569)(0.2218,0.22353)(0.2259,0.22745)(0.2301,0.23137)(0.2343,0.23529)(0.2385,0.23922)(0.2427,0.24314)(0.2469,0.24706)(0.251,0.25098)(0.2552,0.2549)(0.2594,0.25882)(0.2636,0.26275)(0.2678,0.26667)(0.272,0.27059)(0.2762,0.27451)(0.2803,0.27843)(0.2845,0.28627)(0.2887,0.2902)(0.2929,0.29412)(0.2971,0.29804)(0.3013,0.30196)(0.3054,0.30588)(0.3096,0.3098)(0.3138,0.31373)(0.318,0.31765)(0.3222,0.32157)(0.3264,0.32549)(0.3305,0.32941)(0.3347,0.33333)(0.3389,0.33725)(0.3431,0.34118)(0.3473,0.34902)(0.3515,0.35294)(0.3556,0.35686)(0.3598,0.36078)(0.364,0.36471)(0.3682,0.36863)(0.3724,0.37255)(0.3766,0.37647)(0.3808,0.38039)(0.3849,0.38431)(0.3891,0.38824)(0.3933,0.39216)(0.3975,0.39608)(0.4017,0.4)(0.4059,0.40392)(0.41,0.41176)(0.4142,0.41569)(0.4184,0.41961)(0.4226,0.42353)(0.4268,0.42745)(0.431,0.43137)(0.4351,0.43529)(0.4393,0.43922)(0.4435,0.44314)(0.4477,0.44706)(0.4519,0.45098)(0.4561,0.4549)(0.4603,0.45882)(0.4644,0.46275)(0.4686,0.46667)(0.4728,0.47451)(0.477,0.47843)(0.4812,0.48235)(0.4854,0.48627)(0.4895,0.4902)(0.4937,0.49412)(0.4979,0.49804)(0.5021,0.50196)(0.5063,0.50588)(0.5105,0.5098)(0.5146,0.51373)(0.5188,0.51765)(0.523,0.52157)(0.5272,0.52549)(0.5314,0.52941)(0.5356,0.53725)(0.5397,0.54118)(0.5439,0.5451)(0.5481,0.54902)(0.5523,0.55294)(0.5565,0.55686)(0.5607,0.56078)(0.5649,0.56471)(0.569,0.56863)(0.5732,0.57255)(0.5774,0.57647)(0.5816,0.58039)(0.5858,0.58431)(0.59,0.58824)(0.5941,0.59216)(0.5983,0.6)(0.6025,0.60392)(0.6067,0.60784)(0.6109,0.61176)(0.6151,0.61569)(0.6192,0.61961)(0.6234,0.62353)(0.6276,0.62745)(0.6318,0.63137)(0.636,0.63529)(0.6402,0.63922)(0.6444,0.64314)(0.6485,0.64706)(0.6527,0.65098)(0.6569,0.6549)(0.6611,0.66275)(0.6653,0.66667)(0.6695,0.67059)(0.6736,0.67451)(0.6778,0.67843)(0.682,0.68235)(0.6862,0.68627)(0.6904,0.6902)(0.6946,0.69412)(0.6987,0.69804)(0.7029,0.70196)(0.7071,0.70588)(0.7113,0.7098)(0.7155,0.71373)(0.7197,0.71765)(0.7238,0.72549)(0.728,0.72941)(0.7322,0.73333)(0.7364,0.73725)(0.7406,0.74118)(0.7448,0.7451)(0.749,0.74902)(0.7531,0.75294)(0.7573,0.75686)(0.7615,0.76078)(0.7657,0.76471)(0.7699,0.76863)(0.7741,0.77255)(0.7782,0.77647)(0.7824,0.78039)(0.7866,0.78824)(0.7908,0.79216)(0.795,0.79608)(0.7992,0.8)(0.8033,0.80392)(0.8075,0.80784)(0.8117,0.81176)(0.8159,0.81569)(0.8201,0.81961)(0.8243,0.82353)(0.8285,0.82745)(0.8326,0.83137)(0.8368,0.83529)(0.841,0.83922)(0.8452,0.84314)(0.8494,0.85098)(0.8536,0.8549)(0.8577,0.85882)(0.8619,0.86275)(0.8661,0.86667)(0.8703,0.87059)(0.8745,0.87451)(0.8787,0.87843)(0.8828,0.88235)(0.887,0.88627)(0.8912,0.8902)(0.8954,0.89412)(0.8996,0.89804)(0.9038,0.90196)(0.9079,0.90588)(0.9121,0.91373)(0.9163,0.91765)(0.9205,0.92157)(0.9247,0.92549)(0.9289,0.92941)(0.9331,0.93333)(0.9372,0.93725)(0.9414,0.94118)(0.9456,0.9451)(0.9498,0.94902)(0.954,0.95294)(0.9582,0.95686)(0.9623,0.96078)(0.9665,0.96471)(0.9707,0.96863)(0.9749,0.97647)(0.9791,0.98039)(0.9833,0.98431)(0.9874,0.98824)(0.9916,0.99216)(0.9958,0.99608)(1,1)
diff --git a/ds9/cmaps/gist_heat.sao b/ds9/cmaps/gist_heat.sao
new file mode 100644
index 0000000..0bdaee5
--- /dev/null
+++ b/ds9/cmaps/gist_heat.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# heat
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0042,0.0039216)(0.0084,0.0078431)(0.0126,0.015686)(0.0167,0.019608)(0.0209,0.027451)(0.0251,0.031373)(0.0293,0.039216)(0.0335,0.043137)(0.0377,0.05098)(0.0418,0.058824)(0.046,0.066667)(0.0502,0.070588)(0.0544,0.078431)(0.0586,0.082353)(0.0628,0.090196)(0.0669,0.094118)(0.0711,0.10196)(0.0753,0.10588)(0.0795,0.1098)(0.0837,0.11765)(0.0879,0.12157)(0.0921,0.12941)(0.0962,0.13333)(0.1004,0.14118)(0.1046,0.1451)(0.1088,0.15294)(0.113,0.15686)(0.1172,0.16471)(0.1213,0.16863)(0.1255,0.18039)(0.1297,0.18431)(0.1339,0.19216)(0.1381,0.19608)(0.1423,0.20392)(0.1464,0.20784)(0.1506,0.21569)(0.1548,0.21961)(0.159,0.22353)(0.1632,0.23137)(0.1674,0.23529)(0.1715,0.24314)(0.1757,0.24706)(0.1799,0.2549)(0.1841,0.25882)(0.1883,0.26667)(0.1925,0.27059)(0.1967,0.27451)(0.2008,0.28235)(0.205,0.28627)(0.2092,0.29804)(0.2134,0.30588)(0.2176,0.3098)(0.2218,0.31765)(0.2259,0.32157)(0.2301,0.32941)(0.2343,0.33333)(0.2385,0.33725)(0.2427,0.3451)(0.2469,0.34902)(0.251,0.36078)(0.2552,0.36863)(0.2594,0.37255)(0.2636,0.38039)(0.2678,0.38431)(0.272,0.38824)(0.2762,0.39608)(0.2803,0.4)(0.2845,0.40784)(0.2887,0.41176)(0.2929,0.42353)(0.2971,0.43137)(0.3013,0.43529)(0.3054,0.44314)(0.3096,0.44706)(0.3138,0.45098)(0.318,0.45882)(0.3222,0.46275)(0.3264,0.47059)(0.3305,0.47451)(0.3347,0.48235)(0.3389,0.48627)(0.3431,0.49412)(0.3473,0.49804)(0.3515,0.50196)(0.3556,0.5098)(0.3598,0.51373)(0.364,0.52157)(0.3682,0.52549)(0.3724,0.53333)(0.3766,0.5451)(0.3808,0.54902)(0.3849,0.55294)(0.3891,0.56078)(0.3933,0.56471)(0.3975,0.57255)(0.4017,0.57647)(0.4059,0.58431)(0.41,0.58824)(0.4142,0.59608)(0.4184,0.6)(0.4226,0.60784)(0.4268,0.61176)(0.431,0.61569)(0.4351,0.62353)(0.4393,0.62745)(0.4435,0.63529)(0.4477,0.63922)(0.4519,0.64706)(0.4561,0.65098)(0.4603,0.66275)(0.4644,0.66667)(0.4686,0.67451)(0.4728,0.67843)(0.477,0.68627)(0.4812,0.6902)(0.4854,0.69804)(0.4895,0.70196)(0.4937,0.7098)(0.4979,0.71373)(0.5021,0.72549)(0.5063,0.72941)(0.5105,0.73725)(0.5146,0.74118)(0.5188,0.74902)(0.523,0.75294)(0.5272,0.76078)(0.5314,0.76471)(0.5356,0.77255)(0.5397,0.77647)(0.5439,0.78824)(0.5481,0.79216)(0.5523,0.8)(0.5565,0.80392)(0.5607,0.81176)(0.5649,0.81569)(0.569,0.82353)(0.5732,0.82745)(0.5774,0.83137)(0.5816,0.83922)(0.5858,0.84314)(0.59,0.85098)(0.5941,0.8549)(0.5983,0.86275)(0.6025,0.86667)(0.6067,0.87451)(0.6109,0.87843)(0.6151,0.88627)(0.6192,0.8902)(0.6234,0.89412)(0.6276,0.90588)(0.6318,0.91373)(0.636,0.91765)(0.6402,0.92549)(0.6444,0.92941)(0.6485,0.93725)(0.6527,0.94118)(0.6569,0.9451)(0.6611,0.95294)(0.6653,0.95686)(0.6695,0.96471)(0.6736,0.96863)(0.6778,0.97647)(0.682,0.98039)(0.6862,0.98824)(0.6904,0.99216)(0.6946,1)(0.6987,1)(0.7029,1)(0.7071,1)(0.7113,1)(0.7155,1)(0.7197,1)(0.7238,1)(0.728,1)(0.7322,1)(0.7364,1)(0.7406,1)(0.7448,1)(0.749,1)(0.7531,1)(0.7573,1)(0.7615,1)(0.7657,1)(0.7699,1)(0.7741,1)(0.7782,1)(0.7824,1)(0.7866,1)(0.7908,1)(0.795,1)(0.7992,1)(0.8033,1)(0.8075,1)(0.8117,1)(0.8159,1)(0.8201,1)(0.8243,1)(0.8285,1)(0.8326,1)(0.8368,1)(0.841,1)(0.8452,1)(0.8494,1)(0.8536,1)(0.8577,1)(0.8619,1)(0.8661,1)(0.8703,1)(0.8745,1)(0.8787,1)(0.8828,1)(0.887,1)(0.8912,1)(0.8954,1)(0.8996,1)(0.9038,1)(0.9079,1)(0.9121,1)(0.9163,1)(0.9205,1)(0.9247,1)(0.9289,1)(0.9331,1)(0.9372,1)(0.9414,1)(0.9456,1)(0.9498,1)(0.954,1)(0.9582,1)(0.9623,1)(0.9665,1)(0.9707,1)(0.9749,1)(0.9791,1)(0.9833,1)(0.9874,1)(0.9916,1)(0.9958,1)(1,1)
+GREEN:
+(0,0)(0.0042,0)(0.0084,0)(0.0126,0)(0.0167,0)(0.0209,0)(0.0251,0)(0.0293,0)(0.0335,0)(0.0377,0)(0.0418,0)(0.046,0)(0.0502,0)(0.0544,0)(0.0586,0)(0.0628,0)(0.0669,0)(0.0711,0)(0.0753,0)(0.0795,0)(0.0837,0)(0.0879,0)(0.0921,0)(0.0962,0)(0.1004,0)(0.1046,0)(0.1088,0)(0.113,0)(0.1172,0)(0.1213,0)(0.1255,0)(0.1297,0)(0.1339,0)(0.1381,0)(0.1423,0)(0.1464,0)(0.1506,0)(0.1548,0)(0.159,0)(0.1632,0)(0.1674,0)(0.1715,0)(0.1757,0)(0.1799,0)(0.1841,0)(0.1883,0)(0.1925,0)(0.1967,0)(0.2008,0)(0.205,0)(0.2092,0)(0.2134,0)(0.2176,0)(0.2218,0)(0.2259,0)(0.2301,0)(0.2343,0)(0.2385,0)(0.2427,0)(0.2469,0)(0.251,0)(0.2552,0)(0.2594,0)(0.2636,0)(0.2678,0)(0.272,0)(0.2762,0)(0.2803,0)(0.2845,0)(0.2887,0)(0.2929,0)(0.2971,0)(0.3013,0)(0.3054,0)(0.3096,0)(0.3138,0)(0.318,0)(0.3222,0)(0.3264,0)(0.3305,0)(0.3347,0)(0.3389,0)(0.3431,0)(0.3473,0)(0.3515,0)(0.3556,0)(0.3598,0)(0.364,0)(0.3682,0)(0.3724,0)(0.3766,0)(0.3808,0)(0.3849,0)(0.3891,0)(0.3933,0)(0.3975,0)(0.4017,0)(0.4059,0)(0.41,0)(0.4142,0)(0.4184,0)(0.4226,0)(0.4268,0)(0.431,0)(0.4351,0)(0.4393,0)(0.4435,0)(0.4477,0)(0.4519,0)(0.4561,0)(0.4603,0)(0.4644,0)(0.4686,0)(0.4728,0)(0.477,0.0039216)(0.4812,0.011765)(0.4854,0.019608)(0.4895,0.027451)(0.4937,0.035294)(0.4979,0.043137)(0.5021,0.058824)(0.5063,0.066667)(0.5105,0.070588)(0.5146,0.078431)(0.5188,0.086275)(0.523,0.094118)(0.5272,0.10196)(0.5314,0.1098)(0.5356,0.11765)(0.5397,0.12549)(0.5439,0.13725)(0.5481,0.1451)(0.5523,0.15294)(0.5565,0.16078)(0.5607,0.16863)(0.5649,0.17647)(0.569,0.18431)(0.5732,0.19216)(0.5774,0.2)(0.5816,0.20392)(0.5858,0.21176)(0.59,0.21961)(0.5941,0.22745)(0.5983,0.23529)(0.6025,0.24314)(0.6067,0.25098)(0.6109,0.25882)(0.6151,0.26667)(0.6192,0.27059)(0.6234,0.27843)(0.6276,0.29412)(0.6318,0.30196)(0.636,0.3098)(0.6402,0.31765)(0.6444,0.32549)(0.6485,0.33333)(0.6527,0.33725)(0.6569,0.3451)(0.6611,0.35294)(0.6653,0.36078)(0.6695,0.36863)(0.6736,0.37647)(0.6778,0.38431)(0.682,0.39216)(0.6862,0.4)(0.6904,0.40392)(0.6946,0.41176)(0.6987,0.41961)(0.7029,0.42745)(0.7071,0.43529)(0.7113,0.45098)(0.7155,0.45882)(0.7197,0.46667)(0.7238,0.47059)(0.728,0.47843)(0.7322,0.48627)(0.7364,0.49412)(0.7406,0.50196)(0.7448,0.5098)(0.749,0.51765)(0.7531,0.53333)(0.7573,0.53725)(0.7615,0.5451)(0.7657,0.55294)(0.7699,0.56078)(0.7741,0.56863)(0.7782,0.57647)(0.7824,0.58431)(0.7866,0.59216)(0.7908,0.6)(0.795,0.61176)(0.7992,0.61961)(0.8033,0.62745)(0.8075,0.63529)(0.8117,0.64314)(0.8159,0.65098)(0.8201,0.65882)(0.8243,0.66667)(0.8285,0.67059)(0.8326,0.67843)(0.8368,0.68627)(0.841,0.69412)(0.8452,0.70196)(0.8494,0.7098)(0.8536,0.71765)(0.8577,0.72549)(0.8619,0.73333)(0.8661,0.73725)(0.8703,0.7451)(0.8745,0.75294)(0.8787,0.76863)(0.8828,0.77647)(0.887,0.78431)(0.8912,0.79216)(0.8954,0.8)(0.8996,0.80392)(0.9038,0.81176)(0.9079,0.81961)(0.9121,0.82745)(0.9163,0.83529)(0.9205,0.84314)(0.9247,0.85098)(0.9289,0.85882)(0.9331,0.86667)(0.9372,0.87059)(0.9414,0.87843)(0.9456,0.88627)(0.9498,0.89412)(0.954,0.90196)(0.9582,0.9098)(0.9623,0.92549)(0.9665,0.93333)(0.9707,0.93725)(0.9749,0.9451)(0.9791,0.95294)(0.9833,0.96078)(0.9874,0.96863)(0.9916,0.97647)(0.9958,0.98431)(1,0.99216)
+BLUE:
+(0,0)(0.0042,0)(0.0084,0)(0.0126,0)(0.0167,0)(0.0209,0)(0.0251,0)(0.0293,0)(0.0335,0)(0.0377,0)(0.0418,0)(0.046,0)(0.0502,0)(0.0544,0)(0.0586,0)(0.0628,0)(0.0669,0)(0.0711,0)(0.0753,0)(0.0795,0)(0.0837,0)(0.0879,0)(0.0921,0)(0.0962,0)(0.1004,0)(0.1046,0)(0.1088,0)(0.113,0)(0.1172,0)(0.1213,0)(0.1255,0)(0.1297,0)(0.1339,0)(0.1381,0)(0.1423,0)(0.1464,0)(0.1506,0)(0.1548,0)(0.159,0)(0.1632,0)(0.1674,0)(0.1715,0)(0.1757,0)(0.1799,0)(0.1841,0)(0.1883,0)(0.1925,0)(0.1967,0)(0.2008,0)(0.205,0)(0.2092,0)(0.2134,0)(0.2176,0)(0.2218,0)(0.2259,0)(0.2301,0)(0.2343,0)(0.2385,0)(0.2427,0)(0.2469,0)(0.251,0)(0.2552,0)(0.2594,0)(0.2636,0)(0.2678,0)(0.272,0)(0.2762,0)(0.2803,0)(0.2845,0)(0.2887,0)(0.2929,0)(0.2971,0)(0.3013,0)(0.3054,0)(0.3096,0)(0.3138,0)(0.318,0)(0.3222,0)(0.3264,0)(0.3305,0)(0.3347,0)(0.3389,0)(0.3431,0)(0.3473,0)(0.3515,0)(0.3556,0)(0.3598,0)(0.364,0)(0.3682,0)(0.3724,0)(0.3766,0)(0.3808,0)(0.3849,0)(0.3891,0)(0.3933,0)(0.3975,0)(0.4017,0)(0.4059,0)(0.41,0)(0.4142,0)(0.4184,0)(0.4226,0)(0.4268,0)(0.431,0)(0.4351,0)(0.4393,0)(0.4435,0)(0.4477,0)(0.4519,0)(0.4561,0)(0.4603,0)(0.4644,0)(0.4686,0)(0.4728,0)(0.477,0)(0.4812,0)(0.4854,0)(0.4895,0)(0.4937,0)(0.4979,0)(0.5021,0)(0.5063,0)(0.5105,0)(0.5146,0)(0.5188,0)(0.523,0)(0.5272,0)(0.5314,0)(0.5356,0)(0.5397,0)(0.5439,0)(0.5481,0)(0.5523,0)(0.5565,0)(0.5607,0)(0.5649,0)(0.569,0)(0.5732,0)(0.5774,0)(0.5816,0)(0.5858,0)(0.59,0)(0.5941,0)(0.5983,0)(0.6025,0)(0.6067,0)(0.6109,0)(0.6151,0)(0.6192,0)(0.6234,0)(0.6276,0)(0.6318,0)(0.636,0)(0.6402,0)(0.6444,0)(0.6485,0)(0.6527,0)(0.6569,0)(0.6611,0)(0.6653,0)(0.6695,0)(0.6736,0)(0.6778,0)(0.682,0)(0.6862,0)(0.6904,0)(0.6946,0)(0.6987,0)(0.7029,0)(0.7071,0)(0.7113,0)(0.7155,0)(0.7197,0)(0.7238,0)(0.728,0)(0.7322,0)(0.7364,0)(0.7406,0)(0.7448,0)(0.749,0)(0.7531,0.027451)(0.7573,0.043137)(0.7615,0.058824)(0.7657,0.07451)(0.7699,0.090196)(0.7741,0.10588)(0.7782,0.12157)(0.7824,0.13725)(0.7866,0.15294)(0.7908,0.16863)(0.795,0.2)(0.7992,0.21176)(0.8033,0.22745)(0.8075,0.24314)(0.8117,0.25882)(0.8159,0.27451)(0.8201,0.2902)(0.8243,0.30588)(0.8285,0.32157)(0.8326,0.33725)(0.8368,0.35294)(0.841,0.36863)(0.8452,0.38431)(0.8494,0.4)(0.8536,0.41176)(0.8577,0.42745)(0.8619,0.44314)(0.8661,0.45882)(0.8703,0.47451)(0.8745,0.4902)(0.8787,0.52157)(0.8828,0.53725)(0.887,0.55294)(0.8912,0.56863)(0.8954,0.58431)(0.8996,0.6)(0.9038,0.61176)(0.9079,0.62745)(0.9121,0.64314)(0.9163,0.65882)(0.9205,0.67451)(0.9247,0.6902)(0.9289,0.70588)(0.9331,0.72157)(0.9372,0.73725)(0.9414,0.75294)(0.9456,0.76863)(0.9498,0.78431)(0.954,0.8)(0.9582,0.81176)(0.9623,0.84314)(0.9665,0.85882)(0.9707,0.87451)(0.9749,0.8902)(0.9791,0.90588)(0.9833,0.92157)(0.9874,0.93725)(0.9916,0.95294)(0.9958,0.96863)(1,0.98431)
diff --git a/ds9/cmaps/gist_ncar.sao b/ds9/cmaps/gist_ncar.sao
new file mode 100644
index 0000000..a4b68bf
--- /dev/null
+++ b/ds9/cmaps/gist_ncar.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# ncar
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.005,0)(0.0101,0)(0.0151,0)(0.0201,0)(0.0251,0)(0.0302,0)(0.0352,0)(0.0402,0)(0.0452,0)(0.0503,0)(0.0553,0)(0.0603,0)(0.0653,0)(0.0704,0)(0.0754,0)(0.0804,0)(0.0854,0)(0.0905,0)(0.0955,0)(0.1005,0)(0.1055,0)(0.1106,0)(0.1156,0)(0.1206,0)(0.1256,0)(0.1307,0)(0.1357,0)(0.1407,0)(0.1457,0)(0.1508,0)(0.1558,0)(0.1608,0)(0.1658,0)(0.1709,0)(0.1759,0)(0.1809,0)(0.1859,0)(0.191,0)(0.196,0)(0.201,0)(0.206,0)(0.2111,0)(0.2161,0)(0.2211,0)(0.2261,0)(0.2312,0)(0.2362,0)(0.2412,0)(0.2462,0)(0.2513,0)(0.2563,0)(0.2613,0)(0.2663,0)(0.2714,0)(0.2764,0)(0.2814,0)(0.2864,0)(0.2915,0)(0.2965,0)(0.3015,0)(0.3065,0)(0.3116,0)(0.3166,0.0039216)(0.3216,0.043137)(0.3266,0.082353)(0.3317,0.11765)(0.3367,0.15686)(0.3417,0.19608)(0.3467,0.23137)(0.3518,0.27059)(0.3568,0.3098)(0.3618,0.34902)(0.3668,0.38431)(0.3719,0.40392)(0.3769,0.41569)(0.3819,0.42353)(0.3869,0.43137)(0.392,0.44314)(0.397,0.45098)(0.402,0.45882)(0.407,0.47059)(0.4121,0.47843)(0.4171,0.4902)(0.4221,0.50196)(0.4271,0.52549)(0.4322,0.54902)(0.4372,0.57255)(0.4422,0.6)(0.4472,0.62353)(0.4523,0.64706)(0.4573,0.67059)(0.4623,0.69412)(0.4673,0.72157)(0.4724,0.7451)(0.4774,0.76863)(0.4824,0.79216)(0.4874,0.81569)(0.4925,0.83922)(0.4975,0.86275)(0.5025,0.88627)(0.5075,0.9098)(0.5126,0.93333)(0.5176,0.95686)(0.5226,0.98039)(0.5276,1)(0.5327,1)(0.5377,1)(0.5427,1)(0.5477,1)(0.5528,1)(0.5578,1)(0.5628,1)(0.5678,1)(0.5729,1)(0.5779,1)(0.5829,1)(0.5879,1)(0.593,1)(0.598,1)(0.603,1)(0.608,1)(0.6131,1)(0.6181,1)(0.6231,1)(0.6281,1)(0.6332,1)(0.6382,1)(0.6432,1)(0.6482,1)(0.6533,1)(0.6583,1)(0.6633,1)(0.6683,1)(0.6734,1)(0.6784,1)(0.6834,1)(0.6884,1)(0.6935,1)(0.6985,1)(0.7035,1)(0.7085,1)(0.7136,1)(0.7186,1)(0.7236,1)(0.7286,1)(0.7337,1)(0.7387,1)(0.7437,1)(0.7487,1)(0.7538,1)(0.7588,1)(0.7638,1)(0.7688,1)(0.7739,1)(0.7789,1)(0.7839,1)(0.7889,1)(0.794,0.96471)(0.799,0.92549)(0.804,0.8902)(0.809,0.85098)(0.8141,0.81569)(0.8191,0.77647)(0.8241,0.74118)(0.8291,0.70196)(0.8342,0.66667)(0.8392,0.62745)(0.8442,0.61961)(0.8492,0.65098)(0.8543,0.68235)(0.8593,0.71373)(0.8643,0.7451)(0.8693,0.77255)(0.8744,0.80392)(0.8794,0.83529)(0.8844,0.86667)(0.8894,0.89804)(0.8945,0.92941)(0.8995,0.93333)(0.9045,0.93725)(0.9095,0.93725)(0.9146,0.94118)(0.9196,0.9451)(0.9246,0.9451)(0.9296,0.94902)(0.9347,0.95294)(0.9397,0.95294)(0.9447,0.95686)(0.9497,0.96078)(0.9548,0.96471)(0.9598,0.96863)(0.9648,0.97255)(0.9698,0.97647)(0.9749,0.98039)(0.9799,0.98431)(0.9849,0.98824)(0.9899,0.99216)(0.995,0.99608)(1,1)
+GREEN:
+(0,0)(0.005,0.035294)(0.0101,0.07451)(0.0151,0.1098)(0.0201,0.14902)(0.0251,0.18431)(0.0302,0.22353)(0.0352,0.25882)(0.0402,0.29804)(0.0452,0.33333)(0.0503,0.37255)(0.0553,0.36863)(0.0603,0.33333)(0.0653,0.29412)(0.0704,0.25882)(0.0754,0.21961)(0.0804,0.18431)(0.0854,0.1451)(0.0905,0.1098)(0.0955,0.070588)(0.1005,0.035294)(0.1055,0)(0.1106,0.07451)(0.1156,0.1451)(0.1206,0.21569)(0.1256,0.28627)(0.1307,0.36078)(0.1357,0.43137)(0.1407,0.50196)(0.1457,0.57255)(0.1508,0.64706)(0.1558,0.71765)(0.1608,0.76078)(0.1658,0.78431)(0.1709,0.80784)(0.1759,0.83137)(0.1809,0.8549)(0.1859,0.88235)(0.191,0.90588)(0.196,0.92941)(0.201,0.95294)(0.206,0.97647)(0.2111,0.99608)(0.2161,0.99608)(0.2211,0.99216)(0.2261,0.99216)(0.2312,0.99216)(0.2362,0.98824)(0.2412,0.98824)(0.2462,0.98431)(0.2513,0.98431)(0.2563,0.98039)(0.2613,0.98039)(0.2663,0.98039)(0.2714,0.98039)(0.2764,0.98431)(0.2814,0.98431)(0.2864,0.98824)(0.2915,0.98824)(0.2965,0.99216)(0.3015,0.99216)(0.3065,0.99608)(0.3116,0.99608)(0.3166,0.99608)(0.3216,0.97647)(0.3266,0.95686)(0.3317,0.93725)(0.3367,0.92157)(0.3417,0.90196)(0.3467,0.88235)(0.3518,0.86275)(0.3568,0.84706)(0.3618,0.82745)(0.3668,0.80784)(0.3719,0.81569)(0.3769,0.83529)(0.3819,0.85098)(0.3869,0.87059)(0.392,0.8902)(0.397,0.9098)(0.402,0.92549)(0.407,0.9451)(0.4121,0.96471)(0.4171,0.98431)(0.4221,1)(0.4271,1)(0.4322,1)(0.4372,1)(0.4422,1)(0.4472,1)(0.4523,1)(0.4573,1)(0.4623,1)(0.4673,1)(0.4724,1)(0.4774,1)(0.4824,1)(0.4874,1)(0.4925,1)(0.4975,1)(0.5025,1)(0.5075,1)(0.5126,1)(0.5176,1)(0.5226,1)(0.5276,0.99216)(0.5327,0.98039)(0.5377,0.96471)(0.5427,0.94902)(0.5477,0.93333)(0.5528,0.91765)(0.5578,0.90588)(0.5628,0.8902)(0.5678,0.87451)(0.5729,0.85882)(0.5779,0.84314)(0.5829,0.83137)(0.5879,0.81961)(0.593,0.81176)(0.598,0.8)(0.603,0.78824)(0.608,0.77647)(0.6131,0.76471)(0.6181,0.75294)(0.6231,0.74118)(0.6281,0.72941)(0.6332,0.7098)(0.6382,0.66667)(0.6432,0.62353)(0.6482,0.58039)(0.6533,0.53725)(0.6583,0.49412)(0.6633,0.45098)(0.6683,0.40392)(0.6734,0.36078)(0.6784,0.31765)(0.6834,0.27451)(0.6884,0.24706)(0.6935,0.21961)(0.6985,0.19608)(0.7035,0.16863)(0.7085,0.1451)(0.7136,0.11765)(0.7186,0.090196)(0.7236,0.066667)(0.7286,0.039216)(0.7337,0.015686)(0.7387,0)(0.7437,0)(0.7487,0)(0.7538,0)(0.7588,0)(0.7638,0)(0.7688,0)(0.7739,0)(0.7789,0)(0.7839,0)(0.7889,0)(0.794,0.015686)(0.799,0.031373)(0.804,0.05098)(0.809,0.066667)(0.8141,0.086275)(0.8191,0.10588)(0.8241,0.12157)(0.8291,0.14118)(0.8342,0.15686)(0.8392,0.17647)(0.8442,0.2)(0.8492,0.23137)(0.8543,0.25882)(0.8593,0.2902)(0.8643,0.32157)(0.8693,0.35294)(0.8744,0.38431)(0.8794,0.41569)(0.8844,0.44314)(0.8894,0.47451)(0.8945,0.50588)(0.8995,0.52941)(0.9045,0.55294)(0.9095,0.57255)(0.9146,0.59608)(0.9196,0.61961)(0.9246,0.64314)(0.9296,0.66275)(0.9347,0.68627)(0.9397,0.7098)(0.9447,0.72941)(0.9497,0.75294)(0.9548,0.78039)(0.9598,0.80392)(0.9648,0.82745)(0.9698,0.85098)(0.9749,0.87451)(0.9799,0.90196)(0.9849,0.92549)(0.9899,0.94902)(0.995,0.97255)(1,1)
+BLUE:
+(0,0.50196)(0.005,0.45098)(0.0101,0.40392)(0.0151,0.35686)(0.0201,0.3098)(0.0251,0.25882)(0.0302,0.21176)(0.0352,0.16471)(0.0402,0.11765)(0.0452,0.070588)(0.0503,0.019608)(0.0553,0.047059)(0.0603,0.1451)(0.0653,0.23922)(0.0704,0.33333)(0.0754,0.43137)(0.0804,0.52549)(0.0854,0.61961)(0.0905,0.71765)(0.0955,0.81176)(0.1005,0.90588)(0.1055,1)(0.1106,1)(0.1156,1)(0.1206,1)(0.1256,1)(0.1307,1)(0.1357,1)(0.1407,1)(0.1457,1)(0.1508,1)(0.1558,1)(0.1608,1)(0.1658,1)(0.1709,1)(0.1759,1)(0.1809,1)(0.1859,1)(0.191,1)(0.196,1)(0.201,1)(0.206,1)(0.2111,0.99216)(0.2161,0.95686)(0.2211,0.91765)(0.2261,0.88235)(0.2312,0.84314)(0.2362,0.80392)(0.2412,0.76863)(0.2462,0.72941)(0.2513,0.6902)(0.2563,0.6549)(0.2613,0.61569)(0.2663,0.56471)(0.2714,0.5098)(0.2764,0.45098)(0.2814,0.39216)(0.2864,0.33333)(0.2915,0.27843)(0.2965,0.21961)(0.3015,0.16078)(0.3065,0.10588)(0.3116,0.047059)(0.3166,0)(0.3216,0)(0.3266,0)(0.3317,0)(0.3367,0)(0.3417,0)(0.3467,0)(0.3518,0)(0.3568,0)(0.3618,0)(0.3668,0)(0.3719,0)(0.3769,0)(0.3819,0)(0.3869,0)(0.392,0)(0.397,0)(0.402,0)(0.407,0)(0.4121,0)(0.4171,0)(0.4221,0.0039216)(0.4271,0.027451)(0.4322,0.05098)(0.4372,0.07451)(0.4422,0.094118)(0.4472,0.11765)(0.4523,0.14118)(0.4573,0.16471)(0.4623,0.18824)(0.4673,0.21176)(0.4724,0.23529)(0.4774,0.22353)(0.4824,0.2)(0.4874,0.17647)(0.4925,0.15294)(0.4975,0.12941)(0.5025,0.1098)(0.5075,0.086275)(0.5126,0.062745)(0.5176,0.039216)(0.5226,0.015686)(0.5276,0)(0.5327,0)(0.5377,0)(0.5427,0)(0.5477,0)(0.5528,0)(0.5578,0)(0.5628,0)(0.5678,0)(0.5729,0)(0.5779,0)(0.5829,0.0039216)(0.5879,0.0078431)(0.593,0.011765)(0.598,0.019608)(0.603,0.023529)(0.608,0.031373)(0.6131,0.035294)(0.6181,0.043137)(0.6231,0.047059)(0.6281,0.054902)(0.6332,0.054902)(0.6382,0.05098)(0.6432,0.043137)(0.6482,0.039216)(0.6533,0.031373)(0.6583,0.027451)(0.6633,0.019608)(0.6683,0.015686)(0.6734,0.011765)(0.6784,0.0039216)(0.6834,0)(0.6884,0)(0.6935,0)(0.6985,0)(0.7035,0)(0.7085,0)(0.7136,0)(0.7186,0)(0.7236,0)(0.7286,0)(0.7337,0)(0.7387,0.031373)(0.7437,0.12941)(0.7487,0.22353)(0.7538,0.32157)(0.7588,0.41569)(0.7638,0.5098)(0.7688,0.60784)(0.7739,0.70196)(0.7789,0.79608)(0.7839,0.89412)(0.7889,0.98824)(0.794,1)(0.799,1)(0.804,1)(0.809,1)(0.8141,1)(0.8191,1)(0.8241,1)(0.8291,1)(0.8342,1)(0.8392,1)(0.8442,0.99608)(0.8492,0.98824)(0.8543,0.98431)(0.8593,0.97647)(0.8643,0.96863)(0.8693,0.96471)(0.8744,0.95686)(0.8794,0.94902)(0.8844,0.9451)(0.8894,0.93725)(0.8945,0.93333)(0.8995,0.93333)(0.9045,0.93725)(0.9095,0.93725)(0.9146,0.94118)(0.9196,0.9451)(0.9246,0.9451)(0.9296,0.94902)(0.9347,0.95294)(0.9397,0.95294)(0.9447,0.95686)(0.9497,0.96078)(0.9548,0.96471)(0.9598,0.96863)(0.9648,0.97255)(0.9698,0.97647)(0.9749,0.98039)(0.9799,0.98431)(0.9849,0.98824)(0.9899,0.99216)(0.995,0.99608)(1,1)
diff --git a/ds9/cmaps/gist_rainbow.sao b/ds9/cmaps/gist_rainbow.sao
new file mode 100644
index 0000000..f9ed464
--- /dev/null
+++ b/ds9/cmaps/gist_rainbow.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# rainbow
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,1)(0.0042,1)(0.0084,1)(0.0126,1)(0.0167,1)(0.0209,1)(0.0251,1)(0.0293,1)(0.0335,1)(0.0377,1)(0.0418,1)(0.046,1)(0.0502,1)(0.0544,1)(0.0586,1)(0.0628,1)(0.0669,1)(0.0711,1)(0.0753,1)(0.0795,1)(0.0837,1)(0.0879,1)(0.0921,1)(0.0962,1)(0.1004,1)(0.1046,1)(0.1088,1)(0.113,1)(0.1172,1)(0.1213,1)(0.1255,1)(0.1297,1)(0.1339,1)(0.1381,1)(0.1423,1)(0.1464,1)(0.1506,1)(0.1548,1)(0.159,1)(0.1632,1)(0.1674,1)(0.1715,1)(0.1757,1)(0.1799,1)(0.1841,1)(0.1883,1)(0.1925,1)(0.1967,1)(0.2008,1)(0.205,1)(0.2092,1)(0.2134,1)(0.2176,1)(0.2218,0.96078)(0.2259,0.94118)(0.2301,0.92157)(0.2343,0.89804)(0.2385,0.87843)(0.2427,0.85882)(0.2469,0.83529)(0.251,0.81569)(0.2552,0.79216)(0.2594,0.77255)(0.2636,0.75294)(0.2678,0.72941)(0.272,0.7098)(0.2762,0.68627)(0.2803,0.66667)(0.2845,0.62353)(0.2887,0.60392)(0.2929,0.58431)(0.2971,0.56078)(0.3013,0.54118)(0.3054,0.51765)(0.3096,0.49804)(0.3138,0.47843)(0.318,0.4549)(0.3222,0.43529)(0.3264,0.41569)(0.3305,0.39216)(0.3347,0.37255)(0.3389,0.34902)(0.3431,0.32941)(0.3473,0.28627)(0.3515,0.26667)(0.3556,0.24706)(0.3598,0.22353)(0.364,0.20392)(0.3682,0.18039)(0.3724,0.16078)(0.3766,0.14118)(0.3808,0.11765)(0.3849,0.098039)(0.3891,0.07451)(0.3933,0.054902)(0.3975,0.035294)(0.4017,0.011765)(0.4059,0)(0.41,0)(0.4142,0)(0.4184,0)(0.4226,0)(0.4268,0)(0.431,0)(0.4351,0)(0.4393,0)(0.4435,0)(0.4477,0)(0.4519,0)(0.4561,0)(0.4603,0)(0.4644,0)(0.4686,0)(0.4728,0)(0.477,0)(0.4812,0)(0.4854,0)(0.4895,0)(0.4937,0)(0.4979,0)(0.5021,0)(0.5063,0)(0.5105,0)(0.5146,0)(0.5188,0)(0.523,0)(0.5272,0)(0.5314,0)(0.5356,0)(0.5397,0)(0.5439,0)(0.5481,0)(0.5523,0)(0.5565,0)(0.5607,0)(0.5649,0)(0.569,0)(0.5732,0)(0.5774,0)(0.5816,0)(0.5858,0)(0.59,0)(0.5941,0)(0.5983,0)(0.6025,0)(0.6067,0)(0.6109,0)(0.6151,0)(0.6192,0)(0.6234,0)(0.6276,0)(0.6318,0)(0.636,0)(0.6402,0)(0.6444,0)(0.6485,0)(0.6527,0)(0.6569,0)(0.6611,0)(0.6653,0)(0.6695,0)(0.6736,0)(0.6778,0)(0.682,0)(0.6862,0)(0.6904,0)(0.6946,0)(0.6987,0)(0.7029,0)(0.7071,0)(0.7113,0)(0.7155,0)(0.7197,0)(0.7238,0)(0.728,0)(0.7322,0)(0.7364,0)(0.7406,0)(0.7448,0)(0.749,0)(0.7531,0)(0.7573,0)(0.7615,0)(0.7657,0)(0.7699,0)(0.7741,0)(0.7782,0.0078431)(0.7824,0.027451)(0.7866,0.070588)(0.7908,0.094118)(0.795,0.11373)(0.7992,0.13333)(0.8033,0.15686)(0.8075,0.17647)(0.8117,0.19608)(0.8159,0.21961)(0.8201,0.23922)(0.8243,0.26275)(0.8285,0.28235)(0.8326,0.30196)(0.8368,0.32549)(0.841,0.3451)(0.8452,0.36471)(0.8494,0.40784)(0.8536,0.43137)(0.8577,0.45098)(0.8619,0.47059)(0.8661,0.49412)(0.8703,0.51373)(0.8745,0.53333)(0.8787,0.55686)(0.8828,0.57647)(0.887,0.6)(0.8912,0.61961)(0.8954,0.63922)(0.8996,0.66275)(0.9038,0.68235)(0.9079,0.70588)(0.9121,0.7451)(0.9163,0.76863)(0.9205,0.78824)(0.9247,0.80784)(0.9289,0.83137)(0.9331,0.85098)(0.9372,0.87451)(0.9414,0.89412)(0.9456,0.91373)(0.9498,0.93725)(0.954,0.95686)(0.9582,0.97647)(0.9623,1)(0.9665,1)(0.9707,1)(0.9749,1)(0.9791,1)(0.9833,1)(0.9874,1)(0.9916,1)(0.9958,1)(1,1)
+GREEN:
+(0,0)(0.0042,0)(0.0084,0)(0.0126,0)(0.0167,0)(0.0209,0)(0.0251,0)(0.0293,0)(0.0335,0.019608)(0.0377,0.043137)(0.0418,0.062745)(0.046,0.086275)(0.0502,0.10588)(0.0544,0.12549)(0.0586,0.14902)(0.0628,0.16863)(0.0669,0.18824)(0.0711,0.21176)(0.0753,0.23137)(0.0795,0.2549)(0.0837,0.27451)(0.0879,0.29412)(0.0921,0.31765)(0.0962,0.35686)(0.1004,0.38039)(0.1046,0.4)(0.1088,0.42353)(0.113,0.44314)(0.1172,0.46275)(0.1213,0.48627)(0.1255,0.50588)(0.1297,0.52941)(0.1339,0.54902)(0.1381,0.56863)(0.1423,0.59216)(0.1464,0.61176)(0.1506,0.63137)(0.1548,0.6549)(0.159,0.69804)(0.1632,0.71765)(0.1674,0.73725)(0.1715,0.76078)(0.1757,0.78039)(0.1799,0.8)(0.1841,0.82353)(0.1883,0.84314)(0.1925,0.86667)(0.1967,0.88627)(0.2008,0.90588)(0.205,0.92941)(0.2092,0.94902)(0.2134,0.96863)(0.2176,0.99216)(0.2218,1)(0.2259,1)(0.2301,1)(0.2343,1)(0.2385,1)(0.2427,1)(0.2469,1)(0.251,1)(0.2552,1)(0.2594,1)(0.2636,1)(0.2678,1)(0.272,1)(0.2762,1)(0.2803,1)(0.2845,1)(0.2887,1)(0.2929,1)(0.2971,1)(0.3013,1)(0.3054,1)(0.3096,1)(0.3138,1)(0.318,1)(0.3222,1)(0.3264,1)(0.3305,1)(0.3347,1)(0.3389,1)(0.3431,1)(0.3473,1)(0.3515,1)(0.3556,1)(0.3598,1)(0.364,1)(0.3682,1)(0.3724,1)(0.3766,1)(0.3808,1)(0.3849,1)(0.3891,1)(0.3933,1)(0.3975,1)(0.4017,1)(0.4059,1)(0.41,1)(0.4142,1)(0.4184,1)(0.4226,1)(0.4268,1)(0.431,1)(0.4351,1)(0.4393,1)(0.4435,1)(0.4477,1)(0.4519,1)(0.4561,1)(0.4603,1)(0.4644,1)(0.4686,1)(0.4728,1)(0.477,1)(0.4812,1)(0.4854,1)(0.4895,1)(0.4937,1)(0.4979,1)(0.5021,1)(0.5063,1)(0.5105,1)(0.5146,1)(0.5188,1)(0.523,1)(0.5272,1)(0.5314,1)(0.5356,1)(0.5397,1)(0.5439,1)(0.5481,1)(0.5523,1)(0.5565,1)(0.5607,1)(0.5649,1)(0.569,1)(0.5732,1)(0.5774,1)(0.5816,1)(0.5858,1)(0.59,1)(0.5941,0.98039)(0.5983,0.93725)(0.6025,0.91765)(0.6067,0.89412)(0.6109,0.87451)(0.6151,0.8549)(0.6192,0.83137)(0.6234,0.81176)(0.6276,0.78824)(0.6318,0.76863)(0.636,0.74902)(0.6402,0.72549)(0.6444,0.70588)(0.6485,0.68235)(0.6527,0.66275)(0.6569,0.64314)(0.6611,0.6)(0.6653,0.58039)(0.6695,0.55686)(0.6736,0.53725)(0.6778,0.51373)(0.682,0.49412)(0.6862,0.47451)(0.6904,0.45098)(0.6946,0.43137)(0.6987,0.41176)(0.7029,0.38824)(0.7071,0.36863)(0.7113,0.3451)(0.7155,0.32549)(0.7197,0.30588)(0.7238,0.26275)(0.728,0.24314)(0.7322,0.21961)(0.7364,0.2)(0.7406,0.17647)(0.7448,0.15686)(0.749,0.13725)(0.7531,0.11373)(0.7573,0.094118)(0.7615,0.070588)(0.7657,0.05098)(0.7699,0.031373)(0.7741,0.0078431)(0.7782,0)(0.7824,0)(0.7866,0)(0.7908,0)(0.795,0)(0.7992,0)(0.8033,0)(0.8075,0)(0.8117,0)(0.8159,0)(0.8201,0)(0.8243,0)(0.8285,0)(0.8326,0)(0.8368,0)(0.841,0)(0.8452,0)(0.8494,0)(0.8536,0)(0.8577,0)(0.8619,0)(0.8661,0)(0.8703,0)(0.8745,0)(0.8787,0)(0.8828,0)(0.887,0)(0.8912,0)(0.8954,0)(0.8996,0)(0.9038,0)(0.9079,0)(0.9121,0)(0.9163,0)(0.9205,0)(0.9247,0)(0.9289,0)(0.9331,0)(0.9372,0)(0.9414,0)(0.9456,0)(0.9498,0)(0.954,0)(0.9582,0)(0.9623,0)(0.9665,0)(0.9707,0)(0.9749,0)(0.9791,0)(0.9833,0)(0.9874,0)(0.9916,0)(0.9958,0)(1,0)
+BLUE:
+(0,0.16471)(0.0042,0.14118)(0.0084,0.12157)(0.0126,0.10196)(0.0167,0.078431)(0.0209,0.058824)(0.0251,0.039216)(0.0293,0.015686)(0.0335,0)(0.0377,0)(0.0418,0)(0.046,0)(0.0502,0)(0.0544,0)(0.0586,0)(0.0628,0)(0.0669,0)(0.0711,0)(0.0753,0)(0.0795,0)(0.0837,0)(0.0879,0)(0.0921,0)(0.0962,0)(0.1004,0)(0.1046,0)(0.1088,0)(0.113,0)(0.1172,0)(0.1213,0)(0.1255,0)(0.1297,0)(0.1339,0)(0.1381,0)(0.1423,0)(0.1464,0)(0.1506,0)(0.1548,0)(0.159,0)(0.1632,0)(0.1674,0)(0.1715,0)(0.1757,0)(0.1799,0)(0.1841,0)(0.1883,0)(0.1925,0)(0.1967,0)(0.2008,0)(0.205,0)(0.2092,0)(0.2134,0)(0.2176,0)(0.2218,0)(0.2259,0)(0.2301,0)(0.2343,0)(0.2385,0)(0.2427,0)(0.2469,0)(0.251,0)(0.2552,0)(0.2594,0)(0.2636,0)(0.2678,0)(0.272,0)(0.2762,0)(0.2803,0)(0.2845,0)(0.2887,0)(0.2929,0)(0.2971,0)(0.3013,0)(0.3054,0)(0.3096,0)(0.3138,0)(0.318,0)(0.3222,0)(0.3264,0)(0.3305,0)(0.3347,0)(0.3389,0)(0.3431,0)(0.3473,0)(0.3515,0)(0.3556,0)(0.3598,0)(0.364,0)(0.3682,0)(0.3724,0)(0.3766,0)(0.3808,0)(0.3849,0)(0.3891,0)(0.3933,0)(0.3975,0)(0.4017,0)(0.4059,0.0039216)(0.41,0.047059)(0.4142,0.066667)(0.4184,0.090196)(0.4226,0.1098)(0.4268,0.12941)(0.431,0.15294)(0.4351,0.17255)(0.4393,0.19216)(0.4435,0.21569)(0.4477,0.23529)(0.4519,0.25882)(0.4561,0.27843)(0.4603,0.29804)(0.4644,0.32157)(0.4686,0.34118)(0.4728,0.38431)(0.477,0.40392)(0.4812,0.42745)(0.4854,0.44706)(0.4895,0.46667)(0.4937,0.4902)(0.4979,0.5098)(0.5021,0.52941)(0.5063,0.55294)(0.5105,0.57255)(0.5146,0.59608)(0.5188,0.61569)(0.523,0.63529)(0.5272,0.65882)(0.5314,0.67843)(0.5356,0.72157)(0.5397,0.74118)(0.5439,0.76471)(0.5481,0.78431)(0.5523,0.80392)(0.5565,0.82745)(0.5607,0.84706)(0.5649,0.87059)(0.569,0.8902)(0.5732,0.9098)(0.5774,0.93333)(0.5816,0.95294)(0.5858,0.97255)(0.59,0.99608)(0.5941,1)(0.5983,1)(0.6025,1)(0.6067,1)(0.6109,1)(0.6151,1)(0.6192,1)(0.6234,1)(0.6276,1)(0.6318,1)(0.636,1)(0.6402,1)(0.6444,1)(0.6485,1)(0.6527,1)(0.6569,1)(0.6611,1)(0.6653,1)(0.6695,1)(0.6736,1)(0.6778,1)(0.682,1)(0.6862,1)(0.6904,1)(0.6946,1)(0.6987,1)(0.7029,1)(0.7071,1)(0.7113,1)(0.7155,1)(0.7197,1)(0.7238,1)(0.728,1)(0.7322,1)(0.7364,1)(0.7406,1)(0.7448,1)(0.749,1)(0.7531,1)(0.7573,1)(0.7615,1)(0.7657,1)(0.7699,1)(0.7741,1)(0.7782,1)(0.7824,1)(0.7866,1)(0.7908,1)(0.795,1)(0.7992,1)(0.8033,1)(0.8075,1)(0.8117,1)(0.8159,1)(0.8201,1)(0.8243,1)(0.8285,1)(0.8326,1)(0.8368,1)(0.841,1)(0.8452,1)(0.8494,1)(0.8536,1)(0.8577,1)(0.8619,1)(0.8661,1)(0.8703,1)(0.8745,1)(0.8787,1)(0.8828,1)(0.887,1)(0.8912,1)(0.8954,1)(0.8996,1)(0.9038,1)(0.9079,1)(0.9121,1)(0.9163,1)(0.9205,1)(0.9247,1)(0.9289,1)(0.9331,1)(0.9372,1)(0.9414,1)(0.9456,1)(0.9498,1)(0.954,1)(0.9582,1)(0.9623,0.99608)(0.9665,0.97647)(0.9707,0.95294)(0.9749,0.91373)(0.9791,0.8902)(0.9833,0.87059)(0.9874,0.85098)(0.9916,0.82745)(0.9958,0.80784)(1,0.78824)
diff --git a/ds9/cmaps/gist_stern.sao b/ds9/cmaps/gist_stern.sao
new file mode 100644
index 0000000..5d90e1a
--- /dev/null
+++ b/ds9/cmaps/gist_stern.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# stern
+# created by cptutils 1.46
+# Wed Aug 15 23:30:59 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0042,0.070588)(0.0084,0.14118)(0.0126,0.21176)(0.0167,0.28235)(0.0209,0.35294)(0.0251,0.42353)(0.0293,0.49804)(0.0335,0.56863)(0.0377,0.63922)(0.0418,0.78039)(0.046,0.85098)(0.0502,0.92157)(0.0544,0.99608)(0.0586,0.97647)(0.0628,0.95686)(0.0669,0.93725)(0.0711,0.91765)(0.0753,0.89804)(0.0795,0.87451)(0.0837,0.8549)(0.0879,0.83529)(0.0921,0.81569)(0.0962,0.79608)(0.1004,0.77255)(0.1046,0.75294)(0.1088,0.73333)(0.113,0.71373)(0.1172,0.69412)(0.1213,0.67451)(0.1255,0.63137)(0.1297,0.61176)(0.1339,0.59216)(0.1381,0.57255)(0.1423,0.54902)(0.1464,0.52941)(0.1506,0.5098)(0.1548,0.4902)(0.159,0.47059)(0.1632,0.45098)(0.1674,0.42745)(0.1715,0.40784)(0.1757,0.38824)(0.1799,0.36863)(0.1841,0.34902)(0.1883,0.32549)(0.1925,0.30588)(0.1967,0.28627)(0.2008,0.26667)(0.205,0.24706)(0.2092,0.20392)(0.2134,0.18431)(0.2176,0.16471)(0.2218,0.1451)(0.2259,0.12549)(0.2301,0.10196)(0.2343,0.082353)(0.2385,0.062745)(0.2427,0.043137)(0.2469,0.023529)(0.251,0.25098)(0.2552,0.2549)(0.2594,0.25882)(0.2636,0.26275)(0.2678,0.26667)(0.272,0.27059)(0.2762,0.27451)(0.2803,0.27843)(0.2845,0.28235)(0.2887,0.28627)(0.2929,0.29412)(0.2971,0.29804)(0.3013,0.30196)(0.3054,0.30588)(0.3096,0.3098)(0.3138,0.31373)(0.318,0.31765)(0.3222,0.32157)(0.3264,0.32549)(0.3305,0.32941)(0.3347,0.33333)(0.3389,0.33725)(0.3431,0.34118)(0.3473,0.3451)(0.3515,0.34902)(0.3556,0.35294)(0.3598,0.35686)(0.364,0.36078)(0.3682,0.36471)(0.3724,0.36863)(0.3766,0.37647)(0.3808,0.38039)(0.3849,0.38431)(0.3891,0.38824)(0.3933,0.39216)(0.3975,0.39608)(0.4017,0.4)(0.4059,0.40392)(0.41,0.40784)(0.4142,0.41176)(0.4184,0.41569)(0.4226,0.41961)(0.4268,0.42353)(0.431,0.42745)(0.4351,0.43137)(0.4393,0.43529)(0.4435,0.43922)(0.4477,0.44314)(0.4519,0.44706)(0.4561,0.45098)(0.4603,0.45882)(0.4644,0.46275)(0.4686,0.46667)(0.4728,0.47059)(0.477,0.47451)(0.4812,0.47843)(0.4854,0.48235)(0.4895,0.48627)(0.4937,0.4902)(0.4979,0.49412)(0.5021,0.50196)(0.5063,0.50588)(0.5105,0.5098)(0.5146,0.51373)(0.5188,0.51765)(0.523,0.52157)(0.5272,0.52549)(0.5314,0.52941)(0.5356,0.53333)(0.5397,0.53725)(0.5439,0.5451)(0.5481,0.54902)(0.5523,0.55294)(0.5565,0.55686)(0.5607,0.56078)(0.5649,0.56471)(0.569,0.56863)(0.5732,0.57255)(0.5774,0.57647)(0.5816,0.58039)(0.5858,0.58431)(0.59,0.58824)(0.5941,0.59216)(0.5983,0.59608)(0.6025,0.6)(0.6067,0.60392)(0.6109,0.60784)(0.6151,0.61176)(0.6192,0.61569)(0.6234,0.61961)(0.6276,0.62745)(0.6318,0.63137)(0.636,0.63529)(0.6402,0.63922)(0.6444,0.64314)(0.6485,0.64706)(0.6527,0.65098)(0.6569,0.6549)(0.6611,0.65882)(0.6653,0.66275)(0.6695,0.66667)(0.6736,0.67059)(0.6778,0.67451)(0.682,0.67843)(0.6862,0.68235)(0.6904,0.68627)(0.6946,0.6902)(0.6987,0.69412)(0.7029,0.69804)(0.7071,0.70196)(0.7113,0.7098)(0.7155,0.71373)(0.7197,0.71765)(0.7238,0.72157)(0.728,0.72549)(0.7322,0.72941)(0.7364,0.73333)(0.7406,0.73725)(0.7448,0.74118)(0.749,0.7451)(0.7531,0.75294)(0.7573,0.75686)(0.7615,0.76078)(0.7657,0.76471)(0.7699,0.76863)(0.7741,0.77255)(0.7782,0.77647)(0.7824,0.78039)(0.7866,0.78431)(0.7908,0.78824)(0.795,0.79608)(0.7992,0.8)(0.8033,0.80392)(0.8075,0.80784)(0.8117,0.81176)(0.8159,0.81569)(0.8201,0.81961)(0.8243,0.82353)(0.8285,0.82745)(0.8326,0.83137)(0.8368,0.83529)(0.841,0.83922)(0.8452,0.84314)(0.8494,0.84706)(0.8536,0.85098)(0.8577,0.8549)(0.8619,0.85882)(0.8661,0.86275)(0.8703,0.86667)(0.8745,0.87059)(0.8787,0.87843)(0.8828,0.88235)(0.887,0.88627)(0.8912,0.8902)(0.8954,0.89412)(0.8996,0.89804)(0.9038,0.90196)(0.9079,0.90588)(0.9121,0.9098)(0.9163,0.91373)(0.9205,0.91765)(0.9247,0.92157)(0.9289,0.92549)(0.9331,0.92941)(0.9372,0.93333)(0.9414,0.93725)(0.9456,0.94118)(0.9498,0.9451)(0.954,0.94902)(0.9582,0.95294)(0.9623,0.96078)(0.9665,0.96471)(0.9707,0.96863)(0.9749,0.97255)(0.9791,0.97647)(0.9833,0.98039)(0.9874,0.98431)(0.9916,0.98824)(0.9958,0.99216)(1,0.99608)
+GREEN:
+(0,0)(0.0042,0.0039216)(0.0084,0.0078431)(0.0126,0.011765)(0.0167,0.015686)(0.0209,0.019608)(0.0251,0.023529)(0.0293,0.027451)(0.0335,0.031373)(0.0377,0.035294)(0.0418,0.043137)(0.046,0.047059)(0.0502,0.05098)(0.0544,0.054902)(0.0586,0.058824)(0.0628,0.062745)(0.0669,0.066667)(0.0711,0.070588)(0.0753,0.07451)(0.0795,0.078431)(0.0837,0.082353)(0.0879,0.086275)(0.0921,0.090196)(0.0962,0.094118)(0.1004,0.098039)(0.1046,0.10196)(0.1088,0.10588)(0.113,0.1098)(0.1172,0.11373)(0.1213,0.11765)(0.1255,0.12549)(0.1297,0.12941)(0.1339,0.13333)(0.1381,0.13725)(0.1423,0.14118)(0.1464,0.1451)(0.1506,0.14902)(0.1548,0.15294)(0.159,0.15686)(0.1632,0.16078)(0.1674,0.16471)(0.1715,0.16863)(0.1757,0.17255)(0.1799,0.17647)(0.1841,0.18039)(0.1883,0.18431)(0.1925,0.18824)(0.1967,0.19216)(0.2008,0.19608)(0.205,0.2)(0.2092,0.20784)(0.2134,0.21176)(0.2176,0.21569)(0.2218,0.21961)(0.2259,0.22353)(0.2301,0.22745)(0.2343,0.23137)(0.2385,0.23529)(0.2427,0.23922)(0.2469,0.24314)(0.251,0.25098)(0.2552,0.2549)(0.2594,0.25882)(0.2636,0.26275)(0.2678,0.26667)(0.272,0.27059)(0.2762,0.27451)(0.2803,0.27843)(0.2845,0.28235)(0.2887,0.28627)(0.2929,0.29412)(0.2971,0.29804)(0.3013,0.30196)(0.3054,0.30588)(0.3096,0.3098)(0.3138,0.31373)(0.318,0.31765)(0.3222,0.32157)(0.3264,0.32549)(0.3305,0.32941)(0.3347,0.33333)(0.3389,0.33725)(0.3431,0.34118)(0.3473,0.3451)(0.3515,0.34902)(0.3556,0.35294)(0.3598,0.35686)(0.364,0.36078)(0.3682,0.36471)(0.3724,0.36863)(0.3766,0.37647)(0.3808,0.38039)(0.3849,0.38431)(0.3891,0.38824)(0.3933,0.39216)(0.3975,0.39608)(0.4017,0.4)(0.4059,0.40392)(0.41,0.40784)(0.4142,0.41176)(0.4184,0.41569)(0.4226,0.41961)(0.4268,0.42353)(0.431,0.42745)(0.4351,0.43137)(0.4393,0.43529)(0.4435,0.43922)(0.4477,0.44314)(0.4519,0.44706)(0.4561,0.45098)(0.4603,0.45882)(0.4644,0.46275)(0.4686,0.46667)(0.4728,0.47059)(0.477,0.47451)(0.4812,0.47843)(0.4854,0.48235)(0.4895,0.48627)(0.4937,0.4902)(0.4979,0.49412)(0.5021,0.50196)(0.5063,0.50588)(0.5105,0.5098)(0.5146,0.51373)(0.5188,0.51765)(0.523,0.52157)(0.5272,0.52549)(0.5314,0.52941)(0.5356,0.53333)(0.5397,0.53725)(0.5439,0.5451)(0.5481,0.54902)(0.5523,0.55294)(0.5565,0.55686)(0.5607,0.56078)(0.5649,0.56471)(0.569,0.56863)(0.5732,0.57255)(0.5774,0.57647)(0.5816,0.58039)(0.5858,0.58431)(0.59,0.58824)(0.5941,0.59216)(0.5983,0.59608)(0.6025,0.6)(0.6067,0.60392)(0.6109,0.60784)(0.6151,0.61176)(0.6192,0.61569)(0.6234,0.61961)(0.6276,0.62745)(0.6318,0.63137)(0.636,0.63529)(0.6402,0.63922)(0.6444,0.64314)(0.6485,0.64706)(0.6527,0.65098)(0.6569,0.6549)(0.6611,0.65882)(0.6653,0.66275)(0.6695,0.66667)(0.6736,0.67059)(0.6778,0.67451)(0.682,0.67843)(0.6862,0.68235)(0.6904,0.68627)(0.6946,0.6902)(0.6987,0.69412)(0.7029,0.69804)(0.7071,0.70196)(0.7113,0.7098)(0.7155,0.71373)(0.7197,0.71765)(0.7238,0.72157)(0.728,0.72549)(0.7322,0.72941)(0.7364,0.73333)(0.7406,0.73725)(0.7448,0.74118)(0.749,0.7451)(0.7531,0.75294)(0.7573,0.75686)(0.7615,0.76078)(0.7657,0.76471)(0.7699,0.76863)(0.7741,0.77255)(0.7782,0.77647)(0.7824,0.78039)(0.7866,0.78431)(0.7908,0.78824)(0.795,0.79608)(0.7992,0.8)(0.8033,0.80392)(0.8075,0.80784)(0.8117,0.81176)(0.8159,0.81569)(0.8201,0.81961)(0.8243,0.82353)(0.8285,0.82745)(0.8326,0.83137)(0.8368,0.83529)(0.841,0.83922)(0.8452,0.84314)(0.8494,0.84706)(0.8536,0.85098)(0.8577,0.8549)(0.8619,0.85882)(0.8661,0.86275)(0.8703,0.86667)(0.8745,0.87059)(0.8787,0.87843)(0.8828,0.88235)(0.887,0.88627)(0.8912,0.8902)(0.8954,0.89412)(0.8996,0.89804)(0.9038,0.90196)(0.9079,0.90588)(0.9121,0.9098)(0.9163,0.91373)(0.9205,0.91765)(0.9247,0.92157)(0.9289,0.92549)(0.9331,0.92941)(0.9372,0.93333)(0.9414,0.93725)(0.9456,0.94118)(0.9498,0.9451)(0.954,0.94902)(0.9582,0.95294)(0.9623,0.96078)(0.9665,0.96471)(0.9707,0.96863)(0.9749,0.97255)(0.9791,0.97647)(0.9833,0.98039)(0.9874,0.98431)(0.9916,0.98824)(0.9958,0.99216)(1,0.99608)
+BLUE:
+(0,0)(0.0042,0.0039216)(0.0084,0.011765)(0.0126,0.019608)(0.0167,0.027451)(0.0209,0.035294)(0.0251,0.043137)(0.0293,0.05098)(0.0335,0.058824)(0.0377,0.066667)(0.0418,0.082353)(0.046,0.090196)(0.0502,0.098039)(0.0544,0.10588)(0.0586,0.11373)(0.0628,0.12157)(0.0669,0.12941)(0.0711,0.13725)(0.0753,0.1451)(0.0795,0.15294)(0.0837,0.16078)(0.0879,0.16863)(0.0921,0.17647)(0.0962,0.18431)(0.1004,0.19216)(0.1046,0.2)(0.1088,0.20784)(0.113,0.21569)(0.1172,0.22353)(0.1213,0.23137)(0.1255,0.24706)(0.1297,0.2549)(0.1339,0.26275)(0.1381,0.27059)(0.1423,0.27843)(0.1464,0.28627)(0.1506,0.29412)(0.1548,0.30196)(0.159,0.3098)(0.1632,0.31765)(0.1674,0.32549)(0.1715,0.33333)(0.1757,0.34118)(0.1799,0.34902)(0.1841,0.35686)(0.1883,0.36471)(0.1925,0.37255)(0.1967,0.38039)(0.2008,0.38824)(0.205,0.39608)(0.2092,0.41176)(0.2134,0.41961)(0.2176,0.42745)(0.2218,0.43529)(0.2259,0.44314)(0.2301,0.45098)(0.2343,0.45882)(0.2385,0.46667)(0.2427,0.47451)(0.2469,0.48235)(0.251,0.49804)(0.2552,0.50588)(0.2594,0.51373)(0.2636,0.52157)(0.2678,0.52941)(0.272,0.53725)(0.2762,0.5451)(0.2803,0.55294)(0.2845,0.56078)(0.2887,0.56863)(0.2929,0.58431)(0.2971,0.59216)(0.3013,0.6)(0.3054,0.60784)(0.3096,0.61569)(0.3138,0.62353)(0.318,0.63137)(0.3222,0.63922)(0.3264,0.64706)(0.3305,0.6549)(0.3347,0.66275)(0.3389,0.67059)(0.3431,0.67843)(0.3473,0.68627)(0.3515,0.69412)(0.3556,0.70196)(0.3598,0.7098)(0.364,0.71765)(0.3682,0.72549)(0.3724,0.73333)(0.3766,0.74902)(0.3808,0.75686)(0.3849,0.76471)(0.3891,0.77255)(0.3933,0.78039)(0.3975,0.78824)(0.4017,0.79608)(0.4059,0.80392)(0.41,0.81176)(0.4142,0.81961)(0.4184,0.82745)(0.4226,0.83529)(0.4268,0.84314)(0.431,0.85098)(0.4351,0.85882)(0.4393,0.86667)(0.4435,0.87451)(0.4477,0.88235)(0.4519,0.8902)(0.4561,0.89804)(0.4603,0.91373)(0.4644,0.92157)(0.4686,0.92941)(0.4728,0.93725)(0.477,0.9451)(0.4812,0.95294)(0.4854,0.96078)(0.4895,0.96863)(0.4937,0.97647)(0.4979,0.98431)(0.5021,1)(0.5063,0.98431)(0.5105,0.96863)(0.5146,0.95294)(0.5188,0.93333)(0.523,0.91765)(0.5272,0.90196)(0.5314,0.88627)(0.5356,0.86667)(0.5397,0.85098)(0.5439,0.81961)(0.5481,0.8)(0.5523,0.78431)(0.5565,0.76863)(0.5607,0.75294)(0.5649,0.73333)(0.569,0.71765)(0.5732,0.70196)(0.5774,0.68627)(0.5816,0.66667)(0.5858,0.65098)(0.59,0.63529)(0.5941,0.61961)(0.5983,0.6)(0.6025,0.58431)(0.6067,0.56863)(0.6109,0.55294)(0.6151,0.53333)(0.6192,0.51765)(0.6234,0.50196)(0.6276,0.46667)(0.6318,0.45098)(0.636,0.43529)(0.6402,0.41961)(0.6444,0.4)(0.6485,0.38431)(0.6527,0.36863)(0.6569,0.35294)(0.6611,0.33333)(0.6653,0.31765)(0.6695,0.30196)(0.6736,0.28627)(0.6778,0.26667)(0.682,0.25098)(0.6862,0.23529)(0.6904,0.21961)(0.6946,0.2)(0.6987,0.18431)(0.7029,0.16863)(0.7071,0.15294)(0.7113,0.11765)(0.7155,0.10196)(0.7197,0.086275)(0.7238,0.066667)(0.728,0.05098)(0.7322,0.035294)(0.7364,0.019608)(0.7406,0)(0.7448,0.011765)(0.749,0.027451)(0.7531,0.058824)(0.7573,0.07451)(0.7615,0.086275)(0.7657,0.10196)(0.7699,0.11765)(0.7741,0.13333)(0.7782,0.14902)(0.7824,0.16078)(0.7866,0.17647)(0.7908,0.19216)(0.795,0.22353)(0.7992,0.23529)(0.8033,0.25098)(0.8075,0.26667)(0.8117,0.28235)(0.8159,0.29804)(0.8201,0.3098)(0.8243,0.32549)(0.8285,0.34118)(0.8326,0.35686)(0.8368,0.37255)(0.841,0.38431)(0.8452,0.4)(0.8494,0.41569)(0.8536,0.43137)(0.8577,0.44706)(0.8619,0.45882)(0.8661,0.47451)(0.8703,0.4902)(0.8745,0.50588)(0.8787,0.53725)(0.8828,0.54902)(0.887,0.56471)(0.8912,0.58039)(0.8954,0.59608)(0.8996,0.61176)(0.9038,0.62353)(0.9079,0.63922)(0.9121,0.6549)(0.9163,0.67059)(0.9205,0.68627)(0.9247,0.69804)(0.9289,0.71373)(0.9331,0.72941)(0.9372,0.7451)(0.9414,0.76078)(0.9456,0.77255)(0.9498,0.78824)(0.954,0.80392)(0.9582,0.81961)(0.9623,0.84706)(0.9665,0.86275)(0.9707,0.87843)(0.9749,0.89412)(0.9791,0.9098)(0.9833,0.92157)(0.9874,0.93725)(0.9916,0.95294)(0.9958,0.96863)(1,0.98431)
diff --git a/ds9/cmaps/gist_yarg.sao b/ds9/cmaps/gist_yarg.sao
new file mode 100644
index 0000000..d71d033
--- /dev/null
+++ b/ds9/cmaps/gist_yarg.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# yarg
+# created by cptutils 1.46
+# Wed Aug 15 23:30:58 2012
+PSEUDOCOLOR
+RED:
+(0,1)(0.0042,0.99608)(0.0084,0.99216)(0.0126,0.98824)(0.0167,0.98431)(0.0209,0.98039)(0.0251,0.97647)(0.0293,0.97255)(0.0335,0.96471)(0.0377,0.96078)(0.0418,0.95686)(0.046,0.95294)(0.0502,0.94902)(0.0544,0.9451)(0.0586,0.94118)(0.0628,0.93725)(0.0669,0.93333)(0.0711,0.92941)(0.0753,0.92549)(0.0795,0.92157)(0.0837,0.91765)(0.0879,0.91373)(0.0921,0.9098)(0.0962,0.90196)(0.1004,0.89804)(0.1046,0.89412)(0.1088,0.8902)(0.113,0.88627)(0.1172,0.88235)(0.1213,0.87843)(0.1255,0.87451)(0.1297,0.87059)(0.1339,0.86667)(0.1381,0.86275)(0.1423,0.85882)(0.1464,0.8549)(0.1506,0.85098)(0.1548,0.84706)(0.159,0.83922)(0.1632,0.83529)(0.1674,0.83137)(0.1715,0.82745)(0.1757,0.82353)(0.1799,0.81961)(0.1841,0.81569)(0.1883,0.81176)(0.1925,0.80784)(0.1967,0.80392)(0.2008,0.8)(0.205,0.79608)(0.2092,0.79216)(0.2134,0.78824)(0.2176,0.78431)(0.2218,0.77647)(0.2259,0.77255)(0.2301,0.76863)(0.2343,0.76471)(0.2385,0.76078)(0.2427,0.75686)(0.2469,0.75294)(0.251,0.74902)(0.2552,0.7451)(0.2594,0.74118)(0.2636,0.73725)(0.2678,0.73333)(0.272,0.72941)(0.2762,0.72549)(0.2803,0.72157)(0.2845,0.71373)(0.2887,0.7098)(0.2929,0.70588)(0.2971,0.70196)(0.3013,0.69804)(0.3054,0.69412)(0.3096,0.6902)(0.3138,0.68627)(0.318,0.68235)(0.3222,0.67843)(0.3264,0.67451)(0.3305,0.67059)(0.3347,0.66667)(0.3389,0.66275)(0.3431,0.65882)(0.3473,0.65098)(0.3515,0.64706)(0.3556,0.64314)(0.3598,0.63922)(0.364,0.63529)(0.3682,0.63137)(0.3724,0.62745)(0.3766,0.62353)(0.3808,0.61961)(0.3849,0.61569)(0.3891,0.61176)(0.3933,0.60784)(0.3975,0.60392)(0.4017,0.6)(0.4059,0.59608)(0.41,0.58824)(0.4142,0.58431)(0.4184,0.58039)(0.4226,0.57647)(0.4268,0.57255)(0.431,0.56863)(0.4351,0.56471)(0.4393,0.56078)(0.4435,0.55686)(0.4477,0.55294)(0.4519,0.54902)(0.4561,0.5451)(0.4603,0.54118)(0.4644,0.53725)(0.4686,0.53333)(0.4728,0.52549)(0.477,0.52157)(0.4812,0.51765)(0.4854,0.51373)(0.4895,0.5098)(0.4937,0.50588)(0.4979,0.50196)(0.5021,0.49804)(0.5063,0.49412)(0.5105,0.4902)(0.5146,0.48627)(0.5188,0.48235)(0.523,0.47843)(0.5272,0.47451)(0.5314,0.47059)(0.5356,0.46275)(0.5397,0.45882)(0.5439,0.4549)(0.5481,0.45098)(0.5523,0.44706)(0.5565,0.44314)(0.5607,0.43922)(0.5649,0.43529)(0.569,0.43137)(0.5732,0.42745)(0.5774,0.42353)(0.5816,0.41961)(0.5858,0.41569)(0.59,0.41176)(0.5941,0.40784)(0.5983,0.4)(0.6025,0.39608)(0.6067,0.39216)(0.6109,0.38824)(0.6151,0.38431)(0.6192,0.38039)(0.6234,0.37647)(0.6276,0.37255)(0.6318,0.36863)(0.636,0.36471)(0.6402,0.36078)(0.6444,0.35686)(0.6485,0.35294)(0.6527,0.34902)(0.6569,0.3451)(0.6611,0.33725)(0.6653,0.33333)(0.6695,0.32941)(0.6736,0.32549)(0.6778,0.32157)(0.682,0.31765)(0.6862,0.31373)(0.6904,0.3098)(0.6946,0.30588)(0.6987,0.30196)(0.7029,0.29804)(0.7071,0.29412)(0.7113,0.2902)(0.7155,0.28627)(0.7197,0.28235)(0.7238,0.27451)(0.728,0.27059)(0.7322,0.26667)(0.7364,0.26275)(0.7406,0.25882)(0.7448,0.2549)(0.749,0.25098)(0.7531,0.24706)(0.7573,0.24314)(0.7615,0.23922)(0.7657,0.23529)(0.7699,0.23137)(0.7741,0.22745)(0.7782,0.22353)(0.7824,0.21961)(0.7866,0.21176)(0.7908,0.20784)(0.795,0.20392)(0.7992,0.2)(0.8033,0.19608)(0.8075,0.19216)(0.8117,0.18824)(0.8159,0.18431)(0.8201,0.18039)(0.8243,0.17647)(0.8285,0.17255)(0.8326,0.16863)(0.8368,0.16471)(0.841,0.16078)(0.8452,0.15686)(0.8494,0.14902)(0.8536,0.1451)(0.8577,0.14118)(0.8619,0.13725)(0.8661,0.13333)(0.8703,0.12941)(0.8745,0.12549)(0.8787,0.12157)(0.8828,0.11765)(0.887,0.11373)(0.8912,0.1098)(0.8954,0.10588)(0.8996,0.10196)(0.9038,0.098039)(0.9079,0.094118)(0.9121,0.086275)(0.9163,0.082353)(0.9205,0.078431)(0.9247,0.07451)(0.9289,0.070588)(0.9331,0.066667)(0.9372,0.062745)(0.9414,0.058824)(0.9456,0.054902)(0.9498,0.05098)(0.954,0.047059)(0.9582,0.043137)(0.9623,0.039216)(0.9665,0.035294)(0.9707,0.031373)(0.9749,0.023529)(0.9791,0.019608)(0.9833,0.015686)(0.9874,0.011765)(0.9916,0.0078431)(0.9958,0.0039216)(1,0)
+GREEN:
+(0,1)(0.0042,0.99608)(0.0084,0.99216)(0.0126,0.98824)(0.0167,0.98431)(0.0209,0.98039)(0.0251,0.97647)(0.0293,0.97255)(0.0335,0.96471)(0.0377,0.96078)(0.0418,0.95686)(0.046,0.95294)(0.0502,0.94902)(0.0544,0.9451)(0.0586,0.94118)(0.0628,0.93725)(0.0669,0.93333)(0.0711,0.92941)(0.0753,0.92549)(0.0795,0.92157)(0.0837,0.91765)(0.0879,0.91373)(0.0921,0.9098)(0.0962,0.90196)(0.1004,0.89804)(0.1046,0.89412)(0.1088,0.8902)(0.113,0.88627)(0.1172,0.88235)(0.1213,0.87843)(0.1255,0.87451)(0.1297,0.87059)(0.1339,0.86667)(0.1381,0.86275)(0.1423,0.85882)(0.1464,0.8549)(0.1506,0.85098)(0.1548,0.84706)(0.159,0.83922)(0.1632,0.83529)(0.1674,0.83137)(0.1715,0.82745)(0.1757,0.82353)(0.1799,0.81961)(0.1841,0.81569)(0.1883,0.81176)(0.1925,0.80784)(0.1967,0.80392)(0.2008,0.8)(0.205,0.79608)(0.2092,0.79216)(0.2134,0.78824)(0.2176,0.78431)(0.2218,0.77647)(0.2259,0.77255)(0.2301,0.76863)(0.2343,0.76471)(0.2385,0.76078)(0.2427,0.75686)(0.2469,0.75294)(0.251,0.74902)(0.2552,0.7451)(0.2594,0.74118)(0.2636,0.73725)(0.2678,0.73333)(0.272,0.72941)(0.2762,0.72549)(0.2803,0.72157)(0.2845,0.71373)(0.2887,0.7098)(0.2929,0.70588)(0.2971,0.70196)(0.3013,0.69804)(0.3054,0.69412)(0.3096,0.6902)(0.3138,0.68627)(0.318,0.68235)(0.3222,0.67843)(0.3264,0.67451)(0.3305,0.67059)(0.3347,0.66667)(0.3389,0.66275)(0.3431,0.65882)(0.3473,0.65098)(0.3515,0.64706)(0.3556,0.64314)(0.3598,0.63922)(0.364,0.63529)(0.3682,0.63137)(0.3724,0.62745)(0.3766,0.62353)(0.3808,0.61961)(0.3849,0.61569)(0.3891,0.61176)(0.3933,0.60784)(0.3975,0.60392)(0.4017,0.6)(0.4059,0.59608)(0.41,0.58824)(0.4142,0.58431)(0.4184,0.58039)(0.4226,0.57647)(0.4268,0.57255)(0.431,0.56863)(0.4351,0.56471)(0.4393,0.56078)(0.4435,0.55686)(0.4477,0.55294)(0.4519,0.54902)(0.4561,0.5451)(0.4603,0.54118)(0.4644,0.53725)(0.4686,0.53333)(0.4728,0.52549)(0.477,0.52157)(0.4812,0.51765)(0.4854,0.51373)(0.4895,0.5098)(0.4937,0.50588)(0.4979,0.50196)(0.5021,0.49804)(0.5063,0.49412)(0.5105,0.4902)(0.5146,0.48627)(0.5188,0.48235)(0.523,0.47843)(0.5272,0.47451)(0.5314,0.47059)(0.5356,0.46275)(0.5397,0.45882)(0.5439,0.4549)(0.5481,0.45098)(0.5523,0.44706)(0.5565,0.44314)(0.5607,0.43922)(0.5649,0.43529)(0.569,0.43137)(0.5732,0.42745)(0.5774,0.42353)(0.5816,0.41961)(0.5858,0.41569)(0.59,0.41176)(0.5941,0.40784)(0.5983,0.4)(0.6025,0.39608)(0.6067,0.39216)(0.6109,0.38824)(0.6151,0.38431)(0.6192,0.38039)(0.6234,0.37647)(0.6276,0.37255)(0.6318,0.36863)(0.636,0.36471)(0.6402,0.36078)(0.6444,0.35686)(0.6485,0.35294)(0.6527,0.34902)(0.6569,0.3451)(0.6611,0.33725)(0.6653,0.33333)(0.6695,0.32941)(0.6736,0.32549)(0.6778,0.32157)(0.682,0.31765)(0.6862,0.31373)(0.6904,0.3098)(0.6946,0.30588)(0.6987,0.30196)(0.7029,0.29804)(0.7071,0.29412)(0.7113,0.2902)(0.7155,0.28627)(0.7197,0.28235)(0.7238,0.27451)(0.728,0.27059)(0.7322,0.26667)(0.7364,0.26275)(0.7406,0.25882)(0.7448,0.2549)(0.749,0.25098)(0.7531,0.24706)(0.7573,0.24314)(0.7615,0.23922)(0.7657,0.23529)(0.7699,0.23137)(0.7741,0.22745)(0.7782,0.22353)(0.7824,0.21961)(0.7866,0.21176)(0.7908,0.20784)(0.795,0.20392)(0.7992,0.2)(0.8033,0.19608)(0.8075,0.19216)(0.8117,0.18824)(0.8159,0.18431)(0.8201,0.18039)(0.8243,0.17647)(0.8285,0.17255)(0.8326,0.16863)(0.8368,0.16471)(0.841,0.16078)(0.8452,0.15686)(0.8494,0.14902)(0.8536,0.1451)(0.8577,0.14118)(0.8619,0.13725)(0.8661,0.13333)(0.8703,0.12941)(0.8745,0.12549)(0.8787,0.12157)(0.8828,0.11765)(0.887,0.11373)(0.8912,0.1098)(0.8954,0.10588)(0.8996,0.10196)(0.9038,0.098039)(0.9079,0.094118)(0.9121,0.086275)(0.9163,0.082353)(0.9205,0.078431)(0.9247,0.07451)(0.9289,0.070588)(0.9331,0.066667)(0.9372,0.062745)(0.9414,0.058824)(0.9456,0.054902)(0.9498,0.05098)(0.954,0.047059)(0.9582,0.043137)(0.9623,0.039216)(0.9665,0.035294)(0.9707,0.031373)(0.9749,0.023529)(0.9791,0.019608)(0.9833,0.015686)(0.9874,0.011765)(0.9916,0.0078431)(0.9958,0.0039216)(1,0)
+BLUE:
+(0,1)(0.0042,0.99608)(0.0084,0.99216)(0.0126,0.98824)(0.0167,0.98431)(0.0209,0.98039)(0.0251,0.97647)(0.0293,0.97255)(0.0335,0.96471)(0.0377,0.96078)(0.0418,0.95686)(0.046,0.95294)(0.0502,0.94902)(0.0544,0.9451)(0.0586,0.94118)(0.0628,0.93725)(0.0669,0.93333)(0.0711,0.92941)(0.0753,0.92549)(0.0795,0.92157)(0.0837,0.91765)(0.0879,0.91373)(0.0921,0.9098)(0.0962,0.90196)(0.1004,0.89804)(0.1046,0.89412)(0.1088,0.8902)(0.113,0.88627)(0.1172,0.88235)(0.1213,0.87843)(0.1255,0.87451)(0.1297,0.87059)(0.1339,0.86667)(0.1381,0.86275)(0.1423,0.85882)(0.1464,0.8549)(0.1506,0.85098)(0.1548,0.84706)(0.159,0.83922)(0.1632,0.83529)(0.1674,0.83137)(0.1715,0.82745)(0.1757,0.82353)(0.1799,0.81961)(0.1841,0.81569)(0.1883,0.81176)(0.1925,0.80784)(0.1967,0.80392)(0.2008,0.8)(0.205,0.79608)(0.2092,0.79216)(0.2134,0.78824)(0.2176,0.78431)(0.2218,0.77647)(0.2259,0.77255)(0.2301,0.76863)(0.2343,0.76471)(0.2385,0.76078)(0.2427,0.75686)(0.2469,0.75294)(0.251,0.74902)(0.2552,0.7451)(0.2594,0.74118)(0.2636,0.73725)(0.2678,0.73333)(0.272,0.72941)(0.2762,0.72549)(0.2803,0.72157)(0.2845,0.71373)(0.2887,0.7098)(0.2929,0.70588)(0.2971,0.70196)(0.3013,0.69804)(0.3054,0.69412)(0.3096,0.6902)(0.3138,0.68627)(0.318,0.68235)(0.3222,0.67843)(0.3264,0.67451)(0.3305,0.67059)(0.3347,0.66667)(0.3389,0.66275)(0.3431,0.65882)(0.3473,0.65098)(0.3515,0.64706)(0.3556,0.64314)(0.3598,0.63922)(0.364,0.63529)(0.3682,0.63137)(0.3724,0.62745)(0.3766,0.62353)(0.3808,0.61961)(0.3849,0.61569)(0.3891,0.61176)(0.3933,0.60784)(0.3975,0.60392)(0.4017,0.6)(0.4059,0.59608)(0.41,0.58824)(0.4142,0.58431)(0.4184,0.58039)(0.4226,0.57647)(0.4268,0.57255)(0.431,0.56863)(0.4351,0.56471)(0.4393,0.56078)(0.4435,0.55686)(0.4477,0.55294)(0.4519,0.54902)(0.4561,0.5451)(0.4603,0.54118)(0.4644,0.53725)(0.4686,0.53333)(0.4728,0.52549)(0.477,0.52157)(0.4812,0.51765)(0.4854,0.51373)(0.4895,0.5098)(0.4937,0.50588)(0.4979,0.50196)(0.5021,0.49804)(0.5063,0.49412)(0.5105,0.4902)(0.5146,0.48627)(0.5188,0.48235)(0.523,0.47843)(0.5272,0.47451)(0.5314,0.47059)(0.5356,0.46275)(0.5397,0.45882)(0.5439,0.4549)(0.5481,0.45098)(0.5523,0.44706)(0.5565,0.44314)(0.5607,0.43922)(0.5649,0.43529)(0.569,0.43137)(0.5732,0.42745)(0.5774,0.42353)(0.5816,0.41961)(0.5858,0.41569)(0.59,0.41176)(0.5941,0.40784)(0.5983,0.4)(0.6025,0.39608)(0.6067,0.39216)(0.6109,0.38824)(0.6151,0.38431)(0.6192,0.38039)(0.6234,0.37647)(0.6276,0.37255)(0.6318,0.36863)(0.636,0.36471)(0.6402,0.36078)(0.6444,0.35686)(0.6485,0.35294)(0.6527,0.34902)(0.6569,0.3451)(0.6611,0.33725)(0.6653,0.33333)(0.6695,0.32941)(0.6736,0.32549)(0.6778,0.32157)(0.682,0.31765)(0.6862,0.31373)(0.6904,0.3098)(0.6946,0.30588)(0.6987,0.30196)(0.7029,0.29804)(0.7071,0.29412)(0.7113,0.2902)(0.7155,0.28627)(0.7197,0.28235)(0.7238,0.27451)(0.728,0.27059)(0.7322,0.26667)(0.7364,0.26275)(0.7406,0.25882)(0.7448,0.2549)(0.749,0.25098)(0.7531,0.24706)(0.7573,0.24314)(0.7615,0.23922)(0.7657,0.23529)(0.7699,0.23137)(0.7741,0.22745)(0.7782,0.22353)(0.7824,0.21961)(0.7866,0.21176)(0.7908,0.20784)(0.795,0.20392)(0.7992,0.2)(0.8033,0.19608)(0.8075,0.19216)(0.8117,0.18824)(0.8159,0.18431)(0.8201,0.18039)(0.8243,0.17647)(0.8285,0.17255)(0.8326,0.16863)(0.8368,0.16471)(0.841,0.16078)(0.8452,0.15686)(0.8494,0.14902)(0.8536,0.1451)(0.8577,0.14118)(0.8619,0.13725)(0.8661,0.13333)(0.8703,0.12941)(0.8745,0.12549)(0.8787,0.12157)(0.8828,0.11765)(0.887,0.11373)(0.8912,0.1098)(0.8954,0.10588)(0.8996,0.10196)(0.9038,0.098039)(0.9079,0.094118)(0.9121,0.086275)(0.9163,0.082353)(0.9205,0.078431)(0.9247,0.07451)(0.9289,0.070588)(0.9331,0.066667)(0.9372,0.062745)(0.9414,0.058824)(0.9456,0.054902)(0.9498,0.05098)(0.954,0.047059)(0.9582,0.043137)(0.9623,0.039216)(0.9665,0.035294)(0.9707,0.031373)(0.9749,0.023529)(0.9791,0.019608)(0.9833,0.015686)(0.9874,0.011765)(0.9916,0.0078431)(0.9958,0.0039216)(1,0)
diff --git a/ds9/cmaps/h5_autumn.sao b/ds9/cmaps/h5_autumn.sao
new file mode 100644
index 0000000..f7b9fcc
--- /dev/null
+++ b/ds9/cmaps/h5_autumn.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# autumn
+# created by cptutils 1.46
+# Wed Aug 15 23:29:40 2012
+PSEUDOCOLOR
+RED:
+(0,1)(1,1)
+GREEN:
+(0,0)(1,1)
+BLUE:
+(0,0)(1,0)
diff --git a/ds9/cmaps/h5_bluered.sao b/ds9/cmaps/h5_bluered.sao
new file mode 100644
index 0000000..4c3f87c
--- /dev/null
+++ b/ds9/cmaps/h5_bluered.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# bluered
+# created by cptutils 1.46
+# Wed Aug 15 23:29:40 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.5,1)(1,1)
+GREEN:
+(0,0)(0.5,1)(1,0)
+BLUE:
+(0,1)(0.5,1)(1,0)
diff --git a/ds9/cmaps/h5_bone.sao b/ds9/cmaps/h5_bone.sao
new file mode 100644
index 0000000..1c735d8
--- /dev/null
+++ b/ds9/cmaps/h5_bone.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# bone
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0159,0.011765)(0.0317,0.027451)(0.0476,0.039216)(0.0635,0.054902)(0.0794,0.066667)(0.0952,0.082353)(0.1111,0.094118)(0.127,0.1098)(0.1429,0.12157)(0.1587,0.13725)(0.1746,0.14902)(0.1905,0.16471)(0.2063,0.18039)(0.2222,0.19216)(0.2381,0.20784)(0.254,0.21961)(0.2698,0.23529)(0.2857,0.24706)(0.3016,0.26275)(0.3175,0.27451)(0.3333,0.2902)(0.3492,0.30196)(0.3651,0.31765)(0.381,0.32941)(0.3968,0.3451)(0.4127,0.36078)(0.4286,0.37255)(0.4444,0.38824)(0.4603,0.4)(0.4762,0.41569)(0.4921,0.42745)(0.5079,0.44314)(0.5238,0.4549)(0.5397,0.47059)(0.5556,0.48235)(0.5714,0.49804)(0.5873,0.51373)(0.6032,0.52549)(0.619,0.54118)(0.6349,0.55294)(0.6508,0.56863)(0.6667,0.58039)(0.6825,0.59608)(0.6984,0.60784)(0.7143,0.62353)(0.7302,0.63529)(0.746,0.65098)(0.7619,0.67059)(0.7778,0.69412)(0.7937,0.71765)(0.8095,0.73725)(0.8254,0.76078)(0.8413,0.78039)(0.8571,0.80392)(0.873,0.82353)(0.8889,0.84706)(0.9048,0.86667)(0.9206,0.8902)(0.9365,0.9098)(0.9524,0.93333)(0.9683,0.95294)(0.9841,0.97647)(1,1)
+GREEN:
+(0,0)(0.0159,0.011765)(0.0317,0.027451)(0.0476,0.039216)(0.0635,0.054902)(0.0794,0.066667)(0.0952,0.082353)(0.1111,0.094118)(0.127,0.1098)(0.1429,0.12157)(0.1587,0.13725)(0.1746,0.14902)(0.1905,0.16471)(0.2063,0.18039)(0.2222,0.19216)(0.2381,0.20784)(0.254,0.21961)(0.2698,0.23529)(0.2857,0.24706)(0.3016,0.26275)(0.3175,0.27451)(0.3333,0.2902)(0.3492,0.30196)(0.3651,0.31765)(0.381,0.33725)(0.3968,0.35686)(0.4127,0.37647)(0.4286,0.39216)(0.4444,0.41176)(0.4603,0.43137)(0.4762,0.45098)(0.4921,0.47059)(0.5079,0.4902)(0.5238,0.5098)(0.5397,0.52941)(0.5556,0.5451)(0.5714,0.56471)(0.5873,0.58431)(0.6032,0.60392)(0.619,0.62353)(0.6349,0.64314)(0.6508,0.66275)(0.6667,0.67843)(0.6825,0.69804)(0.6984,0.71765)(0.7143,0.73725)(0.7302,0.75686)(0.746,0.77647)(0.7619,0.78824)(0.7778,0.80392)(0.7937,0.81569)(0.8095,0.83137)(0.8254,0.84706)(0.8413,0.85882)(0.8571,0.87451)(0.873,0.88627)(0.8889,0.90196)(0.9048,0.91373)(0.9206,0.92941)(0.9365,0.94118)(0.9524,0.95686)(0.9683,0.96863)(0.9841,0.98431)(1,1)
+BLUE:
+(0,0.0039216)(0.0159,0.023529)(0.0317,0.043137)(0.0476,0.058824)(0.0635,0.078431)(0.0794,0.098039)(0.0952,0.11765)(0.1111,0.13725)(0.127,0.15686)(0.1429,0.17647)(0.1587,0.19608)(0.1746,0.21176)(0.1905,0.23137)(0.2063,0.25098)(0.2222,0.27059)(0.2381,0.2902)(0.254,0.3098)(0.2698,0.32941)(0.2857,0.3451)(0.3016,0.36471)(0.3175,0.38431)(0.3333,0.40392)(0.3492,0.42353)(0.3651,0.44314)(0.381,0.4549)(0.3968,0.47059)(0.4127,0.48235)(0.4286,0.49804)(0.4444,0.51373)(0.4603,0.52549)(0.4762,0.54118)(0.4921,0.55294)(0.5079,0.56863)(0.5238,0.58039)(0.5397,0.59608)(0.5556,0.60784)(0.5714,0.62353)(0.5873,0.63529)(0.6032,0.65098)(0.619,0.66667)(0.6349,0.67843)(0.6508,0.69412)(0.6667,0.70588)(0.6825,0.72157)(0.6984,0.73333)(0.7143,0.74902)(0.7302,0.76078)(0.746,0.77647)(0.7619,0.78824)(0.7778,0.80392)(0.7937,0.81569)(0.8095,0.83137)(0.8254,0.84706)(0.8413,0.85882)(0.8571,0.87451)(0.873,0.88627)(0.8889,0.90196)(0.9048,0.91373)(0.9206,0.92941)(0.9365,0.94118)(0.9524,0.95686)(0.9683,0.96863)(0.9841,0.98431)(1,1)
diff --git a/ds9/cmaps/h5_cool.sao b/ds9/cmaps/h5_cool.sao
new file mode 100644
index 0000000..f6037bb
--- /dev/null
+++ b/ds9/cmaps/h5_cool.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# cool
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0)(1,1)
+GREEN:
+(0,1)(1,0)
+BLUE:
+(0,1)(1,1)
diff --git a/ds9/cmaps/h5_copper.sao b/ds9/cmaps/h5_copper.sao
new file mode 100644
index 0000000..cb3eac9
--- /dev/null
+++ b/ds9/cmaps/h5_copper.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# copper
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0159,0.019608)(0.0317,0.039216)(0.0476,0.058824)(0.0635,0.078431)(0.0794,0.098039)(0.0952,0.11765)(0.1111,0.13725)(0.127,0.15686)(0.1429,0.17647)(0.1587,0.19608)(0.1746,0.21569)(0.1905,0.23529)(0.2063,0.2549)(0.2222,0.27451)(0.2381,0.29412)(0.254,0.31373)(0.2698,0.33725)(0.2857,0.35686)(0.3016,0.37647)(0.3175,0.39608)(0.3333,0.41569)(0.3492,0.43529)(0.3651,0.4549)(0.381,0.47451)(0.3968,0.49412)(0.4127,0.51373)(0.4286,0.53333)(0.4444,0.55294)(0.4603,0.57255)(0.4762,0.59216)(0.4921,0.61176)(0.5079,0.63137)(0.5238,0.65098)(0.5397,0.67451)(0.5556,0.69412)(0.5714,0.71373)(0.5873,0.73333)(0.6032,0.75294)(0.619,0.77255)(0.6349,0.79216)(0.6508,0.81176)(0.6667,0.83137)(0.6825,0.85098)(0.6984,0.87059)(0.7143,0.8902)(0.7302,0.9098)(0.746,0.92941)(0.7619,0.94902)(0.7778,0.96863)(0.7937,0.98824)(0.8095,1)(0.8254,1)(0.8413,1)(0.8571,1)(0.873,1)(0.8889,1)(0.9048,1)(0.9206,1)(0.9365,1)(0.9524,1)(0.9683,1)(0.9841,1)(1,1)
+GREEN:
+(0,0)(0.0159,0.011765)(0.0317,0.023529)(0.0476,0.035294)(0.0635,0.047059)(0.0794,0.058824)(0.0952,0.070588)(0.1111,0.086275)(0.127,0.098039)(0.1429,0.1098)(0.1587,0.12157)(0.1746,0.13333)(0.1905,0.1451)(0.2063,0.16078)(0.2222,0.17255)(0.2381,0.18431)(0.254,0.19608)(0.2698,0.20784)(0.2857,0.21961)(0.3016,0.23529)(0.3175,0.24706)(0.3333,0.25882)(0.3492,0.27059)(0.3651,0.28235)(0.381,0.29412)(0.3968,0.3098)(0.4127,0.32157)(0.4286,0.33333)(0.4444,0.3451)(0.4603,0.35686)(0.4762,0.36863)(0.4921,0.38431)(0.5079,0.39608)(0.5238,0.40784)(0.5397,0.41961)(0.5556,0.43137)(0.5714,0.44314)(0.5873,0.4549)(0.6032,0.47059)(0.619,0.48235)(0.6349,0.49412)(0.6508,0.50588)(0.6667,0.51765)(0.6825,0.52941)(0.6984,0.5451)(0.7143,0.55686)(0.7302,0.56863)(0.746,0.58039)(0.7619,0.59216)(0.7778,0.60392)(0.7937,0.61961)(0.8095,0.63137)(0.8254,0.64314)(0.8413,0.6549)(0.8571,0.66667)(0.873,0.67843)(0.8889,0.69412)(0.9048,0.70588)(0.9206,0.71765)(0.9365,0.72941)(0.9524,0.74118)(0.9683,0.75294)(0.9841,0.76863)(1,0.78039)
+BLUE:
+(0,0)(0.0159,0.0078431)(0.0317,0.015686)(0.0476,0.023529)(0.0635,0.031373)(0.0794,0.039216)(0.0952,0.047059)(0.1111,0.054902)(0.127,0.062745)(0.1429,0.070588)(0.1587,0.078431)(0.1746,0.086275)(0.1905,0.094118)(0.2063,0.10196)(0.2222,0.1098)(0.2381,0.11765)(0.254,0.12549)(0.2698,0.13333)(0.2857,0.14118)(0.3016,0.14902)(0.3175,0.15686)(0.3333,0.16471)(0.3492,0.17255)(0.3651,0.18039)(0.381,0.18824)(0.3968,0.19608)(0.4127,0.20392)(0.4286,0.21176)(0.4444,0.21961)(0.4603,0.22745)(0.4762,0.23529)(0.4921,0.24314)(0.5079,0.25098)(0.5238,0.25882)(0.5397,0.26667)(0.5556,0.27451)(0.5714,0.28235)(0.5873,0.2902)(0.6032,0.29804)(0.619,0.30588)(0.6349,0.31373)(0.6508,0.32157)(0.6667,0.32941)(0.6825,0.33725)(0.6984,0.3451)(0.7143,0.35294)(0.7302,0.36078)(0.746,0.36863)(0.7619,0.37647)(0.7778,0.38431)(0.7937,0.39216)(0.8095,0.4)(0.8254,0.40784)(0.8413,0.41569)(0.8571,0.42353)(0.873,0.43137)(0.8889,0.43922)(0.9048,0.44706)(0.9206,0.4549)(0.9365,0.46275)(0.9524,0.47059)(0.9683,0.47843)(0.9841,0.48627)(1,0.49412)
diff --git a/ds9/cmaps/h5_dkbluered.sao b/ds9/cmaps/h5_dkbluered.sao
new file mode 100644
index 0000000..e3bc109
--- /dev/null
+++ b/ds9/cmaps/h5_dkbluered.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# dkbluered
+# created by cptutils 1.46
+# Wed Aug 15 23:29:40 2012
+PSEUDOCOLOR
+RED:
+(0,0.027451)(0.0333,0.066667)(0.0667,0.098039)(0.1,0.1098)(0.1333,0.098039)(0.1667,0.086275)(0.2,0.058824)(0.2333,0.0078431)(0.2667,0.078431)(0.3,0.21961)(0.3333,0.34902)(0.3667,0.47843)(0.4,0.60784)(0.4333,0.74902)(0.4667,0.87843)(0.5,1)(0.5333,1)(0.5667,1)(0.6,1)(0.6333,1)(0.6667,1)(0.7,1)(0.7333,1)(0.7667,0.96863)(0.8,0.85882)(0.8333,0.74902)(0.8667,0.63922)(0.9,0.52941)(0.9333,0.41961)(0.9667,0.3098)(1,0.20784)
+GREEN:
+(0,0)(0.0333,0)(0.0667,0)(0.1,0)(0.1333,0)(0.1667,0)(0.2,0)(0.2333,0)(0.2667,0.12941)(0.3,0.29804)(0.3333,0.45882)(0.3667,0.6)(0.4,0.72941)(0.4333,0.82745)(0.4667,0.92941)(0.5,1)(0.5333,0.92941)(0.5667,0.82745)(0.6,0.72941)(0.6333,0.6)(0.6667,0.45882)(0.7,0.29804)(0.7333,0.12941)(0.7667,0)(0.8,0)(0.8333,0)(0.8667,0)(0.9,0)(0.9333,0)(0.9667,0)(1,0)
+BLUE:
+(0,0.2)(0.0333,0.3098)(0.0667,0.41961)(0.1,0.52941)(0.1333,0.63922)(0.1667,0.74902)(0.2,0.85882)(0.2333,0.96863)(0.2667,1)(0.3,1)(0.3333,1)(0.3667,1)(0.4,1)(0.4333,1)(0.4667,1)(0.5,1)(0.5333,0.87843)(0.5667,0.74902)(0.6,0.60784)(0.6333,0.47843)(0.6667,0.34902)(0.7,0.21961)(0.7333,0.078431)(0.7667,0.0078431)(0.8,0.058824)(0.8333,0.086275)(0.8667,0.098039)(0.9,0.1098)(0.9333,0.098039)(0.9667,0.066667)(1,0.027451)
diff --git a/ds9/cmaps/h5_gray.sao b/ds9/cmaps/h5_gray.sao
new file mode 100644
index 0000000..2fcd14c
--- /dev/null
+++ b/ds9/cmaps/h5_gray.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# gray
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,1)(1,0)
+GREEN:
+(0,1)(1,0)
+BLUE:
+(0,1)(1,0)
diff --git a/ds9/cmaps/h5_green.sao b/ds9/cmaps/h5_green.sao
new file mode 100644
index 0000000..457e12f
--- /dev/null
+++ b/ds9/cmaps/h5_green.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# green
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,1)(1,0)
+GREEN:
+(0,1)(1,1)
+BLUE:
+(0,1)(1,0)
diff --git a/ds9/cmaps/h5_hot.sao b/ds9/cmaps/h5_hot.sao
new file mode 100644
index 0000000..b767579
--- /dev/null
+++ b/ds9/cmaps/h5_hot.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# hot
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0.039216)(0.0159,0.082353)(0.0317,0.12157)(0.0476,0.16471)(0.0635,0.20784)(0.0794,0.24706)(0.0952,0.2902)(0.1111,0.32941)(0.127,0.37255)(0.1429,0.41569)(0.1587,0.4549)(0.1746,0.49804)(0.1905,0.54118)(0.2063,0.58039)(0.2222,0.62353)(0.2381,0.66667)(0.254,0.70588)(0.2698,0.74902)(0.2857,0.78824)(0.3016,0.83137)(0.3175,0.87451)(0.3333,0.91373)(0.3492,0.95686)(0.3651,1)(0.381,1)(0.3968,1)(0.4127,1)(0.4286,1)(0.4444,1)(0.4603,1)(0.4762,1)(0.4921,1)(0.5079,1)(0.5238,1)(0.5397,1)(0.5556,1)(0.5714,1)(0.5873,1)(0.6032,1)(0.619,1)(0.6349,1)(0.6508,1)(0.6667,1)(0.6825,1)(0.6984,1)(0.7143,1)(0.7302,1)(0.746,1)(0.7619,1)(0.7778,1)(0.7937,1)(0.8095,1)(0.8254,1)(0.8413,1)(0.8571,1)(0.873,1)(0.8889,1)(0.9048,1)(0.9206,1)(0.9365,1)(0.9524,1)(0.9683,1)(0.9841,1)(1,1)
+GREEN:
+(0,0)(0.0159,0)(0.0317,0)(0.0476,0)(0.0635,0)(0.0794,0)(0.0952,0)(0.1111,0)(0.127,0)(0.1429,0)(0.1587,0)(0.1746,0)(0.1905,0)(0.2063,0)(0.2222,0)(0.2381,0)(0.254,0)(0.2698,0)(0.2857,0)(0.3016,0)(0.3175,0)(0.3333,0)(0.3492,0)(0.3651,0)(0.381,0.039216)(0.3968,0.082353)(0.4127,0.12157)(0.4286,0.16471)(0.4444,0.20784)(0.4603,0.24706)(0.4762,0.2902)(0.4921,0.32941)(0.5079,0.37255)(0.5238,0.41569)(0.5397,0.4549)(0.5556,0.49804)(0.5714,0.54118)(0.5873,0.58039)(0.6032,0.62353)(0.619,0.66667)(0.6349,0.70588)(0.6508,0.74902)(0.6667,0.78824)(0.6825,0.83137)(0.6984,0.87451)(0.7143,0.91373)(0.7302,0.95686)(0.746,1)(0.7619,1)(0.7778,1)(0.7937,1)(0.8095,1)(0.8254,1)(0.8413,1)(0.8571,1)(0.873,1)(0.8889,1)(0.9048,1)(0.9206,1)(0.9365,1)(0.9524,1)(0.9683,1)(0.9841,1)(1,1)
+BLUE:
+(0,0)(0.0159,0)(0.0317,0)(0.0476,0)(0.0635,0)(0.0794,0)(0.0952,0)(0.1111,0)(0.127,0)(0.1429,0)(0.1587,0)(0.1746,0)(0.1905,0)(0.2063,0)(0.2222,0)(0.2381,0)(0.254,0)(0.2698,0)(0.2857,0)(0.3016,0)(0.3175,0)(0.3333,0)(0.3492,0)(0.3651,0)(0.381,0)(0.3968,0)(0.4127,0)(0.4286,0)(0.4444,0)(0.4603,0)(0.4762,0)(0.4921,0)(0.5079,0)(0.5238,0)(0.5397,0)(0.5556,0)(0.5714,0)(0.5873,0)(0.6032,0)(0.619,0)(0.6349,0)(0.6508,0)(0.6667,0)(0.6825,0)(0.6984,0)(0.7143,0)(0.7302,0)(0.746,0)(0.7619,0.058824)(0.7778,0.12157)(0.7937,0.18431)(0.8095,0.24706)(0.8254,0.3098)(0.8413,0.37255)(0.8571,0.43529)(0.873,0.49804)(0.8889,0.56078)(0.9048,0.62353)(0.9206,0.68627)(0.9365,0.74902)(0.9524,0.81176)(0.9683,0.87451)(0.9841,0.93725)(1,1)
diff --git a/ds9/cmaps/h5_hsv.sao b/ds9/cmaps/h5_hsv.sao
new file mode 100644
index 0000000..8926b92
--- /dev/null
+++ b/ds9/cmaps/h5_hsv.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# hsv
+# created by cptutils 1.46
+# Wed Aug 15 23:29:38 2012
+PSEUDOCOLOR
+RED:
+(0,1)(0.0159,1)(0.0317,1)(0.0476,1)(0.0635,1)(0.0794,1)(0.0952,1)(0.1111,1)(0.127,1)(0.1429,1)(0.1587,1)(0.1746,0.96863)(0.1905,0.87451)(0.2063,0.78039)(0.2222,0.68627)(0.2381,0.59216)(0.254,0.49804)(0.2698,0.40392)(0.2857,0.3098)(0.3016,0.21569)(0.3175,0.12157)(0.3333,0.027451)(0.3492,0)(0.3651,0)(0.381,0)(0.3968,0)(0.4127,0)(0.4286,0)(0.4444,0)(0.4603,0)(0.4762,0)(0.4921,0)(0.5079,0)(0.5238,0)(0.5397,0)(0.5556,0)(0.5714,0)(0.5873,0)(0.6032,0)(0.619,0)(0.6349,0)(0.6508,0)(0.6667,0)(0.6825,0.027451)(0.6984,0.12157)(0.7143,0.21569)(0.7302,0.3098)(0.746,0.40392)(0.7619,0.49804)(0.7778,0.59216)(0.7937,0.68627)(0.8095,0.78039)(0.8254,0.87451)(0.8413,0.96863)(0.8571,1)(0.873,1)(0.8889,1)(0.9048,1)(0.9206,1)(0.9365,1)(0.9524,1)(0.9683,1)(0.9841,1)(1,1)
+GREEN:
+(0,0)(0.0159,0.090196)(0.0317,0.18431)(0.0476,0.27843)(0.0635,0.37255)(0.0794,0.46667)(0.0952,0.56078)(0.1111,0.6549)(0.127,0.74902)(0.1429,0.84314)(0.1587,0.93725)(0.1746,1)(0.1905,1)(0.2063,1)(0.2222,1)(0.2381,1)(0.254,1)(0.2698,1)(0.2857,1)(0.3016,1)(0.3175,1)(0.3333,1)(0.3492,1)(0.3651,1)(0.381,1)(0.3968,1)(0.4127,1)(0.4286,1)(0.4444,1)(0.4603,1)(0.4762,1)(0.4921,1)(0.5079,1)(0.5238,0.90588)(0.5397,0.81176)(0.5556,0.71765)(0.5714,0.62353)(0.5873,0.52941)(0.6032,0.43529)(0.619,0.34118)(0.6349,0.24706)(0.6508,0.15294)(0.6667,0.058824)(0.6825,0)(0.6984,0)(0.7143,0)(0.7302,0)(0.746,0)(0.7619,0)(0.7778,0)(0.7937,0)(0.8095,0)(0.8254,0)(0.8413,0)(0.8571,0)(0.873,0)(0.8889,0)(0.9048,0)(0.9206,0)(0.9365,0)(0.9524,0)(0.9683,0)(0.9841,0)(1,0)
+BLUE:
+(0,0)(0.0159,0)(0.0317,0)(0.0476,0)(0.0635,0)(0.0794,0)(0.0952,0)(0.1111,0)(0.127,0)(0.1429,0)(0.1587,0)(0.1746,0)(0.1905,0)(0.2063,0)(0.2222,0)(0.2381,0)(0.254,0)(0.2698,0)(0.2857,0)(0.3016,0)(0.3175,0)(0.3333,0)(0.3492,0.058824)(0.3651,0.15294)(0.381,0.24706)(0.3968,0.34118)(0.4127,0.43529)(0.4286,0.52941)(0.4444,0.62353)(0.4603,0.71765)(0.4762,0.81176)(0.4921,0.90588)(0.5079,1)(0.5238,1)(0.5397,1)(0.5556,1)(0.5714,1)(0.5873,1)(0.6032,1)(0.619,1)(0.6349,1)(0.6508,1)(0.6667,1)(0.6825,1)(0.6984,1)(0.7143,1)(0.7302,1)(0.746,1)(0.7619,1)(0.7778,1)(0.7937,1)(0.8095,1)(0.8254,1)(0.8413,1)(0.8571,0.93725)(0.873,0.84314)(0.8889,0.74902)(0.9048,0.6549)(0.9206,0.56078)(0.9365,0.46667)(0.9524,0.37255)(0.9683,0.27843)(0.9841,0.18431)(1,0.090196)
diff --git a/ds9/cmaps/h5_jet.sao b/ds9/cmaps/h5_jet.sao
new file mode 100644
index 0000000..3ea02ea
--- /dev/null
+++ b/ds9/cmaps/h5_jet.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# jet
+# created by cptutils 1.46
+# Wed Aug 15 23:29:38 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0667,0)(0.1333,0)(0.2,0)(0.2667,0)(0.3333,0)(0.4,0.24706)(0.4667,0.49804)(0.5333,0.74902)(0.6,1)(0.6667,1)(0.7333,1)(0.8,1)(0.8667,1)(0.9333,1)(1,0.74902)
+GREEN:
+(0,0)(0.0667,0)(0.1333,0.24706)(0.2,0.49804)(0.2667,0.74902)(0.3333,1)(0.4,1)(0.4667,1)(0.5333,1)(0.6,1)(0.6667,1)(0.7333,0.74902)(0.8,0.49804)(0.8667,0.24706)(0.9333,0)(1,0)
+BLUE:
+(0,0.74902)(0.0667,1)(0.1333,1)(0.2,1)(0.2667,1)(0.3333,1)(0.4,1)(0.4667,0.74902)(0.5333,0.49804)(0.6,0.24706)(0.6667,0)(0.7333,0)(0.8,0)(0.8667,0)(0.9333,0)(1,0)
diff --git a/ds9/cmaps/h5_pink.sao b/ds9/cmaps/h5_pink.sao
new file mode 100644
index 0000000..9f479be
--- /dev/null
+++ b/ds9/cmaps/h5_pink.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# pink
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0.11765)(0.0159,0.19216)(0.0317,0.24706)(0.0476,0.29412)(0.0635,0.33333)(0.0794,0.36863)(0.0952,0.4)(0.1111,0.42745)(0.127,0.4549)(0.1429,0.48235)(0.1587,0.50588)(0.1746,0.52941)(0.1905,0.55294)(0.2063,0.57255)(0.2222,0.59608)(0.2381,0.61569)(0.254,0.63529)(0.2698,0.6549)(0.2857,0.67059)(0.3016,0.6902)(0.3175,0.70588)(0.3333,0.72549)(0.3492,0.74118)(0.3651,0.75686)(0.381,0.76471)(0.3968,0.77255)(0.4127,0.77647)(0.4286,0.78431)(0.4444,0.79216)(0.4603,0.8)(0.4762,0.80392)(0.4921,0.81176)(0.5079,0.81961)(0.5238,0.82353)(0.5397,0.83137)(0.5556,0.83529)(0.5714,0.84314)(0.5873,0.85098)(0.6032,0.8549)(0.619,0.86275)(0.6349,0.86667)(0.6508,0.87451)(0.6667,0.87843)(0.6825,0.88627)(0.6984,0.8902)(0.7143,0.89804)(0.7302,0.90196)(0.746,0.9098)(0.7619,0.91373)(0.7778,0.92157)(0.7937,0.92549)(0.8095,0.93333)(0.8254,0.93725)(0.8413,0.9451)(0.8571,0.94902)(0.873,0.95294)(0.8889,0.96078)(0.9048,0.96471)(0.9206,0.97255)(0.9365,0.97647)(0.9524,0.98039)(0.9683,0.98824)(0.9841,0.99216)(1,1)
+GREEN:
+(0,0)(0.0159,0.10196)(0.0317,0.1451)(0.0476,0.17647)(0.0635,0.20392)(0.0794,0.22745)(0.0952,0.25098)(0.1111,0.27059)(0.127,0.2902)(0.1429,0.30588)(0.1587,0.32157)(0.1746,0.34118)(0.1905,0.35294)(0.2063,0.36863)(0.2222,0.38431)(0.2381,0.39608)(0.254,0.40784)(0.2698,0.42353)(0.2857,0.43529)(0.3016,0.44706)(0.3175,0.45882)(0.3333,0.47059)(0.3492,0.48235)(0.3651,0.4902)(0.381,0.51373)(0.3968,0.53725)(0.4127,0.56078)(0.4286,0.58039)(0.4444,0.60392)(0.4603,0.62353)(0.4762,0.64314)(0.4921,0.65882)(0.5079,0.67843)(0.5238,0.69804)(0.5397,0.71373)(0.5556,0.72941)(0.5714,0.74902)(0.5873,0.76471)(0.6032,0.78039)(0.619,0.79608)(0.6349,0.81176)(0.6508,0.82353)(0.6667,0.83922)(0.6825,0.8549)(0.6984,0.86667)(0.7143,0.88235)(0.7302,0.89412)(0.746,0.9098)(0.7619,0.91373)(0.7778,0.92157)(0.7937,0.92549)(0.8095,0.93333)(0.8254,0.93725)(0.8413,0.9451)(0.8571,0.94902)(0.873,0.95294)(0.8889,0.96078)(0.9048,0.96471)(0.9206,0.97255)(0.9365,0.97647)(0.9524,0.98039)(0.9683,0.98824)(0.9841,0.99216)(1,1)
+BLUE:
+(0,0)(0.0159,0.10196)(0.0317,0.1451)(0.0476,0.17647)(0.0635,0.20392)(0.0794,0.22745)(0.0952,0.25098)(0.1111,0.27059)(0.127,0.2902)(0.1429,0.30588)(0.1587,0.32157)(0.1746,0.34118)(0.1905,0.35294)(0.2063,0.36863)(0.2222,0.38431)(0.2381,0.39608)(0.254,0.40784)(0.2698,0.42353)(0.2857,0.43529)(0.3016,0.44706)(0.3175,0.45882)(0.3333,0.47059)(0.3492,0.48235)(0.3651,0.4902)(0.381,0.50196)(0.3968,0.51373)(0.4127,0.52157)(0.4286,0.53333)(0.4444,0.54118)(0.4603,0.55294)(0.4762,0.56078)(0.4921,0.57255)(0.5079,0.58039)(0.5238,0.58824)(0.5397,0.59608)(0.5556,0.60784)(0.5714,0.61569)(0.5873,0.62353)(0.6032,0.63137)(0.619,0.63922)(0.6349,0.64706)(0.6508,0.6549)(0.6667,0.66667)(0.6825,0.67451)(0.6984,0.68235)(0.7143,0.68627)(0.7302,0.69412)(0.746,0.70196)(0.7619,0.72549)(0.7778,0.7451)(0.7937,0.76863)(0.8095,0.78824)(0.8254,0.80784)(0.8413,0.82745)(0.8571,0.84314)(0.873,0.86275)(0.8889,0.88235)(0.9048,0.89804)(0.9206,0.91765)(0.9365,0.93333)(0.9524,0.94902)(0.9683,0.96471)(0.9841,0.98039)(1,1)
diff --git a/ds9/cmaps/h5_spring.sao b/ds9/cmaps/h5_spring.sao
new file mode 100644
index 0000000..872e2df
--- /dev/null
+++ b/ds9/cmaps/h5_spring.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# spring
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,1)(0.0667,1)(0.1333,1)(0.2,1)(0.2667,1)(0.3333,1)(0.4,1)(0.4667,1)(0.5333,1)(0.6,1)(0.6667,1)(0.7333,1)(0.8,1)(0.8667,1)(0.9333,1)(1,1)
+GREEN:
+(0,0)(0.0667,0.066667)(0.1333,0.12941)(0.2,0.2)(0.2667,0.26667)(0.3333,0.32941)(0.4,0.4)(0.4667,0.46667)(0.5333,0.52941)(0.6,0.6)(0.6667,0.66667)(0.7333,0.72941)(0.8,0.8)(0.8667,0.86667)(0.9333,0.92941)(1,1)
+BLUE:
+(0,1)(0.0667,0.92941)(0.1333,0.86667)(0.2,0.8)(0.2667,0.72941)(0.3333,0.66667)(0.4,0.6)(0.4667,0.52941)(0.5333,0.46667)(0.6,0.4)(0.6667,0.32941)(0.7333,0.26667)(0.8,0.2)(0.8667,0.12941)(0.9333,0.066667)(1,0)
diff --git a/ds9/cmaps/h5_summer.sao b/ds9/cmaps/h5_summer.sao
new file mode 100644
index 0000000..60e14c4
--- /dev/null
+++ b/ds9/cmaps/h5_summer.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# summer
+# created by cptutils 1.46
+# Wed Aug 15 23:29:38 2012
+PSEUDOCOLOR
+RED:
+(0,0)(0.0667,0.066667)(0.1333,0.12941)(0.2,0.2)(0.2667,0.26667)(0.3333,0.32941)(0.4,0.4)(0.4667,0.46667)(0.5333,0.52941)(0.6,0.6)(0.6667,0.66667)(0.7333,0.72941)(0.8,0.8)(0.8667,0.86667)(0.9333,0.92941)(1,1)
+GREEN:
+(0,0.49804)(0.0667,0.52941)(0.1333,0.56471)(0.2,0.6)(0.2667,0.63137)(0.3333,0.66667)(0.4,0.69804)(0.4667,0.72941)(0.5333,0.76471)(0.6,0.8)(0.6667,0.83137)(0.7333,0.86667)(0.8,0.89804)(0.8667,0.92941)(0.9333,0.96471)(1,1)
+BLUE:
+(0,0.4)(0.0667,0.4)(0.1333,0.4)(0.2,0.4)(0.2667,0.4)(0.3333,0.4)(0.4,0.4)(0.4667,0.4)(0.5333,0.4)(0.6,0.4)(0.6667,0.4)(0.7333,0.4)(0.8,0.4)(0.8667,0.4)(0.9333,0.4)(1,0.4)
diff --git a/ds9/cmaps/h5_winter.sao b/ds9/cmaps/h5_winter.sao
new file mode 100644
index 0000000..9a7d46b
--- /dev/null
+++ b/ds9/cmaps/h5_winter.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# winter
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,0)(1,0)
+GREEN:
+(0,0)(1,1)
+BLUE:
+(0,1)(1,0.49804)
diff --git a/ds9/cmaps/h5_yarg.sao b/ds9/cmaps/h5_yarg.sao
new file mode 100644
index 0000000..f1a3c6b
--- /dev/null
+++ b/ds9/cmaps/h5_yarg.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# yarg
+# created by cptutils 1.46
+# Wed Aug 15 23:29:38 2012
+PSEUDOCOLOR
+RED:
+(0,0)(1,1)
+GREEN:
+(0,0)(1,1)
+BLUE:
+(0,0)(1,1)
diff --git a/ds9/cmaps/h5_yellow.sao b/ds9/cmaps/h5_yellow.sao
new file mode 100644
index 0000000..1719fc8
--- /dev/null
+++ b/ds9/cmaps/h5_yellow.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# yellow
+# created by cptutils 1.46
+# Wed Aug 15 23:29:39 2012
+PSEUDOCOLOR
+RED:
+(0,1)(1,1)
+GREEN:
+(0,1)(1,1)
+BLUE:
+(0,1)(1,0)
diff --git a/ds9/cmaps/tpglarf.sao b/ds9/cmaps/tpglarf.sao
new file mode 100644
index 0000000..39a0a17
--- /dev/null
+++ b/ds9/cmaps/tpglarf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglarf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.56863)(0.0071,0.64706)(0.0286,0.69804)(0.0857,0.78824)(0.1429,0.83529)(0.2857,0.83137)(0.4286,0.83137)(0.5714,0.83529)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+GREEN:
+(0,0.53725)(0.0071,0.61569)(0.0286,0.65882)(0.0857,0.74118)(0.1429,0.78824)(0.2857,0.72157)(0.4286,0.75686)(0.5714,0.81961)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+BLUE:
+(0,0.50588)(0.0071,0.57255)(0.0286,0.61176)(0.0857,0.67451)(0.1429,0.70196)(0.2857,0.64314)(0.4286,0.71373)(0.5714,0.81176)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
diff --git a/ds9/cmaps/tpglarm.sao b/ds9/cmaps/tpglarm.sao
new file mode 100644
index 0000000..4be23f4
--- /dev/null
+++ b/ds9/cmaps/tpglarm.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglarm
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.56863)(0.0071,0.64706)(0.0286,0.69804)(0.0857,0.78824)(0.1429,0.83529)(0.2857,0.83137)(0.4286,0.83137)(0.5714,0.83529)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+GREEN:
+(0,0.53725)(0.0071,0.61569)(0.0286,0.65882)(0.0857,0.74118)(0.1429,0.78824)(0.2857,0.72157)(0.4286,0.75686)(0.5714,0.81961)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+BLUE:
+(0,0.50588)(0.0071,0.57255)(0.0286,0.61176)(0.0857,0.67451)(0.1429,0.70196)(0.2857,0.64314)(0.4286,0.71373)(0.5714,0.81176)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
diff --git a/ds9/cmaps/tpglhcf.sao b/ds9/cmaps/tpglhcf.sao
new file mode 100644
index 0000000..bbe36b6
--- /dev/null
+++ b/ds9/cmaps/tpglhcf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglhcf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.43137)(0.0071,0.49804)(0.0286,0.56471)(0.0857,0.69804)(0.1429,0.82745)(0.2857,0.83137)(0.4282,0.83529)(0.5714,0.83922)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+GREEN:
+(0,0.56863)(0.0071,0.63529)(0.0286,0.68235)(0.0857,0.7451)(0.1429,0.78824)(0.2857,0.72157)(0.4282,0.75294)(0.5714,0.81961)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
+BLUE:
+(0,0.54118)(0.0071,0.61569)(0.0286,0.65882)(0.0857,0.69804)(0.1429,0.70196)(0.2857,0.64314)(0.4282,0.7098)(0.5714,0.80784)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
diff --git a/ds9/cmaps/tpglhcm.sao b/ds9/cmaps/tpglhcm.sao
new file mode 100644
index 0000000..cfe0b02
--- /dev/null
+++ b/ds9/cmaps/tpglhcm.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglhcm
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.43137)(0.0071,0.49804)(0.0286,0.56471)(0.0857,0.69804)(0.1429,0.82745)(0.2857,0.83137)(0.4286,0.83529)(0.5714,0.83922)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
+GREEN:
+(0,0.56863)(0.0071,0.63529)(0.0286,0.68235)(0.0857,0.7451)(0.1429,0.78824)(0.2857,0.72157)(0.4286,0.75294)(0.5714,0.81961)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
+BLUE:
+(0,0.54118)(0.0071,0.61569)(0.0286,0.65882)(0.0857,0.69804)(0.1429,0.70196)(0.2857,0.64314)(0.4286,0.7098)(0.5714,0.80784)(0.7143,0.87059)(0.8571,0.93333)(1,0.96078)
diff --git a/ds9/cmaps/tpglhwf.sao b/ds9/cmaps/tpglhwf.sao
new file mode 100644
index 0000000..a71945e
--- /dev/null
+++ b/ds9/cmaps/tpglhwf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglhwf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.41176)(0.0071,0.46275)(0.0286,0.51373)(0.0857,0.64706)(0.1429,0.82745)(0.2857,0.83137)(0.4282,0.83137)(0.5714,0.83922)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
+GREEN:
+(0,0.59608)(0.0071,0.66275)(0.0286,0.7098)(0.0857,0.75294)(0.1429,0.78824)(0.2857,0.72157)(0.4282,0.75294)(0.5714,0.81961)(0.7143,0.86667)(0.8571,0.93333)(1,0.96863)
+BLUE:
+(0,0.52157)(0.0071,0.57255)(0.0286,0.60784)(0.0857,0.6549)(0.1429,0.70196)(0.2857,0.64314)(0.4282,0.7098)(0.5714,0.80784)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
diff --git a/ds9/cmaps/tpglhwm.sao b/ds9/cmaps/tpglhwm.sao
new file mode 100644
index 0000000..2fe7b74
--- /dev/null
+++ b/ds9/cmaps/tpglhwm.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglhwm
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.41176)(0.0071,0.46275)(0.0286,0.51373)(0.0857,0.64706)(0.1429,0.82745)(0.2857,0.83137)(0.4286,0.83137)(0.5714,0.83922)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
+GREEN:
+(0,0.59608)(0.0071,0.66275)(0.0286,0.7098)(0.0857,0.75294)(0.1429,0.78824)(0.2857,0.72157)(0.4286,0.75294)(0.5714,0.81961)(0.7143,0.86667)(0.8571,0.93333)(1,0.96863)
+BLUE:
+(0,0.52157)(0.0071,0.57255)(0.0286,0.60784)(0.0857,0.6549)(0.1429,0.70196)(0.2857,0.64314)(0.4286,0.7098)(0.5714,0.80784)(0.7143,0.87059)(0.8571,0.93333)(1,0.96471)
diff --git a/ds9/cmaps/tpglpof.sao b/ds9/cmaps/tpglpof.sao
new file mode 100644
index 0000000..1c50b5e
--- /dev/null
+++ b/ds9/cmaps/tpglpof.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglpof
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.54118)(0.0125,0.63529)(0.05,0.67843)(0.15,0.72157)(0.25,0.79216)(0.5,0.85882)(0.7494,0.93725)(1,0.95686)
+GREEN:
+(0,0.61176)(0.0125,0.69412)(0.05,0.7451)(0.15,0.78431)(0.25,0.84314)(0.5,0.89804)(0.7494,0.94902)(1,0.97255)
+BLUE:
+(0,0.70196)(0.0125,0.79216)(0.05,0.83529)(0.15,0.87451)(0.25,0.9098)(0.5,0.94118)(0.7494,0.98824)(1,0.99608)
diff --git a/ds9/cmaps/tpglpom.sao b/ds9/cmaps/tpglpom.sao
new file mode 100644
index 0000000..ab9e28f
--- /dev/null
+++ b/ds9/cmaps/tpglpom.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpglpom
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.54118)(0.0125,0.63529)(0.05,0.67843)(0.15,0.72157)(0.25,0.79216)(0.5,0.85882)(0.75,0.93725)(1,0.95686)
+GREEN:
+(0,0.61176)(0.0125,0.69412)(0.05,0.7451)(0.15,0.78431)(0.25,0.84314)(0.5,0.89804)(0.75,0.94902)(1,0.97255)
+BLUE:
+(0,0.70196)(0.0125,0.79216)(0.05,0.83529)(0.15,0.87451)(0.25,0.9098)(0.5,0.94118)(0.75,0.98824)(1,0.99608)
diff --git a/ds9/cmaps/tpsfhf.sao b/ds9/cmaps/tpsfhf.sao
new file mode 100644
index 0000000..0f1876a
--- /dev/null
+++ b/ds9/cmaps/tpsfhf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpsfhf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.17647)(0.0833,0.17647)(0.0833,0.16078)(0.1667,0.16078)(0.1667,0.21569)(0.3334,0.21569)(0.3334,0.27451)(0.5004,0.27451)(0.5004,0.37255)(0.6666,0.37255)(0.6666,0.45098)(0.8333,0.45098)(0.8333,0.56078)(0.9167,0.56078)(0.9167,0.66667)(0.9667,0.66667)(0.9667,0.77647)(0.9833,0.77647)(0.9833,0.88627)(1,0.88627)
+GREEN:
+(0,0.49804)(0.0833,0.49804)(0.0833,0.52941)(0.1667,0.52941)(0.1667,0.57255)(0.3334,0.57255)(0.3334,0.60392)(0.5004,0.60392)(0.5004,0.66275)(0.6666,0.66275)(0.6666,0.70196)(0.8333,0.70196)(0.8333,0.76471)(0.9167,0.76471)(0.9167,0.81569)(0.9667,0.81569)(0.9667,0.89804)(0.9833,0.89804)(0.9833,0.94118)(1,0.94118)
+BLUE:
+(0,0.58039)(0.0833,0.58039)(0.0833,0.63137)(0.1667,0.63137)(0.1667,0.68627)(0.3334,0.68627)(0.3334,0.7451)(0.5004,0.7451)(0.5004,0.8)(0.6666,0.8)(0.6666,0.81176)(0.8333,0.81176)(0.8333,0.85098)(0.9167,0.85098)(0.9167,0.85882)(0.9667,0.85882)(0.9667,0.90588)(0.9833,0.90588)(0.9833,0.9451)(1,0.9451)
diff --git a/ds9/cmaps/tpsfhm.sao b/ds9/cmaps/tpsfhm.sao
new file mode 100644
index 0000000..ea2bb91
--- /dev/null
+++ b/ds9/cmaps/tpsfhm.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpsfhm
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.17647)(0.0833,0.17647)(0.0833,0.16078)(0.1667,0.16078)(0.1667,0.21569)(0.3333,0.21569)(0.3333,0.27451)(0.5,0.27451)(0.5,0.37255)(0.6667,0.37255)(0.6667,0.45098)(0.8333,0.45098)(0.8333,0.56078)(0.9167,0.56078)(0.9167,0.66667)(0.9667,0.66667)(0.9667,0.77647)(0.9833,0.77647)(0.9833,0.88627)(1,0.88627)
+GREEN:
+(0,0.49804)(0.0833,0.49804)(0.0833,0.52941)(0.1667,0.52941)(0.1667,0.57255)(0.3333,0.57255)(0.3333,0.60392)(0.5,0.60392)(0.5,0.66275)(0.6667,0.66275)(0.6667,0.70196)(0.8333,0.70196)(0.8333,0.76471)(0.9167,0.76471)(0.9167,0.81569)(0.9667,0.81569)(0.9667,0.89804)(0.9833,0.89804)(0.9833,0.94118)(1,0.94118)
+BLUE:
+(0,0.58039)(0.0833,0.58039)(0.0833,0.63137)(0.1667,0.63137)(0.1667,0.68627)(0.3333,0.68627)(0.3333,0.7451)(0.5,0.7451)(0.5,0.8)(0.6667,0.8)(0.6667,0.81176)(0.8333,0.81176)(0.8333,0.85098)(0.9167,0.85098)(0.9167,0.85882)(0.9667,0.85882)(0.9667,0.90588)(0.9833,0.90588)(0.9833,0.9451)(1,0.9451)
diff --git a/ds9/cmaps/tpusarf.sao b/ds9/cmaps/tpusarf.sao
new file mode 100644
index 0000000..b064455
--- /dev/null
+++ b/ds9/cmaps/tpusarf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpusarf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.61176)(0.0139,0.63922)(0.0278,0.67451)(0.0417,0.70196)(0.0556,0.71765)(0.0694,0.73333)(0.0833,0.75686)(0.0972,0.76863)(0.1111,0.78431)(0.125,0.79216)(0.1389,0.79608)(0.1528,0.80392)(0.1667,0.80784)(0.1806,0.81569)(0.1944,0.82353)(0.2083,0.82745)(0.2222,0.83529)(0.2361,0.84706)(0.25,0.85882)(0.2639,0.87059)(0.2778,0.87451)(0.2917,0.87451)(0.3056,0.87451)(0.3194,0.87059)(0.3333,0.87843)(0.3472,0.87451)(0.3611,0.87451)(0.375,0.87059)(0.3889,0.87059)(0.4028,0.87059)(0.4167,0.86667)(0.4306,0.86275)(0.4444,0.86275)(0.4583,0.8549)(0.4722,0.85882)(0.4861,0.86275)(0.5,0.85882)(0.5139,0.85882)(0.5278,0.8549)(0.5417,0.8549)(0.5556,0.8549)(0.5694,0.8549)(0.5833,0.85882)(0.5972,0.85882)(0.6111,0.85882)(0.625,0.85882)(0.6389,0.8549)(0.6528,0.8549)(0.6667,0.8549)(0.6806,0.8549)(0.6944,0.8549)(0.7083,0.8549)(0.7222,0.85098)(0.7361,0.85098)(0.75,0.84706)(0.7639,0.84314)(0.7778,0.84314)(0.7917,0.84314)(0.8056,0.84706)(0.8194,0.85098)(0.8333,0.8549)(0.8472,0.85098)(0.8611,0.8549)(0.875,0.85882)(0.8889,0.85882)(0.9028,0.86667)(0.9167,0.87451)(0.9306,0.88235)(0.9444,0.88627)(0.9583,0.8902)(0.9722,0.89412)(0.9861,0.89804)(1,0.90196)
+GREEN:
+(0,0.59608)(0.0139,0.61961)(0.0278,0.66275)(0.0417,0.69412)(0.0556,0.7098)(0.0694,0.72941)(0.0833,0.7451)(0.0972,0.76863)(0.1111,0.77647)(0.125,0.78039)(0.1389,0.78431)(0.1528,0.79216)(0.1667,0.79608)(0.1806,0.80392)(0.1944,0.80784)(0.2083,0.81569)(0.2222,0.81961)(0.2361,0.83137)(0.25,0.83529)(0.2639,0.84314)(0.2778,0.83529)(0.2917,0.83137)(0.3056,0.82745)(0.3194,0.82353)(0.3333,0.81176)(0.3472,0.8)(0.3611,0.79216)(0.375,0.78431)(0.3889,0.77255)(0.4028,0.76863)(0.4167,0.76471)(0.4306,0.76078)(0.4444,0.76078)(0.4583,0.76863)(0.4722,0.77255)(0.4861,0.77647)(0.5,0.77647)(0.5139,0.78431)(0.5278,0.79216)(0.5417,0.79608)(0.5556,0.80392)(0.5694,0.80784)(0.5833,0.81176)(0.5972,0.81176)(0.6111,0.81176)(0.625,0.81176)(0.6389,0.81569)(0.6528,0.81569)(0.6667,0.81569)(0.6806,0.81569)(0.6944,0.81569)(0.7083,0.81569)(0.7222,0.81176)(0.7361,0.80784)(0.75,0.80784)(0.7639,0.81569)(0.7778,0.81569)(0.7917,0.81961)(0.8056,0.82353)(0.8194,0.82745)(0.8333,0.83529)(0.8472,0.83922)(0.8611,0.84706)(0.875,0.8549)(0.8889,0.85882)(0.9028,0.86275)(0.9167,0.87059)(0.9306,0.87451)(0.9444,0.87843)(0.9583,0.88627)(0.9722,0.8902)(0.9861,0.89804)(1,0.90196)
+BLUE:
+(0,0.56471)(0.0139,0.59216)(0.0278,0.62353)(0.0417,0.64706)(0.0556,0.66275)(0.0694,0.68235)(0.0833,0.69804)(0.0972,0.71373)(0.1111,0.72549)(0.125,0.72941)(0.1389,0.73333)(0.1528,0.74118)(0.1667,0.7451)(0.1806,0.74902)(0.1944,0.74902)(0.2083,0.75686)(0.2222,0.76078)(0.2361,0.76471)(0.25,0.76471)(0.2639,0.76078)(0.2778,0.76471)(0.2917,0.76078)(0.3056,0.76078)(0.3194,0.75294)(0.3333,0.74118)(0.3472,0.73725)(0.3611,0.72941)(0.375,0.72157)(0.3889,0.71765)(0.4028,0.71373)(0.4167,0.7098)(0.4306,0.70588)(0.4444,0.70588)(0.4583,0.7098)(0.4722,0.71765)(0.4861,0.72941)(0.5,0.73333)(0.5139,0.74118)(0.5278,0.75686)(0.5417,0.76078)(0.5556,0.76863)(0.5694,0.77255)(0.5833,0.77647)(0.5972,0.77647)(0.6111,0.78039)(0.625,0.78431)(0.6389,0.78824)(0.6528,0.79216)(0.6667,0.79216)(0.6806,0.79216)(0.6944,0.79216)(0.7083,0.79216)(0.7222,0.79216)(0.7361,0.79608)(0.75,0.79608)(0.7639,0.8)(0.7778,0.80392)(0.7917,0.80784)(0.8056,0.81176)(0.8194,0.82353)(0.8333,0.82745)(0.8472,0.83137)(0.8611,0.83922)(0.875,0.84706)(0.8889,0.85882)(0.9028,0.8549)(0.9167,0.86275)(0.9306,0.87451)(0.9444,0.87843)(0.9583,0.88627)(0.9722,0.89412)(0.9861,0.89804)(1,0.90196)
diff --git a/ds9/cmaps/tpusarm.sao b/ds9/cmaps/tpusarm.sao
new file mode 100644
index 0000000..cbdc0d5
--- /dev/null
+++ b/ds9/cmaps/tpusarm.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpusarm
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.61176)(0.0208,0.65882)(0.0417,0.70196)(0.0625,0.72549)(0.0833,0.75686)(0.1042,0.77647)(0.125,0.79216)(0.1458,0.8)(0.1667,0.80784)(0.1875,0.81961)(0.2083,0.82745)(0.2292,0.84314)(0.25,0.85882)(0.2708,0.87059)(0.2917,0.87451)(0.3125,0.87059)(0.3333,0.87843)(0.3542,0.87843)(0.375,0.87059)(0.3958,0.87059)(0.4167,0.86667)(0.4375,0.86275)(0.4583,0.8549)(0.4792,0.85882)(0.5,0.85882)(0.5208,0.8549)(0.5417,0.8549)(0.5625,0.8549)(0.5833,0.85882)(0.6042,0.85882)(0.625,0.85882)(0.6458,0.8549)(0.6667,0.8549)(0.6875,0.8549)(0.7083,0.8549)(0.7292,0.85098)(0.75,0.84706)(0.7708,0.84314)(0.7917,0.84314)(0.8125,0.85098)(0.8333,0.8549)(0.8542,0.85098)(0.875,0.85882)(0.8958,0.86275)(0.9167,0.87451)(0.9375,0.88627)(0.9583,0.8902)(0.9792,0.89412)(1,0.90196)
+GREEN:
+(0,0.59608)(0.0208,0.64314)(0.0417,0.69412)(0.0625,0.72157)(0.0833,0.7451)(0.1042,0.77255)(0.125,0.78039)(0.1458,0.78824)(0.1667,0.79608)(0.1875,0.80392)(0.2083,0.81569)(0.2292,0.82745)(0.25,0.83529)(0.2708,0.84314)(0.2917,0.83137)(0.3125,0.82353)(0.3333,0.81176)(0.3542,0.79608)(0.375,0.78431)(0.3958,0.77255)(0.4167,0.76471)(0.4375,0.76078)(0.4583,0.76863)(0.4792,0.77255)(0.5,0.77647)(0.5208,0.78824)(0.5417,0.79608)(0.5625,0.80392)(0.5833,0.81176)(0.6042,0.81176)(0.625,0.81176)(0.6458,0.81569)(0.6667,0.81569)(0.6875,0.81569)(0.7083,0.81569)(0.7292,0.80784)(0.75,0.80784)(0.7708,0.81569)(0.7917,0.81961)(0.8125,0.82745)(0.8333,0.83529)(0.8542,0.84314)(0.875,0.8549)(0.8958,0.85882)(0.9167,0.87059)(0.9375,0.87843)(0.9583,0.88627)(0.9792,0.89412)(1,0.90196)
+BLUE:
+(0,0.56471)(0.0208,0.60784)(0.0417,0.64706)(0.0625,0.67451)(0.0833,0.69804)(0.1042,0.72157)(0.125,0.72941)(0.1458,0.73725)(0.1667,0.7451)(0.1875,0.74902)(0.2083,0.75686)(0.2292,0.76471)(0.25,0.76471)(0.2708,0.76078)(0.2917,0.76078)(0.3125,0.75686)(0.3333,0.74118)(0.3542,0.73333)(0.375,0.72157)(0.3958,0.71765)(0.4167,0.7098)(0.4375,0.70588)(0.4583,0.7098)(0.4792,0.72549)(0.5,0.73333)(0.5208,0.74902)(0.5417,0.76078)(0.5625,0.76863)(0.5833,0.77647)(0.6042,0.78039)(0.625,0.78431)(0.6458,0.79216)(0.6667,0.79216)(0.6875,0.79216)(0.7083,0.79216)(0.7292,0.79608)(0.75,0.79608)(0.7708,0.8)(0.7917,0.80784)(0.8125,0.81961)(0.8333,0.82745)(0.8542,0.83529)(0.875,0.84706)(0.8958,0.85882)(0.9167,0.86275)(0.9375,0.87843)(0.9583,0.88627)(0.9792,0.89412)(1,0.90196)
diff --git a/ds9/cmaps/tpushuf.sao b/ds9/cmaps/tpushuf.sao
new file mode 100644
index 0000000..aeb8a62
--- /dev/null
+++ b/ds9/cmaps/tpushuf.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpushuf
+# created by cptutils 1.46
+# Wed Aug 15 23:31:06 2012
+PSEUDOCOLOR
+RED:
+(0,0.55686)(0.0139,0.58824)(0.0278,0.61569)(0.0417,0.64314)(0.0556,0.66275)(0.0694,0.68235)(0.0833,0.70196)(0.0972,0.72157)(0.1111,0.73725)(0.125,0.7451)(0.1389,0.75686)(0.1528,0.76863)(0.1667,0.77647)(0.1806,0.78431)(0.1944,0.8)(0.2083,0.81569)(0.2222,0.82745)(0.2361,0.84314)(0.25,0.8549)(0.2639,0.86667)(0.2778,0.87451)(0.2917,0.87843)(0.3056,0.87451)(0.3194,0.87059)(0.3333,0.87843)(0.3472,0.87451)(0.3611,0.87451)(0.375,0.87059)(0.3889,0.87059)(0.4028,0.87059)(0.4167,0.86667)(0.4306,0.86275)(0.4444,0.86275)(0.4583,0.8549)(0.4722,0.85882)(0.4861,0.86275)(0.5,0.85882)(0.5139,0.85882)(0.5278,0.85882)(0.5417,0.8549)(0.5556,0.85098)(0.5694,0.8549)(0.5833,0.85882)(0.5972,0.85882)(0.6111,0.85882)(0.625,0.85882)(0.6389,0.8549)(0.6528,0.8549)(0.6667,0.8549)(0.6806,0.8549)(0.6944,0.8549)(0.7083,0.8549)(0.7222,0.85098)(0.7361,0.85098)(0.75,0.84706)(0.7639,0.84314)(0.7778,0.84706)(0.7917,0.84314)(0.8056,0.84706)(0.8194,0.85098)(0.8333,0.85098)(0.8472,0.84706)(0.8611,0.8549)(0.875,0.85882)(0.8889,0.85882)(0.9028,0.86667)(0.9167,0.87451)(0.9306,0.88235)(0.9444,0.88627)(0.9583,0.8902)(0.9722,0.89412)(0.9861,0.89804)(1,0.90196)
+GREEN:
+(0,0.59608)(0.0139,0.63137)(0.0278,0.67843)(0.0417,0.7098)(0.0556,0.73333)(0.0694,0.75294)(0.0833,0.77255)(0.0972,0.79608)(0.1111,0.81176)(0.125,0.81961)(0.1389,0.81961)(0.1528,0.82353)(0.1667,0.82353)(0.1806,0.83137)(0.1944,0.83529)(0.2083,0.83529)(0.2222,0.84314)(0.2361,0.84314)(0.25,0.84314)(0.2639,0.84314)(0.2778,0.83529)(0.2917,0.83137)(0.3056,0.82745)(0.3194,0.82353)(0.3333,0.81176)(0.3472,0.8)(0.3611,0.79216)(0.375,0.78431)(0.3889,0.77255)(0.4028,0.76863)(0.4167,0.76471)(0.4306,0.76078)(0.4444,0.76078)(0.4583,0.76863)(0.4722,0.77255)(0.4861,0.77647)(0.5,0.77647)(0.5139,0.78431)(0.5278,0.79216)(0.5417,0.79608)(0.5556,0.80392)(0.5694,0.80784)(0.5833,0.81176)(0.5972,0.81176)(0.6111,0.81176)(0.625,0.81176)(0.6389,0.81569)(0.6528,0.81569)(0.6667,0.81569)(0.6806,0.81569)(0.6944,0.81569)(0.7083,0.81569)(0.7222,0.81176)(0.7361,0.80784)(0.75,0.80784)(0.7639,0.81569)(0.7778,0.81961)(0.7917,0.82353)(0.8056,0.82353)(0.8194,0.82745)(0.8333,0.83529)(0.8472,0.84314)(0.8611,0.85098)(0.875,0.8549)(0.8889,0.85882)(0.9028,0.86275)(0.9167,0.87059)(0.9306,0.87451)(0.9444,0.87843)(0.9583,0.88627)(0.9722,0.8902)(0.9861,0.89804)(1,0.90196)
+BLUE:
+(0,0.56863)(0.0139,0.59608)(0.0278,0.63922)(0.0417,0.66667)(0.0556,0.68235)(0.0694,0.70196)(0.0833,0.72157)(0.0972,0.7451)(0.1111,0.76078)(0.125,0.76078)(0.1389,0.76471)(0.1528,0.76863)(0.1667,0.76471)(0.1806,0.76863)(0.1944,0.77255)(0.2083,0.77255)(0.2222,0.77255)(0.2361,0.77255)(0.25,0.76863)(0.2639,0.76471)(0.2778,0.76471)(0.2917,0.76078)(0.3056,0.76078)(0.3194,0.75294)(0.3333,0.74118)(0.3472,0.73725)(0.3611,0.72941)(0.375,0.72157)(0.3889,0.71765)(0.4028,0.71373)(0.4167,0.7098)(0.4306,0.70588)(0.4444,0.70588)(0.4583,0.7098)(0.4722,0.71765)(0.4861,0.72941)(0.5,0.73333)(0.5139,0.74118)(0.5278,0.75686)(0.5417,0.76078)(0.5556,0.76863)(0.5694,0.77255)(0.5833,0.77647)(0.5972,0.77647)(0.6111,0.78039)(0.625,0.78431)(0.6389,0.78824)(0.6528,0.79216)(0.6667,0.79216)(0.6806,0.79216)(0.6944,0.79216)(0.7083,0.79216)(0.7222,0.79216)(0.7361,0.79608)(0.75,0.79608)(0.7639,0.8)(0.7778,0.80392)(0.7917,0.80784)(0.8056,0.81176)(0.8194,0.82353)(0.8333,0.82745)(0.8472,0.83529)(0.8611,0.84314)(0.875,0.84706)(0.8889,0.85882)(0.9028,0.8549)(0.9167,0.86275)(0.9306,0.87451)(0.9444,0.87843)(0.9583,0.88627)(0.9722,0.8902)(0.9861,0.89804)(1,0.90196)
diff --git a/ds9/cmaps/tpushum.sao b/ds9/cmaps/tpushum.sao
new file mode 100644
index 0000000..44cfc9f
--- /dev/null
+++ b/ds9/cmaps/tpushum.sao
@@ -0,0 +1,11 @@
+# SAOimage color table
+# tpushum
+# created by cptutils 1.46
+# Wed Aug 15 23:31:07 2012
+PSEUDOCOLOR
+RED:
+(0,0.55686)(0.0208,0.6)(0.0417,0.64314)(0.0625,0.67451)(0.0833,0.70196)(0.1042,0.72941)(0.125,0.7451)(0.1458,0.76078)(0.1667,0.77647)(0.1875,0.79216)(0.2083,0.81569)(0.2292,0.83529)(0.25,0.8549)(0.2708,0.87059)(0.2917,0.87843)(0.3125,0.87059)(0.3333,0.87843)(0.3542,0.87843)(0.375,0.87059)(0.3958,0.87059)(0.4167,0.86667)(0.4375,0.86275)(0.4583,0.8549)(0.4792,0.85882)(0.5,0.85882)(0.5208,0.85882)(0.5417,0.8549)(0.5625,0.85098)(0.5833,0.85882)(0.6042,0.85882)(0.625,0.85882)(0.6458,0.8549)(0.6667,0.8549)(0.6875,0.8549)(0.7083,0.8549)(0.7292,0.85098)(0.75,0.84706)(0.7708,0.84314)(0.7917,0.84314)(0.8125,0.85098)(0.8333,0.85098)(0.8542,0.85098)(0.875,0.85882)(0.8958,0.86275)(0.9167,0.87451)(0.9375,0.88627)(0.9583,0.8902)(0.9792,0.89804)(1,0.90196)
+GREEN:
+(0,0.59608)(0.0208,0.6549)(0.0417,0.7098)(0.0625,0.7451)(0.0833,0.77255)(0.1042,0.80392)(0.125,0.81961)(0.1458,0.81961)(0.1667,0.82353)(0.1875,0.83137)(0.2083,0.83529)(0.2292,0.84314)(0.25,0.84314)(0.2708,0.84314)(0.2917,0.83137)(0.3125,0.82353)(0.3333,0.81176)(0.3542,0.79608)(0.375,0.78431)(0.3958,0.77255)(0.4167,0.76471)(0.4375,0.76078)(0.4583,0.76863)(0.4792,0.77255)(0.5,0.77647)(0.5208,0.78824)(0.5417,0.79608)(0.5625,0.80784)(0.5833,0.81176)(0.6042,0.81176)(0.625,0.81176)(0.6458,0.81569)(0.6667,0.81569)(0.6875,0.81569)(0.7083,0.81569)(0.7292,0.80784)(0.75,0.80784)(0.7708,0.81569)(0.7917,0.82353)(0.8125,0.82745)(0.8333,0.83529)(0.8542,0.84706)(0.875,0.8549)(0.8958,0.85882)(0.9167,0.87059)(0.9375,0.87843)(0.9583,0.88627)(0.9792,0.89412)(1,0.90196)
+BLUE:
+(0,0.56863)(0.0208,0.61961)(0.0417,0.66667)(0.0625,0.69412)(0.0833,0.72157)(0.1042,0.75294)(0.125,0.76078)(0.1458,0.76471)(0.1667,0.76471)(0.1875,0.76863)(0.2083,0.77255)(0.2292,0.77255)(0.25,0.76863)(0.2708,0.76078)(0.2917,0.76078)(0.3125,0.75686)(0.3333,0.74118)(0.3542,0.73333)(0.375,0.72157)(0.3958,0.71765)(0.4167,0.7098)(0.4375,0.70588)(0.4583,0.7098)(0.4792,0.72549)(0.5,0.73333)(0.5208,0.74902)(0.5417,0.76078)(0.5625,0.76863)(0.5833,0.77647)(0.6042,0.78039)(0.625,0.78431)(0.6458,0.79216)(0.6667,0.79216)(0.6875,0.79216)(0.7083,0.79216)(0.7292,0.79608)(0.75,0.79608)(0.7708,0.8)(0.7917,0.80784)(0.8125,0.81961)(0.8333,0.82745)(0.8542,0.83922)(0.875,0.84706)(0.8958,0.85882)(0.9167,0.86275)(0.9375,0.87843)(0.9583,0.88627)(0.9792,0.89412)(1,0.90196)
diff --git a/ds9/cmaps/viridis.lut b/ds9/cmaps/viridis.lut
new file mode 100644
index 0000000..3896a91
--- /dev/null
+++ b/ds9/cmaps/viridis.lut
@@ -0,0 +1,257 @@
+# matplotlib _cm.py
+0.26700401 0.00487433 0.32941519
+0.26851048 0.00960483 0.33542652
+0.26994384 0.01462494 0.34137895
+0.27130489 0.01994186 0.34726862
+0.27259384 0.02556309 0.35309303
+0.27380934 0.03149748 0.35885256
+0.27495242 0.03775181 0.36454323
+0.27602238 0.04416723 0.37016418
+0.2770184 0.05034437 0.37571452
+0.27794143 0.05632444 0.38119074
+0.27879067 0.06214536 0.38659204
+0.2795655 0.06783587 0.39191723
+0.28026658 0.07341724 0.39716349
+0.28089358 0.07890703 0.40232944
+0.28144581 0.0843197 0.40741404
+0.28192358 0.08966622 0.41241521
+0.28232739 0.09495545 0.41733086
+0.28265633 0.10019576 0.42216032
+0.28291049 0.10539345 0.42690202
+0.28309095 0.11055307 0.43155375
+0.28319704 0.11567966 0.43611482
+0.28322882 0.12077701 0.44058404
+0.28318684 0.12584799 0.44496
+0.283072 0.13089477 0.44924127
+0.28288389 0.13592005 0.45342734
+0.28262297 0.14092556 0.45751726
+0.28229037 0.14591233 0.46150995
+0.28188676 0.15088147 0.46540474
+0.28141228 0.15583425 0.46920128
+0.28086773 0.16077132 0.47289909
+0.28025468 0.16569272 0.47649762
+0.27957399 0.17059884 0.47999675
+0.27882618 0.1754902 0.48339654
+0.27801236 0.18036684 0.48669702
+0.27713437 0.18522836 0.48989831
+0.27619376 0.19007447 0.49300074
+0.27519116 0.1949054 0.49600488
+0.27412802 0.19972086 0.49891131
+0.27300596 0.20452049 0.50172076
+0.27182812 0.20930306 0.50443413
+0.27059473 0.21406899 0.50705243
+0.26930756 0.21881782 0.50957678
+0.26796846 0.22354911 0.5120084
+0.26657984 0.2282621 0.5143487
+0.2651445 0.23295593 0.5165993
+0.2636632 0.23763078 0.51876163
+0.26213801 0.24228619 0.52083736
+0.26057103 0.2469217 0.52282822
+0.25896451 0.25153685 0.52473609
+0.25732244 0.2561304 0.52656332
+0.25564519 0.26070284 0.52831152
+0.25393498 0.26525384 0.52998273
+0.25219404 0.26978306 0.53157905
+0.25042462 0.27429024 0.53310261
+0.24862899 0.27877509 0.53455561
+0.2468114 0.28323662 0.53594093
+0.24497208 0.28767547 0.53726018
+0.24311324 0.29209154 0.53851561
+0.24123708 0.29648471 0.53970946
+0.23934575 0.30085494 0.54084398
+0.23744138 0.30520222 0.5419214
+0.23552606 0.30952657 0.54294396
+0.23360277 0.31382773 0.54391424
+0.2316735 0.3181058 0.54483444
+0.22973926 0.32236127 0.54570633
+0.22780192 0.32659432 0.546532
+0.2258633 0.33080515 0.54731353
+0.22392515 0.334994 0.54805291
+0.22198915 0.33916114 0.54875211
+0.22005691 0.34330688 0.54941304
+0.21812995 0.34743154 0.55003755
+0.21620971 0.35153548 0.55062743
+0.21429757 0.35561907 0.5511844
+0.21239477 0.35968273 0.55171011
+0.2105031 0.36372671 0.55220646
+0.20862342 0.36775151 0.55267486
+0.20675628 0.37175775 0.55311653
+0.20490257 0.37574589 0.55353282
+0.20306309 0.37971644 0.55392505
+0.20123854 0.38366989 0.55429441
+0.1994295 0.38760678 0.55464205
+0.1976365 0.39152762 0.55496905
+0.19585993 0.39543297 0.55527637
+0.19410009 0.39932336 0.55556494
+0.19235719 0.40319934 0.55583559
+0.19063135 0.40706148 0.55608907
+0.18892259 0.41091033 0.55632606
+0.18723083 0.41474645 0.55654717
+0.18555593 0.4185704 0.55675292
+0.18389763 0.42238275 0.55694377
+0.18225561 0.42618405 0.5571201
+0.18062949 0.42997486 0.55728221
+0.17901879 0.43375572 0.55743035
+0.17742298 0.4375272 0.55756466
+0.17584148 0.44128981 0.55768526
+0.17427363 0.4450441 0.55779216
+0.17271876 0.4487906 0.55788532
+0.17117615 0.4525298 0.55796464
+0.16964573 0.45626209 0.55803034
+0.16812641 0.45998802 0.55808199
+0.1666171 0.46370813 0.55811913
+0.16511703 0.4674229 0.55814141
+0.16362543 0.47113278 0.55814842
+0.16214155 0.47483821 0.55813967
+0.16066467 0.47853961 0.55811466
+0.15919413 0.4822374 0.5580728
+0.15772933 0.48593197 0.55801347
+0.15626973 0.4896237 0.557936
+0.15481488 0.49331293 0.55783967
+0.15336445 0.49700003 0.55772371
+0.1519182 0.50068529 0.55758733
+0.15047605 0.50436904 0.55742968
+0.14903918 0.50805136 0.5572505
+0.14760731 0.51173263 0.55704861
+0.14618026 0.51541316 0.55682271
+0.14475863 0.51909319 0.55657181
+0.14334327 0.52277292 0.55629491
+0.14193527 0.52645254 0.55599097
+0.14053599 0.53013219 0.55565893
+0.13914708 0.53381201 0.55529773
+0.13777048 0.53749213 0.55490625
+0.1364085 0.54117264 0.55448339
+0.13506561 0.54485335 0.55402906
+0.13374299 0.54853458 0.55354108
+0.13244401 0.55221637 0.55301828
+0.13117249 0.55589872 0.55245948
+0.1299327 0.55958162 0.55186354
+0.12872938 0.56326503 0.55122927
+0.12756771 0.56694891 0.55055551
+0.12645338 0.57063316 0.5498411
+0.12539383 0.57431754 0.54908564
+0.12439474 0.57800205 0.5482874
+0.12346281 0.58168661 0.54744498
+0.12260562 0.58537105 0.54655722
+0.12183122 0.58905521 0.54562298
+0.12114807 0.59273889 0.54464114
+0.12056501 0.59642187 0.54361058
+0.12009154 0.60010387 0.54253043
+0.11973756 0.60378459 0.54139999
+0.11951163 0.60746388 0.54021751
+0.11942341 0.61114146 0.53898192
+0.11948255 0.61481702 0.53769219
+0.11969858 0.61849025 0.53634733
+0.12008079 0.62216081 0.53494633
+0.12063824 0.62582833 0.53348834
+0.12137972 0.62949242 0.53197275
+0.12231244 0.63315277 0.53039808
+0.12344358 0.63680899 0.52876343
+0.12477953 0.64046069 0.52706792
+0.12632581 0.64410744 0.52531069
+0.12808703 0.64774881 0.52349092
+0.13006688 0.65138436 0.52160791
+0.13226797 0.65501363 0.51966086
+0.13469183 0.65863619 0.5176488
+0.13733921 0.66225157 0.51557101
+0.14020991 0.66585927 0.5134268
+0.14330291 0.66945881 0.51121549
+0.1466164 0.67304968 0.50893644
+0.15014782 0.67663139 0.5065889
+0.15389405 0.68020343 0.50417217
+0.15785146 0.68376525 0.50168574
+0.16201598 0.68731632 0.49912906
+0.1663832 0.69085611 0.49650163
+0.1709484 0.69438405 0.49380294
+0.17570671 0.6978996 0.49103252
+0.18065314 0.70140222 0.48818938
+0.18578266 0.70489133 0.48527326
+0.19109018 0.70836635 0.48228395
+0.19657063 0.71182668 0.47922108
+0.20221902 0.71527175 0.47608431
+0.20803045 0.71870095 0.4728733
+0.21400015 0.72211371 0.46958774
+0.22012381 0.72550945 0.46622638
+0.2263969 0.72888753 0.46278934
+0.23281498 0.73224735 0.45927675
+0.2393739 0.73558828 0.45568838
+0.24606968 0.73890972 0.45202405
+0.25289851 0.74221104 0.44828355
+0.25985676 0.74549162 0.44446673
+0.26694127 0.74875084 0.44057284
+0.27414922 0.75198807 0.4366009
+0.28147681 0.75520266 0.43255207
+0.28892102 0.75839399 0.42842626
+0.29647899 0.76156142 0.42422341
+0.30414796 0.76470433 0.41994346
+0.31192534 0.76782207 0.41558638
+0.3198086 0.77091403 0.41115215
+0.3277958 0.77397953 0.40664011
+0.33588539 0.7770179 0.40204917
+0.34407411 0.78002855 0.39738103
+0.35235985 0.78301086 0.39263579
+0.36074053 0.78596419 0.38781353
+0.3692142 0.78888793 0.38291438
+0.37777892 0.79178146 0.3779385
+0.38643282 0.79464415 0.37288606
+0.39517408 0.79747541 0.36775726
+0.40400101 0.80027461 0.36255223
+0.4129135 0.80304099 0.35726893
+0.42190813 0.80577412 0.35191009
+0.43098317 0.80847343 0.34647607
+0.44013691 0.81113836 0.3409673
+0.44936763 0.81376835 0.33538426
+0.45867362 0.81636288 0.32972749
+0.46805314 0.81892143 0.32399761
+0.47750446 0.82144351 0.31819529
+0.4870258 0.82392862 0.31232133
+0.49661536 0.82637633 0.30637661
+0.5062713 0.82878621 0.30036211
+0.51599182 0.83115784 0.29427888
+0.52577622 0.83349064 0.2881265
+0.5356211 0.83578452 0.28190832
+0.5455244 0.83803918 0.27562602
+0.55548397 0.84025437 0.26928147
+0.5654976 0.8424299 0.26287683
+0.57556297 0.84456561 0.25641457
+0.58567772 0.84666139 0.24989748
+0.59583934 0.84871722 0.24332878
+0.60604528 0.8507331 0.23671214
+0.61629283 0.85270912 0.23005179
+0.62657923 0.85464543 0.22335258
+0.63690157 0.85654226 0.21662012
+0.64725685 0.85839991 0.20986086
+0.65764197 0.86021878 0.20308229
+0.66805369 0.86199932 0.19629307
+0.67848868 0.86374211 0.18950326
+0.68894351 0.86544779 0.18272455
+0.69941463 0.86711711 0.17597055
+0.70989842 0.86875092 0.16925712
+0.72039115 0.87035015 0.16260273
+0.73088902 0.87191584 0.15602894
+0.74138803 0.87344918 0.14956101
+0.75188414 0.87495143 0.14322828
+0.76237342 0.87642392 0.13706449
+0.77285183 0.87786808 0.13110864
+0.78331535 0.87928545 0.12540538
+0.79375994 0.88067763 0.12000532
+0.80418159 0.88204632 0.11496505
+0.81457634 0.88339329 0.11034678
+0.82494028 0.88472036 0.10621724
+0.83526959 0.88602943 0.1026459
+0.84556056 0.88732243 0.09970219
+0.8558096 0.88860134 0.09745186
+0.86601325 0.88986815 0.09595277
+0.87616824 0.89112487 0.09525046
+0.88627146 0.89237353 0.09537439
+0.89632002 0.89361614 0.09633538
+0.90631121 0.89485467 0.09812496
+0.91624212 0.89609127 0.1007168
+0.92610579 0.89732977 0.10407067
+0.93590444 0.8985704 0.10813094
+0.94563626 0.899815 0.11283773
+0.95529972 0.90106534 0.11812832
+0.96489353 0.90232311 0.12394051
+0.97441665 0.90358991 0.13021494
+0.98386829 0.90486726 0.13689671
+0.99324789 0.90615657 0.1439362 \ No newline at end of file
diff --git a/ds9/doc/acknowledgment.html b/ds9/doc/acknowledgment.html
new file mode 100644
index 0000000..75c3966
--- /dev/null
+++ b/ds9/doc/acknowledgment.html
@@ -0,0 +1,33 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Acknowledgment</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3> <img alt="" src="sun.gif" height="98" align="middle"
+ width="100"> SAOImage DS9 Acknowledgment</h3>
+ <blockquote>
+ <p>SAOImage DS9 development has been made possible by funding from
+ the Chandra X-ray Science Center (CXC) (NAS8-03060) and the High
+ Energy Astrophysics Science Archive Center (HEASARC) (NCC5-568).
+ Additional funding was provided by the JWST Mission office at
+ Space Telescope Science Institute (NAS-03127) to improve
+ capabilities for 3-D data visualization.<br>
+ </p>
+ <p>If you have found SAOImage DS9 to be helpful in your research,
+ the following acknowledgment would be appreciated</p>
+ <p><i> </i></p>
+ <blockquote>
+ <p><i>"This research has made use of SAOImage DS9, developed by
+ Smithsonian Astrophysical Observatory" </i></p>
+ </blockquote>
+ <p>or reference the following paper<a
+href="http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=2003adass..12..489J">2003adass..12..489J</a></p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/faq.html b/ds9/doc/faq.html
new file mode 100644
index 0000000..4feac67
--- /dev/null
+++ b/ds9/doc/faq.html
@@ -0,0 +1,805 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>DS9 FAQ</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" vlink="#551a8b"
+ text="#000000">
+ <h3> <img alt="" src="sun.gif" align="middle" height="98"
+ width="100"> SAOImage DS9 FAQ</h3>
+ <blockquote>
+ <p>This FAQ is a new, on going project, and it is far from being
+ complete. But as common questions on DS9 are received, the FAQ
+ will be updated. </p>
+ <p><b>Contents</b></p>
+ <blockquote><a href="#Copyright">Copyright</a><br>
+ <a href="#General">General</a><br>
+ <a href="#Fonts">Fonts</a><br>
+ <a href="faq.html#Linux">Linux</a> <br>
+ <a href="faq.html#Windows">Windows</a> <br>
+ <a href="#MacOSX">MacOSX</a><br>
+ <a href="faq.html#X11">X11</a> <br>
+ <a href="#IRAF">IRAF</a> <br>
+ <a href="#Coordinates">Coordinates</a> <br>
+ <a href="#Regions">Regions</a> <br>
+ <a href="#Printing">Printing</a> <br>
+ <a href="#XPA">XPA</a><br>
+ <a href="#VO">VO</a><br>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p> <b><a name="Copyright"></a>Copyright</b></p>
+ <blockquote>
+ <p>SAOImage DS9 is composed of approximately 20 open source
+ packages, all of which are distributed under their own open
+ source license agreements, usually GPL, LGPL, or BSD. In
+ addition, several open source packages have been developed
+ here at the Smithsonian Astrophysical Observatory, Cambridge,
+ MA, USA and are distributed under the terms of the GNU General
+ Public License as published by the Free Software Foundation.
+ As long as you continue to adhere to the provisions of the
+ licenses, you are free to distribute SAOImage DS9 along with
+ your software.</p>
+ <p>The <a href="http://www.gnu.org/copyleft/gpl.html">GNU site</a>
+ contains an excellent FAQ on the the dos and donts of GPL.</p>
+ </blockquote>
+ <p><b><a name="General"></a>General</b></p>
+ <blockquote>
+ <p><b>The web browser, catalog tool, image server, and other
+ Analysis functions don't appear to work. Whats going on?<br>
+ </b></p>
+ <p>For a number of the Analysis functions, DS9 requires
+ temporary disk space to download and store data. By default,
+ this directory is defined by the TMP or TEMP environment
+ variable. This is usually defined as <tt>/tmp</tt> for Linux
+ and MacOSX users. For Windows users, this will vary, depending
+ on which version of Windows you have. In any case, if the temp
+ directory is not writable, or you have specified an invalid
+ directory in the preferences, these functions will fail with a
+ variety of error messages.<br>
+ </p>
+ <p><b>My system admin stripped the DS9 binary and now DS9 fails
+ to start with the following error message:</b></p>
+ <p><tt>Application initialization failed: Can't find a usable
+ tk.tcl in the following directories...</tt></p>
+ <p>DS9 is based on tcl/tk which is a scripting language which
+ requires many support files. To create a stand alone
+ application, we <i>fool</i> tcl/tk into thinking that it has
+ a valid installation. To do this, DS9 is really an
+ application, along with an zip archive attached. The first
+ thing DS9 does is to create a virtual file system in memory
+ and unpack that archive into memory. The application DS9 is
+ already stripped of debugging symbols when built. </p>
+ <p>It appears that the <tt>strip</tt> command is <i>stripping</i>
+ part of the archive, hence DS9 is unable to un-compress it. In
+ summary, don't <tt>strip</tt> the DS9 binary and everything
+ works fine. </p>
+ <p><b>When I open my FITS image, all I see is 'white'. Yet
+ everything, including the color bar seems to work?</b></p>
+ <p>New with version 2.1, is support for the DATASEC keyword.
+ This keyword specifies what portion of the image is valid
+ data, for calculating min / max and for displaying. This is
+ very important for images created from CCDs with over scan and
+ bias strips. By default, this support is enabled. However, a
+ number of fits images with this keyword, have invalid values.
+ Therefor, when DS9 opens the image, it finds no valid data to
+ display. To correct this problem, either disable DATASEC
+ support, via the Scale menu, or correct the the value of
+ DATASEC in the fits header. You can also change the default
+ behavior by disabling DATASEC from the preferences menu.<br>
+ </p>
+ </blockquote>
+ <p> <b><a name="Fonts"></a>Fonts</b></p>
+ <blockquote>
+ <p><b>Where is the Symbol Font? How do I enter special
+ characters into an entry dialog?</b> </p>
+ <p>The concept of a separate <tt>SYMBOL</tt> font is no longer
+ implemented with the latest OS font and scripting support,
+ especially with scalable anti-alias fonts such as Xft for
+ Linux. Most newer fonts (if not all) now have greek characters
+ as part of the font. The greek chars start at unicode \u0391
+ for 'A' and \u03b1 for 'a'. Each OS has a tool used to build
+ and copy a string of characters. Then use the Edit:Paste menu
+ of DS9 to insert the character string.</p>
+ <p>Linux- Gnome: <b>gucharmap<br>
+ </b>Linux- KDE: <b>kcharselect<br>
+ </b>MacOSX: <b>Character Viewer</b> (Select <tt>Edit:Special
+ Characters</tt>) Now click and drag the characters to a
+ terminal window. Then select the string and select <tt>Edit:Copy</tt>.<br>
+ Windows: <b>Character Map</b> (from <tt>Start</tt> button,
+ select <tt>All Programs</tt>, <tt>Accessories</tt>, <tt>System
+
+
+
+
+ Tools</tt> and then <tt>Character Map</tt>)<br>
+ </p>
+ </blockquote>
+ <p> <b><a name="Linux"></a>Linux</b></p>
+ <blockquote>
+ <p><b>My /tmp directory is mounted -noexec and bin table
+ filtering does not work.</b></p>
+ <p>Set the environment variable FILTER_TMPDIR to a directory
+ that is both writable and can execute.<br>
+ </p>
+ <p><b>I have Red Hat 7, and I'm running KDE. The magnifier keeps
+ going blank after a few seconds, what's going on?</b> </p>
+ <p>The problem was in KDE. If the user has decided to hide the
+ panel taskbar and&nbsp; sets a delay time for when it appears
+ if the mouse is moved to the panel&nbsp; location, then it
+ appears that KDE creates mouse events that fool DS9 into&nbsp;
+ thinking the mouse is outside and it blanks the magnifier. By
+ turning off the&nbsp; hide panel, the effect goes away. The
+ alternative is to update to KDE2.1Beta&nbsp; where this method
+ of dealing with the hidden panel is not used and all is&nbsp;
+ well, as it was for KDE </p>
+ <p><b>I have FreeBSD. When I run ds9, I get the following error:</b>
+ <tt>&nbsp; <b>ELF binary type "0" not known</b> </tt><b>Whats
+
+
+
+
+
+ going on?</b></p>
+ <p>The solution was to use the <b><tt>brandelf</tt></b> utility
+ on the file to ensure that the machine understood that it
+ &nbsp;was a Linux program.</p>
+ <p><tt>% brandelf -t Linux (file name)<br>
+ </tt></p>
+ <blockquote> </blockquote>
+ </blockquote>
+ <p> <b><a name="Windows"></a>Windows</b></p>
+ <blockquote>
+ <p><b>When I do Save Image, I get the same result (and this is
+ true for either .gif, .jpeg, .tiff, .png and .ppm) : it
+ saves only a stripe at the top of my image.<br>
+ </b></p>
+ <p>This problem seems to be caused by running DS9 in Windows XP
+ compatibility mode. Please un-check the compatibility option
+ in the properties dialog.<br>
+ </p>
+ <p><b>How can I open a FITS file with an extension name?</b></p>
+ <p><b> </b>By default, the windows port of DS9 uses the Windows
+ standard dialog box to open and save files. This can be a
+ problem in that the native Windows dialog will not allow
+ extensions to the file name, such as <tt>foo.fits[2]</tt>.
+ You must use the Unix like standard dialogs to be able to
+ specify an extension. Select <tt>Edit-&gt;Preferences-&gt;General:Dialogbox</tt>
+ to change the default standard dialog.</p>
+ <p><b>Every time I create an auxiliary window in ds9, such as a
+ Pixel Table, or Analysis Plot, it will retreat behind the
+ main ds9 window. Then, when I bring the auxiliary window to
+ the front and move the mouse out of it, it automatically
+ goes behind the main ds9 window again. What can I do to fix
+ things so that the auxiliary window stays on top of the ds9
+ window?</b> </p>
+ <p>To fix things so that the auxiliary window stays on top of
+ the ds9 window, do the following: </p>
+ <blockquote>
+ <p><tt>Go to the icon task bar at the bottom of the screen.</tt><tt>
+ Bring the auxiliary window to the front by clicking on its
+ icon in the icon task bar.</tt><tt> While the mouse still
+ is on the aux window icon, press the mouse button, and
+ keeping it pressed, move the mouse off the task bar.</tt><tt>
+ Release the mouse while off the task bar.</tt><tt> The
+ auxiliary window will now stay on top of the main ds9
+ window.</tt></p>
+ <blockquote> </blockquote>
+ </blockquote>
+ </blockquote>
+ <p><b><a name="MacOSX"></a>MacOSX</b><br>
+ </p>
+ <blockquote>
+ <p><b>I can't invoke the 'Save Image' function from the MacOSX
+ X11 version. I get an error message "An error has occurred
+ while creating the image. Please make sure entire image is
+ visible on screen."<br>
+ </b></p>
+ Up until MacOSX 10.8 (Mountain Lion), Apple provided their own
+ version of a X11 server. At first, it was based on XFree86
+ (X11R6.6) and available with versions up to MacOSX 10.4. Later
+ with MacOSX versions 10.5 to 10.7, the Apple's X11 server was
+ based upon X.org (X11R7.2). <br>
+ <br>
+ The Apple version of X11 server for MacOSX 10.5 to 10.7 contains
+ a bug which fails if you invoke certain X11 calls on a window if
+ its location is not at 0,0 on the screen. Hence, within DS9, if
+ you 'Save Image' and your window is not exactly in the upper
+ left corner, it will fail.<br>
+ <br>
+ Again, this only affects users of MacOSX 10.5 to 10.7.<br>
+ <br>
+ Starting with MacOSX 10.8, Apple no longer provides a X11 window
+ server. The user must go to the XQuartz site and
+ download/install directly. The current version is 2.7.3.<br>
+ <p><b>When I invoke DS9 MacOSX Aqua from the command line, I get
+ weird errors such as<tt>:</tt></b></p>
+ <blockquote>
+ <p><tt>The document "foo.fits" could not be opened. SAOImage
+ DS9 cannot open files in the "Flexible Image Transport
+ System" format.</tt></p>
+ </blockquote>
+ <p><b><tt> </tt></b>When opening MacOSX Aqua from the command
+ line, it is better to use the <tt>OPEN</tt> application as
+ opposed to specifying the binary directly. The <tt>OPEN</tt>
+ application sets up the environment just as it is when a user
+ double clicks.</p>
+ <tt> # good</tt><br>
+ <tt>% open /Applications/SAOImage\ DS9.app foo.fits<br>
+ <br>
+ # bad<br>
+ % /Applications/SAOImage\ DS9.app/Contents/MacOS/ds9 bar.fits</tt><br>
+ <p><b>How can I open a FITS file with an extension name?</b></p>
+ <p><b> </b>By default, DS9 MacOSX Aqua uses the MacOSX standard
+ dialog box to open and save files. This can be a problem in
+ that the native MacOSX dialog will not allow extensions to the
+ file name, such as <tt>foo.fits[2]</tt>. You must use the
+ Unix like standard dialogs to be able to specify an extension.
+ Select <tt>Edit-&gt;Preferences-&gt;General</tt> to change
+ the default standard dialog.</p>
+ <p><b>How do I set my PATH environment variable under MacOSX for
+ use with external analysis programs, such as funtools?<br>
+ </b></p>
+ <p>When you double click on a MacOSX application, it does not
+ parse any shell startup files, such as ~/.profile. Instead,
+ the environment is defined using a special environment file, <tt>.MacOSX/environment.plist</tt>.
+ This file can be created with the MacOSX utility <tt>/Developer/Applications/PropertyListEditor.app.
+
+
+
+
+ </tt>For further information, please click <a
+ href="http://developer.apple.com/qa/qa2001/qa1067.html">here</a>.<br>
+ </p>
+ <blockquote> </blockquote>
+ </blockquote>
+ <p> <b><a name="X11"></a>X11</b><br>
+ </p>
+ <blockquote>
+ <p><b>Is it possible to work in batch mode without a physical
+ display?<br>
+ </b></p>
+ <p>DS9 is written as an interactive, window client program, and
+ as a result, does require a window server to be available for
+ rendering (X11, Windows, or MacOSX).<br>
+ <br>
+ Therefore, using DS9 as a batch process can be cumbersome. We
+ recommend using <tt>xvfb</tt> under X11. Just set up a
+ virtual display buffer, reset your DISPLAY variable, then
+ invoke DS9 with a number of command line options or use xpa
+ from a shell script as a batch processor. Example:<br>
+ </p>
+ <p><tt>% export DISPLAY=:1</tt><tt><br>
+ </tt><tt>% Xvfb :1 -screen 0 1024x768x16 &amp;</tt><tt><br>
+ </tt><tt>% ds9 -file cmap.fits -zoom to fit -cmap b -grid
+ skyformat degrees -grid yes -regions ../EMS-names.reg
+ -saveimage png mytest.png -exit</tt><br>
+ </p>
+ <p><b>When I start DS9, I get the following error message:</b></p>
+ <tt>_X11TransSocketINETConnect: Can't get address for
+ foo.bar.edu </tt><br>
+ <tt>couldn't connect to display "foo.bar.edu:0.0"</tt> &nbsp; <br>
+ <p>DS9 is unable to determine a valid X11 Display server,
+ because of a number of reasons. Most often this is seen when
+ you have a laptop configured for a network, but is not
+ physically connected. You need to set the DISPLAY environment
+ variable to :0.0 </p>
+ <blockquote><tt>$ xhost + </tt><br>
+ <tt>$ set DISPLAY=:0.0 </tt><br>
+ <tt>$ export DISPLAY </tt><br>
+ </blockquote>
+ <p><b>Under Solaris, when I start DS9, my twm window manager
+ crashes!</b></p>
+ <p>TWM distributed with X11R5 had a major bug, that was
+ corrected around 1996. DS9 will trigger this bug, and will
+ cause TWM to crash. If you are running Solaris, and have X11R5
+ installed, be sure that /usr/openwin/bin is in your path
+ before X11R5/bin. This will insure that you are running the
+ correct version of TWM . </p>
+ <p><b>When I run ds9 with the tvtwm window manager, sometimes
+ the open file dialog box does not appear?</b> </p>
+ <p>If you are running tvtwm, and you are currently viewing a
+ virtual screen other than the first, when you open a file, the
+ dialog box will appear in the first virtual screen, not your
+ current. This is a bug with tvtwm and not ds9.</p>
+ </blockquote>
+ <blockquote>
+ <p> </p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p><b><a name="IRAF"></a>IRAF</b></p>
+ </blockquote>
+ <blockquote>
+ <blockquote>
+ <blockquote>
+ <blockquote> </blockquote>
+ </blockquote>
+ <p><b>I can't use more than 9 frames with the IMEXAMINE task?</b><br>
+ </p>
+ <p>The task <tt>IMEXAMINE</tt> can not be used with frame
+ numbers greater than 9.</p>
+ <p><b>Can I display from IRAF to DS9 running under Windows or
+ MacOSX?</b> </p>
+ <p>Yes, DS9 for Windows and MacOSX is also a fully functional
+ IRAF display server. To direct image output from IRAF to DS9
+ running under Windows or MacOSX, use the IMTDEV environment
+ variable. For example, if the machine is named 'foo.bar.edu',
+ define IMTDEV to the follow value before entering IRAF. </p>
+ <blockquote><tt>$ setenv IMTDEV inet:5137:foo.bar.edu </tt><br>
+ <tt>$ cl </tt><br>
+ <tt>cl&gt; display dev$pix</tt><br>
+ </blockquote>
+ <blockquote>
+ <blockquote> </blockquote>
+ </blockquote>
+ <p><b>I'm having problems with </b><b>mscred task </b><b>msczero?</b></p>
+ DS9 now supports IRAF's new IIS image display protocol. However,
+ there is one minor problem with the <b>mscred</b> task <b>msczero.</b>
+ Before using <b>msczero</b>, issue the following command in the
+ cl:<br>
+ <br>
+ <tt>cl&gt; set disable_wcs_maps=""<br>
+ cl&gt; flpr</tt><br>
+ <p><b>I find that there is a frustrating delay in performing
+ operations on images displayed from IRAF - there's a wait of
+ a second or two before an image is (re)displayed, whereas <i>saoimage</i>
+ reacts virtually instantly for the same type of operation.
+ This makes running imexamine on a batch of images a pain,
+ and using the mouse to change color gamma/bias to desired
+ values basically impossible.</b> </p>
+ <p>DS9 and <i>saoimage</i> are similar in speed when working
+ with IRAF. In fact, DS9 uses&nbsp; the same code to interface
+ with IRAF as saoimage and ximtool. The only&nbsp; difference
+ is that DS9 is double buffered, whereas, <i>saoimage</i> and
+ <i>ximtool</i> only&nbsp; use a single buffer. So with <i>saoimage</i>
+ and <i>ximtool</i>, you see incremental progress,&nbsp; where
+ DS9 will render the image all at one time. However, the
+ overall time to&nbsp; finish rendering should almost be the
+ same. </p>
+ <p>DS9 runs in both 8 bit and 24 bit environments, but <i>saoimage</i>
+ is restricted to 8 bit. If you are running DS9 and <i>saoimage</i>
+ at the same time, then you must be in 8 bit mode. You should
+ not see any&nbsp; delay in changing the color bias/contrast
+ between the two. </p>
+ <p>However, if you are running DS9 in 24 bit mode, then you will
+ see slower&nbsp; performance in changing the bias/contrast, as
+ compared to 8 bit mode. Instead of&nbsp; changing a color look
+ up table, as in 8 bit mode, DS9 has to update every
+ pixel&nbsp; on the screen. If your cpu speed is slow, you can
+ select the&nbsp; Edit:Preferences:True Colorbar to tell DS9
+ not to update the entire screen,&nbsp; only a part of the
+ screen. This should only be needed if your machine is
+ slower&nbsp; than 200 MHz. Again <i>saoimage</i> does not
+ even run in 24 bit mode, so there are no&nbsp; comparisons. </p>
+ <p><b>I try to display an image from IRAF and I get the
+ following error message:</b></p>
+ <p><tt>Cannot open device (node!imtool,,512,512)</tt></p>
+ <p> </p>
+ <p>DS9 works the same way as <tt>ximtool,</tt> <tt>saoimage,</tt>
+ and <tt>saotng.</tt> No special scripts&nbsp; should be
+ needed. If you have one of the above currently working, DS9
+ should&nbsp; work <i>out of the box</i>. </p>
+ <p>IRAF can use one of three methods to communicate with DS9:
+ fifo, socket, and unix&nbsp; domain name. The DS9 defaults
+ are:</p>
+ <blockquote><tt>fifo /dev/imt1</tt> <br>
+ <tt>port 5137</tt> <br>
+ <tt>unix /tmp/.IMT%d</tt> </blockquote>
+ <p>If your IRAF configuration is set up different (i.e., a
+ different port number, or&nbsp; via a fifo), you need to tell
+ DS9 how to communicate with iraf. DS9 uses the same&nbsp;
+ command line options as XIMTOOL: </p>
+ <blockquote><tt>-fifo </tt> <br>
+ <tt> -fifo_only </tt><br>
+ <tt> -inet_only </tt> <br>
+ <tt> -port </tt> <br>
+ <tt> -port_only </tt> <br>
+ <tt> -unix </tt> <br>
+ <tt> -unix_only </tt> </blockquote>
+ </blockquote>
+ </blockquote>
+ <blockquote> </blockquote>
+ <blockquote>
+ <blockquote>
+ <p><b>I try to display an image, I see something, but it's
+ corrupted and I get multiple error messages from DS9...</b></p>
+ <p><b> </b>An IRAF image server (<i>ximtool</i>, <i>saoimage</i>,
+ DS9, etc...) uses a configuration file&nbsp; to specify the
+ number of available buffers and their sizes. What actually
+ passes&nbsp; from IRAF is not the buffer size, but an index
+ number into this file. </p>
+ <p>So when an image server starts (DS9), it will attempt to
+ locate this file as&nbsp; $HOME/.imtoolrc and
+ /usr/local/lib/imtoolrc. If not found, it will look for
+ shell&nbsp; environment variables IMTOOLRC and imtoolrc, that
+ contains the name of the configuration file. </p>
+ <p>If no configuration file is found, DS9 will assume the
+ following default configuration: </p>
+ <blockquote><tt>&nbsp;1&nbsp; 2&nbsp; 512&nbsp; 512&nbsp; #
+ imt1|imt512 </tt><br>
+ <tt>&nbsp;2&nbsp; 2&nbsp; 800&nbsp; 800&nbsp; # imt2|imt800 </tt><br>
+ <tt>&nbsp;3&nbsp; 2 1024 1024&nbsp; # imt3|imt1024 </tt><br>
+ <tt>&nbsp;4&nbsp; 1 1600 1600&nbsp; # imt4|imt1600 </tt><br>
+ <tt>&nbsp;5&nbsp; 1 2048 2048&nbsp; # imt5|imt2048 </tt><br>
+ <tt>&nbsp;6&nbsp; 1 4096 4096&nbsp; # imt6|imt4096 </tt><br>
+ <tt>&nbsp;7&nbsp; 1 8192 8192&nbsp; # imt7|imt8192 </tt><br>
+ <tt>&nbsp;8&nbsp; 1 1024 4096&nbsp; # imt8|imt1x4 </tt><br>
+ <tt>&nbsp;9&nbsp; 2 1144&nbsp; 880&nbsp; # imt9|imtfs full
+ screen (1152x900 minus frame) </tt><br>
+ <tt>10&nbsp; 2 1144&nbsp; 764&nbsp; # imt10|imtfs35 full
+ screen at 35mm film aspect ratio </tt><br>
+ <tt>11&nbsp; 2&nbsp; 128&nbsp; 128&nbsp; # imt11|imt128 </tt><br>
+ <tt>12&nbsp; 2&nbsp; 256&nbsp; 256&nbsp; # imt12|imt256 </tt><br>
+ <tt>13&nbsp; 2&nbsp; 128 1056&nbsp; # imt13|imttall128 tall
+ &amp; narrow for spectro. </tt><br>
+ <tt>14&nbsp; 2&nbsp; 256 1056&nbsp; # imt14|imttall256 tall
+ &amp; wider for spectro. </tt><br>
+ <tt>15&nbsp; 2 1056&nbsp; 128&nbsp; # imt15|imtwide128 wide
+ &amp; thin for spectro. </tt><br>
+ <tt>16&nbsp; 2 1056&nbsp; 256&nbsp; # imt16|imtwide256 wide
+ &amp; fatter for spectro. </tt><br>
+ <tt>17&nbsp; 2 1008&nbsp; 648&nbsp; # imt17|imtssy Solitaire
+ fmt w/ imtool border </tt><br>
+ <tt>18&nbsp; 2 1024&nbsp; 680&nbsp; # imt18|imtssn Solitaire
+ fmt w/out imtool border </tt><br>
+ <tt>19&nbsp; 1 4096 1024&nbsp; # imt19|imt4x1</tt><br>
+ </blockquote>
+ <p>If on the other hand, IRAF assumes a different buffer size,
+ the image will appear corrupted and DS9 may issue a number of
+ error messages. </p>
+ <p>Another problem is that this file must be in sync with
+ dev$graphcap. If your&nbsp; system administrator has made
+ changes to graphcap, they must also be implemented in
+ imtoolrc. </p>
+ <p>Here is a note from NOAO: </p>
+ <blockquote>
+ <p><tt>The messages means that there is no
+ /usr/local/lib/imtoolrc file </tt><tt>on the machine.
+ This is created as a symlink to dev$imtoolrc by the </tt><tt>iraf
+
+
+
+
+ install script but only if the /usr/local/lib dir already
+ exists on the </tt><tt>machine. The fix is the create the
+ dir and rerun the install script or </tt><tt>else make
+ the link by hand.&nbsp; Users can also just copy
+ dev$imtoolrc </tt><tt>to $HOME/.imtoolrc and restart the
+ server to also workaround it. Note </tt><tt>that an
+ existing .imtoolrc might define old frame buffer configs
+ which </tt><tt>might confuse things, so if the system
+ file exists check for a private </tt><tt>copy screwing
+ things up. </tt></p>
+ </blockquote>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <blockquote>
+ <p><b>Where do I find this .imtoolrc file?</b> </p>
+ <p>Again, here a note from NOAO concerning this issue: </p>
+ <blockquote>
+ <p><tt>In a smooth installation the imtoolrc file is installed
+ as a </tt><tt>/usr/local/lib/imtoolrc symlink pointing to
+ the dev$imtoolrc file in the </tt><tt>iraf system.&nbsp;
+ This is normally what's used but XImtool (and DS9?) also </tt><tt>allow
+
+
+
+
+ a $HOME/.imtoolrc and IMTOOLRC environment variable
+ defining the </tt><tt>path as fallbacks.&nbsp; There are
+ several practical problems with&nbsp; this:&nbsp; for </tt><tt>some
+
+
+
+
+ reason (I'm trying to fix) the imtoolrc link won't be
+ created if </tt><tt>the /usr/local/lib directory doesn't
+ exist when the install script is </tt><tt>run on the
+ machine, even though it's run as root and the file can be
+ </tt><tt>directory easily.&nbsp; On PC-IRAF systems there is
+ also a typo in the install </tt><tt>script (extra logical
+ or at line 515) which causes it to exit before </tt><tt>the
+
+
+
+
+ display setup is run (i.e. no /dev fifos or imtoolrc). If
+ users don't </tt><tt>catch this or see it in the README
+ file they'll think everything went </tt><tt>fine. Lastly,
+ the local iraf admin might not have run the install script
+ </tt><tt>on the local iraf NFS client machine at all.</tt></p>
+ </blockquote>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <blockquote>
+ <p><b>When I display an image from IRAF, the SCALE menu option
+ is not active, Why?</b> </p>
+ <p>When you display an image from IRAF into DS9, IRAF actually
+ does the color scale&nbsp; distribution. In Display, use the
+ ztrans and z1,z2 parameters to set the upper/lower bounds and
+ distribution. You can also use the zscale parameter to auto
+ determine z1,z2.Here are the DISPLAY parameters in question: </p>
+ <blockquote><tt>ztrans=[linear|log|none|user] </tt><br>
+ <tt>z1=min </tt><br>
+ <tt>z2=max </tt><br>
+ <tt>zscale=[yes|no]</tt></blockquote>
+ <p>What actually is sent from IRAF to DS9 is one byte per pixel,
+ values 0-200,&nbsp; which already has applied both the upper
+ and lower clipping bounds and the distribution. So this is
+ why, the SCALE menu is disabled in DS9 when it receives a
+ image from IRAF.</p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p> <b><a name="Coordinates"></a>Coordinates</b></p>
+ </blockquote>
+ <blockquote>
+ <blockquote>
+ <p><b>Why don't I see PHYSICAL/WCS/WCSA...WCSZ coordinates
+ displayed when I load my image?</b></p>
+ <p>DS9 supports the following coordinate systems: </p>
+ <blockquote><tt>WCS Sky coords (fk4,fk5,icrs,galactic,ecliptic)
+ <br>
+ </tt><tt>WCS Linear coords <br>
+ </tt><tt>Image (also known as Logical) <br>
+ </tt><tt>Physical (also known as CCD)<br>
+ Detector<br>
+ Amplifier &nbsp; </tt><br>
+ </blockquote>
+ <p>DS9 uses the following FITS keywords in the header to define
+ a coordinate system: &nbsp;</p>
+ </blockquote>
+ <center>
+ <table nosave="" border="1" cellpadding="4" width="75%">
+ <tbody>
+ <tr>
+ <td><b>Coordinate System</b></td>
+ <td><b>Keyword Values</b></td>
+ </tr>
+ <tr nosave="">
+ <td nosave=""><tt>WCS / WCSA...WCSZ</tt></td>
+ <td><tt>CRVAL,CRPIX,CRDELT,CD... (for images) <br>
+ TCRVL,TCRPX,TCDLT,... (for tables)</tt></td>
+ </tr>
+ <tr>
+ <td><tt>Image</tt></td>
+ <td><tt>none required</tt></td>
+ </tr>
+ <tr>
+ <td><tt>Physical</tt></td>
+ <td><tt>WCSNAMEP='PHYSICAL' or LTMx_x/LTVx</tt></td>
+ </tr>
+ <tr>
+ <td valign="top"><tt>Detector</tt><br>
+ </td>
+ <td valign="top"><tt>DTMx_x/DTVx</tt><br>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top"><tt>Amplifier</tt><br>
+ </td>
+ <td valign="top"><tt>ATMx_x/ATVx</tt><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </center>
+ <blockquote>
+ <p>If the required keywords are not present, values for those
+ coordinates are not displayed. </p>
+ <p>Note: For PHYSICAL, DS9 will first look for an alternative
+ WCS with WCSNAMEx='PHYSICAL'. If not found, DS9 will then look
+ for the LTMx_x LTVx keywords.</p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p> <b><a name="Regions"></a>Regions</b></p>
+ <blockquote>
+ <p><b>How do I indicate distance on my printed images?</b>&nbsp;
+ </p>
+ <p>You have two choices, the RULER region and the LINE region.
+ The ruler region is mainly used for interactive measurements.
+ For printed output, use the LINE region to create a distance
+ indicator. In the line region dialog, there is a read-only
+ entry that indicates the length in pixels, degrees, arcmin, or
+ arcsec. Edit to the desired distance and enter the desired
+ label, including ' or ", in the region text labile entry. You
+ have the option of arrows at each end of the line. </p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p> <b><a name="Printing"></a>Printing</b></p>
+ <blockquote>
+ <p><b>I can make some wonderful color images in DS9 and save
+ them as postscript files that look great, but often when I
+ print them they appear washed out or very different than
+ they do on the screen. My question then is what, if
+ anything, can I do about this?</b> </p>
+ <p>The problem is that you create an image on a display, which
+ is the product of&nbsp; RGB colors (red, green, and blue) and
+ print the image on a printer, which is the&nbsp; product of
+ CMYK colors (cyan, yellow, magenta, and black). Furthermore,
+ every&nbsp; monitor is different in how it will display a
+ certain color, and every printing&nbsp; technology is
+ different in how well it will reproduce that color. And
+ finally,&nbsp; the translation between RGB and CMYK is not
+ symmetric, i.e. its not possible to&nbsp; translate some
+ colors back and forth. </p>
+ <p>It's possible to calibrate your monitor and your printer, to
+ create a&nbsp; translation matrix, to correct for problems
+ outlined above (in the Macintosh&nbsp; world, this is what
+ ColorSync does). The idea is to <i>apply</i> a gamma
+ correction to the output of DS9, so&nbsp; that it will print
+ much more in line with what you expect. To do this you'd
+ need&nbsp; special software and hardware, and its only valid
+ for your monitor and your&nbsp; printer. </p>
+ <p>In summary, its not worth it. Especially in the case of
+ publication, such as ApJ,&nbsp; where you have no idea on what
+ printing technology will be used to reproduce&nbsp; your
+ image. So the only control you have is to calibrate your
+ monitor and to&nbsp; hope for the best. </p>
+ <p>However, there are some <i>rules of thumb </i>that might
+ help. First, printers have a very hard time with <i>blues</i>
+ and <i>purples</i>, as they tend to be washed out. Either
+ avoid these colors, or over compensate these colors.&nbsp;</p>
+ <p>ApJ has a good idea in that you send in both an electronic
+ version and a hard copy of your color image. That way, they
+ can manually adjust the printers to&nbsp; try to match your
+ output.</p>
+ <p><i>NOTE: Even though ApJ requests images in CMYK, we
+ recommend RGB. From personal experience, if you send RGB,
+ the printed results will be closer to the original.</i></p>
+ <p><b>We used DS9 to generate 300 dpi CMYK eps figures, as per
+ the ApJ specifications, but the color scheme on&nbsp; our
+ proofs is wrong.&nbsp; In the proofs, the violet is washed
+ out and looks similar to the black, and the blue is not
+ nearly as intense.</b></p>
+ <p><b> </b>There are two issues here: first,&nbsp; color
+ printers are notorious for failure to reproduce blues and
+ purples correctly. Second,&nbsp; not all colors in RGB space
+ can be reproduced correctly in CMYK space, blues being the
+ prime example. Below is an excerpt from an industry pamphlet:</p>
+ <blockquote>
+ <p><tt>Be aware that it is possible to see colors in RGB that
+ you can't make with CMYK. They are said to be "out of the
+ CMYK color gamut". What happens is that the RGB-to-CMYK
+ translator just gets as close as possible to the
+ appearance of the original and that's as good as it can
+ be. It's something that everyone in the industry puts up
+ with. So it's best to select any colors you use for fonts
+ or other design elements in your layout using CMYK
+ definitions instead of RGB. That way, you will have a
+ better idea of how they will appear in your printed piece.
+ Here's a common example: many programs translate the 100%
+ Blue in RGB into a somewhat purple-looking color in CMYK.
+ We recommend a CMYK value of 100-65-0-0 to get a nice
+ clean blue.<font size="-1"><br>
+ </font></tt></p>
+ </blockquote>
+ <p>For this reason, you may wish to use the RGB color space or
+ colormaps without deep blues and purples, such as <tt>BB</tt>
+ or <tt>Heat.</tt></p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p> <b><a name="XPA"></a>XPA</b></p>
+ <blockquote>
+ <p><b>How can I use XPA to display from a client machine to DS9
+ on a server machine?<br>
+ </b></p>
+ <p>Assuming you have direct IP reachability between the machines
+ (i.e. one host can successfully connect() to the other), XPA
+ does allow you to have an XPA-enabled server like DS9 on one
+ machine and a client on another. To make this work, you need
+ to do two things (let's assume DS9 is running on a machine
+ called "server_host" and you want to send xpa commands from
+ "client_host"):<br>
+ </p>
+ <ol>
+ <li>The XPA server program (i.e. DS9) must allow the client
+ host to send XPA commands. Access can be permitted in one of
+ two ways:<br>
+ <ol style="list-style-type: lower-alpha;">
+ <li>Send the XPA server an acl request by running xpaset
+ on the same host on which the server is running (i.e. on
+ the server_host):<br>
+ <br>
+ <span style="font-family: monospace;">% xpaset -p ds9
+ -acl client_host +<br>
+ <br>
+ </span></li>
+ <li>For more permanent access, add permissions in
+ ~acls.xpa:<br>
+ <br>
+ <span style="font-family: monospace;">% cat &gt;
+ ~/acls.xpa</span><br style="font-family: monospace;">
+ <span style="font-family: monospace;">DS9:ds9
+ client_host +<br>
+ </span><br>
+ You can check the acls for an XPA server using xpaget: <br>
+ <br>
+ <span style="font-family: monospace;">% xpaget ds9 -acl<br>
+ </span><br>
+ </li>
+ </ol>
+ </li>
+ <li>On the client side, the client needs to communicate with
+ the xpansname server program on the server machine to find
+ the XPA server communication info. This also can be done in
+ two ways:<br>
+ <ol style="list-style-type: lower-alpha;">
+ <li>use the -i [host] switch to override <span
+ style="font-family: monospace;">XPA_NSINET</span> for
+ this execution (The default port is 14285):<br>
+ <span style="font-family: monospace;"><br>
+ % xpaget -i 'server_host:14285<span
+ style="font-family: monospace;">' ds9</span></span><br>
+ <br>
+ </li>
+ <li>Set the <span style="font-family: monospace;">XPA_NSINET</span>
+ variable for more permanent selection of xpans on the
+ server host:<br>
+ <br>
+ <span style="font-family: monospace;">% setenv
+ XPA_NSINET 'server_host:14285'</span><br>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ <p>Once these two setup steps are performed, you should be able
+ to send commands to DS9 and receive data from DS9. You can
+ look at the <a
+ href="http://hea-www.harvard.edu/saord/xpa/acl.html">xpaacl
+ man page</a> for more information.</p>
+ <p><b>I have a laptop, that most of the time, is connected to a
+ network. DS9 runs fine. However, when I'm not connected to a
+ network and I start DS9, it hangs. What's going on?</b></p>
+ <p>&nbsp;DS9 uses XPA for interprocess communication. When DS9
+ starts, XPA initializes itself. XPA uses either IP sockets or
+ UNIX sockets, based if your machine is configured to connect
+ to the internet. In the case where your machine is configured
+ for the internet, but you are not currently connected, XPA
+ gets very confused. So, you can define a shell variable,
+ XPA_METHOD, that tells XPA which method to use. </p>
+ <p>The following is from the XPA documentation: </p>
+ <blockquote>
+ <p><tt>Determines the socket connection method used by this
+ session of XPA. The choices are: inet (to use INET or
+ Internet-based sockets) and local (unix) (to use UNIX
+ sockets). The default is INET. Using the inet method will
+ allow access from other machines (subject to access
+ controls) but using local will not. Local is most useful
+ for private access and when the machine in question is not
+ connected to the Internet</tt></p>
+ </blockquote>
+ <p>More information is available on XPA shell variables at: <a
+ href="http://hea-www.harvard.edu/RD/xpa/env.html">The XPA
+ Environment</a><br>
+ </p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <blockquote>
+ <p> </p>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p><b><a name="VO"></a>VO</b></p>
+ <blockquote>
+ <p><b>I can't connect to any of the virtual observatories. What
+ do I do now?</b></p>
+ <p>The DS9 help facility now contains a tutorial on how to
+ configure DS9 to by pass network firewalls. See <a
+ href="ref/vo.html">Virtual Observatory Reference</a> for
+ more information.</p>
+ </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/helpdesk.html b/ds9/doc/helpdesk.html
new file mode 100644
index 0000000..bc13f5c
--- /dev/null
+++ b/ds9/doc/helpdesk.html
@@ -0,0 +1,28 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=ISO-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Help Desk</title>
+</head>
+<body link="#0000ee" text="#000000" vlink="#551a8b" alink="#ff0000"
+ bgcolor="#ffffff">
+<h3> <img alt="" src="sun.gif" height="98" width="100" align="middle">
+SAOImage DS9 Help Desk</h3>
+<blockquote>
+ <p>If you encounter any problems or have suggestions with
+SAOImage DS9,
+please
+contact us:<br>
+saord @ cfa.harvard.edu</p>
+ <p>William Joye<br>
+Smithsonian Astrophysical Observatory<br>
+60 Garden St.<br>
+Cambridge, MA 02138 USA
+ </p>
+</blockquote>
+<br>
+</body>
+</html>
diff --git a/ds9/doc/install.html b/ds9/doc/install.html
new file mode 100644
index 0000000..b4091af
--- /dev/null
+++ b/ds9/doc/install.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>DS9 Installation Instructions</title>
+</head>
+<body>
+<h3> <img alt="" src="sun.gif" height="98" width="100" align="middle">
+SAOImage DS9 Installation Instructions <a href="#windows"></a><br>
+</h3>
+<blockquote>
+ <blockquote>
+ <p><b>Solaris / Linux Installation</b></p>
+DS9 for Solaris and Linux is a self contained application and does not
+require any installation procedures or support files.<br>
+ <ol>
+ <li>Download DS9. This is a gzip'ed tar file.<br>
+ </li>
+ <li>Use the following command line to extract DS9: <br>
+ </li>
+ <tt>$ gzcat ds9.&lt;port&gt;.&lt;version&gt;.tar.gz | tar -xvf -</tt>
+ <li>Move
+the DS9 executable into a directory in your path.</li>
+ </ol>
+ <p><b>MacOSX</b></p>
+There are versions of DS9 for 10.4 (Tiger) and 10.5 (Leopard)<br>
+ </blockquote>
+ <blockquote>
+ <ol>
+ <li> Download DS9 for MacOSX. This is an universal application
+that contains binaries for both PPC and Intel Macs. Drag to your
+Applications folder.<br>
+ </li>
+ </ol>
+ <p><b>Darwin</b></p>
+There are versions of DS9 for 10.4 (Tiger) and 10.5 (Leopard). Darwin
+is only recommended for experienced users of unix and
+linux. For other users, we recommend DS9 for MacOSX.<br>
+ <br>
+DS9 Darwin requires X11.&nbsp; DS9 for Darwin is a
+unix executable and
+must be run from the command line of a Terminal window.<br>
+ <ol>
+ <li>Download DS9 for Darwin. This is a gzip'ed tar file.</li>
+ <li>Open a Terminal window.</li>
+ <li>Use the following command line to extract DS9: <br>
+ </li>
+ <tt>$ gzcat ds9.darwin&lt;arch&gt;.&lt;version&gt;.tar.gz | tar
+-xvf -</tt>
+ <li>(Optional)
+Move the DS9 executable into a directory in your path.<br>
+ </li>
+ </ol>
+ <p><b>Windows 7/Vista/XP</b><br>
+ </p>
+ </blockquote>
+ <blockquote>
+ <ol>
+ <li>Download DS9 for Windows NT/2000/XP. This is a WinZip.exe
+install file.</li>
+ <li>Execute the install file. DS9 will be installed by default in
+ <tt>C:\Program Files\ds9</tt>. It will contain two files, the
+DS9 application and cygwin.dll.</li>
+ <li>To run, go to <tt>C:\Program Files\ds9</tt> and double click
+on the DS9 icon.</li>
+ </ol>
+ </blockquote>
+</blockquote>
+</body>
+</html>
diff --git a/ds9/doc/new.html b/ds9/doc/new.html
new file mode 100644
index 0000000..67f11e7
--- /dev/null
+++ b/ds9/doc/new.html
@@ -0,0 +1,333 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; SunOS 5.8
+ sun4u) [Netscape]">
+ <title>DS9 New Features</title>
+ </head>
+ <body bgcolor="#ffffff" alink="#ff0000" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3> <img alt="" src="sun.gif" align="middle" height="98"
+ width="100"> SAOImage DS9 Version 7 New Features</h3>
+ <blockquote>
+ <p><b><b><b>Version 7.3<br>
+ </b></b></b></p>
+ <blockquote>
+ <p><b><b><b>64 bit Applications</b></b></b><br>
+ </p>
+ <p>DS9 now fully supports 64 bit applications across all
+ platforms. New support for 64 bit MacOSX Aqua has been added,
+ along with 64 bit Windows Cygwin.</p>
+ <p><b><b><b>2D Plots</b></b></b></p>
+ </blockquote>
+ <blockquote>New and improved GUI<br>
+ Support for data set legend<br>
+ Improvements in rendering<br>
+ Error bar caps are now supported</blockquote>
+ <blockquote>
+ <p><b><b><b>Mouse Mode</b></b></b></p>
+ <p>The default mouse mode is now <b><tt>NONE</tt></b> and not <b><tt>REGION</tt></b>
+ or <b><tt>POINTER</tt></b>. This prevents unwanted region
+ creation went bringing the DS9 window to the front in most
+ Window managers.</p>
+ <p><b><b><b>Other Enhancements</b></b></b></p>
+ </blockquote>
+ <blockquote>Improved rendering of rotated text<br>
+ Support for ENVI data format<br>
+ 3D Image caching<br>
+ 3D Background Image rendering<br>
+ Dramatic improvements in analysis speed of large 3D data sets<br>
+ New Segment region</blockquote>
+ </blockquote>
+ <blockquote>
+ <p><b><b>Version 7.2<br>
+ </b></b></p>
+ <blockquote>
+ <p><b>FITS</b></p>
+ </blockquote>
+ <blockquote>
+ <p>DS9 now fully supports complex FITS images such as data
+ cubes, multiple extension data cubes, mosaics, RGB images, and
+ 3D images. In addition, DS9 can be use to create complex FITS
+ images from multiple FITS files and other image formats.
+ Furthermore, complex FITS images can be easily disassembled
+ into individual images and saved in FITS or other image
+ formats.</p>
+ </blockquote>
+ <blockquote>
+ <p><b>Common API</b></p>
+ </blockquote>
+ <blockquote>
+ <p>XPA and SAMP now share the same API as the command line
+ interface. Backward compatibility is maintained to previous
+ versions of DS9.</p>
+ </blockquote>
+ <blockquote>
+ <p><b>Other Enhancements</b></p>
+ </blockquote>
+ <blockquote>More robust handling of SEGV and SIGBUS events<br>
+ DS9 now distinguishes between BLANK/NAN/INF values<br>
+ <b>saveimage</b> now supports EPS<br>
+ Support for NRRD (Nearly RAW Raster Data) data format<br>
+ Added support for exporting RGB images in TIFF, JPEG, or PNG<br>
+ Improvement for FITS compression support<br>
+ Released under GPL v3<br>
+ </blockquote>
+ <b><b> </b></b>
+ <p><b>Version 7.1<br>
+ </b></p>
+ <blockquote>
+ <p><b>Catalog Matching</b><br>
+ </p>
+ <p> DS9 now supports catalog matching. From the Catalog menu
+ option, the user selects two currently loaded catalogs, an
+ error radius, and matching function. The user may request all
+ sources that are present in both catalogs, or in one catalog
+ and not in the other. Each catalog need not to be specified in
+ the same world coordinate system.<br>
+ </p>
+ <p><b>Enhanced Plot Tool</b><br>
+ </p>
+ <p> In addition to a Line Plot Tool, DS9 now supports additional
+ Bar and Scatter Plots Tools. The GUI for the Plot Tools have
+ been enhanced and new features have been added including
+ statistics and data lists. Each Plot Tool supports multiple
+ data sets and custom plotting options.</p>
+ <p><b>Catalog Scatter Plots</b><br>
+ </p>
+ <p>The user may now plot the results of two columns of a loaded
+ catalog as a scatter plot. A selected region on the image will
+ highlight the corresponding row and plot point. Likewise, a
+ selected row or plot point will highlight the corresponding
+ image region.<br>
+ </p>
+ <p><b>Interactive Region Analysis</b><br>
+ </p>
+ <p> DS9 regions now support interactive region analysis. The
+ analysis tasks are enabled by selecting the Analysis Menu in a
+ region's dialog box. Interactive analysis tasks includes
+ statistics, data cuts in 2D and 3D, and radial profiles.<br>
+ </p>
+ <p><b>Other Enhancements</b><br>
+ </p>
+ </blockquote>
+ <blockquote>3D scaling along the z axis of data cubes<br>
+ Lock/Match Smoothing option<br>
+ WCS dialog support for non-linear projections such as TAN-SIP
+ and SCAMP<br>
+ Support for FITS files larger than 2Gb has been improved<br>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p><b>Version 7.0<br>
+ </b></p>
+ <blockquote>
+ <p><b>3-D Data Visualization</b><br>
+ </p>
+ <p> Previous versions of SAOImage DS9 would allow users to load
+ 3-D data into traditional 2-D frames, and would allow users to
+ step through successive z-dimension pixel slices of the data
+ cube. To visualize 3-D data in DS9 v. 7.0, a new module,
+ encompassed by the new <tt>Frame 3D</tt> option, allows users
+ to load and view data cubes in multiple dimensions.</p>
+ <p>The new module implements a simple ray-trace algorithm. For
+ each pixel on the screen, a ray is projected back into the
+ view volume, based on the current viewing parameters,
+ returning a data value if the ray intersects the FITS data
+ cube. To determine the value returned, there are 2 methods
+ available, Maximum Intensity Projection (MIP) and Average
+ Intensity Projection (AIP). MIP returns the maximum value
+ encountered, AIP returns an average of all values encountered.
+ At this point, normal DS9 operations are applied, such as
+ scaling, clipping and applying a color map.<br>
+ </p>
+ <p>Rendering time is independent of the actual data cube size.
+ Instead, the time it takes to render is based on how many rays
+ are needed to project the data cube upon the screen in the
+ view volume and the current zoom factor. The new module
+ requires no special hardware or graphical processor unit (GPU)
+ and the rendering time is adequate for interactive GUI
+ manipulation on most computers. The rendering engine is
+ developed using the POSIX thread library, allowing multiple
+ light weight processes to be spawned to complete an image in
+ parallel. The number of threads actually generated is a user
+ specified parameter. Since all modern hardware contain
+ multiple CPU cores, the default value is 8 threads. For larger
+ work stations, this number can be increase. For every doubling
+ in the number of CPU cores available, rendering times decrease
+ approximately 75%.<br>
+ </p>
+ <p>The new module is support on all hardware platforms currently
+ supported by DS9, including 32-bit and 64-bit versions of
+ Linux and MacOSX, and 32-bit versions of Windows and Solaris.<br>
+ </p>
+ <p>All 2-D graphics, regions, cross hairs, contours, and
+ coordinate grids, are applied to the current slice, which is
+ selected by the user. When the user wishes to match or lock a
+ 2-D image and to a 3-D data cube, the current slice is used to
+ determine the rendering solution. The user can crop the data
+ cube for all 3 axes via the command line or the GUI. The new
+ module also supports FITS event files binned into a data cube.<br>
+ </p>
+ <p>All printing support has been extended to the new 3-D module.
+ The user may generate 3-D images in Postscript, JPEG, TIFF,
+ and other formats, just as in the 2-D case. Furthermore,
+ native printing is supported for the Windows version.<br>
+ </p>
+ <p>DS9 analysis macros have been enhanced to fully support the
+ new 3-D module, allowing the user to invoke external analysis
+ tasks based on the current view parameters and to return
+ results back into DS9 in the form of text, plot, 2-D image, or
+ 3-D image.<br>
+ </p>
+ <p>Funding for 3-D data visualization was provided by the JWST
+ Mission office at Space Telescope Science Institute
+ (NAS-03127) </p>
+ <p><b>Color Tags</b><br>
+ </p>
+ The purpose of color tags are to highlight (or hide) certain
+ values of data, regardless of the color map selected. The user
+ creates, edits, and deletes color tags via the GUI. To create a
+ color tag, enter the Colorbar Mode, and click once on the
+ colorbar. This creates a default color tag. Click and drag to
+ change the values. Click and drag on one side to increase or
+ decrease the value. Double click to manually edit the values and
+ color. Place the cursor over the color tag and press the delete
+ key to delete it. From the color parameters dialog, the user can
+ load, save, and delete all color tags for that frame.<br>
+ <p><b>Regions<br>
+ </b></p>
+ Regions now support analysis tasks unique to each region type.
+ In the menu of the region dialog, the <tt>Analysis</tt> menu
+ will contain any type specific analysis tasks. The <tt>Circle</tt>,
+ <tt>Ellipse</tt>, <tt>Box</tt>, <tt>Polygon</tt>, and <tt>Point</tt>
+ regions now support interactive 1-D cuts along the 3rd axis of
+ 3-D data cubes. The <tt>Line</tt>, <tt>Vector</tt>, and <tt>Projection</tt>
+ regions support 2-D cuts through the current slice of 2-D and
+ 3-D data. The <tt>Auto Plot</tt> option under the regions
+ preferences can be used to specify if a plot is automatically
+ generated when the region is created.<br>
+ <p><b>Analysis<br>
+ </b></p>
+ DS9 analysis macros have been enhanced to fully support the new
+ 3-D module, allowing the user to invoke external analysis tasks
+ on the current slice of 3-D data cube. The macro <tt>$z</tt> is
+ now supported for 3-D data. In support of <tt>Funtools</tt>,
+ the <tt>PLANE</tt> keyword is supported.<br>
+ <p><b>Slice</b><br>
+ </p>
+ DS9 now allows the user to load a 3-D data cube one slice at a
+ time via the GUI or from the command line. Use the option <tt>-slice
+
+
+
+
+
+
+ </tt>to specify that all following 2-D files are to be
+ interpreted as a slice of a 3-D data cube.<br>
+ <p><b>Photo</b><br>
+ </p>
+ DS9 can now load images in TIFF, JPEG, and PNG file format
+ directly. When loaded into a <tt>Frame</tt>, the average of the
+ luminosity is used. When loaded into a <tt>Frame RGB</tt>, each
+ channel is loaded directly. Use the <tt>-photo</tt> command
+ line option to specify that all following files are to be
+ interpreted as a photo image.<br>
+ <p><b>Export</b><br>
+ </p>
+ DS9 will export the current image in TIFF, JPEG, or PNG file
+ format with the current colorbar parameters applied. The entire
+ image is exported (not just the visible portion) at the native
+ resolution.<br>
+ <p><b>Lock/Match</b><br>
+ </p>
+ The support for the Lock/Match functionality of DS9 has been
+ greatly enhanced. The user may choose to lock/match frames, the
+ cross hair, cropping, the current slice, binning parameters,
+ scale parameters, or color map parameters.<br>
+ <p><b>Crop<br>
+ </b></p>
+ DS9 now supports cropping the current image, via the GUI,
+ command line, or XPA/SAMP in both 2-D and 3-D. The user may
+ specify a rectangular region of the image data as a center and
+ width/height in any coordinate system via the Crop Dialog, or
+ can interactively select the region of the image to display by
+ clicking and dragging while in Crop Mode. For 3-D frames, the <i>shift-click</i>
+ to change the front clip plane, and <i>control-click</i> to
+ change the back clip plane. From the command line, cropping
+ parameters can be specified in IRAF format.<br>
+ <p><b>ASINH Scale<br>
+ </b></p>
+ A new scale function has been added, <tt>ashinh</tt>, based on
+ the arc sinh function. This new function has similar properties
+ as the <tt>log</tt> function, with <tt>a=10</tt>.<br>
+ <p><b>All new GUI<br>
+ </b></p>
+ <p>DS9 now supports basic GUI elements (buttons, menus, etc) via
+ the native window manager API. Each port of DS9 will have a
+ native look and feel of each hardware platform. DS9 will take
+ advantage of the current user selected <i>Theme </i>if
+ supported by the native windowing system.<br>
+ </p>
+ <p><b>Postscript</b><b><br>
+ </b></p>
+ DS9 now generates identical postscript code for a particular
+ image, regardless of which hardware platform was used to
+ generate the image.<br>
+ <p><b>Catalogs</b><b><br>
+ </b></p>
+ The user may now specify coordinates in any equatorial system
+ (not just FK5) for a catalog search and receive results in any
+ equatorial system, to be plotted or saved. Local catalogs in any
+ equatorial system are now supported.<br>
+ <p><b>New WCS support</b><br>
+ </p>
+ <p>New WCS support for non-FITS WCS projections have been added
+ to DS9: TNX, ZPX, SCAMP, SIP and HEALPIX.&nbsp; The keyword
+ WCSDEP is now supported.<br>
+ </p>
+ <p>Enhancements and improvements have been made in the support
+ for the following FITS WCS projections: COD, COO, COE, COP,
+ ZEA, and CAR.<br>
+ </p>
+ <p>DS9 now supports non-equatorial long/lat coordinate systems
+ in the form of xLON/xLAT and xyLN/xyLT. This includes solar
+ WCS HPLN/HPLT, HGLN/HGLT, and HRLN/HRLT systems.<br>
+ </p>
+ <p>DS9 now fully supports multiple alternative celestial WCS, if
+ specified. All cut/paste/copy operations, catalog, image
+ server, contour, regions, and coordinate grids will now use
+ the default WCS as selected by the user, via the WCS menu
+ item.<br>
+ </p>
+ <p><b>HEALPIX</b><br>
+ </p>
+ <p>DS9 now supports native HEALPIX maps, in both FITS binary
+ table and ascii table form. Any table with keyword
+ PIXTYPE=HEALPIX or NSIDE=x will be processed as an HEALPIX
+ image. The user may specify HEALPIX parameters within the file
+ specification to indicate RING (default) or NESTED order,
+ Coordinate System (default is Unknown),&nbsp; Quadrant
+ (default is first), and Equator (default), North, or South
+ layout. The appropriate WCS is generated for the image.<br>
+ </p>
+ <p><b>External Analysis</b><b> Files<br>
+ </b></p>
+ DS9 will now look for external analysis files in the following
+ locations at start up: the current directory, <tt>$HOME/bin,
+ /usr/local/bin</tt>, <tt>/opt/local/bin,</tt> and <tt>/soft/saord/bin</tt>
+ in the form of <tt>*.ds9</tt>. If found, they will be
+ automatically loaded. Users may disable this feature via the
+ presences analysis panel. DS9 will continue to load <tt>ds9.ans</tt>
+ and <tt>ds9.analysis</tt> if found, and users specified
+ analysis files as before. DS9 will verify that the same analysis
+ file is not loaded twice to avoid duplication of analysis menus.
+ </blockquote>
+ <p><b> For more detailed information, Please see <a
+ href="release/r7.0.html">Release Notes</a></b></p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/3d.html b/ds9/doc/ref/3d.html
new file mode 100644
index 0000000..7be0aa9
--- /dev/null
+++ b/ds9/doc/ref/3d.html
@@ -0,0 +1,80 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>3D</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" width="100"
+ height="98"> 3-D Frames<br>
+ </h3>
+ <blockquote>
+ <p>Previous versions of SAOImage DS9 would allow users to load 3-D
+ data into the traditional 2-D frames, and would allow users to
+ step through successive z-dimension pixel slices of the data
+ cube. To visualize the 3-D data in DS9 v. 7.0, a new module,
+ encompassed by the new <tt>Frame 3D</tt> option, allows users
+ to load and view data cubes in multiple dimensions.<br>
+ </p>
+ <p>The new module implements a simple ray-trace algorithm. For
+ each pixel on the screen, a ray is projected back into the view
+ volume, based on the current viewing parameters, returning a
+ data value if the ray intersects the FITS data cube. To
+ determine the value returned, there are 2 methods available,
+ Maximum Intensity Projection (MIP) and Average Intensity
+ Projection (AIP). MIP returns the maximum value encountered, AIP
+ returns an average of all values encountered. At this point,
+ normal DS9 operations are applied, such as scaling, clipping and
+ applying a color map.<br>
+ </p>
+ <p>Rendering time is independent upon the actual data cube size.
+ Instead, the time it takes to render is based on how many rays
+ are needed to project the data cube upon the screen in the view
+ volume and the current zoom factor. The new module requires no
+ special hardware or graphical processor unit (GPU) and the
+ rendering time is adequate for interactive GUI manipulation on
+ most computers. The rendering engine is developed using the
+ POSIX thread library, allowing multiple light weight processes
+ to be spawned to complete an image in parallel. The number of
+ threads actually generated is a user specified parameter. Since
+ all modern hardware contain multiple CPU cores, the default
+ value is 8 threads. For larger work stations, this number can be
+ increase. For every doubling in the number of CPU cores
+ available, rendering times decrease approximately 75%.<br>
+ </p>
+ <blockquote><tt>Example:</tt><br>
+ <tt># create 3d frame, load fits file</tt><br>
+ <tt> # set view angle to az 45 el 30 deg</tt><br>
+ <tt> # set rendering method to Average Intensity Projection</tt><br>
+ <br>
+ <tt>% ds9 -3d mycube.fits </tt><tt>-3d vp 45 30 </tt><tt>-3d
+ method aip</tt><br>
+ <br>
+ <tt>% xpaset -p ds9 3d</tt><br>
+ <tt> % xpaset -p ds9 file mycube.fits</tt><br>
+ <tt> % xpaset -p ds9 3d vp 45 30</tt><br>
+ <tt> % xpaset -p ds9 3d method aip</tt></blockquote>
+ <blockquote> </blockquote>
+ All 2-D graphics, regions, cross hairs, contours, and coordinate
+ grids, are applied to the current slice, which is selected by the
+ user. When the user wishes to match or lock a 2-D image and to a
+ 3-D data cube, the current slice is used to determine the
+ rendering solution. The user can crop the data cube for all 3 axes
+ via the command line or the GUI. The new module also supports FITS
+ event files binned into a data cube.<br>
+ <br>
+ All printing support has been extended to the new 3-D module. The
+ user may generate 3-D images in Postscript, JPEG, TIFF, and other
+ formats, just as in the 2-D case. Furthermore, native printing is
+ supported for the Windows version.<br>
+ <br>
+ DS9 analysis macros have been enhanced to fully support the new
+ 3-D module, allowing the user to invoke external analysis tasks
+ based on the current view parameters and to return results back
+ into DS9 in the form of text, plot, 2-D image, or 3-D image. </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/analysis.html b/ds9/doc/ref/analysis.html
new file mode 100644
index 0000000..e5dd279
--- /dev/null
+++ b/ds9/doc/ref/analysis.html
@@ -0,0 +1,878 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Analysis</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Analysis</h3>
+ <blockquote>
+ <p>Each file type known to DS9 can have user-defined analysis
+ commands associated with it. These analysis commands are defined
+ at start-up time , or loaded by the user, by means of an ASCII
+ analysis description file. The analysis commands are available
+ for execution, either via the <i>Analysis Menu </i>or the XPA
+ point <i>Analysis</i>. In addition, commands may be <i>bound</i>
+ to events, such as keystrokes or mouse clicks. This type of
+ command is called a bind command.<br>
+ </p>
+ <p>DS9 searches for an analysis file named <tt>ds9.ans</tt> or <tt>ds9.analysis</tt>
+ in the current directory and <tt>$HOME</tt> to be loaded at
+ startup. In addition, DS9 will search the following directories
+ for any analysis files to be loaded at startup in the form of <tt>*.ds9</tt>:
+ the current directory, <tt>$HOME/bin</tt>, <tt>/usr/local/bin</tt>,
+ <tt>/opt/local/bin</tt>, and <tt>/soft/saord/bin</tt>. Finally,
+ the user may specify analysis files to be loaded at startup in
+ the preferences analysis panel. The user may also load or clear
+ current analysis commands via command line options or the <i>Analysis
+
+
+
+ m</i>enu<i>.</i></p>
+ <p>When activated, either from the menu, XPA, or bound event, an
+ analysis command first is macro-expanded to fill in user-defined
+ arguments and then is executed externally. Results may be
+ displayed in a separate text window, plot window, or in a image
+ frame. </p>
+ <a href="#Syntax">Syntax</a> <br>
+ <a href="#CommandType">Command Type</a> <br>
+ <a href="#Macros">Macros</a> <br>
+ <a href="#Help">Help</a> <br>
+ <a href="#Web"> </a><a href="#Parameters">Parameters</a> <br>
+ <a href="#HierarchicalMenus">Hierarchical Menus</a> <br>
+ <a href="#Sample">Sample</a>
+ <p><b><a name="Syntax"></a>Syntax</b></p>
+ The analysis file that defines the known analysis commands
+ consists of one or more file descriptors, each of which has the
+ following format:
+ <blockquote> <tt>Menu label to be used</tt> <br>
+ <tt>A space separated list of file templates</tt> <br>
+ <tt>Command type [menu | bind &lt;event&gt;]</tt> <br>
+ <tt>The command line for the analysis program</tt> </blockquote>
+ <p>Task names may contain space characters. All lines may be
+ indented. Also, the '#' character is a comment character. A
+ separator can be inserted in the menu by specifying the
+ following sequence '---'.</p>
+ <tt>Example:</tt>
+ <blockquote> <tt># this will insert a menu separator</tt> <br>
+ <tt>---</tt> </blockquote>
+ <p><b><a name="CommandType"></a>Command Type</b></p>
+ <p>The third line indicates the type of command. </p>
+ <blockquote>
+ <p><b>menu</b></p>
+ <p>A <tt>menu</tt> command creates an menu option under the <i>Analysis
+
+
+
+
+
+
+ </i>menu option, and can be invoked by the user via the GUI or
+ XPA.</p>
+ <tt>Example:</tt>
+ <blockquote> <tt># Menu command example</tt><br>
+ <tt>My Analysis Task</tt><br>
+ <tt> </tt><tt>*.fits</tt> <br>
+ <tt>menu</tt> <br>
+ <tt>$data | doit | $text</tt> </blockquote>
+ <p><b>bind</b></p>
+ <p>A <tt>bind</tt> command is a command that is bound to an
+ event. When the event occurs, the command is executed. Types
+ of events available include all TK events, including all <i>keystrokes</i>
+ and <i>mouse clicks.</i> If a command is bound to an event
+ other that a <i>keystroke</i>, care must be taken to not to
+ interfere with other internal DS9 events. </p>
+ <p>To bind to a key stroke, use the following command type:</p>
+ <blockquote> <tt>bind &lt;keystroke&gt; </tt><br>
+ </blockquote>
+ <tt>Example:</tt>
+ <blockquote> <tt># Bind command example</tt><br>
+ <tt>Print coordinates</tt><br>
+ <tt>*.fits</tt><br>
+ <tt>bind x</tt><br>
+ <tt>echo "$x $y" | $text</tt><br>
+ </blockquote>
+ <p><b>web</b></p>
+ <p>A <tt>web</tt> command allows the user to invoke the
+ internal web browser from the analysis menu.</p>
+ <tt>Example:</tt>
+ <blockquote> <tt> # web command example<br>
+ HTTP based<br>
+ *<br>
+ web<br>
+ http://hea-www.harvard.edu/RD/ds9/ref/index.html<br>
+ <br>
+ File based<br>
+ *<br>
+ web<br>
+ file:/home/joye/index.html<br>
+ </tt> </blockquote>
+ </blockquote>
+ <p><b><a name="Macros"></a>Macros</b></p>
+ <p>The following macros are macro-expanded to fill in user-defined
+ arguments before the command is executed. Strings that contain
+ $&lt;macroname&gt; that user does not want to be expanded may be
+ escaped by using $$&lt;macroname&gt;. All strings that contain
+ $&lt;string&gt; &nbsp;that are not a macro name will not be
+ affected.</p>
+ <p>For example:</p>
+ <blockquote> <tt>echo "$$data $foo" | $text</tt><br>
+ </blockquote>
+ <p>will display a text dialog that contains "$data $foo"</p>
+ <p><b>$width<br>
+ $height<br>
+ $depth</b></p>
+ <p>Substitute the width, height, or depth of the data file in the
+ command line. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $width</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; $height</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "$width $height $depth" | $text</tt>
+ <br>
+ <p><b>$bitpix</b></p>
+ <p>Substitute the bitpix of the data file in the command line. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $bitpix</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "$bitpix" | $text</tt>
+ <p><b>$data</b></p>
+ <p>Data from the current frame becomes the input data to the
+ command string. This data is in the form of a FITS image. This
+ macro can only used at the beginning of the command string. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $data</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $data | dosomething | $text</tt>
+ <p><b>$entry</b></p>
+ <p>Display an entry modal dialog. The returned string is
+ substituted. If <tt>cancel</tt> is selected, the command line
+ is not executed. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $entry(&lt;message&gt;)</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "$entry(Enter something here)"
+ | $text</tt>
+ <p><b>$env</b></p>
+ <p>Substitute the value of a shell environment variable. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $env(&lt;shell variable&gt;)</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "$env(PATH)" | $text</tt>
+ <p><b>$filedialog</b></p>
+ <p>Display the standard file dialog. Substitutes the returned
+ pathname. Argument specifies if an open file or save file dialog
+ is invoked.</p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $filedialog([open|save])</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "$filedialog(open)" | $text</tt><br>
+ <p><b>$filename</b></p>
+ <p>Substitute the filename of the data file in the command line. A
+ full filename includes any absolute or relative path. A root
+ filename contains no path. A (2D) subsection defines a subimage
+ from <tt>xmin,ymin</tt> to <tt>xmax,ymax</tt>. For Frame3D, a
+ 2D subsection will also include the current slice (PLANE=)
+ parameter if not 1. A 3D subsection defines a subimage from <tt>xmin,ymin,zmin</tt>
+ to <tt>xmax,ymax,zmax</tt> and no PLANE parameter.<br>
+ </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $filename # filename with extname,
+ (2d) subsections, filters</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; $filename(root|root,base) # root filename
+ with </tt><tt>with extname, </tt><tt>no subsections, no
+ filters)</tt> <br>
+ <tt>&nbsp; &nbsp; $filename(full|full,base) # full filename </tt><tt>with
+
+ extname, </tt><tt>no subsections, no filters)</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; dosomething $filename | $text</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; dosomething $filename(root) | $text<br>
+ </tt><br>
+ <b>$filename[$regions]</b>
+ <p>Combination of <tt>$filename </tt>and <tt>$regions </tt>macros.
+
+Generates
+a
+
+
+
+
+ series of filenames, each with a region. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $filename[$regions]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $filename[$regions(&lt;options&gt;)]</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; dosomething $filename[$regions] |
+ $text</tt>
+ <p><b>$geturl</b></p>
+ <p>This macro differs from all other macros, including $<tt>url</tt>,
+ in that no subprocess pipe is created. Only HTTP is supported.
+ The contents of the url are retrieved and sent to $<tt>text</tt>,
+ $<tt>plot</tt>, or $<tt>image.</tt> No other processing is
+ allowed. The primary purpose of this macro is to support
+ external analysis for the Windows platform, which has no
+ subprocess support. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp;
+ $geturl(http://&lt;hostname&gt;:&lt;port&gt;/&lt;query&gt;)</tt>
+ <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $geturl(http://foo.bar.edu/foo.html)
+ | $text</tt><br>
+ <p><b>$image</b></p>
+ <p>The resulting image data is display in a DS9 frame. This macro
+ should be the last macro of a command line. Optional parameter
+ indicates if a new frame and what type of frame is created for
+ the new data. The macro is removed from the command line before
+ execution. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $image</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $image([new|rgb|3d|current])</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; doit | $image(new)</tt>
+ <p><b>$message</b></p>
+ <p>Display a message dialog box, with option buttons.&nbsp; After
+ displaying the message, the macro is removed from the command
+ line before execution. If <tt>cancel</tt> or <tt>no</tt> is
+ selected, the command line is not executed. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $message(&lt;message&gt;)</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;
+ $message([ok|okcancel|yesno],&lt;message&gt;)</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $message(okcancel,This is a
+ Message)| doit | $text</tt>
+ <p><b>$null</b></p>
+ <p>Expect no output or results from analysis task. Note: no error
+ message will be returned if the analysis task fails to execute
+ correctly. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $null</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo "Hello, world" &gt; foo | $null</tt>
+ <p><b>$pan</b></p>
+ <p>Substitute current pan location of the particular data file are
+ returned. The default coordinate system is <tt>physical</tt>. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $pan<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $pan(&lt;coordinate
+ system&gt;,&lt;format&gt;)</tt> <br>
+ <p>where:</p>
+ <tt>&nbsp;&nbsp;&nbsp; coordinate system =
+ [image|physical|detector|amplifier|wcs|wcsa...wcsz]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ frame&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [fk4|fk5|icrs|galactic|ecliptic]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [hms|sexagesimal|degrees]</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo $pan(fk5,sexagesimal) | $text</tt><br>
+ <p><b>$plot</b></p>
+ <p>Display data in plot window. This macro should be the last
+ macro of a command line. The data is read via <tt>STDIN</tt>
+ and consist of a pair of coordinates, with option error values.
+ (<tt>xy, xyex, xyey, xyexe</tt>y) Default dimension is <tt>xy.</tt>
+ The macro is removed from the command line before execution. </p>
+ <p>For <tt>$plot(stdin)</tt> only: </p>
+ <p>The title, x axis label, and y axis label are assumed to be on
+ the first line of input, delimited with a new-line. However, if
+ the data starts with $<tt>BEGINTEXT</tt>, all text between $<tt>BEGINTEXT</tt>
+ and $<tt>ENDTEXT</tt> will be removed from the data and
+ displayed in a separate text dialog window, with the remaining
+ data, including the title, x axis label, and y axis label, will
+ be displayed in a plot window. Furthermore, if the data contains
+ the string $<tt>ERROR,</tt> an error is assumed to have occurred
+ and a text dialog window is displayed only. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $plot</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $plot(,,,)</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $plot(&lt;title&gt;,&lt;x axis
+ label&gt;,&lt;y axis label&gt;,[xy|xyex|xyey|xyexey])</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $plot(stdin)</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; doit | $plot(This is aTitle,X Axis,Y
+ Axis)<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; doit | $plot(stdin)</tt>
+ <p><b>$regions</b></p>
+ <p>Substitute region definition in specified region format,
+ coordinate system, and coordinate format. The default coordinate
+ system is <tt>physical</tt>, default coordinate format <tt>degrees</tt>,
+ and default region format <tt>DS9</tt>. Arguments may appear in
+ any order, as long as they are separated by ',' and no spaces.
+ If one or&nbsp; more properties are specified, only regions with
+ all of the specified properties will be substituted. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $regions</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $regions(&lt;options&gt;)</tt>
+ <p>where options are one of the following: </p>
+ <tt>&nbsp;&nbsp;&nbsp; regions format&nbsp;&nbsp;&nbsp; =
+ [ds9|ciao|saotng|saoimage|pros|xy]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;
+ property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [include|exclude|source|background]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; coordinate system =
+ [image|physical|detector|amplifier|wcs]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ frame&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [fk4|fk5|icrs|galactic|ecliptic]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [sexagesimal|degrees]</tt>
+ <p>also, the old <i>SAOTNG</i> formats are also supported: </p>
+ <tt>&nbsp;&nbsp;&nbsp; $regions_pixels</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $regions_degrees</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $regions_hms</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $include_regions</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $include_regions_pixels</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $include_regions_degrees</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $include_regions_hms</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $exclude_regions</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $exclude_regions_pixels</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $exclude_regions_degrees</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $exclude_regions_hms<br>
+ </tt> <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; dosomething $regions | $text</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; dosomething $regions(pros) | $text</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; dosomething $regions(source,wcs,fk5) |
+ $text</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; dosomething
+ $regions(saotng,background,exclude,ecliptic,sexagesimal) | $text</tt>
+ <p><b>$text</b></p>
+ <p>Display text in a text dialog window. This macro should be the
+ last macro of a command line. To display text from only STDOUT
+ use '|' as the pipe command. To display text from both STDOUT
+ and STDERR, use '|&amp;' as the pipe command. No parameters are
+ required. The macro is removed from the command line before
+ execution. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $text</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; doit | $text # stdout<br>
+ &nbsp;&nbsp;&nbsp; doit |&amp; $text # stdout and stderr<br>
+ </tt>
+ <p><b>$url</b></p>
+ <p>URLs are processed and stored in a temporary file. Only HTTP
+ and anonymous FTP are supported. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp;
+ $url(http://&lt;hostname&gt;:&lt;port&gt;/&lt;query&gt;)</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;
+ $url(ftp://&lt;hostname&gt;/&lt;filename&gt;)</tt><br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp;
+ $url(http://legacy.gsfc.nasa.gov/rosat/data/p000s26b.img.Z) |
+ uncompress | $image</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;
+ $url(ftp://legacy.gsfc.nasa.gov/rosat/data/hri/images/rh100193_img.fits)
+ | $image<br>
+ </tt>
+ <p><b>$vo_method</b></p>
+ <p>Returns the vo method. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $vo_method</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo '$vo_method' | $text</tt><br>
+ <p><b>$value<br>
+ </b></p>
+ <p>Substitute the value at the location of the cursor of an bind
+ event.<br>
+ </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $value<br>
+ <br>
+ Example:<br>
+ &nbsp;&nbsp;&nbsp; echo "$value" | $text</tt><br>
+ <p><b>$x<br>
+ $y<br>
+ $z<br>
+ </b></p>
+ <p>Substitute coordinates of an bind event. When a bind event is
+ triggered, the <i>x,y </i>coordinates of the mouse of the
+ particular data file are returned. The default coordinate system
+ is <tt>physical</tt>. This macro is only available for bind
+ commands. For datacubes, the z coordinate is returned based on
+ the current slice selected.<br>
+ </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $x</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $x(&lt;coordinate
+ system&gt;,&lt;format&gt;)</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $y</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; $y(&lt;coordinate
+ system&gt;,&lt;format&gt;)<br>
+ &nbsp;&nbsp;&nbsp; $z<br>
+ &nbsp;&nbsp;&nbsp; $z(&lt;coordinate system&gt;)<br>
+ </tt>
+ <p>where:</p>
+ <tt>&nbsp;&nbsp;&nbsp; coordinate system =
+ [image|physical|detector|amplifier|wcs|wcsa...wcsz]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ frame&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [fk4|fk5|icrs|galactic|ecliptic]</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; sky
+ format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
+ [hms|sexagesimal|degrees]</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; echo "$x $y" | $text<br>
+ &nbsp;&nbsp;&nbsp; echo "$x $y $z" | $text<br>
+ &nbsp;&nbsp;&nbsp; echo "$x(fk5,sexagesimal)
+ $y(fk5,sexagesimal)" | $text<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; echo "$x(wcs) $y(wcs) $z(wcs)" | $text</tt><br>
+ <p><b>$xpa</b></p>
+ <p>Returns the xpa access point name. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $xpa</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo '$xpa' | $text</tt>
+ <p><b>$xpa_method</b></p>
+ <p>Returns the xpa method. </p>
+ <tt>Syntax:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; $xpa_method</tt> <br>
+ <br>
+ <tt>Example:<br>
+ </tt> <tt>&nbsp;&nbsp;&nbsp; echo '$xpa_method' | $text</tt>
+ <p><b><a name="Help"></a>Help</b></p>
+ <p>The user may define his own <tt>HELP</tt> message. This
+ message will be available to the user as a menu item. An
+ optional label maybe specified. The default label is <tt>Help</tt>.
+ When invoked, an text dialog window will appear, containing the
+ message. Multiple <tt>HELP</tt> items maybe defined within a
+ menu or across hierarchical menus. </p>
+ <tt>Example:</tt>
+ <blockquote><tt>help Main Help</tt> <br>
+ <tt>A help message may contain</tt> <br>
+ <tt>multiple lines of description of the tasks</tt> <br>
+ <tt>in the menu or menus</tt> <br>
+ <tt>endhelp</tt> </blockquote>
+ <p><b><a name="Parameters"></a>Parameters</b></p>
+ <p>The user may define his own macros or parameters to be
+ evaluated before the command line is executed. To do this, the
+ user defines a param segment that is referenced in the command
+ line. The param definition has the follow format: </p>
+ <blockquote> <tt>param &lt;name&gt;</tt> <br>
+ <tt>&lt;variable&gt; &lt;entry | checkbox | menu&gt;
+ &lt;title&gt; &lt;default&gt; &lt;{comment}&gt;</tt> <br>
+ <tt>...</tt> <br>
+ <tt>endparam</tt> </blockquote>
+ <p>or </p>
+ <blockquote> <tt>param &lt;name&gt;</tt> <br>
+ <tt>@&lt;iraf param filename&gt;</tt> <br>
+ <tt>end</tt> </blockquote>
+ <p>The definition either consisted of a number of variables, one
+ per row, or the name of a IRAF style parameter file. DS9 will
+ look for the IRAF parameter file in: </p>
+ <blockquote> <tt>./&lt;filename&gt;</tt> <br>
+ <tt>$UPARM/&lt;filename&gt;</tt> <br>
+ <tt>$HOME/iraf/&lt;filename&gt;</tt> </blockquote>
+ <tt>Example:<br>
+ </tt>
+ <blockquote> <tt>param foobar</tt> <br>
+ <tt>var1 entry {Variable 1} default {this is a entry}</tt> <br>
+ <tt>var2 checkbox {Variable 2} 1 {this is a checkbox}</tt> <br>
+ <tt>var3 menu {Variable 3} AAA|BBB|CCC {this is a menu}</tt> <br>
+ <tt>endparam</tt> </blockquote>
+ <p>To use parameters, specify the param name at the beginning of
+ your command line: </p>
+ <blockquote> <tt>Parameter Test</tt> <br>
+ <tt>*</tt> <br>
+ <tt>menu</tt> <br>
+ <tt>$param(foobar); echo "$var1 $var2 $var3" | $text</tt> </blockquote>
+ <p>When the menu item is selected, the user will be presented with
+ a dialog box that contains <i>entry, checkbox, or menu </i>choices
+
+
+
+
+ for each variable specified. If the user clicks ok, the values
+ are substituted in the command line before execution. </p>
+ <p><b><a name="HierarchicalMenus"></a>Hierarchical Menus</b></p>
+ <p>The user may define hierarchical menus. Use this to organized
+ crowded menus. To do this, frame menu entries with <tt>hmenu
+ &lt;label&gt; </tt>and <tt>endhmenu</tt>. Hierarchical menu
+ labels may contain spaces. Multiple levels maybe implemented. </p>
+ <tt>Example:<br>
+ </tt>
+ <blockquote> <tt>hmenu Stuff</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; hello</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; *</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; menu</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; echo "Hello" | $text</tt>
+ <p><tt>&nbsp;&nbsp;&nbsp; world</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; *</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; menu</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; echo "World" | $text</tt> </p>
+ <p><tt>&nbsp;&nbsp;&nbsp; hmenu More Stuff</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hello world</tt>
+ <br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; menu</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Hello
+ World" | $text</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp; endhmenu</tt> <br>
+ <tt>endhmenu</tt></p>
+ </blockquote>
+ <p>Will create an hierarchical menu with two members, <tt>hello</tt>
+ and <tt>world</tt>. </p>
+ <p><b><a name="Sample"></a>Sample</b></p>
+ <tt>#<br>
+ # Analysis command descriptions:<br>
+ #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; menu label<br>
+ #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file templates<br>
+ #&nbsp;&nbsp;&nbsp; menu/bind<br>
+ #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; analysis command line<br>
+ <br>
+ param foo<br>
+ &nbsp;&nbsp;&nbsp; var1 entry entry 40 {this is a entry}<br>
+ &nbsp;&nbsp;&nbsp; var2 checkbox checkbox 1 {this is a checkbox}<br>
+ &nbsp;&nbsp;&nbsp; var3 menu menu AAA|BBB|CCC {this is a menu}<br>
+ endparam<br>
+ <br>
+ param bar<br>
+ &nbsp;&nbsp;&nbsp; @analysis.par<br>
+ endparam<br>
+ <br>
+ param foobar<br>
+ &nbsp;&nbsp;&nbsp; @tvdisply.par<br>
+ endparam<br>
+ <br>
+ param ltc<br>
+ &nbsp;&nbsp;&nbsp; bins entry "Enter number of [t1:t2:]bins" 0
+ "('0' for default number of bins)"<br>
+ endparam<br>
+ <br>
+ # Help Main Help<br>
+ <br>
+ help Main Help<br>
+ These menus contain a test for each possible feature<br>
+ <br>
+ supported by the ds9 (blank line above)<br>
+ endhelp<br>
+ ---<br>
+ <br>
+ hmenu Test Web<br>
+ &nbsp;&nbsp;&nbsp; help Web Help<br>
+ &nbsp;&nbsp;&nbsp; Help for web features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Web Test url<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; web<br>
+ &nbsp;&nbsp;&nbsp; http://hea-www.harvard.edu/RD/ds9/<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Web Test file<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; web<br>
+ &nbsp;&nbsp;&nbsp; file:/home/joye/saods9/ds9/tests/hv.html<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Basics<br>
+ &nbsp;&nbsp;&nbsp; help Basic Help<br>
+ &nbsp;&nbsp;&nbsp; Help for basic features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test escape char # this is a comment<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "this is not a macro $$xpa" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test pass thru # this is a comment<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "this is not a macro $foo" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $xpa # this is a comment<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $xpa | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $xpa_method<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $xpa_method | $text<br>
+ </tt><tt><br>
+ &nbsp;&nbsp;&nbsp; Test $vo_method<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $vo_method | $text<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; Test $filename<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $filename | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $filename(root)<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $filename(root) | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $xdim $ydim $bitpix<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$xdim $ydim $bitpix" | $text<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; Test $xcen $ycen<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$xcen $ycen" | $text<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; Test $env<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo $env(PATH) | $text<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Regions<br>
+ &nbsp;&nbsp;&nbsp; help Regions Help<br>
+ &nbsp;&nbsp;&nbsp; Help for regions features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $regions<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$regions
+ ds9_s:$regions(ds9,source,image)
+ ciao_b:$regions(ciao,background)
+ saotng_i:$regions(saotng,include,wcs,fk5)
+ pros_e:$regions(pros,exclude,wcs,fk5,sexagesimal)
+ xy_be:$regions(xy,background,exclude,wcs,fk4,hms)" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $regions wcs<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$regions(ds9,wcs)
+ $regions(ds9,wcs,fk5,sexagesimal) $regions(ds9,wcsa) " | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $include_regions_pixels<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "ds9_s: $source_regions ds9_b:
+ $background_regions_pixels ds9_i: $include_regions_degrees
+ ds9_e: $exclude_regions_hms" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $filename $regions<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$filename[$regions]" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $filename $regions()<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$filename[$regions()]" | $text<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Output<br>
+ &nbsp;&nbsp;&nbsp; help Output Help<br>
+ &nbsp;&nbsp;&nbsp; Help for output features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $null<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "This is Text" &gt; /dev/null | $null<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $text<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "This is Text" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $text stderr<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; ls foofoofoo | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xy.dat | $plot<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(title,x,y,xyey)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xye.dat | $plot(Title,X Axis,Y Axis,xyey)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(title,x,y,xyexey)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xyee.dat | $plot(Title,X Axis,Y
+ Axis,xyexey)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(title,x,y,4)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xyey.dat | $plot(Title,X Axis,Y Axis,4)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(title,x,y,5)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xyeye.dat | $plot(Title,X Axis,Y Axis,5)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(stdin)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xye.stdin.dat | $plot(stdin)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(stdin) text<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xye.stdin.text.dat | $plot(stdin)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $plot(stdin) error<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat xy.stdin.error.dat | $plot(stdin)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $data<br>
+ &nbsp;&nbsp;&nbsp; *.fits<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $data | $image(new)<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $image<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; cat img16.fits | $image<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Dialogs<br>
+ &nbsp;&nbsp;&nbsp; help Dialogs Help<br>
+ &nbsp;&nbsp;&nbsp; Help for dialog features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $message(message)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $message(ok,This is a Message) | echo "hello"
+ | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $message(ok,message)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $message(ok,This is a Message) | echo "World"
+ | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $entry(message)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; echo "$entry(Enter Something)" | $text<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Params<br>
+ &nbsp;&nbsp;&nbsp; help Param Help<br>
+ &nbsp;&nbsp;&nbsp; Help for param features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $param<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $param(foo); echo "$var1 $var2 $var3" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $param @file<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $param(bar); echo "$var1 $var2 $var3" | $text<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Network<br>
+ &nbsp;&nbsp;&nbsp; help Network Help<br>
+ &nbsp;&nbsp;&nbsp; Help for network features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $url(http://)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp;
+ $url(http://legacy.gsfc.nasa.gov/FTP/rosat/data/cdrom/vol1/IMAGES/00h/p000s26b.img.Z)
+
+|
+gunzip
+
+
+
+
+ | $image<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $url(ftp://)<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp;
+ $url(ftp://legacy.gsfc.nasa.gov/rosat/data/hri/images/fits/rh100193_img.fits)
+
+
+
+
+ | $image<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $geturl $text<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp;
+$geturl(http://hea-www.harvard.edu/RD/saord-cgi/funtools?funcnts+$filename+$regions(source,,)+$regions(background,,))|$text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; Test $geturl $plotstd<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $param(ltc);
+$geturl(http://hea-www.harvard.edu/RD/saord-cgi/funtools?funhist_plot+$filename[$regions]+time+$bins)|$plot(stdin)<br>
+ endhmenu<br>
+ <br>
+ hmenu Test Other<br>
+ &nbsp;&nbsp;&nbsp; help Other Help<br>
+ &nbsp;&nbsp;&nbsp; Help for other features<br>
+ &nbsp;&nbsp;&nbsp; endhelp<br>
+ &nbsp;&nbsp;&nbsp; ---<br>
+ &nbsp;&nbsp;&nbsp; Test $param @tvdisply<br>
+ &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; $param(foobar); echo "$frame $erase" | $text<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; hmenu Test MultiLevel<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; test<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; *<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; menu<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo "Hello World" | $text<br>
+ &nbsp;&nbsp;&nbsp; endhmenu<br>
+ endhmenu<br>
+ <br>
+ $x $y<br>
+ *.fits<br>
+ bind x<br>
+ echo "$x $y" | $text<br>
+ <br>
+ $x(fk5,hms) $y(fk5,hms)<br>
+ *.fits<br>
+ bind y<br>
+ echo "$x(fk5,hms) $y(fk5,hms)" | $text<br>
+ <br>
+ $x(wcs,fk5,hms) $y(wcs,fk5,hms)<br>
+ *.fits<br>
+ bind z<br>
+ echo "$x(wcs,fk5,hms) $y(wcs,fk5,hms)" | $text<br>
+ </tt> </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/backup.html b/ds9/doc/ref/backup.html
new file mode 100644
index 0000000..63bc304
--- /dev/null
+++ b/ds9/doc/ref/backup.html
@@ -0,0 +1,60 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Backup</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" width="100"
+ height="98"> Backup and Restore</h3>
+ <blockquote>
+ <p>DS9 now supports Backup and Restore. When a backup is invoked,
+ DS9 will save in a backup save set all files needed to restore
+ DS9 to that state, including geometry, data files, colormaps,
+ catalogs, contours, and regions.<br>
+ </p>
+ <p><b>Backup Save Set</b></p>
+ <p>A backup save set consists of a text file, called a backup
+ script, and an optional directory, which will contain auxiliary
+ data files needed to restore DS9 to a previous state. The backup
+ file and the auxiliary directory maybe moved across file
+ systems, or even platforms, but must remain together in the same
+ directory. <br>
+ </p>
+ <p><b>Image data files</b></p>
+ <p>By default, all data image files are save within the backup
+ save set. However, the user has the option, via the Preferences,
+ to only save only an absolute pathname to the data file, and not
+ the data file itself. This option will dramatically reduce the
+ size of a backup save set, but will restrict the usage to a
+ particular file system and platform.<br>
+ </p>
+ <p>Image files that have been loaded into DS9 via XPA, SAMP, or
+ from URL will always be saved into the save set.<br>
+ </p>
+ <p><b>Caveats</b></p>
+ <p>There are several caveats in the usage of Backup and Restore.
+ In particular:<br>
+ </p>
+ <blockquote>
+ <p> <tt>Currently, there is no support for masks.<br>
+ External Analysis menus will not be saved.<br>
+ Plot Tool windows will not be saved.<br>
+ IIS frames (IRAF) will not be saved.<br>
+ SAMP and XPA sessions will not be saved.</tt></p>
+ </blockquote>
+ <p>And finally, if the image data had been loaded into DS9 via
+ XPA, SAMP, or from a URL, the following complex load operations
+ are not supported:</p>
+ <blockquote> <tt>Open Mosaic IRAF Image<br>
+ Open Mosaic IRAF Segment Open Mosaic WCS Image<br>
+ Open Mosaic WCS Segment Open Mosaic WFPC2 Open RGB Fits Image
+ Open RGB Fits Cube Open RGB Array Open Multi Ext Data Cube
+ Open Multi Ext Multiple Frames </tt></blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/bin.html b/ds9/doc/ref/bin.html
new file mode 100644
index 0000000..966d3ba
--- /dev/null
+++ b/ds9/doc/ref/bin.html
@@ -0,0 +1,53 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Bin</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> Binning</h3>
+ <blockquote>
+ <p>To create an image from a FITS Bin Table, the user needs to
+ specify a binning factor, binning buffer size, and the binning
+ function.<br>
+ </p>
+ <p>The Binning (or Block) Factor is defined as the following: A
+ value greater or equal to zero. This value indicates the number
+ of pixel values that will fall into a particular bin.<br>
+ </p>
+ <p>The Bin Buffer Size is overall size of the image generated.
+ This has no relation to min and max values of the columns used
+ to create the image. <br>
+ </p>
+ <p>The Bin Function is defined as the following: Average - all
+ pixel values that fall into one pixel bin are averaged. Sum -
+ all pixel values that fall into one pixel bin are summed.<br>
+ </p>
+ <p>Bin to Fit Frame will calculate a bin block factor as a power
+ of 2 that will allow the entire data space to be displayed in
+ the current frame. </p>
+ <p>By default, DS9 will bin about the center of the image. To
+ determine the center of the image, DS9 will look for the
+ following keywords in order:</p>
+ <blockquote> <tt>TDMIN/TDMAX<br>
+ TLMIN/TLMAX<br>
+ TALEN<br>
+ AXLEN</tt> </blockquote>
+ <p>If no valid keywords are found, DS9 will define the center as
+ the middle of the possible data space based on the coordinate
+ data type.</p>
+ <br>
+ <p><br>
+ </p>
+ <blockquote> </blockquote>
+ <p><br>
+ </p>
+ <br>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/catalog.html b/ds9/doc/ref/catalog.html
new file mode 100644
index 0000000..3cd39c8
--- /dev/null
+++ b/ds9/doc/ref/catalog.html
@@ -0,0 +1,147 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Catalogs</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Catalogs</h3>
+ <blockquote>
+ <p>DS9 provides full support for loading, displaying, filtering,
+ and saving catalogs. DS9 allows you to overlay symbols from
+ multiple catalogs on the current image.</p>
+ <p>Local and on-line catalog access is supported. Most major
+ catalogs can be retrieved from online servers. Both the CDS and
+ SDSS catalog servers are now supported. Local catalog files in
+ starbase (rdb) or CSV (with or without header) are supported.</p>
+ <p>On-line catalogs are available via services provided by the
+ VizieR catalog access tool, CDS, Strasbourg, France (VizieR is a
+ joint effort of the Centre de Donnees Astronomiques de
+ Strasbourg and ESA-ESRIN Information Systems Division) and by
+ the Sloan Digital Sky Survey.</p>
+ <p>A selection of popular catalogs is provided in the Analysis
+ menu. In addition, you can search for other catalogs based on
+ title, keywords, mission, wavelength, and object type.</p>
+ <p>When a catalog is overlayed on an image, each displayed catalog
+ symbol consists of a shape, color, and text. An advanced symbol
+ editor is available that allows you to specify the shape, size,
+ color, and text of each symbol, based on catalog column values.
+ These symbol expressions can be saved for future use.</p>
+ <p>Along with the overlay display, a catalog list is provided in a
+ separate window. It displays the column values for each catalog
+ object. The catalog list can be sorted and filtered, and the
+ catalog display will be automatically updated. Advanced
+ filtering options are available. Catalogs can be loaded and
+ saved as local files in ASCII Starbase format. Each catalog
+ contains header information which can be displayed. The list can
+ be printed separately from the image.</p>
+ <p>An interactive connection between the displayed catalog symbols
+ and the catalog list is provided. When you select one or more
+ rows within the catalog list, the corresponding symbols are
+ highlighted on the image display. Conversely, selecting multiple
+ symbols on the image display will highlight the corresponding
+ rows within the catalog list. Catalog symbols can be converted
+ to regions for use with analysis tasks.</p>
+ <p><b>Filter Option</b></p>
+ <p>The catalog list can be sorted and filtered, and the catalog
+ display will be automatically updated. A filter is conditional
+ expression, when evaluated for each row of the catalog, if true,
+ the row is displayed, and if false, the row is not displayed.
+ The conditional expression can be any valid TCL expression. The
+ value of a column may be indicated with <tt>$&lt;column
+ name&gt;</tt>.</p>
+ <blockquote> <tt>$_RAJ2000&gt;180. &amp;&amp; $_RAJ2000&lt;270.</tt><br>
+ <tt>$Jmag&gt;11</tt><br>
+ <tt>log($Kmag*10)&lt;.3<br>
+ </tt><tt>[string equal $OTYPE_S SNR]</tt><br>
+ </blockquote>
+ <p><b>Advanced Symbol Editor</b></p>
+ <p>An advanced symbol editor is available that allows you to
+ specify the shape, size, color, and text of each symbol, based
+ on catalog column values. For each row of the catalog, one or
+ more conditional expressions are evaluated. For the first
+ expression to evaluate true, a given symbol is displayed, with
+ the specified shape, color, size and text properties. As with
+ the filter, the value of a particular column can be indicated as
+ <tt>$&lt;column name&gt;.</tt></p>
+ <p>For the condition entry, the expression you type in is
+ automatically evaluated via TCL <tt>expr</tt> after macro
+ expansion.</p>
+ <blockquote> <tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ always</tt><br>
+ <tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ never</tt><br>
+ <tt>true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ always</tt><br>
+ <tt>false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ never</tt><br>
+ <tt>$Jmag&gt;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ conditional</tt><br>
+ <tt>sin($Jmag)&gt;.5
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ # conditional</tt><br>
+ <tt>[string equal $Class
+ SNR]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# conditional</tt><br>
+ <tt>[regexp {*SNR*}
+ $Class]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+ conditional</tt><br>
+ </blockquote>
+ <p>For the size, size2, and angle entries, the expression you type
+ in is also automatically evaluated via TCL <tt>expr</tt> after
+ macro expansion.</p>
+ <blockquote> <tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ value of '2' is used</tt><br>
+ <tt>$Jmag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ value of column Jmag is used</tt><br>
+ <tt>$Jmag/2.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+ value of column Jmag div 2 is used</tt><br>
+ <tt>(4+2)/3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ value of '2' is used</tt><br>
+ </blockquote>
+ <p>For the text portion, this is not true. It is assumed to be
+ text, unless you explicitly use an <tt>expr </tt>operator.</p>
+ <blockquote> <tt>foo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ will put 'foo' above the symbol</tt><br>
+ <tt>$Jmag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ will put the value of column Jmag above the symbol</tt><br>
+ <tt>(4+2)/3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#
+
+
+ will put the text '(4+2)/3' above the symbol</tt><br>
+ <tt>[expr (4+2)/3]&nbsp;&nbsp;# will put the text '2' above the
+ symbol</tt><br>
+ <tt>[expr $Jmag/2.]&nbsp;# will take the value of Jmag and div
+ by 2</tt><br>
+ </blockquote>
+ <p>And finally, one special case for shape = text and text =
+ empty. In this case, the row number is displayed. </p>
+ &nbsp; </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/colorbar.html b/ds9/doc/ref/colorbar.html
new file mode 100644
index 0000000..ee432cd
--- /dev/null
+++ b/ds9/doc/ref/colorbar.html
@@ -0,0 +1,71 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Color</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" width="100"
+ height="98"> Colorbar<br>
+ </h3>
+ <blockquote>
+ <p><b>Color Tags</b></p>
+ <p>The purpose of color tags are to highlight (or hide) certain
+ values of data, regardless of the color map selected. The user
+ creates, edits, and deletes color tags via the GUI. To create a
+ color tag, enter the Colorbar Mode, and click once on the
+ colorbar. This creates a default color tag. Click and drag to
+ change the values. Click and drag on one side to increase or
+ decrease the value. Double click to manually edit the values and
+ color. Place the cursor over the color tag and press the delete
+ key to delete it. From the color parameters dialog, the user can
+ load, save, and delete all color tags for that frame.<br>
+ </p>
+ <p><b>Visuals</b></p>
+ <p>DS9 supports a number of color environments. Not all color
+ environments, or visuals, are available on most machines. In
+ fact, you may be restricted to one or two, base on the color
+ graphics hardware your computer has. A color visual is composed
+ of two parts, the color model and the bit depth. Pseudo color
+ uses a color lookup table to derive the correct color, True
+ color uses the value directly as a RGB triplet, to derive the
+ correct color. The follow is a list of the color visuals DS9
+ currently supports:</p>
+ <blockquote> <tt>pseudo color, 8 bit<br>
+ true color, 8 bit <br>
+ true color, 15 bit <br>
+ true color, 16 bit <br>
+ true color, 24 bit</tt> </blockquote>
+ <p> You can use the <tt>xdpyinfo</tt> command to see if one of
+ these visual are available. NOTE: Linux Users-- if your desired
+ visual is not available, use the Xconfigarator command (Red Hat)
+ or similar command under other versions of linux, to configure
+ your X window visuals.</p>
+ <p>When DS9 is invoked, by default, it will use the default
+ visual. You can find out what the default visual is by using the
+ <tt>xdpyinfo</tt> command. You can also force DS9 to use another
+ visual by command line option. If you specify a visual, and it
+ is not available, DS9 will exit with an error message. </p>
+ <blockquote><tt>$ds9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ # default visual, default depth<br>
+ $ds9 -visual pseudo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
+ pseudo color, default depth <br>
+ $ds9 -visual pseudocolor&nbsp; # pseudo color, default depth <br>
+ $ds9 -visual pseudocolor8 # pseudo color 8 <br>
+ $ds9 -visual
+ true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # true
+ color, default depth <br>
+ $ds9 -visual truecolor&nbsp;&nbsp;&nbsp; # true color, default
+ depth <br>
+ $ds9 -visual truecolor8&nbsp;&nbsp; # true color 8 <br>
+ $ds9 -visual truecolor16&nbsp; # true color 16 <br>
+ $ds9 -visual truecolor24&nbsp; # true color 24</tt> </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/command.html b/ds9/doc/ref/command.html
new file mode 100644
index 0000000..6da067d
--- /dev/null
+++ b/ds9/doc/ref/command.html
@@ -0,0 +1,5025 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Command Line Options</title>
+ </head>
+ <body alink="#ff0000" link="#0000ff" vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> Command Line Options</h3>
+ <blockquote>
+ <p>DS9 will process each command line option, one at a time, as
+ the last step in the initialization process. Therefore, it is
+ possible to use command line options as a little script. For
+ example, the following command line option is used:</p>
+ <tt>$ds9 -tile foo.fits -cmap Heat -zscale bar.fits -cmap I8</tt>
+ <p>First DS9 is put in tile mode, then <tt>foo.fits</tt> is
+ loaded. Then the colormap for <tt>foo.fits</tt> is changed to <tt>Heat</tt>
+ and the scale changed to <tt>zscale</tt>. Next, <tt>bar.fits</tt>
+ is loaded and the colormap for <tt>bar.fits</tt> is changed to
+ <tt>I8.</tt> </p>
+ <tt> <a href="#2mass">2mass</a><br>
+ <a href="#3d">3d</a><br>
+ <a href="#about">about</a><br>
+ <a href="#align">align</a><br>
+ <a href="#analysis">analysis</a><br>
+ <a href="#array">array</a><br>
+ <a href="#asinh">asinh</a><br>
+ <a href="#background">background</a><br>
+ <a href="#backup">backup</a><br>
+ <a href="#bin">bin</a><br>
+ <a href="#blink">blink</a><br>
+ <a href="#block">block</a><br>
+ <a href="#blue">blue</a><br>
+ <a href="#catalog">catalog</a><br>
+ <a href="#cd">cd</a><br>
+ <a href="#cmap">cmap</a><br>
+ <a href="#colorbar">colorbar</a><br>
+ <a href="#console">console</a><br>
+ <a href="#contour">contour</a><br>
+ <a href="#crop">crop</a><br>
+ <a href="#crosshair">crosshair</a><br>
+ <a href="#cube">cube</a><br>
+ <a href="#cursor">cursor</a><br>
+ <a href="#dsssao">dsssao</a><br>
+ <a href="#dsseso">dsseso</a><br>
+ <a href="#dssstsci">dssstsci</a><br>
+ <a href="#envi">envi</a><br>
+ <a href="#exit">exit</a><br>
+ <a href="#export">export</a><br>
+ <a href="#fifo">fifo</a><br>
+ <a href="#fifo_only">fifo_only</a><br>
+ <a href="#fits">fits</a><br>
+ <a href="#frame">frame</a><br>
+ <a href="#geometry">geometry</a><br>
+ <a href="#gif">gif</a><br>
+ <a href="#green">green</a><br>
+ <a href="#geometry">grid</a><br>
+ <a href="#header">header</a><br>
+ <a href="#height">height</a><br>
+ <a href="#help">help</a><br>
+ <a href="#histequ">histequ</a><br>
+ <a href="#iconify">iconify</a><br>
+ <a href="#import">import</a><br>
+ <a href="#inet_only">inet_only</a><br>
+ <a href="#invert">invert</a><br>
+ <a href="#iis">iis</a><br>
+ <a href="#jpeg">jpeg</a><br>
+ <a href="#language">language</a><br>
+ <a href="#linear">linear</a><br>
+ <a href="#lock">lock</a><br>
+ <a href="#log">log</a><br>
+ <a href="#lower">lower</a><br>
+ <a href="#magnifier">magnifier</a><br>
+ <a href="#mask">mask</a><br>
+ <a href="#match">match</a><br>
+ <a href="#mecube">mecube</a><br>
+ <a href="#minmax">minmax</a><br>
+ <a href="#mode">mode</a><br>
+ <a href="#mosaic">mosaic</a><br>
+ <a href="#mosaicimage">mosaicimage</a><br>
+ <a href="#movie">movie</a><br>
+ <a href="#msg">msg</a><br>
+ <a href="#multiframe">multiframe</a><br>
+ <a href="#nameserver">nameserver</a><br>
+ <a href="#nan">nan</a><br>
+ <a href="#nrrd">nrrd</a><br>
+ <a href="#nvss">nvss</a><br>
+ <a href="#orient">orient</a><br>
+ <a href="#pagesetup">pagesetup</a><br>
+ <a href="#pan">pan</a><br>
+ <a href="#pixeltable">pixeltable</a><br>
+ <a href="#plot">plot</a><br>
+ <a href="#png">png</a><br>
+ <a href="#prefs">prefs</a><br>
+ <a href="#preserve">preserve</a><br>
+ <a href="#psprint">psprint</a><br>
+ <a href="#print">print</a><br>
+ <a href="#private">private</a><br>
+ <a href="#port">port</a><br>
+ <a href="#port_only">port_only</a><br>
+ <a href="#pow">pow</a><br>
+ <a href="#exit">quit</a><br>
+ <a href="#raise">raise</a><br>
+ <a href="#regions">regions</a><br>
+ <a href="#red">red</a><br>
+ <a href="#restore">restore</a><br>
+ <a href="#rgb">rgb</a><br>
+ <a href="#rgbarray">rgbarray</a><br>
+ <a href="#rgbcube">rgbcube</a><br>
+ <a href="#rgbimage">rgbimage</a><br>
+ <a href="#rotate">rotate</a><br>
+ <a href="#samp">samp</a><br>
+ <a href="#save">save</a><br>
+ <a href="#saveimage">saveimage</a><br>
+ <a href="#scale">scale</a><br>
+ <a href="#shm">shm</a><br>
+ </tt><tt><tt><a href="#sia">sia</a><br>
+ </tt> <a href="#single">single</a><br>
+ <a href="#sinh">sinh</a><br>
+ <a href="#skyview">skyview</a><br>
+ <a href="#sleep">sleep</a><br>
+ <a href="#slice">slice</a><br>
+ <a href="#smooth">smooth</a><br>
+ <a href="#squared">squared</a><br>
+ <a href="#sqrt">sqrt</a><br>
+ <a href="#source">source</a><br>
+ <a href="#tcl">tcl</a><br>
+ <a href="#threads">threads</a><br>
+ <a href="#tiff">tiff</a><br>
+ <a href="#tile">tile</a><br>
+ <a href="#title">title</a><br>
+ <a href="#unix">unix</a><br>
+ <a href="#unix_only">unix_only</a><br>
+ <a href="#update">update</a><br>
+ <a href="#url">url</a><br>
+ <a href="#version">version</a><br>
+ <a href="#view">view</a><br>
+ <a href="#visual">visual</a><br>
+ <a href="#vla">vla</a><br>
+ </tt><tt><tt><a href="#vlss">vlss</a><br>
+ </tt><a href="#vo">vo</a><br>
+ <a href="#wcs">wcs</a><br>
+ <a href="#web">web</a><br>
+ <a href="#width">width</a><br>
+ <a href="#xpa">xpa</a><br>
+ <a href="#zmax">zmax</a><br>
+ <a href="#zoom">zoom</a><br>
+ <a href="#zscale">zscale</a><br>
+ </tt>
+ <p><b><a name="2mass"></a>2mass </b></p>
+ <p>Support for 2MASS Digital Sky Survey.</p>
+ <tt> Syntax: <br>
+ -2mass []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp; [survey j|h|k] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -2mass<br>
+ $ds9 -2mass m31 <br>
+ $ds9 -2mass name m31 <br>
+ $ds9 -2mass coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -2mass size 60 60 arcmin<br>
+ $ds9 -2mass save yes<br>
+ $ds9 -2mass frame current<br>
+ $ds9 -2mass update frame<br>
+ $ds9 -2mass survey j<br>
+ $ds9 -2mass open<br>
+ $ds9 -2mass close<br>
+ </tt>
+ <p><b><a name="3d"></a>3d </b></p>
+ <p>Support for 3D frame.</p>
+ <tt> Syntax: <br>
+ </tt><tt>-3d []<br>
+ &nbsp;&nbsp;&nbsp; [view &lt;az&gt; &lt;el&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [az &lt;az&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [el &lt;el&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [scale &lt;scale&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [method mip|aip]</tt><br>
+ <tt><tt>&nbsp;&nbsp;&nbsp; [background none|azimuth|elevation]<br>
+ </tt>&nbsp;</tt><tt>&nbsp;&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp;&nbsp; [border color]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [highlite yes|no]<br>
+ &nbsp;&nbsp;&nbsp; [highlite color]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [open|close]<br>
+ </tt><tt>&nbsp; <br>
+ Example:<br>
+ $ds9 -3d # create new 3D frame<br>
+ $ds9 -3d view 45 30<br>
+ $ds9 -3d az 45<br>
+ $ds9 -3d el 30<br>
+ $ds9 -3d scale 10<br>
+ $ds9 -3d method mip</tt><br>
+ <tt>$ds9 -3d background azimuth<br>
+ </tt><tt>$ds9 -3d border yes<br>
+ $ds9 -3d border color red<br>
+ </tt> <tt>$ds9 -3d highlite yes<br>
+ $ds9 -3d highlite color red<br>
+ </tt> <tt>$ds9 -3d open<br>
+ $ds9 -3d close</tt><br>
+ <p><b><a name="about"></a>about</b></p>
+ <p>Get DS9 credits.</p>
+ <tt> Syntax: <br>
+ -about <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -about<br>
+ </tt>
+ <p><b> <a name="align"></a>align</b></p>
+ <p>Controls the World Coordinate System alignment for the current
+ frame.</p>
+ <tt> Syntax: <br>
+ -align [yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -align yes <br>
+ </tt>
+ <p><b> <a name="analysis"></a>analysis</b></p>
+ <p>Control external analysis tasks. Tasks are numbered as they are
+ loaded, starting with 0. Can also be used to display a message
+ and display text in the text dialog window. </p>
+ <tt> Syntax: <br>
+ -analysis [&lt;task number&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [task &lt;task
+ number&gt;|&lt;task name&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [clear][load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [message
+ ok|okcancel|yesno &lt;message&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [entry
+ &lt;message&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [text]</tt><tt><tt><tt><tt><tt><br>
+ </tt></tt> &nbsp; </tt></tt><br>
+ Example:<br>
+ $ds9 -analysis 0 # invoke first analysis task<br>
+ $ds9 -analysis task 0<br>
+ </tt><tt>$ds9 -analysis task foobar<br>
+ </tt><tt>$ds9 -analysis task "{foo bar}"<br>
+ $ds9 -analysis my.ans<br>
+ $ds9 -analysis load my.ans <br>
+ $ds9 -analysis clear <br>
+ $ds9 -analysis clear load my.ans<br>
+ $ds9 -analysis message '{This is a message}'<br>
+ $ds9 -analysis message okcancel '{This is a message}'<br>
+ $ds9 -analysis text '{This is text}'</tt><tt><br>
+ </tt>
+ <p><b> <a name="array"></a>array</b></p>
+ <p>Load raw data array into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -array
+&lt;filename&gt;[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],zdim=&lt;z&gt;,bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -array foo.arr[dim=512,bitpix=-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | ds9 -array -[dim=512,bitpix=-32,endian=little]</tt><tt><br>
+ </tt>
+ <p><b> <a name="asinh"></a></b><b>asinh</b> </p>
+ <p>Select ASINH scale function for the current frame.</p>
+ <tt> Syntax:<br>
+ -asinh <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -asinh</tt><br>
+ <p><b><a name="background"></a>bg<br>
+ background</b></p>
+ <p>Set image background color. </p>
+ <tt> Syntax: <br>
+ -bg &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -background red<br>
+ $ds9 -bg red</tt><br>
+ <p><b> <a name="backup"></a>backup</b></p>
+ <p>Create a backup save set. </p>
+ <tt> Syntax: <br>
+ -backup &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -backup ds9.bck</tt><br>
+ <p><b> <a name="bin"></a>bin</b></p>
+ <p>Controls binning factor, binning buffer size, and&nbsp; binning
+ function for binning FITS bin tables. </p>
+ <tt> Syntax: <br>
+ -bin [about &lt;x&gt; &lt;y&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [about center]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [buffersize &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [cols &lt;x&gt; &lt;y&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [colsz &lt;x&gt; &lt;y&gt; &lt;z&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [factor &lt;value&gt; [&lt;value&gt;]]
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [depth &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [filter &lt;string&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [function average|sum] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -bin about 4096 4096<br>
+ $ds9 -bin about center<br>
+ $ds9 -bin buffersize 512<br>
+ $ds9 -bin cols detx dety<br>
+ $ds9 -bin colsz detx dety time<br>
+ $ds9 -bin factor 4<br>
+ $ds9 -bin factor 4 2<br>
+ $ds9 -bin depth 10<br>
+ $ds9 -bin filter 'pha &gt; 5'<br>
+ $ds9 -bin filter ''<br>
+ $ds9 -bin function sum<br>
+ </tt><tt><tt>$ds9 -bin in<br>
+ $ds9 -bin out<br>
+ </tt>$ds9 -bin to fit<br>
+ $ds9 -bin match<br>
+ $ds9 -bin lock yes<br>
+ $ds9 -bin open<br>
+ $ds9 -bin close<br>
+ </tt>
+ <p><b> <a name="blink"></a>blink</b></p>
+ <p>Blink mode parameters. Interval is in seconds.</p>
+ <tt> Syntax: <br>
+ -blink []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -blink<br>
+ $ds9 -blink yes<br>
+ $ds9 -blink interval 1</tt><br>
+ <p><b> <a name="block"></a>block</b></p>
+ <p>Controls blocking parameters. </p>
+ <tt> Syntax: <br>
+ -block</tt><tt><tt> [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt;
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ </tt><tt>$ds9 </tt><tt><tt><tt>-block</tt></tt> 4<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> 4 2<br>
+ </tt><tt><tt><tt>$ds9 </tt><tt><tt><tt>-block</tt></tt> to 4<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> to 4 2<br>
+ </tt>$ds9 </tt><tt><tt><tt>-block</tt></tt> in<br>
+ </tt></tt><tt><tt><tt>$ds9 </tt><tt><tt><tt>-block</tt></tt>
+ out<br>
+ </tt></tt>$ds9 </tt><tt><tt><tt>-block</tt></tt> to fit<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> match<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> lock yes<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> open<br>
+ $ds9 </tt><tt><tt><tt>-block</tt></tt> close</tt><tt><br>
+ </tt> <b> </b>
+ <p><b> <a name="blue"></a>blue</b></p>
+ <p>For RGB frames, sets the current color channel to blue.</p>
+ <tt> Syntax: <br>
+ -blue<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -blue foo.fits<br>
+ </tt>
+ <p><b> <a name="catalog"></a>catalog<br>
+ cat</b></p>
+ <p>Support for catalogs. The first three commands will create a
+ new catalog search. All other commands operated on the last
+ search created, unless indicated otherwise.</p>
+ <tt> Syntax: <br>
+ </tt><tt>-catalog []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ned|simbad|denis|skybot]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ascss|cmc|gsc1|gsc2|gsc3|ac|nomad|ppmx|sao|sdss5|sdss6|</tt><tt>sdss7|sdss8|</tt><tt>tycho|ua2|ub1|ucac2]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2mass|iras]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [csc|xmm|rosat]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [first|nvss]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [chandralog|cfhtlog|esolog|stlog|xmmlog]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [cds &lt;catalogname&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cds
+ &lt;catalogid&gt;]<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [import sb|tsv
+ &lt;filename&gt;]<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [allcols]<br>
+ </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
+ [&lt;ref&gt;] [allrows]<br>
+ &nbsp;</tt><tt>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [clear]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [coordinate &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [dec
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [edit
+ yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [export sb|tsv &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [filter &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [filter load
+ &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [header]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [hide]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [location
+ &lt;code&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [match &lt;ref&gt; &lt;ref&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match error &lt;value&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match function 1and2|1not2|2not1]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match return 1and2|1only|2only]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match unique yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [maxrows
+ &lt;number&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [name
+ &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [panto yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [plot
+ &lt;xcol&gt; &lt;ycol&gt; &lt;xerrcol&gt; &lt;yerrcol&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psky
+ &lt;skyframe&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psystem
+ &lt;coordsys&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [ra
+ &lt;col&gt;]</tt><br>
+ <tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [regions]</tt><br>
+ <tt> </tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [retrieve]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [samp]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ broadcast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ send &lt;application&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [save &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [server cds|sao|cadc|adac|iucaa|bejing|cambridge|ukirt]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [show]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [sky &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [skyformat &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [sort
+ &lt;col&gt; incr|decr]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ [#]
+ condition|shape|color|text|font|fontsize|fontweight|fontslant
+ &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol [#] text|size|size2|units|angle &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol shape {circle point}|{box point}|{diamond point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {cross point}|{x
+ point}|{arrow point}|{boxcircle point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
+ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; circle|ellipse|box|text]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ add| [#] remove]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ save|load &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [system
+ &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [update]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [x
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [y
+ &lt;col&gt;]</tt><br>
+ <tt><br>
+ Example:<br>
+ </tt><tt>$ds9 -catalog<br>
+ $ds9 -catalog 2mass<br>
+ $ds9 -catalog cds 2mass<br>
+ $ds9 -catalog cds "I/252"<br>
+ <br>
+ </tt><tt>$ds9 -catalog load foo.xml<br>
+ $ds9 -catalog import tsv foo.tsv<br>
+ <br>
+ </tt><tt>$ds9 -catalog allrows<br>
+ $ds9 -catalog allcols<br>
+ </tt><tt>$ds9 -catalog cancel<br>
+ </tt><tt>$ds9 -catalog clear<br>
+ </tt><tt>$ds9 -catalog close<br>
+ </tt><tt>$ds9 -catalog coordinate 202.48 47.21 fk5<br>
+ </tt><tt>$ds9 -catalog crosshair<br>
+ </tt><tt>$ds9 -catalog dec DEC<br>
+ </tt><tt>$ds9 -catalog edit yes<br>
+ </tt><tt>$ds9 -catalog export tsv bar.tsv<br>
+ </tt><tt>$ds9 -catalog filter </tt><tt>'\$Jmag&gt;15'</tt><tt><br>
+ $ds9 -catalog filter load foo.flt<br>
+ $ds9 -catalog header<br>
+ </tt><tt>$ds9 -catalog hide<br>
+ </tt><tt>$ds9 -catalog location 500</tt><br>
+ <tt>$ds9 -catalog match error 2 arcsec<br>
+ $ds9 -catalog match function 1and2<br>
+ $ds9 -catalog match unique no<br>
+ $ds9 -catalog match return 1only<br>
+ $ds9 -catalog match 2mass csc<br>
+ </tt><tt>$ds9 -catalog maxrows 2000<br>
+ </tt><tt>$ds9 -catalog name m51<br>
+ $ds9 -catalog panto no<br>
+ </tt><tt>$ds9 -catalog plot </tt><tt>'\$Jmag' '\$Hmag' '\$e_Jmag'
+ '\$e_Hmag'</tt><tt><br>
+ </tt><tt>$ds9 -catalog print</tt><br>
+ <tt>$ds9 -catalog psky fk5</tt><br>
+ <tt>$ds9 -catalog psystem wcs</tt><br>
+ <tt>$ds9 -catalog ra RA</tt><br>
+ <tt><tt>$ds9 -catalog regions<br>
+ </tt><tt> </tt>$ds9 -catalog retrieve<br>
+ </tt><tt> $ds9 -catalog samp broadcast<br>
+ $ds9 -catalog samp send aladin<br>
+ $ds9 -catalog save foo.xml<br>
+ </tt><tt>$ds9 -catalog server sao<br>
+ </tt><tt>$ds9 -catalog show</tt><br>
+ <tt> $ds9 -catalog size 1 1 degrees</tt><br>
+ <tt>$ds9 -catalog symbol condition '\$Jmag&gt;15'<br>
+ $ds9 -catalog symbol 2 shape "boxcircle point"<br>
+ $ds9 -catalog symbol color red<br>
+ $ds9 -catalog symbol font times<br>
+ </tt><tt>$ds9 -catalog symbol fontsize 14<br>
+ </tt><tt>$ds9 -catalog symbol fontweight bold<br>
+ </tt><tt>$ds9 -catalog symbol fontslant italic<br>
+ </tt><tt>$ds9 -catalog symbol add<br>
+ $ds9 -catalog symbol 2 remove<br>
+ $ds9 -catalog symbol load foo.sym<br>
+ $ds9 -catalog symbol save bar.sym</tt><tt><br>
+ $ds9 -catalog sky fk5<br>
+ $ds9 -catalog skyformat degrees<br>
+ </tt><tt>$ds9 -catalog sort "Jmag" incr<br>
+ </tt><tt>$ds9 -catalog system wcs</tt><tt><br>
+ </tt><tt>$ds9 -catalog update<br>
+ </tt><tt>$ds9 -catalog x RA<br>
+ $ds9 -catalog y DEC</tt><br>
+ <p><b><a name="cd"></a>cd</b></p>
+ <p>Sets the current working directory. </p>
+ <tt> Syntax: <br>
+ cd [&lt;directory&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -cd /home/mrbill<br>
+ </tt>
+ <p><b> <a name="cmap"></a>cmap</b></p>
+ <p>Controls the colormap for the current frame. The colormap name
+ is not case sensitive. A valid contrast value is&nbsp; from 0 to
+ 10 and bias value from 0 to 1. </p>
+ <tt> Syntax: <br>
+ -cmap [&lt;colormap&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [file]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [invert yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [value &lt;contrast&gt;
+ &lt;bias&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tag [load|save]
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tag delete]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -cmap Heat <br>
+ $ds9 -cmap load foo.sao <br>
+ $ds9 -cmap save bar.sao<br>
+ $ds9 -cmap invert yes <br>
+ $ds9 -cmap value 5 .5<br>
+ $ds9 -cmap tag load foo.tag<br>
+ $ds9 -cmap tag save foo.tag<br>
+ $ds9 -cmap tag delete<br>
+ </tt><tt>$ds9 -cmap match<br>
+ $ds9 -cmap lock yes</tt><br>
+ <tt> $ds9 -cmap open<br>
+ $ds9 -cmap close<br>
+ </tt>
+ <p><b><a name="colorbar"></a>colorbar</b></p>
+ <p>Controls colorbar parameters.</p>
+ <tt> Syntax: <br>
+ -colorbar []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [orientation
+ horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [space
+ value|distance]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontsize
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [fontslant
+ roman|italic]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [ticks]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -colorbar yes<br>
+ $ds9 -colorbar vertical<br>
+ $ds9 -colorbar orientation vertical<br>
+ $ds9 -colorbar numerics yes<br>
+ $ds9 -colorbar space value<br>
+ $ds9 -colorbar font times<br>
+ $ds9 -colorbar fontsize 14<br>
+ $ds9 -colorbar fontweight bold<br>
+ $ds9 -colorbar fontslant italic<br>
+ $ds9 -colorbar size 20<br>
+ $ds9 -colorbar ticks 11<br>
+ </tt>
+ <p><b> <a name="console"></a>console</b></p>
+ <p>Display tcl console window.</p>
+ <tt> Syntax: <br>
+ -console<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -console<br>
+ </tt>
+ <p><b> <a name="contour"></a>contour<br>
+ </b></p>
+ <p>Controls contours in the current frame. </p>
+ <tt> Syntax: <br>
+ -contour []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [generate]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save
+ &lt;filename&gt; &lt;coordsys&gt; &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [convert]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [loadlevels
+ &lt;filename&gt;]</tt><br>
+ <tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [savelevels &lt;filename&gt;]<br>
+ </tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [paste
+ &lt;coordsys&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [color
+ &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [width
+ &lt;width&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [dash yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [smooth
+ &lt;smooth&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [method
+ block|smooth]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [nlevels &lt;number
+ of levels&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale
+ linear|log|pow|squared|sqrt|asinh|sinh|histequ]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [log exp
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [limits &lt;min&gt;
+ &lt;max&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [levels
+ &lt;value value value...&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -contour<br>
+ $ds9 -contour yes<br>
+ $ds9 -contour generate<br>
+ $ds9 -contour clear<br>
+ $ds9 -contour load ds9.ctr<br>
+ $ds9 -contour load ds9.ctr red 2 yes<br>
+ $ds9 -contour save ds9.ctr wcs fk5<br>
+ $ds9 -contour convert<br>
+ $ds9 -contour loadlevels ds9.ctr<br>
+ </tt><tt><tt>$ds9 -contour savelevels ds9.lev<br>
+ </tt>$ds9 -contour copy<br>
+ $ds9 -contour paste wcs red 2 no<br>
+ $ds9 -contour color yellow<br>
+ $ds9 -contour width 2<br>
+ $ds9 -contour dash yes<br>
+ $ds9 -contour smooth 5<br>
+ $ds9 -contour method smooth<br>
+ $ds9 -contour nlevels 10<br>
+ $ds9 -contour scale sqrt<br>
+ $ds9 -contour log exp 1000<br>
+ $ds9 -contour mode zscale<br>
+ $ds9 -contour limits 1 100<br>
+ $ds9 -contour levels "1 10 100 1000"<br>
+ $ds9 -contour open<br>
+ $ds9 -contour close<br>
+ </tt>
+ <p><b><a name="crop"></a>crop</b> </p>
+ <p>Set current image display area. </p>
+ <tt> Syntax: <br>
+ -crop [&lt;x&gt; &lt;y&gt; &lt;width&gt; &lt;height&gt;
+[&lt;coordsys&gt;][&lt;skyframe&gt;][&lt;skyformat&gt;][degrees|arcmin|arcsec]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]</tt><tt>
+ <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 foo.fits -crop 40 30 10 20 # set crop in physical coords<br>
+ $ds9 foo.fits -crop +104:51:06.915 +68:33:40.761&nbsp; 28.144405
+ 22.000204 wcs galactic arcsec<br>
+ $ds9 foo.fits -crop match wcs<br>
+ $ds9 foo.fits -crop lock wcs<br>
+ </tt>
+ <p><b> <a name="crosshair"></a>crosshair</b></p>
+ <p>Controls the current position of the crosshair in the current
+ frame. DS9 is placed in crosshair mode when the crosshair is
+ set. </p>
+ <tt> Syntax: <br>
+ -crosshair [&lt;x&gt; &lt;h&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;]]<br>
+ &nbsp;</tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock
+ &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $ds9 -crosshair 100 100 physical # set crosshair in physical <br>
+ $ds9 -crosshair 345 58.8 wcs fk5 # set crosshair in wcs coords <br>
+ $ds9 -crosshair 23:01:00 +58:52:51 wcs fk5<br>
+ $ds9 -crosshair match<br>
+ $ds9 -crosshair lock wcs<br>
+ </tt>
+ <p><b><a name="cube"></a>cube<br>
+ </b></p>
+ <p>Controls FITS cube. </p>
+ <tt> Syntax: <br>
+ -cube [play|stop|next|prev|first|last]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;slice&gt;
+ [&lt;coordsys&gt;][&lt;axis&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;numeric&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [axis &lt;axis&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [order 123|132|213|231|312|321]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes lock [yes|no]]<br>
+ </tt> <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -cube play<br>
+ $ds9 -cube last<br>
+ $ds9 -cube 3<br>
+ $ds9 -cube 4.5 wcs 3<br>
+ $ds9 -cube interval 2<br>
+ $ds9 -cube axis 3<br>
+ $ds9 -cube match wcs<br>
+ $ds9 -cube lock wcs<br>
+ $ds9 -cube order 123<br>
+ $ds9 -cube axes lock yes<br>
+ $ds9 -cube open<br>
+ $ds9 -cube close</tt><br>
+ <p><b> <a name="cursor"></a>cursor</b></p>
+ <p>Move mouse pointer or crosshair in image pixels in the current
+ frame. Note, this will move selected Regions also. </p>
+ <tt> Syntax: <br>
+ -cursor [&lt;x&gt; &lt;h&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -cursor 10 10</tt><tt><br>
+ </tt>
+ <p><b><a name="dsssao"></a>dsssao<br>
+ dss<br>
+ </b></p>
+ <p>Support for Digital Sky Survey at SAO.</p>
+ <tt> Syntax: <br>
+ -dsssao []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -dsssao <br>
+ $ds9 -dsssao m31 <br>
+ $ds9 -dsssao name m31 <br>
+ $ds9 -dsssao coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -dsssao size 60 60 arcmin<br>
+ $ds9 -dsssao save yes<br>
+ $ds9 -dsssao frame current<br>
+ $ds9 -dsssao update frame<br>
+ $ds9 -dsssao open<br>
+ $ds9 -dsssao close<br>
+ </tt>
+ <p><b><a name="dsseso"></a>dsseso </b></p>
+ <p>Support for Digital Sky Survey at ESO.</p>
+ <tt> Syntax:<br>
+ -dsseso []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [survey
+ DSS1|DSS2-red|DSS2-blue|DSS2-infrared]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -dsseso <br>
+ $ds9 -dsseso m31 <br>
+ $ds9 -dsseso name m31 <br>
+ $ds9 -dsseso coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -dsseso size 60 60 arcmin<br>
+ $ds9 -dsseso save yes<br>
+ $ds9 -dsseso frame current<br>
+ $ds9 -dsseso update frame <br>
+ $ds9 -dsseso survey DSS2-red<br>
+ $ds9 -dsseso open<br>
+ </tt><tt>$ds9 -dsseso close</tt><br>
+ <p><b><a name="dssstsci"></a>dssstsci </b></p>
+ <p>Support for Digital Sky Survey at STSCI.</p>
+ <tt> Syntax:<br>
+ -dssstsci []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name
+ &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord
+ &lt;ra&gt; &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame
+ new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss2ukstu_red|poss2ukstu_ir|poss2ukstu_blue] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss1_blue|poss1_red]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ all|quickv|phase2_gsc2|phase2_gsc1]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -dssstsci <br>
+ $ds9 -dssstsci m31 <br>
+ $ds9 -dssstsci name m31 <br>
+ $ds9 -dssstsci coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -dssstsci size 60 60 arcmin<br>
+ $ds9 -dssstsci save yes<br>
+ $ds9 -dssstsci frame current<br>
+ $ds9 -dssstsci update frame <br>
+ $ds9 -dssstsci survey all<br>
+ $ds9 -dssstsci open<br>
+ $ds9 -dssstsci close</tt><br>
+ <p><b> <a name="envi"></a>envi</b></p>
+ <p>Load an ENVI header and file. Optional parameter: array endian.<br>
+ </p>
+ <tt> Syntax: <br>
+ -envi &lt;header&gt; [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt><tt><tt><tt>$ds9 -envi foo.hdr</tt></tt><tt><tt><tt><tt><tt><tt><br>
+ </tt></tt></tt></tt></tt></tt> <b> </b>$ds9 -envi
+ foo.hdr foo.bsq</tt></tt><tt><tt><tt><tt><tt><tt><br>
+ </tt></tt></tt></tt></tt></tt>
+ <p><b> <a name="exit"></a>exit<br>
+ quit</b></p>
+ <p>Quits DS9. </p>
+ <tt> Syntax: <br>
+ -exit <br>
+ -quit <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -exit<br>
+ </tt>
+ <p><b> <a name="export"></a>export<br>
+ </b></p>
+ <p>Export loaded image data of current frame in specified image
+ format, at native resolution, using current colormap and
+ contrast/bias settings. NOTE: not scaling, rotation, or
+ translation is applied. If no format specified, the file name
+ extension is used to determine the output format. Optional
+ parameters: jpeg quality (1-100) and tiff compression method.<br>
+ </p>
+ <tt> Syntax: <br>
+ -export [array|nrrd|envi|gif|tiff|jpeg|png] &lt;filename&gt;</tt><tt><br>
+ </tt><tt><tt>-export array &lt;filename&gt;</tt><tt> </tt><tt>[big|little</tt><tt>|native]<br>
+ </tt>-export nrrd &lt;filename&gt; </tt><tt>[big|little</tt><tt>|native]</tt><br>
+ <tt>-export envi &lt;header&gt; [&lt;filename&gt;] </tt><tt>[big|little</tt><tt>|native]</tt><tt>
+ </tt><tt><br>
+ </tt><tt>-export &lt;filename&gt;</tt><tt>.jpeg [1-100]<br>
+ </tt><tt>-export &lt;filename&gt;</tt><tt>.tiff
+ [none|jpeg|packbits|deflate]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ $ds9 -export array foo.arr little<br>
+ $ds9 -export nrrd foo.nrrd little<br>
+ $ds9 -export envi foo.hdr little<br>
+ </tt><tt><tt>$ds9 -export envi foo.hdr foo.bsq little<br>
+ </tt>$ds9 -export tiff foo.tiff jpeg<br>
+ $ds9 -export jpeg foo.jpeg 75<br>
+ $ds9 -export png foo.png</tt><br>
+ <p><b><a name="fifo"></a>fifo</b></p>
+ <p>Set the name of the IRAF input and output fifos. The default is
+ /dev/imt1. These fifos are used by IRAF to communicate with DS9.
+ </p>
+ <tt> Syntax: <br>
+ -fifo name <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -fifo /dev/imt1 </tt>
+ <p><b> <a name="fifo_only"></a>fifo_only</b></p>
+ <p>Only use IRAF input and output fifos. Same as -port 0 -unix
+ none. </p>
+ <tt> Syntax: <br>
+ -fifo_only <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -fifo_only<br>
+ </tt>
+ <p><b> <a name="fits"></a>fits</b></p>
+ <p>Load a FITS image into the current frame.<br>
+ </p>
+ <tt> Syntax: <br>
+ -fits </tt><tt><tt>&lt;filename&gt;</tt></tt><tt><br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt>$ds9 -fits foo.fits<br>
+ $ds9 -fits bar.fits[bin=detx,dety]<br>
+ $cat foo.fits | ds9 -fits -<br>
+ $cat bar.fits | ds9 -fits -[bin=detx,dety]</tt><tt><br>
+ </tt>
+ <p><b><a name="frame"></a>frame</b></p>
+ <p>Controls frame functions. Frames may be created, deleted,
+ reset, and centered. While return the current frame number. If
+ you goto a frame that does not exists, it will be created. If
+ the frame is hidden, it will be shown. The 'frameno' option is
+ available for backward compatibility. </p>
+ <tt> Syntax: <br>
+ -frame [center [#|all]]<br>
+ &nbsp; &nbsp; &nbsp;&nbsp; [clear [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; [new [rgb]]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[delete [#|all]] <br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[reset [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;[refresh [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;[hide [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;[show [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move first]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move forward]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move last]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[first]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;[prev]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[next]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[last]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;[frameno #]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;[#]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock
+ &lt;coordsys&gt;|none]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -frame center # center current frame<br>
+ $ds9 -frame center 1 # center 'Frame1' <br>
+ $ds9 -frame center all # center all frames <br>
+ $ds9 -frame clear # clear current frame<br>
+ $ds9 -frame new # create new frame <br>
+ $ds9 -frame new rgb # create new rgb frame<br>
+ $ds9 -frame delete # delete current frame <br>
+ $ds9 -frame reset # reset current frame <br>
+ $ds9 -frame refresh # refresh current frame <br>
+ $ds9 -frame hide # hide current frame <br>
+ $ds9 -frame show 1 # show frame 'Frame1'<br>
+ $ds9 -frame move first # move frame to first in order<br>
+ $ds9 -frame move back # move frame back in order<br>
+ $ds9 -frame move forward # move frame forward in order<br>
+ $ds9 -frame move last # move frame to last in order<br>
+ $ds9 -frame first # goto first frame <br>
+ $ds9 -frame prev # goto prev frame <br>
+ $ds9 -frame next # goto next frame<br>
+ $ds9 -frame last # goto last frame<br>
+ $ds9 -frame frameno 4 # goto frame 'Frame4', create if needed<br>
+ $ds9 -frame 3 # goto frame 'Frame3', create if needed<br>
+ $ds9 -frame lock wcs</tt><br>
+ <p><b> <a name="gif"></a>gif</b></p>
+ <p>Import gif file. </p>
+ <tt> Syntax: <br>
+ -gif &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -gif foo.gif<br>
+ $cat foo.gif | ds9 -gif -<br>
+ </tt>
+ <p><b> <a name="geometry"></a>geometry</b></p>
+ <p>Define the initial window geometry. This includes all of the
+ ds9 window, not just the image space. see X(1). </p>
+ <tt> Syntax: <br>
+ -geometry value <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -geometry 640x480 </tt>
+ <p><b> <a name="green"></a>green</b></p>
+ <p>For RGB frames, sets the current color channel to green.</p>
+ <tt> Syntax: <br>
+ -green<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -green foo.fits </tt>
+ <p><b> <a name="grid"></a>grid</b></p>
+ <p>Controls coordinate grid. For grid numeric format syntax,&nbsp;
+ click <a href="grid.html#Format">here</a>.</p>
+ <tt> Syntax: <br>
+ -grid []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [type analysis|publication] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sky &lt;skyframe&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat &lt;skyformat&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes type interior|exterior]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes origin
+ lll|llu|lul|luu|ull|ulu|uul|uuu]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp; &nbsp; [format1 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format2 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics type interior|exterior]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics vertical yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title text &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title def yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title gap &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontweight normal|bold]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [title fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text1 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def1 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text2 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def2 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [reset]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -grid <br>
+ $ds9 -grid yes<br>
+ $ds9 -grid type analysis <br>
+ $ds9 -grid system wcs <br>
+ $ds9 -grid sky fk5 <br>
+ $ds9 -grid skyformat degrees<br>
+ $ds9 -grid grid yes<br>
+ $ds9 -grid grid color red<br>
+ $ds9 -grid grid width 2<br>
+ $ds9 -grid grid style 1<br>
+ $ds9 -grid grid gap1 10<br>
+ $ds9 -grid grid gap2 10<br>
+ $ds9 -grid axes yes<br>
+ $ds9 -grid axes color red<br>
+ $ds9 -grid axes width 2<br>
+ $ds9 -grid axes style 1<br>
+ $ds9 -grid axes type exterior<br>
+ $ds9 -grid axes origin lll<br>
+ $ds9 -grid format1 d.2<br>
+ $ds9 -grid format2 d.2<br>
+ $ds9 -grid tickmarks yes<br>
+ $ds9 -grid tickmarks color red<br>
+ $ds9 -grid tickmarks width 2<br>
+ $ds9 -grid tickmarks style 1<br>
+ $ds9 -grid border yes<br>
+ $ds9 -grid border color red<br>
+ $ds9 -grid border width 2<br>
+ $ds9 -grid border style 1<br>
+ $ds9 -grid numerics yes<br>
+ $ds9 -grid numerics font courier<br>
+ $ds9 -grid numerics fontsize 12<br>
+ $ds9 -grid numerics fontweight bold<br>
+ $ds9 -grid numerics fontslant italic<br>
+ $ds9 -grid numerics color red<br>
+ $ds9 -grid numerics gap1 10<br>
+ $ds9 -grid numerics gap2 10<br>
+ $ds9 -grid numerics type exterior<br>
+ $ds9 -grid numerics vertical yes<br>
+ $ds9 -grid title yes<br>
+ $ds9 -grid title text {Hello World}<br>
+ $ds9 -grid title def yes<br>
+ $ds9 -grid title gap 10<br>
+ $ds9 -grid title font courier<br>
+ $ds9 -grid title fontsize 12<br>
+ $ds9 -grid title fontweight bold<br>
+ $ds9 -grid title fontslant italic<br>
+ $ds9 -grid title color red<br>
+ $ds9 -grid labels yes<br>
+ $ds9 -grid labels text1 {Hello World}<br>
+ $ds9 -grid labels def1 yes<br>
+ $ds9 -grid labels gap1 10<br>
+ $ds9 -grid labels text2 {Hello World}<br>
+ $ds9 -grid labels def2 yes<br>
+ $ds9 -grid labels gap2 10<br>
+ $ds9 -grid labels font courier<br>
+ $ds9 -grid labels fontsize 12<br>
+ $ds9 -grid labels fontweight bold<br>
+ $ds9 -grid labels fontslant italic<br>
+ $ds9 -grid labels color red<br>
+ $ds9 -grid reset<br>
+ $ds9 -grid load foo.grd <br>
+ $ds9 -grid save foo.grd <br>
+ $ds9 -grid open<br>
+ $ds9 -grid close<br>
+ </tt>
+ <p><b> <a name="header"></a>header</b></p>
+ <p>Display current fits header dialog. Optional extension number
+ maybe specified.</p>
+ <tt> Syntax: <br>
+ -header [&lt;ext&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [close [&lt;ext&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save [&lt;ext&gt;]
+ &lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -header <br>
+ $ds9 -header 2<br>
+ $ds9 -header close<br>
+ $ds9 -header save 1 foo.txt<br>
+ </tt>
+ <p><b> <a name="height"></a>height</b></p>
+ <p>Set the height of the image display window. Use the <a
+ href="command.html#geometry">geometry</a> command to set the
+ overall width and height of the ds9 window.</p>
+ <tt> Syntax: <br>
+ -height [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -height 512<br>
+ </tt>
+ <p><b> <a name="help"></a>help</b></p>
+ <p>Display help information. To maintain backward compatibility,
+ -help will display a brief help message and exit. --help will
+ display all command line options within the built-in help
+ facility.</p>
+ <tt> Syntax: <br>
+ -help # Display brief help message and exit.<br>
+ --help # Display command line options within help facility.<br>
+ -? # Display command line options within help facility.<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -help # Display brief help message and exit.<br>
+ $ds9 --help # Display command line options within help facility<br>
+ $ds9 -? # Display command line options within help facility.<br>
+ </tt>
+ <p><b> <a name="histequ"></a>histequ</b></p>
+ <p>Select histogram equalization scale function for the current
+ frame. </p>
+ <tt> Syntax: <br>
+ -histequ<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -histequ<br>
+ </tt>
+ <p><b> <a name="iconify"></a>iconify</b></p>
+ <p>Toggles iconification. </p>
+ <tt> Syntax: <br>
+ -iconify []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -iconify<br>
+ $ds9 -iconify yes</tt><br>
+ <p><b> <a name="invert"></a>invert</b></p>
+ <p>Invert Colormap. </p>
+ <tt> Syntax: <br>
+ -invert <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -invert<br>
+ </tt>
+ <p><b><a name="iis"></a>iis</b></p>
+ <p>Set IIS Filename. Optional mosaic number maybe supplied.</p>
+ <tt> Syntax: <br>
+ -iis [filename &lt;filename&gt; [#]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -iis filename foo.fits<br>
+ $ds9 -iis filename bar.fits 4</tt><br>
+ <p><b> <a name="jpeg"></a>jpeg</b></p>
+ <p>Load JPEG image into current frame.</p>
+ <tt> Syntax:<br>
+ -jpeg &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt>$ds9 -jpeg foo.jpeg</tt><br>
+ <tt>$cat foo.jpeg | ds9 -jpeg -</tt><br>
+ <p><b> <a name="language"></a>language</b></p>
+ <p>Select current language. </p>
+ <tt> Syntax: <br>
+ -language [locale|da|de|es|en|fr|ja|pt]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -language fr<br>
+ </tt>
+ <p><b> <a name="linear"></a>linear</b></p>
+ <p>Select linear scale function for the current frame. </p>
+ <tt> Syntax: <br>
+ -linear <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -linear </tt>
+ <p><b> <a name="lock"></a>lock</b></p>
+ <p>Lock all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ </tt><tt>-lock</tt><tt> </tt><tt>[frame &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;|none] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp; [crop &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp; &nbsp; [slice &lt;coordsys&gt;|none]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp; [bin [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [scale [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [scalelimits [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [colorbar [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [block [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [smooth [yes|no]]</tt><br>
+ <tt><br>
+ </tt><tt> </tt><tt>Example: </tt><tt><br>
+ $ds9 -lock frame wcs</tt><tt><br>
+ </tt><tt>$ds9 -lock crosshair wcs</tt><tt><br>
+ </tt><tt>$ds9 -lock crop wcs</tt><br>
+ <tt>$ds9 -lock slice wcs</tt><br>
+ <tt>$ds9 -lock bin yes<br>
+ $ds9 -lock axes yes<br>
+ </tt><tt>$ds9 -lock scale yes<br>
+ $ds9 -lock scalelimits yes<br>
+ </tt><tt>$ds9 -lock colorbar yes</tt><tt><br>
+ $ds9 -lock block yes<br>
+ $ds9 -lock smooth yes<br>
+ </tt>
+ <p><b> <a name="log"></a>log</b></p>
+ <p>Select log scale function for the current frame. <br>
+ </p>
+ <tt> Syntax: <br>
+ -log <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -log </tt>
+ <p><b> <a name="lower"></a>lower</b></p>
+ <p>Lower in the window stacking order. </p>
+ <tt> Syntax: <br>
+ -lower <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -lower<br>
+ </tt>
+ <p><b> <a name="magnifier"></a>magnifier</b></p>
+ <p>Controls the magnifier settings. </p>
+ <tt> Syntax: <br>
+ magnifier [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [zoom
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cursor
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [region
+ yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -magnifier color yellow<br>
+ $ds9 -magnifier zoom 2<br>
+ $ds9 -magnifier cursor no<br>
+ $ds9 -magnifier region no<br>
+ </tt>
+ <p><b> <a name="mask"></a>mask<br>
+ nomask<br>
+ </b></p>
+ <p>Controls mask parameters. </p>
+ <tt> Syntax: <br>
+ -mask [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mark 1|0]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [transparency &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ -nomask<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -mask color red<br>
+ $ds9 -mask mark 0<br>
+ $ds9 -mask transparency 50<br>
+ $ds9 -mask clear<br>
+ $ds9 -mask open<br>
+ $ds9 -mask close<br>
+ $ds9 -nomask<br>
+ </tt>
+ <p><b> <a name="match"></a>match</b></p>
+ <p>Match all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ </tt><tt>-match </tt><tt>[frame &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [crop
+ &lt;coordsys&gt;]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [slice &lt;coordsys&gt;]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [bin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [scalelimits]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [block]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [smooth]<br>
+ </tt><tt>&nbsp;<br>
+ Example: <br>
+ </tt><tt>$ds9 -match frame wcs <br>
+ </tt><tt>$ds9 -match crosshair wcs<br>
+ </tt><tt>$ds9 -match crop wcs</tt><br>
+ <tt> $ds9 -match slice wcs</tt> <br>
+ <tt>$ds9 -match bin<br>
+ $ds9 -match axes<br>
+ $ds9 -match scale<br>
+ $ds9 -match scalelimits<br>
+ $ds9 -match colorbar<br>
+ $ds9 -match block<br>
+ $ds9 -match smooth<br>
+ <br>
+ </tt><b><a name="mecube"></a>mecube</b>
+ <p>Load FITS multiple extension file as data cube.<br>
+ </p>
+ <tt> Syntax:<br>
+ mecube &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -mecube foo.fits</tt><tt><tt><br>
+ </tt>$cat foo.fits | ds9 -mecube -</tt><br>
+ <p><b> <a name="minmax"></a>minmax</b></p>
+ <p>This is how DS9 determines&nbsp; the min and max data values
+ from the data. <tt>SCAN</tt> will scan all data.</p>
+ <tt> Syntax: <br>
+ -minmax [scan|sample|datamin|irafmin] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ scan|sample|datamin|irafmin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval #]<br>
+ &nbsp; <br>
+ Example: <br>
+ $ds9 -minmax scan <br>
+ $ds9 -minmax mode scan<br>
+ $ds9 -minmax interval 100<br>
+ </tt>
+ <p><b> <a name="mode"></a>mode</b></p>
+ <p>Select the current mode. </p>
+ <tt> Syntax: <br>
+ -mode
+ [none|region|crosshair|colorbar|pan|zoom|rotate|catalog|examine]
+ <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -mode crosshair</tt><br>
+ <p><b> <a name="mosaic"></a>mosaic</b></p>
+ <p>Load FITS mosaic segment into current frame.</p>
+ <tt> Syntax:<br>
+ -mosaic [wcs|wcsa...wcsz|iraf] &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: </tt><tt><br>
+ $ds9 -mosaic foo.fits</tt><br>
+ <tt><tt>$ds9 -mosaic wcs foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>$cat foo.fits | ds9 -mosaic -</tt> <br>
+ <tt><tt>$cat foo.fits | ds9 -mosaic wcs -</tt></tt><tt><br>
+ </tt>
+ <p><b> <a name="mosaicimage"></a>mosaicimage</b></p>
+ <p>Load FITS mosaic image into current frame.</p>
+ <tt> Syntax:<br>
+ -mosaicimage [wcs|wcsa...wcsz|iraf|wfpc2] &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: </tt><tt><br>
+ $ds9 -mosaicimage foo.fits</tt><br>
+ <tt><tt>$ds9 -mosaicimage wcs foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>$cat foo.fits | ds9 -mosaicimage</tt><br>
+ <tt><tt>$cat foo.fits | ds9 -mosaiimage wcs</tt></tt><tt><br>
+ </tt>
+ <p><b><a name="movie"></a>movie<br>
+ savempeg<br>
+ </b></p>
+ <p>Create mpeg1 movie from snap shots of the DS9 window. A <tt>slice</tt>
+ movie cycles though all slices of a cube. A <tt>frame</tt>
+ movie cycles through all active frames. A <tt>3d</tt> movie
+ cycles through specified viewing angles. The default is <tt>frame</tt>.
+ Optional parameters for <tt>3d</tt>: number of frames, azimuth
+ from/to, elevation from/to, slice from/to, oscillate/repeat
+ times.<br>
+ </p>
+ <tt> Syntax:<br>
+ -movie [slice|frame|3d] &lt;filename&gt;<br>
+ -movie 3d &lt;filename&gt;
+ [number|azfrom|azto|elfrom|elto|slfrom|slto|oscillate|repeat
+ &lt;#&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -movie slice ds9.mpg<br>
+ $ds9 -movie 3d ds9.mpg number 10 azfrom -60 azto 60 oscillate 1</tt><br>
+ <p><b> <a name="msg"></a>msg</b></p>
+ <p>Specify a directory of translation tables to be loaded.</p>
+ <tt> Syntax: <br>
+ -msg &lt;directory&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -msg $HOME/msgs</tt><br>
+ <p><b> <a name="multiframe"></a>multiframe</b></p>
+ <p>Load FITS multiple extension file as multiple images.<br>
+ </p>
+ <tt> Syntax:<br>
+ multiframe &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -multiframe foo.fits</tt><tt><tt><br>
+ </tt>$cat foo.fits | ds9 -multiframe -</tt><tt><br>
+ </tt>
+ <p><b><a name="nameserver"></a>nameserver</b></p>
+ <p>Support Name Server functions. Coordinates are in fk5. </p>
+ <tt> Syntax: <br>
+ -nameserver [&lt;object&gt;]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [name &lt;object&gt;]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [server
+ ned-sao|ned-eso|simbad-sao|simbad-eso] <br>
+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [pan]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -nameserver m31<br>
+ $ds9 -nameserver name m31 <br>
+ $ds9 -nameserver server ned-sao <br>
+ $ds9 -nameserver skyformat sexagesimal<br>
+ $ds9 -nameserver pan<br>
+ $ds9 -nameserver crosshair<br>
+ $ds9 -nameserver open<br>
+ $ds9 -nameserver close<br>
+ </tt>
+ <p><b> <a name="nan"></a>nan</b></p>
+ <p>Set image not-a-number color. </p>
+ <tt> Syntax: <br>
+ -nan &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -nan red</tt><br>
+ <p><b> <a name="nrrd"></a>nrrd</b></p>
+ <p>Load an NRRD (Nearly Raw Raster Data) file.<br>
+ </p>
+ <tt> Syntax: <br>
+ -nrrd &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt><tt>$ds9 -nrrd foo.nrrd</tt></tt><br>
+ <tt>$cat foo.nrrd | xpaset ds9 -nrrd</tt> - <tt><br>
+ </tt>
+ <p><b> <a name="nvss"></a>nvss</b></p>
+ <p>Support for NRAO VLA Sky Survey.</p>
+ <tt> Syntax: <br>
+ -nvss []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -nvss<br>
+ $ds9 -nvss m31 <br>
+ $ds9 -nvss name m31 <br>
+ $ds9 -nvss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -nvss size 60 60 arcmin<br>
+ $ds9 -nvss save yes<br>
+ $ds9 -nvss frame current<br>
+ $ds9 -nvss update frame<br>
+ $ds9 -nvss open<br>
+ $ds9 -nvess close<br>
+ </tt>
+ <p><b><a name="orient"></a>orient</b></p>
+ <p>Controls the orientation of the current frame. </p>
+ <tt> Syntax: <br>
+ -orient [none|x|y|xy] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -orient xy<br>
+ $ds9 -orient open<br>
+ $ds9 -orient close<br>
+ </tt>
+ <p><b> <a name="pagesetup"></a>pagesetup</b></p>
+ <p>Controls Page Setup options.<br>
+ </p>
+ <tt> Syntax: <br>
+ -pagesetup [orient portrait|landscape] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [scale &lt;numberic&gt;]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [size letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $ds9 -pagesetup orient portrait <br>
+ $ds9 -pagesetup scale 50<br>
+ $ds9 -pagesetup size poster</tt><br>
+ <p><b> <a name="pan"></a>pan</b></p>
+ <p>Controls the current image cursor location for the current
+ frame. </p>
+ <tt> Syntax: <br>
+ -pan [&lt;x&gt; &lt;h&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;] # relative<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to &lt;x&gt; &lt;h&gt;
+ &lt;coordsys&gt; [&lt;skyframe&gt;][&lt;skyformat&gt;] #
+ absolute<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -pan 200 200 image</tt><tt><tt> # pan relative </tt> <br>
+ $ds9 -pan to 400 400 physical</tt><tt><tt> # pan to physical
+ coords</tt> <br>
+ $ds9 -pan to 13:29:55 47:11:50 wcs fk</tt><tt><tt> # pan to wcs
+ coords</tt><br>
+ $ds9 -pan open<br>
+ $ds9 -pan close</tt><br>
+ <p><b><a name="pixeltable"></a>pixeltable</b></p>
+ <p>Display/Hide the pixel table. </p>
+ <tt> Syntax: <br>
+ -pixeltable []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [yes|open]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [no|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -pixeltable<br>
+ $ds9 -pixeltable yes<br>
+ $ds9 -pixeltable open<br>
+ $ds9 -pixeltable close<br>
+ </tt>
+ <p><b> <a name="plot"></a>plot</b></p>
+ <br>
+ <p>Display and configure data plots. All plot commands take an
+ optional second command, the plot name. If no plot name is
+ specified, the last plot created is assumed. Plot data is
+ assumed to be a pair of coordinates, with optional error values.
+ The follow are valid data descriptions:</p>
+ <blockquote>xy &nbsp;&nbsp; &nbsp; &nbsp; x and y coordinates<br>
+ xyex&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with x errors<br>
+ xyey&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with y errors<br>
+ xyexey&nbsp;&nbsp;&nbsp; x,y coordinates with&nbsp; x and y
+ errors<br>
+ </blockquote>
+ <p>To create a new plot, use the plot new command.</p>
+ <tt> Syntax: <br>
+ # create new empty plot window<br>
+ -plot<br>
+ -plot [bar|scatter]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter] &lt;title&gt; &lt;xaxis label&gt; &lt;yaxis
+ label&gt; </tt><tt>xy|xyex|xyey|xyexey</tt><tt>]<br>
+ <br>
+ </tt><tt><tt>-plot [&lt;plotname&gt;] load &lt;filename&gt;
+ [xy|xyex|xyey|xyexey]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [&lt;plotname&gt;] save
+ &lt;filename&gt;<br>
+ </tt>&nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] clear<br>
+ </tt><tt><tt><tt><tt><tt><tt>&nbsp; &nbsp; &nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ duplicate<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp; </tt>[&lt;plotname&gt;] stats<br>
+ </tt></tt>&nbsp;&nbsp;&nbsp; &nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ list<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loadconfig &lt;filename&gt;<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] saveconfig
+ &lt;filename&gt;<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+ &nbsp;&nbsp; [&lt;plotname&gt;] pagesetup orient
+ [portrait|landscape]<br>
+ &nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] pagesetup size
+ [letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp; [&lt;plotname&gt;] print<br>
+ &nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] print
+ destination [printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ command &lt;command&gt;<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ filename &lt;filename&gt;<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] print color
+ [rgb|gray]<br>
+ </tt>&nbsp; &nbsp; &nbsp; </tt>[&lt;plotname&gt;] close<br>
+ <br>
+ </tt></tt></tt><tt><tt><tt><tt><tt><tt><tt> -plot </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mode [pointer|zoom]<br>
+ <br>
+ </tt></tt></tt></tt></tt></tt><tt># configure graph<br>
+ -plot [&lt;plotname&gt;] axis [x|y] grid [yes|no]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y] log
+ [yes|no]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y]
+ flip [yes|no]</tt><br>
+ <tt><tt>&nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] axis [x|y] auto
+ [yes|no]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y] min
+ &lt;value&gt;<br>
+ </tt><tt><tt>&nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] axis [x|y]
+ max &lt;value&gt;</tt><tt><br>
+ </tt>&nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] axis [x|y] format
+ &lt;string&gt;</tt><tt><br>
+ </tt>&nbsp; &nbsp; &nbsp; </tt><tt><tt>[&lt;plotname&gt;]
+ legend [yes|no]<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] legend position
+ [right|left|top|bottom]</tt><br>
+ </tt><tt><tt>&nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] font
+ [title|labels|numbers] font [times|helvetica|courier]<br>
+ &nbsp; &nbsp; &nbsp; [&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ size &lt;value&gt;<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ weight [normal|bold]<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ slant [roman|italic]<br>
+ </tt></tt><tt>&nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] title
+ &lt;string&gt;</tt><br>
+ <tt><tt>&nbsp; &nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] title [x|y]
+ &lt;string&gt;</tt></tt><tt><tt><tt><br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] barmode
+ [normal|stacked|aligned|overlap]<br>
+ <br>
+ # configure current dataset<br>
+ </tt>-plot [&lt;plotname&gt;] show [yes|no]<br>
+ </tt>&nbsp; &nbsp; &nbsp; </tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape
+ [circle|square|diamond|plus|splus|scross|triangle|arrow]</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt>&nbsp; &nbsp;&nbsp;&nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape fill [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+ shape color &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp; &nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ smooth
+ [step|linear|cubic|quadratic|catrom]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ width
+ &lt;value&gt;<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dash [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp; &nbsp;
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error width
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name
+ &lt;string&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><br>
+ # select current dataset<br>
+ </tt></tt></tt>-plot [&lt;plotname&gt;] select &lt;value&gt;<br>
+ &nbsp; <br>
+ Example: <br>
+ </tt><tt><tt> </tt></tt><tt># create new empty plot window<br>
+ $ds9 -plot<br>
+ $ds9 -plot scatter<br>
+ $ds9 -plot new<br>
+ $ds9 -plot new bar<br>
+ $ds9 -plot new name foo<br>
+ $ds9 -plot new name foo scatter<br>
+ </tt><tt><tt><br>
+ $ds9 -plot load foo.dat xy # load new dataset with dimension
+ xy<br>
+ $ds9 -plot save bar.dat # save current dataset<br>
+ </tt></tt><tt><tt>$ds9 -plot clear # clear all datasets<br>
+ $ds9 -plot duplicate # duplicate current dataset<br>
+ $ds9 -plot stats # display current dataset statistics<br>
+ $ds9 -plot list # list current dataset<br>
+ </tt></tt><tt><tt>$ds9 -plot loadconfig foo.plt # load plot
+ configuration <br>
+ $ds9 -plot saveconfig bar.plt # save current plot
+ configuration<br>
+ </tt></tt><tt><tt>$ds9 -plot pagesetup orient portrait<br>
+ $ds9 -plot pagesetup size letter<br>
+ </tt></tt><tt><tt>$ds9 -plot print<br>
+ $ds9 -plot print destination file<br>
+ $ds9 -plot print command "lp"<br>
+ $ds9 -plot print filename "foo.ps"<br>
+ $ds9 -plot print color rgb<br>
+ </tt>$ds9 -plot close # close current plot<br>
+ </tt><tt><tt><br>
+ $ds9 -plot mode pointer</tt><br>
+ </tt><tt><br>
+ # configure plot<br>
+ </tt><tt>$ds9 -plot axis x grid yes<br>
+ $ds9 -plot axis x log yes</tt><br>
+ <tt>$ds9 -plot axis x flip yes</tt><tt><br>
+ </tt><tt><tt>$ds9 -plot axis x auto no<br>
+ $ds9 -plot axis x min 0<br>
+ $ds9 -plot axis x max 100<br>
+ </tt><tt><tt>$ds9 -plot axis x format {%f}<br>
+ </tt></tt>$ds9 -plot legend yes # show legend<br>
+ </tt><tt>$ds9 -plot legend position left</tt><tt><tt><tt><tt><br>
+ </tt></tt>$ds9 -plot font numbers font times<br>
+ $ds9 -plot font numbers size 12<br>
+ $ds9 -plot font numbers weight bold<br>
+ $ds9 -plot font numbers slant italic<br>
+ </tt></tt><tt>$ds9 -plot title {The Title}<br>
+ $ds9 -plot title x {X Axis}<br>
+ $ds9 -plot barmode aligned<br>
+ <br>
+ # configure current dataset<br>
+ </tt><tt>$ds9 -plot show yes<br>
+ $ds9 -plot shape circle<br>
+ </tt><tt><tt>$ds9 -plot shape fill no<br>
+ </tt></tt><tt><tt><tt>$ds9 -plot shape color cyan<br>
+ </tt></tt></tt><tt><tt>$ds9 -plot smooth step<br>
+ </tt>$ds9 -plot color red<br>
+ $ds9 -plot width 2<br>
+ $ds9 -plot dash yes<br>
+ $ds9 -plot error yes<br>
+ $ds9 -plot error color red</tt><br>
+ <tt>$ds9 -plot error width 2</tt><br>
+ <tt>$ds9 -plot name {My Data}</tt><br>
+ <tt><br>
+ # select current dataset<br>
+ $ds9 -plot select 2</tt>
+ <p><b><b><a name="png"></a></b>png</b></p>
+ <p>Load PNG image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -png &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: </tt><br>
+ <tt>$ds9 png foo.png</tt><tt><tt><tt><br>
+ </tt></tt>$cat foo.png | ds9 -png -</tt><tt><br>
+ </tt>
+ <p><b> <a name="port"></a>port</b></p>
+ <p>Set the IRAF port number, used by IRAF to communicate with DS9.
+ The default is 5137, the standard IRAF port used by <i>ximtool</i>.
+ </p>
+ <tt> Syntax: <br>
+ -port number <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -port 5137 </tt>
+ <p><b> <a name="port_only"></a>port_only<br>
+ inet_only</b></p>
+ <p>Only use the IRAF port number. This is the same as -fifo none
+ -unix none. </p>
+ <tt> Syntax: <br>
+ -port_only <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -port_only<br>
+ </tt>
+ <p><b> <a name="pow"></a>pow</b></p>
+ <p>Select power scale function for the current frame. </p>
+ <tt> Syntax: <br>
+ -pow <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -pow </tt>
+ <p><b> <a name="prefs"></a>prefs</b></p>
+ <p>Controls various preference settings. </p>
+ <tt> Syntax: <br>
+ -prefs [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [irafalign yes|no]<br>
+ &nbsp; <br>
+ Example: <br>
+ $ds9 -prefs clear<br>
+ $ds9 -prefs irafalign yes<br>
+ </tt>
+ <p><b><a name="preserve"></a>preserve</b> </p>
+ <p>Preserve the follow attributes while loading a new image. </p>
+ <tt> Syntax: <br>
+ preserve [pan yes|no]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; [regions yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -preserve pan yes<br>
+ $ds9 -preserve regions yes<br>
+ </tt>
+ <p><b><a name="psprint"></a>psprint</b></p>
+ <p>Invokes postscript printing. Please see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/command.html#print">print</a>
+ for further details.</p>
+ <p><b><a name="print"></a>print</b></p>
+ <p>Controls printing. Use print option to set printing options.<br>
+ </p>
+ <tt> Syntax: <br>
+ -print [destination printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command &lt;command&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [filename &lt;filename&gt;]
+ <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color
+ rgb|cmyk|gray] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [level 1|2] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [resolution
+ 53|72|75|150|300|600] <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -print <br>
+ $ds9 -print destination file <br>
+ $ds9 -print command 'gv -' <br>
+ $ds9 -print filename foo.ps <br>
+ $ds9 -print color cmyk <br>
+ $ds9 -print level 2 <br>
+ $ds9 -print resolution 75 </tt>
+ <p><b> <a name="private"></a>private</b></p>
+ <p>use private colormap, valid for pseudocolor 8 mode. </p>
+ <tt> Syntax: <br>
+ -private <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -private </tt>
+ <p><b> <a name="raise"></a>raise</b></p>
+ <p>Raise in the window stacking order. </p>
+ <tt> Syntax: <br>
+ -raise <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -raise<br>
+ </tt>
+ <p><b> <a name="regions"></a>regions</b></p>
+ <p>Controls regions in the current frame. </p>
+ <tt> Syntax: <br>
+ -regions [&lt;filename&gt;]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load [all]
+ &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [list [close]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [epsilon
+ &lt;integer&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [show yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [showtext yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid auto
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid
+ radius &lt;value&gt;|iteration &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [getinfo]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [move front] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select all]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [select none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select invert]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [delete all]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [delete select]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format
+ ds9|xml|ciao|saotng|saoimage|pros|xy]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [system
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [sky
+ fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [strip yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [shape
+ &lt;shape&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color
+ &lt;color&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [width
+ &lt;width&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
+ [fixed|edit|rotate|delete yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
+ [include|exclude|source|background]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [delim
+ [nl|&lt;char&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command
+ &lt;marker command&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [composite]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [dissolve]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [template
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [template
+ &lt;filename&gt; at &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt;
+ &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [savetemplate
+ &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group new]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group
+ &lt;tag&gt; new]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group
+ &lt;tag&gt; update]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group
+ &lt;tag&gt; select]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group
+ &lt;tag&gt; color &lt;color&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ copy] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ delete] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ font &lt;font&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ move &lt;int&gt; &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ movefront] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ moveback] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ property &lt;property&gt; yes|no] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [paste
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [undo]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -regions foo.reg <br>
+ $ds9 -regions -format ciao bar.reg # load as ciao format<br>
+ $ds9 -regions foo.fits # FITS regions files do not need a format
+ specification<br>
+ $ds9 -regions load foo.reg # load foo.reg into current frame<br>
+ $ds9 -regions load all foo.reg # load foo.reg into all frames<br>
+ $ds9 -regions load '*.reg'# expand *.reg and load into current
+ frame<br>
+ $ds9 -regions load all '*.reg' # expand *.reg and load into all
+ frames<br>
+ $ds9 -regions save foo.reg<br>
+ $ds9 -regions list <br>
+ $ds9 -regions list close<br>
+ $ds9 -regions epsilon 5<br>
+ $ds9 -regions show yes<br>
+ $ds9 -regions showtext no<br>
+ $ds9 -regions centroid<br>
+ $ds9 -regions centroid auto yes<br>
+ $ds9 -regions centroid radius 10<br>
+ $ds9 -regions centroid iteration 20<br>
+ $ds9 -regions getinfo<br>
+ $ds9 -regions move back<br>
+ $ds9 -regions move front<br>
+ $ds9 -regions select all <br>
+ $ds9 -regions select none<br>
+ $ds9 -regions select invert<br>
+ $ds9 -regions delete all<br>
+ $ds9 -regions delete select<br>
+ $ds9 -regions format ds9 <br>
+ $ds9 -regions system wcs<br>
+ $ds9 -regions sky fk5 <br>
+ $ds9 -regions skyformat degrees <br>
+ $ds9 -regions delim nl <br>
+ $ds9 -regions strip yes<br>
+ $ds9 -regions shape ellipse <br>
+ $ds9 -regions color red <br>
+ $ds9 -regions width 3<br>
+ </tt><tt>$ds9 -regions edit yes<br>
+ $ds9 -regions include<br>
+ </tt><tt>$ds9 -regions command "circle 100 100 20 # color=red"<br>
+ $ds9 -regions composite<br>
+ $ds9 -regions dissolve<br>
+ $ds9 -regions template foo.tpl<br>
+ $ds9 -regions template foo.tpl at 13:29:55.92 +47:12:48.02 fk5<br>
+ $ds9 -regions savetemplate foo.tpl<br>
+ $ds9 -regions group new<br>
+ $ds9 -regions group foo new<br>
+ $ds9 -regions group foo update<br>
+ $ds9 -regions group foo select<br>
+ $ds9 -regions group foo color red<br>
+ $ds9 -regions group foo copy<br>
+ $ds9 -regions group foo delete<br>
+ $ds9 -regions group foo cut<br>
+ $ds9 -regions group foo font {times 14 bold}<br>
+ $ds9 -regions group foo move 100 100<br>
+ $ds9 -regions group foo movefront<br>
+ $ds9 -regions group foo moveback<br>
+ $ds9 -regions group foo property delete no<br>
+ $ds9 -regions copy<br>
+ $ds9 -regions cut<br>
+ $ds9 -regions paste wcs<br>
+ $ds9 -regions undo<br>
+ </tt>
+ <p><b><a name="red"></a>red</b></p>
+ <p>For RGB frames, sets the current color channel to red.</p>
+ <tt> Syntax:<br>
+ -red<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -red foo.fits<br>
+ </tt>
+ <p><b> <a name="restore"></a>restore</b></p>
+ <p>Restore DS9 to a previous state from a backup save set. </p>
+ <tt> Syntax: <br>
+ -restore &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -restore ds9.bck</tt><br>
+ <p><b> <a name="rgb"></a>rgb</b></p>
+ <p>Create RGB frame and control RGB frame parameters.</p>
+ <tt> Syntax: <br>
+ -rgb []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[red|green|blue]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[channel [red|green|blue]]<br>
+ &nbsp;&nbsp; &nbsp; [view [red|green|blue] [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[lock
+ wcs|crop|slice|bin|scale|scalelimits|colorbar|block|smooth
+ [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -rgb # create new rgb frame<br>
+ $ds9 -rgb red # set current channel to red<br>
+ $ds9 -rgb channel red # set current channel to red<br>
+ $ds9 -rgb view blue no # turn off blue channel<br>
+ $ds9 -rgb system wcs # set rgb coordinate system<br>
+ </tt><tt>$ds9 -rgb lock wcs yes</tt><br>
+ <tt>$ds9 -rgb lock crop yes</tt><br>
+ <tt>$ds9 -rgb lock slice yes</tt><br>
+ <tt>$ds9 -rgb lock bin yes</tt><br>
+ <tt> $ds9 -rgb lock scale yes<br>
+ $ds9 -rgb lock scalelimits yes<br>
+ $ds9 -rgb lock colorbar yes<br>
+ $ds9 -rgb lock block yes<br>
+ $ds9 -rgb lock smooth yes<br>
+ $ds9 -rgb open<br>
+ $ds9 -rgb close<br>
+ </tt><br>
+ <p><b> <a name="rgbarray"></a>rgbarray</b></p>
+ <p>Load raw data array cube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -rgbarray
+&lt;filename&gt;[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],[zdim=3],bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -rgbarray foo.arr[dim=512,zdim=3,bitpix=-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | ds9 -rgbarray
+ -[dim=512,zdim=3,bitpix=-32,endian=little]</tt><br>
+ <p><b> <a name="rgbcube"></a>rgbcube</b></p>
+ <p>Load FITS rgbcube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -rgbcube &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -rgbcube foo.fits</tt><tt><tt><br>
+ </tt>$cat foo.fits | ds9 -rgbcube -</tt><br>
+ <p><b> <a name="rgbimage"></a>rgbimage</b></p>
+ <p>Load FITS rgbimage into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -rgbimage &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -rgbimage foo.fits</tt><tt><tt><br>
+ </tt>$cat foo.fits | ds9 -rgbimage -</tt> <br>
+ <p><b> <a name="rotate"></a>rotate</b></p>
+ <p>Controls the rotation angle (in degrees) of the current frame.
+ </p>
+ <tt> Syntax: <br>
+ -rotate [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -rotate 45 <br>
+ $ds9 -rotate to 30<br>
+ $ds9 -rotate open<br>
+ $ds9 -rotate close<br>
+ </tt>
+ <p><b><a name="samp"></a>samp</b></p>
+ <p>Configure SAMP protocol. </p>
+ <tt> Syntax: <br>
+ -samp [yes|no|connect|disconnect] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [broadcast [image|table]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [send [image|table]
+ &lt;application&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -samp yes<br>
+ </tt><tt><tt>$ds9 -samp connect<br>
+ </tt>$ds9 -samp broadcast image<br>
+ $ds9 -samp send image aladin</tt><br>
+ <p><b> <a name="save"></a>save<br>
+ </b></p>
+ <p>Save loaded image data of current frame as FITS.</p>
+ <tt> Syntax: <br>
+ -save </tt><tt>[fits|rgbimage|rgbcube|mecube|mosaic|mosaicimage]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &lt;filename&gt; [image|table|slice]</tt> <br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $ds9 -save foo.fits</tt><br>
+ <tt>$ds9 -save fits foo.fits image</tt><br>
+ <tt>$ds9 -save fits foo.fits table<br>
+ $ds9 -save fits foo.fits slice</tt><br>
+ <tt>$ds9 -save rgbimage foo.fits<br>
+ </tt><tt>$ds9 -save rgbcube foo.fits</tt><br>
+ <tt>$ds9 -save mecube foo.fits</tt><br>
+ <tt>$ds9 -save mosaic foo.fits</tt><br>
+ <tt>$ds9 -save mosaicimage foo.fits</tt><br>
+ <p><b> <a name="saveimage"></a>saveimage</b></p>
+ <p>Create a snap shot of the current DS9 window and save in
+ specified image format. If no format specified, the file name
+ extension is used to determine the output format. Optional
+ parameters: <tt>jpeg</tt> quality (1-100) and <tt>tiff</tt>
+ compression method. </p>
+ <tt> Syntax: <br>
+ -saveimage </tt><tt>[fits|eps|gif|tiff|jpeg|png] </tt><tt>&lt;filename&gt;<br>
+ -saveimage &lt;filename&gt;.jpeg [1-100]<br>
+ -saveimage &lt;filename&gt;.tiff [none|jpeg|packbits|deflate]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -saveimage ds9.tiff<br>
+ $ds9 -saveimage jpeg ds9.jpeg 75</tt><tt><br>
+ </tt>
+ <p><b> <a name="scale"></a>scale</b></p>
+ <p>Controls the limits and color scale distribution. </p>
+ <tt> Syntax: <br>
+ -scale [linear|log|pow|sqrt|squared|asinh|sinh|histequ]<br>
+ &nbsp; &nbsp; &nbsp;&nbsp; [log exp &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [datasec yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [limits &lt;minvalue&gt;
+ &lt;maxvalue&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scope local|global] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match limits]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock limits [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -scale linear<br>
+ $ds9 -scale log exp 100<br>
+ $ds9 -scale datasec yes <br>
+ $ds9 -scale histequ <br>
+ $ds9 -scale limits 1 100 <br>
+ $ds9 -scale mode zscale <br>
+ $ds9 -scale mode 99.5 <br>
+ $ds9 -scale scope local<br>
+ $ds9 -scale match<br>
+ $ds9 -scale match limits<br>
+ $ds9 -scale lock yes<br>
+ $ds9 -scale lock limits yes<br>
+ $ds9 -scale open<br>
+ $ds9 -scale close</tt><tt><br>
+ </tt>
+ <p><b> <a name="shm"></a>shm</b></p>
+ <p>Load a shared memory segment into the current frame. </p>
+ <tt> Syntax: <br>
+ -shm [&lt;key&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [key &lt;id&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [shmid &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [fits [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mosaicimage
+ [iraf|wcs|wcsa...wcsz|wfpc2] [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mosaicimagenext [wcs|wcsa...wcsz]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[mosaic [iraf|wcs|wcsa...wcsz]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [rgbcube [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [rgbimage [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [rgbarray [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;,zdim=3],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [array [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -shm 102 <br>
+ $ds9 -shm key 102 <br>
+ $ds9 -shm shmid 102 foo<br>
+ $ds9 -shm fits 100 foo<br>
+ $ds9 -shm mosaicimage iraf key 100 foo <br>
+ $ds9 -shm mosaicimage wcs key 100 foo <br>
+ $ds9 -shm mosaicimage wcsa key 100 foo <br>
+ $ds9 -shm mosaicimage wfpc2 key 100 foo <br>
+ $ds9 -shm mosaicimagenext wcs key 100 foo <br>
+ $ds9 -shm mosaic iraf key 100 foo<br>
+ $ds9 -shm mosaic wcs key 100 foo<br>
+ $ds9 -shm rgbcube key 100 foo<br>
+ $ds9 -shm rgbimage key 100 foo<br>
+ $ds9 -shm rgbarray shmid 102 [dim=32,zdim=3,bitpix=-32]<br>
+ $ds9 -shm array shmid 102 [dim=32,bitpix=-32]<br>
+ </tt>
+ <p><b> <a name="sia"></a>sia<br>
+ </b></p>
+ <p>Support for VO Simple Image Access protocol. The first command
+ will create a new search. All other commands operated on the
+ last search created, unless indicated otherwise.</p>
+ <tt> Syntax: <br>
+ </tt><tt>-sia </tt><tt><tt>[2mass|akari|astrowise|cadc|cxc|mast|sdss|skyview|tgssadr</tt><tt>]</tt><br>
+ <br>
+ </tt><tt> </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp;&nbsp;
+ [&lt;ref&gt;] [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [clear]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [coordinate &lt;ra&gt;
+ &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+ [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [export sb|tsv
+ &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [name &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [retrieve]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [save
+ &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [sky
+ &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [skyformat
+ &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [system
+ &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;] [update]</tt><br>
+ <tt><br>
+ Example:<br>
+ </tt><tt>$ds9 -sia 2mass<br>
+ </tt><tt>$ds9 -sia cancel<br>
+ </tt><tt>$ds9 -sia clear<br>
+ </tt><tt>$ds9 -sia close<br>
+ </tt><tt>$ds9 -sia coordinate 202.48 47.21 fk5<br>
+ </tt><tt>$ds9 -sia crosshair<br>
+ </tt><tt>$ds9 -sia export tsv bar.tsv<br>
+ </tt><tt>$ds9 -sia name m51<br>
+ </tt><tt>$ds9 -sia print</tt><br>
+ <tt>$ds9 -sia retrieve<br>
+ </tt><tt> $ds9 -sia save foo.xml<br>
+ </tt><tt>$ds9 -sia size 1 1 degrees</tt><br>
+ <tt>$ds9 -sia sky fk5<br>
+ $ds9 -sia skyformat degrees<br>
+ </tt><tt>$ds9 -sia system wcs</tt><tt><br>
+ </tt><tt>$ds9 -sia update<br>
+ <br>
+ </tt><b><a name="single"></a>single</b>
+ <p>Set display mode to single. </p>
+ <tt> Syntax: <br>
+ -single <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -single<br>
+ </tt>
+ <p><b><a name="skyview"></a>skyview </b></p>
+ <p>Support for SkyView image server at HEASARC. </p>
+ <tt> Syntax: <br>
+ -skyview []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name
+ &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord
+ &lt;ra&gt; &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [pixels
+ &lt;width&gt; &lt;height&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame
+ new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [survey &lt;survey&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -skyview<br>
+ $ds9 -skyview m31 <br>
+ $ds9 -skyview name m31 <br>
+ $ds9 -skyview coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -skyview size 60 60 arcmin<br>
+ $ds9 -skyview pixels 600 600<br>
+ $ds9 -skyview save yes<br>
+ $ds9 -skyview frame current<br>
+ $ds9 -skyview update frame <br>
+ $ds9 -skyview survey sdssi<br>
+ $ds9 -skyview open<br>
+ $ds9 -skyview close<br>
+ </tt>
+ <p><b><a name="sleep"></a>sleep </b></p>
+ <p>Delays execution for specified number of seconds. Default is 1
+ second.</p>
+ <tt> Syntax: <br>
+ -sleep [#]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -sleep <br>
+ $ds9 -sleep 2<br>
+ </tt>
+ <p><b> <a name="slice"></a>slice<br>
+ noslice<br>
+ </b></p>
+ <p>Indicates next files loaded are to treated as slices of a cube.
+ Can be disabled with <tt>noslice</tt> command.<br>
+ </p>
+ <tt> Syntax: <br>
+ -slice &lt;filename&gt;<br>
+ -noslice<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -slice *.fits<br>
+ $ds9 -noslice<br>
+ </tt>
+ <p><b><a name="smooth"></a>smooth</b></p>
+ <p>Smooth current image or set smooth parameters.</p>
+ <tt> Syntax:<br>
+ -smooth []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [function
+ boxcar|tophat|gaussian]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [radius &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -smooth<br>
+ $ds9 -smooth yes<br>
+ $ds9 -smooth function tophat<br>
+ $ds9 -smooth radius 4<br>
+ $ds9 -smooth open<br>
+ $ds9 -smooth close<br>
+ $ds9 -smooth match<br>
+ $ds9 -smooth lock yes<br>
+ </tt>
+ <p><b> <a name="squared"></a>squared</b></p>
+ <p>Select squared scale function for the current frame. </p>
+ <tt> Syntax: <br>
+ -squared <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -squared </tt>
+ <p><b> <a name="sqrt"></a>sqrt</b></p>
+ <p>Select square soot scale function for the current frame. </p>
+ <tt> Syntax: <br>
+ -sqrt <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -sqrt </tt>
+ <p><b> <a name="source"></a>source</b></p>
+ <p>Source TCL code from a file. </p>
+ <tt> Syntax: <br>
+ -source &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -source extensions.tcl<br>
+ </tt>
+ <p><b> <a name="tcl"></a>tcl</b></p>
+ <p>Execute one TCL command. Note: this a different behavior from
+ previous versions of DS9.<br>
+ </p>
+ <tt> Syntax:<br>
+ -tcl &lt;tcl command&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -tcl 'puts "Hello, World"'</tt><br>
+ <p><b> <a name="threads"></a>threads</b></p>
+ <p>Set number of process threads for functions which are
+ multi-threaded. </p>
+ <tt> Syntax:<br>
+ -threads #<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -threads 8</tt><br>
+ <br>
+ <b><a name="tiff"></a>tiff</b><br>
+ <p>Load TIFF image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ -tiff &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt>$ds9 -tiff foo.tiff</tt><tt><tt><tt><tt><br>
+ </tt></tt> </tt></tt><tt><tt>$cat foo.fits | ds9 -tiff -</tt></tt><tt><br>
+ </tt>
+ <p><b> <a name="tile"></a>tile</b></p>
+ <p>Controls the tile display mode. </p>
+ <tt> Syntax: <br>
+ -tile []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode grid|column|row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid mode automatic|manual] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid direction x|y]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid layout &lt;col&gt;
+ &lt;row&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap &lt;pixels&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [column] <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -tile <br>
+ $ds9 -tile yes <br>
+ $ds9 -tile mode row <br>
+ $ds9 -tile grid <br>
+ $ds9 -tile grid mode manual<br>
+ $ds9 -tile grid direction x <br>
+ $ds9 -tile grid layout 5 5 <br>
+ $ds9 -tile grid gap 10 <br>
+ $ds9 -tile row <br>
+ $ds9 -tile column </tt>
+ <p><b> <a name="title"></a>title</b></p>
+ <p>Changes the display window title to the specified name. </p>
+ <tt> Syntax: <br>
+ -title name <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -title Voyager </tt>
+ <p><b> <a name="unix"></a>unix</b></p>
+ <p>Set the IRAF unix socket name, used by IRAF to communicate with
+ DS9. The default is /tmp/.IMT%d, so that the standard IRAF unix
+ socket is defined. </p>
+ <tt> Syntax: <br>
+ -unix name <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -unix "/tmp/.IMT%d" </tt>
+ <p><b> <a name="unix_only"></a>unix_only</b></p>
+ <p>Only use the IRAF unix socket name. This is the same as -fifo
+ none -port 0. </p>
+ <tt> Syntax: <br>
+ -unix_only <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -unix_only<br>
+ </tt>
+ <p><b> <a name="update"></a>update</b></p>
+ <p>Updates the current frame or region of frame. In the second
+ form, the first argument is the number of the fits HDU (starting
+ with 1) and the remaining args are a bounding box in IMAGE
+ coordinates. By default, the screen is updated the next
+ available idle cycle. However, you may force an immediate update
+ by specifying the NOW option. </p>
+ <tt> Syntax: <br>
+ -update [] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [# x1 y1 x2 y2]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now # x1 y1 x2 y2]<br>
+ &nbsp; <br>
+ Example: <br>
+ $ds9 -update <br>
+ $ds9 -update 1 100 100 300 400 <br>
+ $ds9 -update now <br>
+ $ds9 -update now 1 100 100 300 400</tt><br>
+ <p><b> <a name="url"></a>url</b></p>
+ <p>Load FITS from URL into the current frame</p>
+ <tt> Syntax: <br>
+ -url &lt;url&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -url http://foo.bar.edu/foo.fits</tt><tt> </tt>
+ <p><b> <a name="version"></a>version</b></p>
+ <p>Returns the current version of DS9 and exits. </p>
+ <tt> Syntax: <br>
+ -version <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -version </tt>
+ <p><b> <a name="view"></a>view</b></p>
+ <p>Controls the GUI and visible RGB frame color channels. </p>
+ <tt> Syntax: <br>
+ -view [layout horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [keyvalue &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [info yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [panner yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [magnifier yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [buttons yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [graph horizontal|vertical
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [filename yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [object yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [keyword yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [minmax yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [lowhigh yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [units yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [image|physical|wcs|wcsa...wcsz
+ yes|no]<br>
+ </tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame yes|no] <br>
+ </tt></tt>&nbsp;&nbsp;&nbsp; &nbsp; [red yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [green yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [blue yes|no]</tt><tt><tt><br>
+ &nbsp; </tt> <br>
+ Example: <br>
+ $ds9 -view layout vertical<br>
+ $ds9 -view keyvalue BITPIX<br>
+ $ds9 -view info yes<br>
+ $ds9 -view panner yes<br>
+ $ds9 -view magnifier yes<br>
+ $ds9 -view buttons yes<br>
+ $ds9 -view colorbar yes<br>
+ $ds9 -view graph horizontal yes<br>
+ $ds9 -view filename yes<br>
+ $ds9 -view object yes<br>
+ $ds9 -view keyword yes<br>
+ $ds9 -view minmax yes<br>
+ $ds9 -view lowhigh yes<br>
+ $ds9 -view wcsa yes<br>
+ </tt><tt>$ds9 -view frame yes</tt><br>
+ <tt>$ds9 -view red yes<br>
+ $ds9 -view green yes<br>
+ $ds9 -view blue yes</tt><tt><br>
+ </tt>
+ <p><b> <a name="visual"></a>visual</b></p>
+ <p>Force DS9 to use the specified color visual. This argument MUST
+ be the first argument listed. Requires the visual be available.
+ </p>
+ <tt> Syntax: <br>
+ -visual
+ [pseudocolor|pseudocolor8|truecolor|truecolor8|truecolor16|truecolor24]
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -visual truecolor24<br>
+ </tt>
+ <p><b> <a name="vla"></a>vla</b></p>
+ <p>Support for VLA Sky Survey.</p>
+ <tt> Syntax: <br>
+ -vla []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [survey first|stripe82]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -vla<br>
+ $ds9 -vla m31 <br>
+ $ds9 -vla name m31 <br>
+ $ds9 -vla coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -vla size 60 60 arcmin<br>
+ $ds9 -vla save yes<br>
+ $ds9 -vla frame current<br>
+ $ds9 -vla update frame<br>
+ $ds9 -vla survey stripe82<br>
+ $ds9 -vla open<br>
+ $ds9 -vla close</tt><br>
+ <p><b> <a name="vlss"></a>vlss</b></p>
+ <p>Support for NRAO VLSS Sky Survey.</p>
+ <tt> Syntax: <br>
+ -vlss []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -vlss<br>
+ $ds9 -vlss m31 <br>
+ $ds9 -vlss name m31 <br>
+ $ds9 -vlss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $ds9 -vlss size 60 60 arcmin<br>
+ $ds9 -vlss save yes<br>
+ $ds9 -vlss frame current<br>
+ $ds9 -vlss update frame<br>
+ $ds9 -vlss open<br>
+ $ds9 -nvess close</tt>
+ <p><b> <a name="vo"></a>vo</b></p>
+ <p>Invoke an connection to a Virtual Observatory site. </p>
+ <tt> Syntax: <br>
+ -vo [method xpa|mime]<br>
+ &nbsp;&nbsp;&nbsp; [server &lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [internal yes|no]<br>
+ &nbsp;&nbsp;&nbsp; [delay #]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [connect &lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [disconnect &lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ $ds9 -vo method xpa<br>
+ $ds9 -vo server "http://foo.bar.edu/list.txt"<br>
+ $ds9 -vo internal yes<br>
+ $ds9 -vo delay 15 # keep-alive delay<br>
+ $ds9 -vo chandra-ed<br>
+ $ds9 -vo connect chandra-ed<br>
+ $ds9 -vo disconnect chandra-ed<br>
+ $ds9 -vo open<br>
+ $ds9 -vo close<br>
+ </tt>
+ <p><b> <a name="wcs"></a>wcs</b></p>
+ <p>Controls the World Coordinate System for the current frame. If
+ the wcs system, skyframe, or skyformat is modified, the info
+ panel, compass, grid, and alignment will be modified
+ accordingly. Also, a new WCS specification can be loaded and
+ used by the current image regardless of the WCS that was
+ contained in the image file. Please see <a href="file.html#WCS">WCS</a>
+ for more information. </p>
+ <tt> Syntax: <br>
+ -wcs [[system] wcs|wcsa...wcsz] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [[sky] fk4|fk5|icrs|galactic|ecliptic]
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [[skyformat] degrees|sexagesimal] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [align yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [reset [#]] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [replace [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [append [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -wcs wcs <br>
+ $ds9 -wcs system wcs<br>
+ </tt><tt>$ds9 -wcs fk5 <br>
+ </tt><tt>$ds9 -wcs sky fk5 <br>
+ </tt><tt>$ds9 -wcs sexagesimal <br>
+ </tt><tt>$ds9 -wcs skyformat sexagesimal <br>
+ $ds9 -wcs align yes <br>
+ $ds9 -wcs reset <br>
+ $ds9 -wcs reset 3<br>
+ $ds9 -wcs replace foo.wcs <br>
+ $ds9 -wcs replace 3 foo.wcs <br>
+ $ds9 -wcs append foo.wcs<br>
+ $ds9 -wcs append 3 foo.wcs<br>
+ $ds9 -wcs open<br>
+ $ds9 -wcs close<br>
+ </tt>
+ <p><b> <a name="web"></a>web</b></p>
+ <p>Display specified URL in the web display. </p>
+ <tt> Syntax:<br>
+ -web [new|&lt;webname&gt;] [&lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [click
+ back|forward|stop|reload|#]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -web www.cnn.com<br>
+ $ds9 -web new www.cnn.com<br>
+ $ds9 -web hvweb www.apple.com<br>
+ $ds9 -web click back<br>
+ $ds9 -web click 2<br>
+ $ds9 -web clear<br>
+ $ds9 -web close<br>
+ </tt>
+ <p><b> <a name="width"></a>width</b></p>
+ <p>Set the width of the image display window. Use the <a
+ href="command.html#geometry">geometry</a> command to set the
+ overall width and height of the ds9 window.</p>
+ <tt> Syntax: <br>
+ -width [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -width 512<br>
+ </tt>
+ <p><b> <a name="xpa"></a>xpa</b></p>
+ <p>Configure XPA.</p>
+ <tt> Syntax:<br>
+ -xpa [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [inet|local|unix|localhost] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [noxpans]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [connect]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [disconnect]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [info]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -xpa no <br>
+ $ds9 -xpa local <br>
+ $ds9 -xpa noxpans<br>
+ $ds9 -xpa connect<br>
+ $ds9 -xpa disconnect<br>
+ $ds9 -xpa info<br>
+ </tt>
+ <p><b> <a name="zmax"></a>zmax</b></p>
+ <p>Set Scale Limits based&nbsp; on the <i>IRAF</i> algorithm and
+ maximum data value. </p>
+ <tt> Syntax: <br>
+ -zmax <br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -zmax </tt>
+ <p><b> <a name="zscale"></a>zscale</b></p>
+ <p>Set Scale Limits based&nbsp; on the <i>IRAF</i> algorithm. </p>
+ <tt> Syntax: <br>
+ -zscale []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [contrast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sample]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [line]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -zscale<br>
+ $ds9 -zscale contrast .25<br>
+ $ds9 -zscale sample 600<br>
+ $ds9 -zscale line 120<br>
+ </tt>
+ <p><b> <a name="zoom"></a>zoom</b></p>
+ <p>Controls the current zoom value for the current frame. </p>
+ <tt> Syntax: <br>
+ -zoom [&lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt; &lt;value&gt;]
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $ds9 -zoom 2<br>
+ $ds9 -zoom 2 4<br>
+ $ds9 -zoom to 4<br>
+ $ds9 -zoom to 2 4 <br>
+ $ds9 -zoom in<br>
+ $ds9 -zoom out<br>
+ $ds9 -zoom to fit<br>
+ $ds9 -zoom open<br>
+ $ds9 -zoom close<br>
+ <br>
+ </tt> </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/contour.html b/ds9/doc/ref/contour.html
new file mode 100644
index 0000000..25dc20d
--- /dev/null
+++ b/ds9/doc/ref/contour.html
@@ -0,0 +1,189 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Contours</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Contours</h3>
+ <blockquote>
+ <p>DS9 can create and display contours as an overlay on an image.
+ The Analysis Contours menu is used to display contours. To
+ create, copy, paste,&nbsp; and configure contours, use the
+ Analysis Contour Parameters menu.</p>
+ <p><b>Contour Parameters </b></p>
+ <p>When creating a new contour, a dialog box appears, in which the
+ user selects the number of contour levels, smoothness, and the
+ distribution of the contours. </p>
+ <p><b> Contour Levels</b></p>
+ <p>Specifies the number of contour levels to be generated. A
+ typical number is between 1 and 10. Note: large numbers of
+ contours can take a long time to generate. </p>
+ <p><b> Contour Smoothness</b></p>
+ <p>Specifies how smooth the contours are. A smoothness level of 1
+ will evaluate the contour at each image pixel. A level of 2 will
+ evaluate the contour at every other pixel. The larger the
+ number, the quicker the contour will be generated, and the less
+ detail will be available. </p>
+ <p><b> Contour Scale</b></p>
+ <p>Specifies the distribution of the contour levels. <br>
+ </p>
+ <p><b> Contour Method</b></p>
+ <p>There are two methods that are available to calculate the
+ contour lines. The first, BLOCK, blocks down the image, by the
+ smoothness factor, before contours are calculated. As a result,
+ the larger the smoothness, the faster the result. The second
+ method, SMOOTH, smooths the image before calculating contours.
+ As a result, the larger the smoothness, the slower the result.<br>
+ </p>
+ <p><b> <a name="ContourFiles"></a>Contour Files</b></p>
+ <p>A contour file is an ASCII file containing a header, global
+ properties, coordinate system, contour levels, and contour
+ points. <br>
+ </p>
+ <blockquote>
+ <p><b> Header</b></p>
+ <p>A DS9 contour file may start with the following optional
+ header: </p>
+ <blockquote> <tt># Contour file format: DS9 version 7.5<br>
+ </tt></blockquote>
+ <p><b> Global Properties</b></p>
+ <p>Global properties affect all contour levels unless a line
+ level attribute is specified. The <tt>global</tt> keyword is
+ first, followed by a list of keyword = value pairs. Multiple
+ global property lines may be used within a region file. </p>
+ <blockquote> <tt>global color=green width=1 dash=1 dashlist=8 3<br>
+ </tt></blockquote>
+ <p><b> Coordinate Systems</b></p>
+ <p>For each contour file, it is important to specify the
+ coordinate system used to interpret the contour points, i.e.,
+ to set the context in which the positions are interpreted. For
+ this purpose, the following keywords are recognized: </p>
+ <blockquote> <tt>PHYSICAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of original file using LTM/LTV</tt> <br>
+ <tt>IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of current file</tt> <br>
+ <tt><tt><tt>FK4,B1950&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &nbsp;
+ # sky coordinate systems</tt> <br>
+ FK5,J2000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ </tt><tt><tt><tt>ICRS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+ sky coordinate systems</tt> <br>
+ </tt>GALACTIC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ <tt>ECLIPTIC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ <tt>WCS&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp;&nbsp; # primary WCS<br>
+ </tt><tt>WCSA &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #
+ secondary WCS<br>
+ </tt><tt>LINEAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ linear primary WCS</tt> <tt><br>
+ </tt></blockquote>
+ </blockquote>
+ <blockquote>
+ <p><b> Contour Level</b></p>
+ <p>Each contour level is composed of a line value, line
+ attributes and one or more contours. Line attributes are
+ specified at the start of a new level and only affect contours
+ within that level . </p>
+ <blockquote> <tt>level=15.78775 color=pink width=2 dash=yes dashlist=2
+ 2<br>
+ </tt></blockquote>
+ <p><b> Contour</b></p>
+ <p>Each contour is composed of one or more X,Y coordinates, with
+ a deliminator of space or comma,&nbsp; starting with "(" and
+ ending with ")". Contours are not closed.<br>
+ </p>
+ </blockquote>
+ <blockquote>
+ <blockquote><tt>(</tt><tt>202.4836468 47.22380226</tt><tt><br>
+ </tt><tt>&nbsp;202.4833538 47.2239185</tt><tt><br>
+ </tt><tt>&nbsp;202.4831634 47.22409874</tt><tt><br>
+ </tt><tt>&nbsp;202.4829883 47.22428858</tt><tt>)</tt><br>
+ </blockquote>
+ </blockquote>
+ <blockquote>
+ <p><br>
+ </p>
+ <blockquote> </blockquote>
+ </blockquote>
+ <p><br>
+ </p>
+ <blockquote>
+ <blockquote> </blockquote>
+ <blockquote> </blockquote>
+ <blockquote> </blockquote>
+ </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/file.html b/ds9/doc/ref/file.html
new file mode 100644
index 0000000..379eee3
--- /dev/null
+++ b/ds9/doc/ref/file.html
@@ -0,0 +1,825 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>File Formats</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> File Formats</h3>
+ <blockquote> <a href="#FITS">FITS</a><br>
+ <a href="#FITSImage">FITS Image</a><br>
+ <a href="#FITSBinaryEventsTable">FITS Binary Events Table</a><br>
+ <a href="#FITSHEALPIXTable">FITS HEALPIX Table</a><br>
+ <a href="#FITSDataCube">FITS Data Cube</a><br>
+ <a href="#FITSMultipleExtensionDataCube">FITS Multiple Extension
+ Data Cube</a><br>
+ <a href="#FITSMultipleExtensionMultipleFrames">FITS Multiple
+ Extension Multiple Frames</a><br>
+ <a href="#FITSMosaic">FITS Mosaic</a><br>
+ <a href="#FITSMosaicDataCube">FITS Mosaic Data Cube</a><br>
+ <a href="#FITSRGB">FITS RGB </a><br>
+ <a href="#SplitFITS">Split FITS</a><br>
+ <a href="#array">Array</a> <br>
+ <a href="file:///Users/joye/saods9/doc/ref/file.html#nrrd">NRRD</a><br>
+ <a href="#envi">ENVI</a><br>
+ <a href="#gif">GIF</a><br>
+ <a href="#tiff">TIFF</a><br>
+ <a href="#jpeg">JPEG</a><br>
+ <a href="#png">PNG</a><br>
+ <a href="#ExternalFileSupport">External Format Support</a> <br>
+ <a href="#ExternalAnalysisSupport">External Analysis Support</a> <br>
+ <a href="#RegionFiles">Region Files</a><br>
+ <a href="#ContourFiles">Contour Files</a> <br>
+ <a href="#ColorLookupTable">Color Lookup Table</a> <br>
+ <a href="#WCS">WCS</a> <br>
+ <a href="#PreferenceFile">Preference File</a> <br>
+ <a href="#StartupFile">Startup File</a> <br>
+ <a href="#TCL">TCL</a><br>
+ <p><b><a name="FITS"></a>FITS</b></p>
+ DS9 supports FITS images and FITS binary tables. The following
+ algorithm is used to locate and to load the FITS image or table if
+ no additional information is provide:
+ <blockquote>
+ <ul>
+ <li> <tt> Examine primary HDU, if IMAGE, load.<br>
+ </tt></li>
+ <li><tt>Examine each extension HDU</tt></li>
+ <ul>
+ <li><tt>If IMAGE, load.<br>
+ </tt></li>
+ <li><tt>If BINARY TABLE, create IMAGE if the following is
+ true:</tt></li>
+ <ul>
+ <li><tt>FITS COMPRESSED: keyword ZIMAGE is T.</tt></li>
+ <li><tt>FITS EVENTS: keyword EXTNAME is EVENTS,STDEVT, or
+ RAYEVENT, column names X and Y are present.</tt></li>
+ <li><tt>FITS HEALPIX: keyword PIXTYPE is HEALPIX.</tt><br>
+ </li>
+ </ul>
+ </ul>
+ <li><tt> If DS9 traverses the entire FITS file without
+ satisfying one of the above, an error is generated.</tt> </li>
+ </ul>
+ </blockquote>
+ FITS keyword inheritance is supported. All valid FITS <tt>BITPIX</tt>
+ values are supported, along with <tt>-16,</tt> for <tt>UNSIGNED
+ SHORT</tt>. The following FITS keywords are supported:
+ <blockquote> <tt> OBJECT<br>
+ UNITS<br>
+ BSCALE / BZERO<br>
+ BLANK<br>
+ DATASEC<br>
+ LTV / LTM&nbsp; for physical coords<br>
+ DTV / DTM&nbsp; for detector coords<br>
+ ATV / ATM&nbsp; for amplifier coords<br>
+ WCS keywords<br>
+ WCS# keywords </tt> </blockquote>
+ <p><b> <a name="FITSImage"></a>FITS Image</b></p>
+ At load time, the user may provide just a file name or a file name
+ along with FITS extension name/number and image section
+ specification. FITS extension names are case insensitive. When
+ specifying an extension, be sure to quote strings correctly to
+ pass both the shell and DS9 parser. A image section specification
+ is used to specify the x,y limits of an image subsection. By
+ default, x and y coordinates are in <tt>IMAGE</tt>, use a <tt>'p'</tt>
+ as the last character to indicate <tt>PHYSICAL</tt> coordinates.
+ A <tt>'*'</tt> indicates use the default for that axis only.
+ Block is optional and defaults to 1.<br>
+ <blockquote> <tt> Syntax:<br>
+ filename<br>
+ filename[ext]<br>
+ filename[ext][sect]<br>
+ filename[sect]<br>
+ filename[ext,sect]<br>
+ <br>
+ where</tt><tt><br>
+ <br>
+ ext:<br>
+ [extension name | extension #]<br>
+ <br>
+ sect:<br>
+ [x0:x1</tt><tt>,y0:y1[p]]<br>
+ </tt><tt><tt><tt>[x0:x1</tt></tt></tt><tt><tt><tt>,y0:y1</tt></tt></tt><tt><tt><tt><tt>,block</tt></tt></tt></tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt>[x0:x1</tt></tt><tt><tt>,y0:y1</tt></tt><tt><tt>,z0:z1</tt></tt><tt><tt><tt>[p]</tt>]<br>
+ </tt></tt><tt><tt><tt>[x0:x1</tt></tt></tt><tt><tt><tt>,y0:y1</tt></tt></tt><tt><tt><tt>,block,z0:z1</tt></tt></tt><tt><tt><tt><tt>[p]</tt>]</tt></tt></tt><br>
+ <tt><tt><tt>[*,y0:y1</tt></tt></tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt><tt><tt><tt>[*,y0:y1</tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>,block</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt>[*,y0:y1</tt></tt></tt></tt><tt><tt><tt><tt>,z0:z1</tt></tt></tt></tt><tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt></tt><tt><tt><tt>[*,y0:y1</tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>,block,z0:z1</tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[p]</tt>]</tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt>[x0:x1</tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>,*</tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt><tt><tt><tt>[x0:x1</tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>,*</tt></tt></tt><tt><tt><tt><tt>,block</tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt>[x0:x1</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>,*,z0:z1</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt>]<br>
+ </tt></tt><tt><tt><tt>[x0:x1</tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>,*,block,z0:z1</tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt>]</tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[*,*</tt></tt></tt><tt><tt><tt><tt>,block</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>]<br>
+ </tt>[*,*,z0:z1</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>]<br>
+ </tt></tt><tt><tt><tt>[*,*,block,z0:z1</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>]</tt></tt></tt><br>
+ <br>
+ </tt></tt></tt></tt></tt></tt>[dim1@xcen,dim2@ycen</tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>[dim1@xcen,dim2@ycen,block</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt>[dim1@xcen,dim2@ycen,dim3@zcen</tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[dim1@xcen,dim2@ycen,block,dim3@zcen</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]</tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt>[*,dim2@ycen</tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>[*,dim2@ycen,block</tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt>[*,dim2@ycen,dim3@zcen</tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[*,dim2@ycen,block,dim3@zcen</tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]</tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[dim1@xcen,*</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>[dim1@xcen,*,block</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt>[dim1@xcen,*,dim3@zcen</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[dim1@xcen,*,block,dim3@zcen</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[p]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>[*,*,block]<br>
+ </tt></tt>[*,*,dim3@zcen]<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>[*,*,block,dim3@zcen]</tt></tt></tt></tt></tt></tt><br>
+ <br>
+ </tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt>[dim@xcen@ycen]</tt></tt><tt><tt><br>
+ </tt></tt>[dim@xcen@ycen,block]</tt></tt><br>
+ <tt><tt><tt><tt>[dim@xcen@ycen,zdim@zcen]</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt>[dim@xcen@ycen,block,zdim@zcen]</tt></tt></tt></tt></tt></tt></tt></tt><tt><br>
+ <br>
+ Example:<br>
+ $ds9 foo.fits # default load <br>
+ $ds9 foo.fits[1] # load first extension<br>
+ $ds9 foo.fits[BCKGRD] # load extension named 'BCKGRD'<br>
+ $ds9 foo.fits[10:200,40:100] # image section<br>
+ </tt><tt><tt>$ds9 foo.fits[10:200,40:100,2] # image section,
+ blocked by 2<br>
+ </tt>$ds9 foo.fits[*,40:100] # only section y axis<br>
+ $ds9 foo.fits[256@512@512] # section box at 512,512<br>
+ $ds9 foo.fits[2][100:200,100:200] # second extension, image
+ section<br>
+ </tt><tt><tt>$ds9 foo.fits[2][100:200,100:200,2] # second
+ extension, image section, blocked by 2<br>
+ </tt>$ds9 foo.fits[10:200,40:100,5:20] # cube section<br>
+ $ds9 foo.fits[*,40:100,5:20] # only section y and z axes<br>
+ $ds9 foo.fits[256@512@512] # section cube at 512,512<br>
+ $ds9 foo.fits[2][100:200,100:200,5:20] # second extension,
+ cube section</tt><br>
+ <tt>$ds9 foo.fits[2][100:200,100:200,2,5:20] # second extension,
+ cube section, blocked by 2</tt> </blockquote>
+ <b><a name="FITSBinaryEventsTable"></a>FITS Binary Events Table<br>
+ <br>
+ </b> At load time, the user may provide just a file name or a file
+ name along with FITS extension name/number, image section
+ specification, and binnng parameters. DS9 will automatically
+ convert an FITS binary events table into a 2D image for display.
+ FITS extension names and parameters are case insensitive. The
+ users may specify a number of parameters on how to construct the
+ image and how to filter data. When specifying a filter, be sure to
+ quote strings correctly to pass both the shell and DS9 parser. </blockquote>
+ <blockquote>
+ <blockquote> <tt><tt><tt><tt>Syntax: <br>
+ </tt></tt></tt></tt><tt><tt>filename<br>
+ filename[ext]<br>
+ filename[ext][sect]<br>
+ filename[sect]<br>
+ filename[ext,sect]<br>
+ </tt><br>
+ filename[ext][bin]<br>
+ </tt><tt><tt><tt><tt><tt>filename[ext][bin][sect]<br>
+ </tt></tt></tt></tt>filename[ext][sect][bin]<br>
+ </tt><tt><tt><tt><tt>filename[bin]<br>
+ </tt></tt></tt>filename[bin][sect]<br>
+ </tt><tt><tt>filename[sect][bin]<br>
+ </tt></tt><tt>filename[ext,bin]<br>
+ <br>
+ </tt><tt>where:<br>
+ ext: see <a href="FITSImage">FITS Image</a><br>
+ sect: see <a href="FITSImage">FITS Image</a><br>
+ <br>
+ bin:<br>
+ [bin=colx,coly] # bin counts <br>
+ </tt><tt><tt>[bin=colx,coly,filter] # bin counts with filter<br>
+ </tt>[bin=colx,coly,colz] # bin on colz <br>
+ </tt><tt><tt>[bin=colx,coly,colz,filter] # bin on colz with
+ filter<br>
+ </tt></tt><tt><tt>[bin=colz] # bin cols 'x', 'y', and colz <br>
+ </tt></tt><tt><tt>[bin=colz,filter] # bin cols 'x', 'y', and
+ colz with filter<br>
+ </tt>[key=colx,coly] <br>
+ [binkey=colx,coly]<br>
+ </tt><br>
+ (see <a
+ href="http://hea-www.harvard.edu/saord/funtools/filters.html">Introduction
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ to Filtering</a>)<br>
+ <br>
+ <tt>Example: </tt><br>
+ <tt> $ds9 foo.fits # default load </tt><br>
+ <tt> $ds9 foo.fits[1] # load first extension </tt><br>
+ <tt> $ds9 foo.fits[BCKGRD] # load extension named 'BCKGRD' </tt><br>
+ <tt> $ds9 foo.fits[bin=detx,dety] # bin on detx,dety </tt><br>
+ <tt> $ds9 foo.fits[2][bin=rawx,rawy] # load ext 2, cols
+ rawx,rawy </tt><br>
+ <tt> $ds9 foo.fits[bg_events,bin=rawx,rawy] # load ext
+ bg_events, cols rawx,rawy </tt><br>
+ <tt> $ds9 foo.fits[bin=x,y,pha] # bin on x,y,pi </tt><br>
+ <tt> $ds9 foo.fits[bin=pi] # bin on x,y,pi</tt><br>
+ <tt> $ds9 'foo.fits[ccd_id==3&amp;&amp;energy&gt;4000]' # quoted
+ filter</tt><br>
+ <tt> $ds9 '"foo.fits[ccd_id==3 &amp;&amp; energy&gt;4000]"' #
+ double quoted filter</tt><br>
+ <tt> $ds9 'foo.fits[events][pha&gt;5,pi&lt;2]' # load extension
+ 'events' and filter</tt></blockquote>
+ </blockquote>
+ <blockquote>
+ <blockquote> </blockquote>
+ <p>The shell environment variable <tt>DS9_BINKEY </tt>may be
+ used to specify default bin cols for FITS bin tables. Example:</p>
+ <blockquote> <tt>$ export DS9_BINKEY='[bin=rawx,rawy]'</tt> <br>
+ <tt>$ ds9 foo.fits # load FITS bin table, bin on rawx, rawy<br>
+ </tt></blockquote>
+ <p><b> <a name="FITSHEALPIXTable"></a>FITS HEALPIX Table<br>
+ </b></p>
+ At load time, the user may provide just a file name or a file name
+ along with FITS extension name/number, image section
+ specification, and Healpix parameters. DS9 will automatically
+ convert a FITS HEALPIX binary or ascii table into a 2D image for
+ display. FITS extension names and parameters are case insensitive.
+ The users may specify a number of parameters on how to construct
+ the image. Any table with keyword PIXTYPE=HEALPIX or NSIDE=x will
+ be processed as an HEALPIX image. The following FITS keywords will
+ be used if present and not overwritten by a command line option:
+ NSIDE, COORDSYS, ORDER.<br>
+ <blockquote>
+ <blockquote> </blockquote>
+ <tt><tt><tt><tt>Syntax: <br>
+ </tt></tt></tt></tt><tt><tt>filename<br>
+ filename[ext]<br>
+ filename[ext][sect]<br>
+ filename[sect]<br>
+ filename[ext,sect]<br>
+ <br>
+ </tt></tt><tt><tt><tt>filename[ext][hpx]<br>
+ </tt><tt><tt><tt><tt><tt>filename[ext][hpx][sect]<br>
+ </tt></tt></tt></tt>filename[ext][sect][hpx]<br>
+ </tt><tt><tt><tt><tt>filename[hpx]<br>
+ </tt></tt></tt>filename[hpx][sect]<br>
+ </tt><tt><tt>filename[sect][hpx]<br>
+ </tt></tt><tt>filename[ext,hpx]<br>
+ <br>
+ </tt>where:<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt><tt>ext: see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/FITSImage">FITS
+
+
+
+
+
+ Image</a><br>
+ </tt></tt></tt></tt></tt>sect: see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/FITSImage">FITS
+
+
+
+
+
+ Image</a><br>
+ <br>
+ hpx:<br>
+ </tt></tt><tt>[order=ring|nested] # default ring<br>
+ [layout=equatorial|north|south] # default equatorial<br>
+ [col=&lt;column number&gt;] # defaut 1<br>
+ [quad=&lt;quadurant number&gt;] # (1-4) default 1<br>
+ [system=equatorial|galactic|ecliptic|unknown] # default
+ unknown</tt><br>
+ <br>
+ <tt>Example: </tt><tt><br>
+ $ds9 foo.fits # default load </tt><tt><br>
+ $ds9 foo.fits[1] # load first extension </tt><tt><br>
+ $ds9
+ foo.fits[order=ring,layout=equatorial,col=1,quad=1,system=unknown]<br>
+ </tt><tt>$ds9 foo.fits[1,order=nested] # first extension, nested
+ order</tt><br>
+ </blockquote>
+ <blockquote> </blockquote>
+ <p><b><a name="FITSDataCube"></a>FITS Cube</b></p>
+ A FITS Cube is a FITS image which contains more than 2 axes
+ (NAXES&gt;2). DS9 will automatically detect if a cube is present
+ and will load all additional images. In addition, individual
+ images can be loaded one at a time into a cube. DS9 will display
+ the Cube dialog box which allows the user to select which 2 image
+ to be displayed.
+ <p><b><a name="FITSMultipleExtensionDataCube"></a>FITS Multiple
+ Extension Cube</b></p>
+ A FITS Multiple Extension Data Cube file is a FITS file with one
+ or more extensions, that is to be displayed as a data cube. Each
+ image does not have to be the same size, however, only the
+ coordinate systems from the first extension will be used for
+ contours and grids. <br>
+ <blockquote><tt> Example:</tt><br>
+ <tt> $ds9 -mecube foo.fits # load multiple extension fits file
+ as data cube</tt></blockquote>
+ <p><b><a name="FITSMultipleExtensionMultipleFrames"></a>FITS
+ Multiple Extension Multiple Frames</b></p>
+ Load a multiple extension FITS file into multiple frames. Please
+ note that files loaded via standard-in or the xpa fits command can
+ not be displayed using this method. <br>
+ <blockquote><tt> Example:</tt><br>
+ <tt> $ds9 -multiframe foo.fits # load multiple extension fits
+ file as multiple frames</tt></blockquote>
+ <p><b><a name="FITSMosaic"></a>FITS Mosaic</b></p>
+ A FITS mosaic image may exist as a series of FITS files, or as one
+ FITS file with many extensions. A FITS mosaic may be loaded all a
+ one time, or by the segment. Once loaded, the multiple FITS images
+ are treated as one FITS image. <br>
+ <br>
+ DS9 supports three forms of mosaics:&nbsp;
+ <center>
+ <table align="center" border="1" cellpadding="2" cellspacing="2"
+ width="50%">
+ <tbody>
+ <tr>
+ <td valign="top"><tt>IRAF</tt><br>
+ </td>
+ <td valign="top"> <tt>contains the DETSEC and DETSIZE
+ keywords.<br>
+ See <a
+ href="http://iraf.noao.edu/projects/ccdmosaic/imagedef/imagedef.html">NOAO
+
+IRAF
+Mosaic
+Data
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Structures</a></tt> <br>
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top"> <tt>WCS</tt><br>
+ </td>
+ <td align="left" valign="top"><tt>each FITS image contains
+ a valid WCS.</tt><br>
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top"> <tt>HST WFPC2</tt><br>
+ </td>
+ <td align="left" valign="top"> <tt>valid HST WFPC2 data
+ cube, consisting of 4 planes, along with a fits ascii
+ table containing wcs information. </tt></td>
+ </tr>
+ </tbody>
+ </table>
+ </center>
+ <tt></tt>
+ <blockquote><tt>Example:</tt><br>
+ <tt> $ds9 -mosaicimage iraf foo.fits # load mosaic iraf from one
+ fits file with multiple exts</tt><br>
+ <tt> $ds9 -mosaic iraf foo.fits bar.fits wow.fits # load mosaic
+ iraf from 3 files</tt><br>
+ <tt> $ds9 -mosaicimage wcs foo.fits # load mosaic wcs from one
+ fits file with multiple exts</tt><br>
+ <tt> $ds9 -mosaic wcs foo.fits bar.fits wow.fits # load mosaic
+ wcs from 3 files</tt><br>
+ <tt> $ds9 -mosaicimage wfpc2 bar.fits # load wfpc2 mosaic</tt><br>
+ <tt> $ds9 -mosaic foo.fits bar.fits wow.fits # load mosaic (wcs)
+ from 3 files</tt><br>
+ <tt> </tt></blockquote>
+ <p><b><a name="FITSMosaicDataCube"></a>FITS Mosaic Data Cube</b></p>
+ A FITS Mosaic Data Cube is a FITS mosaic image which contains more
+ than 2 axes (NAXES&gt;2). DS9 will automatically detect if a
+ mosaic data cube is present and will load all additional images.
+ At the same time, DS9 will display the data cube dialog box which
+ allows the user to select which 2 image to be displayed.
+ <p><b><a name="FITSRGB"></a>FITS RGB</b></p>
+ A FITS RGB image may exist as three of FITS images, one FITS file
+ with three extensions, or as a FITS 3D Data cube, with three
+ slices, each representing the red, green, and blue channel. A FITS
+ RGB image may be loaded all a one time, or by the channel. Once
+ loaded, the multiple FITS images are treated as one FITS image.<br>
+ <blockquote><tt>Example:</tt><br>
+ <tt> $ds9 -rgbimage rgb.fits # load rgb image consisting of one
+ fits file with 3 image exts</tt><br>
+ <tt> $ds9 -rgbcube cube.fits # load rgb image consisting of one
+ fits data cube</tt><br>
+ <tt> $ds9 -rgb -red foo.fits -green bar.fits -blue wow.fits #
+ rgb image from 3 fits images</tt><br>
+ <tt> </tt></blockquote>
+ <p><b><a name="SplitFITS"></a>Split FITS</b></p>
+ A split fits is a valid fits file in which two files contain the
+ header and data segments.
+ <p><b><a name="array"></a>Array</b></p>
+ Raw data arrays are supported. To load an array, the user must
+ provide the dimensions, pixel depth, and optional header size and
+ architecture type.
+ <blockquote> <tt> Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename[arr]<br>
+ </tt></tt></tt>filename[arr][sect]<br>
+ </tt><tt><tt>filename[sect][arr]<br>
+ &nbsp; </tt></tt></tt></tt><br>
+ where</tt><br>
+ <tt><tt><tt>sect: see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/FITSImage">FITS
+
+
+
+
+
+ Image</a><br>
+ </tt></tt>arr:<br>
+ </tt>
+ <blockquote><tt> xdim=value </tt><br>
+ <tt> ydim=value </tt><br>
+ <tt> zdim=value # default is a depth of 1</tt><br>
+ <tt> dim=value </tt><br>
+ <tt> dims=value </tt><br>
+ <tt> bitpix=[8|16|-16|32|64|-32|-64] </tt><br>
+ <tt> skip=value # must be even, most must be factor of 4 </tt><br>
+ <tt> arch|endian=[big|bigendian|little|littleendian]</tt><br>
+ </blockquote>
+ <tt> Example:<br>
+ $ds9 -array bar.arr[xdim=512,ydim=512,zdim=1,bitpix=16] # load
+ 512x512 short<br>
+ $ds9 -array bar.arr[dim=256,bitpix=-32,skip=4] # load 256x256
+ float with 4 byte head<br>
+ $ds9 -array bar.arr[dim=512,bitpix=32,arch=little] # load
+ 512x512 long, intel<br>
+ </tt>
+ <p>or alternate format:</p>
+ <tt>filename[array(&lt;type&gt;&lt;dim&gt;&lt;:skip&gt;&lt;endian&gt;)]<br>
+ <br>
+ where:<br>
+ type:
+ <blockquote> 'b' 8 -bit unsigned char<br>
+ 's' 16-bit short int<br>
+ 'u' 16-bit unsigned short int<br>
+ 'i' 32-bit int<br>
+ 'l' 64-bit int<br>
+ 'r' 32-bit float<br>
+ 'f' 32-bit float<br>
+ 'd' 64-bit float </blockquote>
+ dim:
+ <blockquote> int&nbsp;&nbsp;&nbsp;&nbsp; # x,y dim<br>
+ int.int # x,y dim<br>
+ int.int.int # x,y,z dim<br>
+ </blockquote>
+ skip:
+ <blockquote> int&nbsp;&nbsp;&nbsp;&nbsp; # number of bytes to
+ skip </blockquote>
+ endian:
+ <blockquote> 'l' little endian<br>
+ 'b' big endian<br>
+ </blockquote>
+ Example:<br>
+ $ds9 -array bar.arr[array(s512)]&nbsp;&nbsp; # load 512x512
+ short<br>
+ $ds9 -array bar.arr[array(r256:4)] # load 256x256 float with 4
+ byte head<br>
+ $ds9 -array bar.arr[array(i512l)]&nbsp; # load 512x512 long,
+ intel </tt>
+ <p>The shell environment variable <tt>DS9_ARRAY </tt>may be
+ used to specify default array parameters. </p>
+ <tt> Example:<br>
+ $export DS9_ARRAY='[dim=256,bitpix=-32]'<br>
+ $ds9 -array foo.arr # load 256x256 float<br>
+ </tt></blockquote>
+ <p><b><a name="nrrd"></a>NRRD (Nearly Raw Raster Data)</b><br>
+ </p>
+ Images in NRRD are supported directly. Encodings supported: <tt>raw,
+
+
+
+
+
+
+
+
+ gzip<br>
+ </tt><br>
+ <tt>Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt>filename[sect]<br>
+ </tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>where:<br>
+ sect: see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/FITSImage">FITS
+
+
+
+
+
+ Image</a><br>
+ </tt></tt> </tt><tt><tt><br>
+ </tt></tt></tt></tt></tt><tt>Example:</tt><br>
+ <tt>$ds9 -nrrd foo.nrrd<br>
+ $ds9 -nrrd foo.nrrd[100:200,100:200] # cropped</tt><br>
+ <p><b><a name="envi"></a>ENVI</b><br>
+ </p>
+ Images in ENVI are supported directly. Encodings supported: <tt>BIL,
+
+
+
+
+
+
+ BIP, BSQ.<br>
+ </tt><br>
+ <tt>Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt>filename[sect]<br>
+ <br>
+ where:</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>sect: see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/FITSImage">FITS
+
+
+
+
+
+ Image</a><br>
+ </tt></tt> </tt><tt><tt><br>
+ </tt></tt></tt></tt></tt> <tt>Example:</tt><br>
+ <tt>$ds9 -envi foo.hdr foo.bsq<br>
+ $ds9 -envi foo.hdr foo.bsq[100:200,100:200] # cropped<br>
+ </tt>
+ <p><b><a name="gif"></a>GIF</b><br>
+ </p>
+ Images in GIF are supported directly. For a <tt>Frame</tt>, the
+ average of the luminosity is used. For <tt>Frame RGB</tt>, each
+ channel is loaded directly.<br>
+ <tt><br>
+ Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt></tt></tt></tt></tt><br>
+ <tt>Example:<br>
+ </tt> <tt>$ ds9 -gif foo.gif</tt><br>
+ <p><b><a name="tiff"></a>TIFF</b><br>
+ </p>
+ Images in TIFF are supported directly. For a <tt>Frame</tt>, the
+ average of the luminosity is used. For <tt>Frame RGB</tt>, each
+ channel is loaded directly.<br>
+ <br>
+ <tt>Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt></tt></tt></tt></tt><br>
+ <tt>Example:</tt><br>
+ <tt>$ ds9 -tiff foo.tiff</tt><br>
+ <p><b><a name="jpeg"></a>JPEG</b><br>
+ </p>
+ Images in JPEG are supported directly. For a <tt>Frame</tt>, the
+ average of the luminosity is used. For <tt>Frame RGB</tt>, each
+ channel is loaded directly.<br>
+ <tt><br>
+ Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt></tt></tt></tt></tt><br>
+ <tt>Example:</tt><br>
+ <tt>$ ds9 -jpeg foo.jpeg</tt><br>
+ <p><b><a name="png"></a>PNG</b><br>
+ </p>
+ Images in PNG are supported directly. For a <tt>Frame</tt>, the
+ average of the luminosity is used. For <tt>Frame RGB</tt>, each
+ channel is loaded directly.<br>
+ <br>
+ <tt>Syntax:<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt>filename<br>
+ </tt></tt></tt></tt></tt></tt></tt><br>
+ <tt>Example:</tt><br>
+ <tt>$ ds9 -png foo.png</tt><br>
+ <p><b> <a name="ExternalFileSupport"></a>External File Support</b></p>
+ DS9 supports external file formats via an ASCII description file.
+ When loading a file into DS9, these descriptions are referenced
+ for instructions for loading the file, based on the file
+ extension. If found, the command is executed and the result, a
+ FITS image or FITS Binary Table, is read into DS9 via stdin. <br>
+ At start-up, DS9 first searches for the ASCII file, named <tt>.ds9.fil</tt>in
+
+
+the
+local
+directory,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ then in the users home directory. <br>
+ The file command first is macro-expanded to fill in user-defined
+ arguments and then is executed externally. <br>
+ The ASCII file that defines the known image files consists of one
+ or more file descriptors, each of which has the following format:
+ <blockquote> <tt> Help description<br>
+ A space-separated list of templates<br>
+ A space-separated list of file types (not currently used)<br>
+ The command line for the loading this file type<br>
+ </tt> </blockquote>
+ Note that blank lines separate the file descriptions and should
+ not be used as part of a description. Also, the '#' character is a
+ comment character. <br>
+ <br>
+ The following macros are supported: <tt>$filename</tt><br>
+ <blockquote><tt> For Example: </tt><br>
+ <tt> # File access descriptions:</tt><br>
+ <tt> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; help explanation</tt><br>
+ <tt> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file template</tt><br>
+ <tt> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file type</tt><br>
+ <tt> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; access command</tt><br>
+ <tt> IRAF IMH files</tt><br>
+ <tt> *.imh</tt><br>
+ <tt> IMH</tt><br>
+ <tt> i2f -s $filename </tt></blockquote>
+ <p><b> <a name="ExternalAnalysisSupport"></a>External Analysis
+ Support</b></p>
+ For more information about external analysis support files, see <a
+ href="analysis.html">Analysis</a>.
+ <p><b> <a name="RegionFiles"></a>Region Files</b></p>
+ DS9 can read and write a number of region file formats. See <a
+ href="region.html">Regions</a> documentation for more
+ information.
+ <blockquote> <tt> <a href="region.html#RegionDescriptions">DS9</a><br>
+ <a href="region.html#FUNTools">FUNTools</a><br>
+ <a href="region.html#Ciao">Ciao</a><br>
+ <a href="region.html#SAOimage">SAOimage</a><br>
+ <a href="region.html#IRAFPROS">IRAF PROS</a><br>
+ <a href="region.html#FITSREGIONBinaryTable">FITS REGION Binary
+ Table</a><br>
+ <a href="region.html#XY">X Y</a><br>
+ </tt></blockquote>
+ <p> <b><a name="ContourFiles"></a>Contour Files</b></p>
+ <b> </b>See <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/contour.html#ContourFiles">Contours</a>
+ documentation for more information. <br>
+ <b></b>
+ <blockquote><tt> </tt> </blockquote>
+ <p><b> <a name="ColorLookupTable"></a>Color Lookup Table</b></p>
+ DS9 has a number of default colormaps available to the user. DS9
+ also supports reading and writing color lookup table formats from
+ the following programs:
+ <blockquote> <tt> <a
+href="http://tdc-www.harvard.edu/software/saoimage/saoimage.color.html#cmap">SAOimage</a><br>
+ <a
+ href="http://hea-www.harvard.edu/RD/saotng/adding_cmaps.html">SAOtng</a><br>
+ XImtool<br>
+ </tt> </blockquote>
+ DS9 uses the file extension to determine the color table format:
+ <center>
+ <table nosave="" border="1" cellpadding="2" cellspacing="2"
+ width="50%">
+ <tbody>
+ <tr nosave="">
+ <td nosave="">
+ <center><tt>Ext</tt></center>
+ </td>
+ <td>
+ <center><tt>Format</tt></center>
+ </td>
+ </tr>
+ <tr>
+ <td><tt>.lut</tt></td>
+ <td><tt>XImtool, SAOtng</tt></td>
+ </tr>
+ <tr>
+ <td><tt>.sao</tt></td>
+ <td><tt>DS9, SAOimage</tt></td>
+ </tr>
+ <tr>
+ <td><tt>any other</tt></td>
+ <td><tt>DS9</tt></td>
+ </tr>
+ </tbody>
+ </table>
+ </center>
+ <p><b> <a name="WCS"></a>WCS</b></p>
+ A new WCS specification can be loaded and used by the current
+ image regardless of the WCS that was contained in the image file.
+ WCS specification can be sent to DS9 as an ASCII file via XPA. The
+ format of the specification is a set of valid FITS keywords that
+ describe a WCS.
+ <blockquote> <tt> Example: <br>
+ &nbsp;&nbsp;&nbsp; CRPIX1&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 257.75<br>
+ &nbsp;&nbsp;&nbsp; CRPIX2&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 258.93<br>
+ &nbsp;&nbsp;&nbsp; CRVAL1&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -201.94541667302 <br>
+ &nbsp;&nbsp;&nbsp; CRVAL2&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -47.45444<br>
+ &nbsp;&nbsp;&nbsp; CDELT1&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -2.1277777E-4 <br>
+ &nbsp;&nbsp;&nbsp; CDELT2&nbsp;
+ =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.1277777E-4
+ <br>
+ &nbsp;&nbsp;&nbsp; CTYPE1&nbsp; = 'RA---TAN' <br>
+ &nbsp;&nbsp;&nbsp; CTYPE2&nbsp; = 'DEC--TAN' <br>
+ </tt> </blockquote>
+ Note that the WCS definitions can contain standard FITS 80
+ character WCS card images, as shown above, or free-form name/value
+ pairs without the intervening "=" sign:
+ <blockquote> <tt> &nbsp;&nbsp;&nbsp; CRPIX1&nbsp;&nbsp;&nbsp;
+ 257.75 <br>
+ &nbsp;&nbsp;&nbsp; CRPIX2&nbsp;&nbsp;&nbsp; 258.93 <br>
+ &nbsp;&nbsp;&nbsp; CRVAL1&nbsp;&nbsp;&nbsp; -201.94541667302 <br>
+ &nbsp;&nbsp;&nbsp; CRVAL2&nbsp;&nbsp;&nbsp; -47.45444 <br>
+ &nbsp;&nbsp;&nbsp; CDELT1&nbsp;&nbsp;&nbsp; -2.1277777E-4 <br>
+ &nbsp;&nbsp;&nbsp; CDELT2&nbsp;&nbsp;&nbsp; 2.1277777E-4 <br>
+ &nbsp;&nbsp;&nbsp; CTYPE1&nbsp;&nbsp; 'RA---TAN' <br>
+ &nbsp;&nbsp;&nbsp; CTYPE2&nbsp;&nbsp; 'DEC--TAN' </tt> </blockquote>
+ <p><b> <a name="PreferenceFile"></a>Preference File</b></p>
+ A preference file is a valid tcl script generated by DS9 to save
+ the current preference items. See <a href="prefs.html">Preferences</a>
+ for more information.
+ <p><b> <a name="StartupFile"></a>Startup File</b></p>
+ If a startup file <tt>$HOME/ds9.ini</tt> is available, it is
+ sourced as the last step in initialization. The file permissions
+ must be group/world readonly.<br>
+ Users may have several different startup files. DS9 looks for a
+ startup file with its own name. By default, if the application is
+ named <tt>ds9</tt>, it will look for <tt>.ds9.ini.</tt> However,
+ if the DS9 application is named <tt>foo</tt>, then DS9 will look
+ for <tt>.foo.ini.</tt> In this manner, the user can have several
+ predefined startup files that are activated by invoking DS9 with a
+ different application names. <br>
+ <p><b> <a name="TCL"></a>TCL</b></p>
+ TCL/TK script file. Users may customize the appearance and enhance
+ the capabilities of DS9 by sourcing their own TCL scripts. </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/grid.html b/ds9/doc/ref/grid.html
new file mode 100644
index 0000000..ed772cc
--- /dev/null
+++ b/ds9/doc/ref/grid.html
@@ -0,0 +1,90 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Coordinate Grids</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> Coordinate Grids</h3>
+ <blockquote>
+ <p>DS9 can create and display coordinate grids as an overlay on an
+ image. The Display Coordinate Grid Menu is used to display
+ grids. A coordinate grid is composed of Grid Lines, Axes,
+ Border, and Title. Axes include tick marks, title, and numbers.
+ The appearance of the coordinate grid is specified by
+ parameters. These parameters may be configured via the
+ Coordinate Grid Parameters dialog box. In addition to the axes
+ titles and the grid title, the following menus are available. </p>
+ <p><b><a name="Format"></a>Numeric Formats</b></p>
+ <p>The user may specify custom numeric formats for either axes.
+ The format specification can be empty (default) or a print
+ function, based on the selected coordinate system:<br>
+ </p>
+ <blockquote> <tt>image</tt><br>
+ <tt>physical</tt><br>
+ <tt>detector</tt><br>
+ <tt>amplifier</tt><br>
+ <tt>wcs linear</tt><br>
+ <tt>wcs equatorial</tt><br>
+ </blockquote>
+ <p>The format specification string to be passed to the C "printf"
+ function (e.g. "%%1.7G") in order to format a single coordinate
+ value.</p>
+ <p>The Format string supplied should contain one or more of the
+ following characters. These may occur in any order, but the
+ following is recommended for clarity:</p>
+ <blockquote> "": Indicates that a plus sign should be prefixed to
+ positive values. By default, no plus sign is used.<br>
+ "z": Indicates that leading zeros should be prefixed to the
+ value so that the first field is of constant width, as would be
+ required in a fixed-width table (leading zeros are always
+ prefixed to any fields that follow). By default, no leading
+ zeros are added.<br>
+ "i": Use the standard ISO field separator (a colon) between
+ fields. This is the default behaviour.<br>
+ "b": Use a blank to separate fields.<br>
+ "l": Use a letter ("h"/"d", "m" or "s" as appropriate) to
+ separate fields.<br>
+ "g": Use a letter and symbols to separate fields ("h"/"d", "m"
+ or "s", etc, as appropriate), but include escape sequences in
+ the formatted value so that the Plot class will draw the
+ separators as small super-scripts.<br>
+ "d": Include a degrees field. Expressing the angle purely in
+ degrees is also the default if none of "h", "m", "s" or "t" are
+ given.<br>
+ "h": Express the angle as a time and include an hours field
+ (where 24 hours correspond to 360 degrees). Expressing the angle
+ purely in hours is also the default if "t" is given without
+ either "m" or "s".<br>
+ "m": Include a minutes field. By default this is not included.<br>
+ "s": Include a seconds field. By default this is not included.
+ This request is ignored if "d" or "h" is given, unless a minutes
+ field is also included.<br>
+ "t": Express the angle as a time (where 24 hours correspond to
+ 360 degrees). This option is ignored if either "d" or "h" is
+ given and is intended for use where the value is to be expressed
+ purely in minutes and/or seconds of time (with no hours field).
+ If "t" is given without "d", "h", "m" or "s" being present, then
+ it is equivalent to "h".<br>
+ ".": Indicates that decimal places are to be given for the final
+ field in the formatted string (whichever field this is). The "."
+ should be followed immediately by an unsigned integer which
+ gives the number of decimal places required, or by an asterisk.
+ If an asterisk is supplied, a default number of decimal places
+ is used which is based on the value of the Digits attribute.<br>
+ </blockquote>
+ <p>All of the above format specifiers are case-insensitive. If
+ several characters make conflicting requests (e.g. if both "i"
+ and "b" appear), then the character occurring last takes
+ precedence, except that "d" and "h" always override "t".</p>
+ <p>The default formats are <tt>d.3</tt> for degrees and <tt>hms.1</tt>
+ / <tt>dms.1</tt> / <tt>ldms.1</tt> for sexagesimal.<br>
+ </p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/how.html b/ds9/doc/ref/how.html
new file mode 100644
index 0000000..9a76d51
--- /dev/null
+++ b/ds9/doc/ref/how.html
@@ -0,0 +1,159 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>How</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> How it Works</h3>
+ <blockquote>
+ <p><b>Table of Contents</b></p>
+ <a href="#How">How DS9 Renders an Image</a><br>
+ <a href="#Scales">Scales</a><br>
+ <a href="#Smoothing">Smoothing</a><br>
+ <a href="#Contours">Contours</a><br>
+ <a href="#LargeFiles">Large Files</a><br>
+ <p><b><a name="How"></a>How DS9 renders an image</b></p>
+ <p>Here is a short description on how DS9 decides to paint a pixel
+ a color on the the screen, give an data value... you need a
+ color scale, a contrast/bias pair for the colorscale, clip
+ values for the data, a scale distribution, and finally, the
+ value of the pixel in question.</p>
+ <blockquote>
+ <p>Step 1. Select a color scale. A color scale is defined as a
+ number of colors (RGB triplets). The number of RGB triplets
+ can vary from just a few to over 200. DS9 contains a number of
+ predefined color scales (Gray, A, B, I8, ...) or the user may
+ load his own color scale.</p>
+ <p>Step 2. Apply a contrast/bias pair. This step takes the
+ result of step 1 and creates a new array with the
+ contrast/bias applied. The length of the new array will
+ between 200 (for pseudocolor) and 4096 (for truecolor).</p>
+ <p>Step 3. Calculate the data clip values (low/high data
+ values). The min/max data values may be used or an algorithm
+ may be used to determine the clip data values.</p>
+ <p>Step 4. Apply the scale distribution. This involves taking
+ the result of step 2, and creating yet another array, this
+ time of size 16384, redistributing the colors, based on the
+ scale algorithm selected (see <a href="Scales">Scales</a>).</p>
+ <p>Step 5. Based on your data clip values, and the value of the
+ pixel you have, index into the result of step 4, and you have
+ an index into lookup table (for pseudocolor) and an RGB pair
+ (for truecolor and postscript).</p>
+ </blockquote>
+ <p><b><a name="Scales"></a>Scales</b></p>
+ <p>The <tt>log</tt> function is defined as the following:</p>
+ <blockquote>
+ <p><b><img src="img/log.png" alt="log equation" height="32"
+ width="78"></b></p>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1. The user may specify an exponent
+ <i>a</i> to change the distribution of colors within the
+ colorbar. The default value of <i>a</i> is 1000. Typically,
+ optical images respond well at 1000, IR images as low as 100,
+ and high energy bin tables up to 10000. A value of 10000 closely
+ matches the <b><tt>log</tt></b> function of SAOImage as defined
+ as the following:</p>
+ <blockquote>
+ <p><b><img src="img/saolog.png" alt="SAOImage log equation"
+ height="34" width="65"></b></p>
+ </blockquote>
+ <p>The <tt>pow</tt> function is defined as the following:</p>
+ <blockquote>
+ <p><b><img src="img/pow.png" alt="pow equation" height="30"
+ width="51"></b></p>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1. The user may specify an exponent
+ <i>a</i> to change the distribution of colors within the
+ colorbar. The default value of <i>a</i> is 1000.</p>
+ <p>The <tt>sqrt</tt> scale function is defined as the following:</p>
+ <blockquote><img src="img/sqrt.png" alt="sqrt equation"
+ height="21" width="42"><br>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1. </p>
+ <p>The <tt>square</tt> scale function is defined as the
+ following:</p>
+ <blockquote><img src="img/square.png" alt="square equation"
+ height="21" width="35"><br>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1.<br>
+ </p>
+ <p>The <tt>asinh</tt> scale function is defined as the following:</p>
+ <blockquote><img alt="asinh" src="img/asinh.png" height="29"
+ width="80"><br>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1. </p>
+ <p>The <tt>sinh</tt> scale function is defined as the following:</p>
+ <blockquote><img alt="sinh" src="img/sinh.png" height="29"
+ width="69"><br>
+ </blockquote>
+ <p>as <i>x</i> goes from 0 to 1. </p>
+ <p>The <tt>histogram equalization</tt> scale function distributes
+ colors based on the frequency of each data value.</p>
+ <p><b><a name="Smoothing"></a>Smoothing</b></p>
+ <p>The user may select one of three types of smoothing kernels.
+ The parameter, <i>r</i> or <tt>kernel radius</tt>, is defined
+ as the following:</p>
+ <blockquote> Boxcar function, where the width = 2<i>r</i>+1<br>
+ Tophat function, where the radius = <i>r</i> and the diameter
+ of kernel is 2<i>r</i>+1<br>
+ Gaussian function, defined as:
+ <blockquote><img src="img/gauss.png" alt="Gaussian Equation"
+ height="38" width="173"><br>
+ </blockquote>
+ where the mean = 0 and sigma =<i> r</i>/2, and the diameter of
+ kernel is 2<i>r</i>+1 </blockquote>
+ <p><b><a name="Contours"></a>Contours</b></p>
+ <p>The contour algorithm is from an unknown author and originally
+ came from FV. The difference between the two modes are:<tt><br>
+ </tt></p>
+ <blockquote><tt>block</tt> : the image is blocked down before the
+ contour is generated <br>
+ <tt>smooth</tt> : the image is smoothed via a Gaussian kernel
+ before the contour is generated. </blockquote>
+ <p><tt>block</tt> mode is faster as the smoothing parameter
+ increases. Inversely, <tt>smooth</tt> mode is much slower as
+ the smoothing parameter increases.</p>
+ <p><b><a name="LargeFiles"></a>Large Files</b></p>
+ There are several factors that determine if DS9 will be able to
+ load a large file.<br>
+ <p>32 bit OS vs 64 bit OS : to address very large files, you may
+ need to use an 64 bit OS with a 64bit version of DS9. 32bit apps
+ can address up to 4Gb of address space. However, depending on
+ the OS, this limit may be less. Linux for example, the limit
+ appears to be ~3GB (the OS and shared libs eat up a lot of
+ address space). Under 64bit Solaris, 32bit ds9 has a full 4Gb of
+ space. MacOSX appears to have a limit ~3Gb. Under windows, ~2Gb.</p>
+ <p>Large File Support: is the ability to sequence thru files
+ larger than 4Gb. DS9 is compiled with LFS.</p>
+ <p>File system: the OS file system must be able to support files
+ larger than 4Gb. Most recent file systems fully support 4GB&gt;.</p>
+ <p>Memory Management: There are a number of memory management
+ techniques supported in DS9 that will greatly affect the ability
+ and speed of loading large files:</p>
+ <blockquote> <tt>$ ds9 foo.fits # uses mmap</tt><br>
+ <tt>$ cat foo.fits | ds9 - # allocates memory</tt> <br>
+ <tt>$ xpaset -p ds9 file foo.fits # uses mmap</tt> <br>
+ <tt>$ xpaset -p ds9 fits foo.fits # allocates memory</tt><br>
+ </blockquote>
+ <p>Memory Map (<tt>mmap</tt>) is very fast, limit is memory
+ address space (see above). Allocate is very slow, limit is
+ amount of physical memory + swap partition.</p>
+ <p>Scanning Data: DS9 needs to determine the min and max data
+ values to correctly display your image. For large files, such as
+ Mosaics and Data Cubes,&nbsp; this can take time. You have the
+ option of using using the FITS keywords DATAMIN/MAX or
+ IRAFMIN/MAX - great if present, bad because they are always
+ wrong. Another option is to specify the low and high clip values
+ via the command line or Scale dialogbox.<br>
+ </p>
+ <blockquote> <br>
+ </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/img/asinh.png b/ds9/doc/ref/img/asinh.png
new file mode 100644
index 0000000..7021885
--- /dev/null
+++ b/ds9/doc/ref/img/asinh.png
Binary files differ
diff --git a/ds9/doc/ref/img/gauss.png b/ds9/doc/ref/img/gauss.png
new file mode 100644
index 0000000..31a639a
--- /dev/null
+++ b/ds9/doc/ref/img/gauss.png
Binary files differ
diff --git a/ds9/doc/ref/img/log.png b/ds9/doc/ref/img/log.png
new file mode 100644
index 0000000..f122879
--- /dev/null
+++ b/ds9/doc/ref/img/log.png
Binary files differ
diff --git a/ds9/doc/ref/img/pow.png b/ds9/doc/ref/img/pow.png
new file mode 100644
index 0000000..65b2dd5
--- /dev/null
+++ b/ds9/doc/ref/img/pow.png
Binary files differ
diff --git a/ds9/doc/ref/img/saolog.png b/ds9/doc/ref/img/saolog.png
new file mode 100644
index 0000000..0a4b871
--- /dev/null
+++ b/ds9/doc/ref/img/saolog.png
Binary files differ
diff --git a/ds9/doc/ref/img/sinh.png b/ds9/doc/ref/img/sinh.png
new file mode 100644
index 0000000..395e6d9
--- /dev/null
+++ b/ds9/doc/ref/img/sinh.png
Binary files differ
diff --git a/ds9/doc/ref/img/sqrt.png b/ds9/doc/ref/img/sqrt.png
new file mode 100644
index 0000000..16ad2c0
--- /dev/null
+++ b/ds9/doc/ref/img/sqrt.png
Binary files differ
diff --git a/ds9/doc/ref/img/square.png b/ds9/doc/ref/img/square.png
new file mode 100644
index 0000000..b96c6bf
--- /dev/null
+++ b/ds9/doc/ref/img/square.png
Binary files differ
diff --git a/ds9/doc/ref/index.html b/ds9/doc/ref/index.html
new file mode 100644
index 0000000..8286492
--- /dev/null
+++ b/ds9/doc/ref/index.html
@@ -0,0 +1,105 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Reference Manual</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> SAOImage DS9 Reference Manual</h3>
+ <blockquote>
+ <p>DS9 is&nbsp; the next version of the popular <a
+ href="http://hea-www.harvard.edu/RD/saotng/">SAOtng</a>
+ display program. It is a Tk/Tcl application which utilizes the
+ SAOtk widget set. It also incorporates the new X Public Access (<a
+ href="http://hea-www.harvard.edu/RD/xpa/">XPA</a>) mechanism
+ to allow external processes to access and control its data, GUI
+ functions, and algorithms. DS9&nbsp; supports the direct display
+ of FITS images and binary tables, multiple frame buffers, region
+ cursor manipulation, many scale algorithms and colormaps, and
+ easy communication with external analysis tasks. It is highly
+ configurable and extensible to meet the evolving needs of the
+ astronomical community. </p>
+ <p>DS9 supports advanced features such as multiple frame buffers,
+ mosaic images, tiling, blinking, geometric markers, colormap
+ manipulation, scaling, arbitrary zoom, rotation, pan, and a
+ variety of coordinate systems (including Image, Physical,
+ Detector, and WCS). DS9 also supports FTP and HTTP access. The
+ GUI for DS9 is user configurable.</p>
+ <table align="center" border="0" cellpadding="4" cellspacing="2"
+ height="25%" width="75%">
+ <tbody>
+ <tr>
+ <td align="center" valign="middle"> <a href="how.html">How
+ It Works</a></td>
+ <td align="center" valign="top"><a href="backup.html">Backup
+ and Restore</a></td>
+ <td align="center" valign="middle"> <a href="file.html">File
+
+
+
+
+
+
+
+ Formats</a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="middle"> <a href="keyboard.html">Mouse
+
+
+
+
+ and Keyboard</a> </td>
+ <td align="center" valign="top"><a href="grid.html">Coordinate
+
+
+
+
+
+
+
+ Grids</a></td>
+ <td align="center" valign="middle"> <a href="prefs.html">Preferences</a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="middle"> <a href="command.html">Command
+
+
+
+
+ Line Options</a> </td>
+ <td align="center" valign="top"><a href="catalog.html">Catalogs</a></td>
+ <td align="center" valign="middle"> <a href="3d.html">3-D
+ Frames</a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="middle"> <a href="xpa.html">XPA
+ Access Points</a> </td>
+ <td align="center" valign="top"><a href="colorbar.html">Colorbar</a><br>
+ </td>
+ <td align="center" valign="middle"> <a href="contour.html">Contours</a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="top"> <a href="samp.html">SAMP<br>
+ </a> </td>
+ <td align="center" valign="top"><a href="print.html">Printing</a></td>
+ <td align="center" valign="top"> <a href="iraf.html">IRAF
+ Support</a></td>
+ </tr>
+ <tr>
+ <td align="center" valign="middle"> <a href="region.html">Regions</a>
+ </td>
+ <td align="center" valign="top"><a href="analysis.html">Analysis</a></td>
+ <td align="center" valign="middle"> <a href="bin.html">Binning</a><br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/iraf.html b/ds9/doc/ref/iraf.html
new file mode 100644
index 0000000..72545d4
--- /dev/null
+++ b/ds9/doc/ref/iraf.html
@@ -0,0 +1,179 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=ISO-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>IRAF Support</title>
+ </head>
+ <body link="#0000ee" text="#000000" vlink="#551a8b" alink="#ff0000"
+ bgcolor="#ffffff">
+ <h3><img alt="" src="../sun.gif" height="98" width="100" align="middle">
+ IRAF Support</h3>
+ <blockquote>
+ <p>DS9 is a fully functional IRAF image display server. IRAF
+ uses the IIS protocol to communicate with a valid image display server,
+ such as DS9, ximtool, saoimage, and saotng. With DS9, no special
+ scripts are
+ needed. If you have one of the above currently working, DS9 works <i>right</i>
+ <i>out of the box.</i> And DS9 now supports IRAF's new IIS image
+ display
+ protocol that supports up to 16 display frames. </p>
+ <p>All native DS9 functions may be used with images load with IRAF
+ display
+ except for the <tt>Scale</tt> menu items. Values displayed may the the
+ true values, if a linear scale is specified with the <tt>display</tt>
+ command.
+ Otherwise, the value is a scaled value. DS9 supports IRAF in all
+ display
+ visuals including <tt>Truecolor</tt>. Support full postscript printing
+ of images loaded from IRAF is provided. </p>
+ <p><b> Command Line Arguments</b></p>
+ <p>As with <i>ximtool</i>, the follow command line arguments may be
+ used
+ to specify the communication parameters: </p>
+ <blockquote>
+ <tt>
+ <a href="command.html#fifo">fifo</a><br>
+ <a href="command.html#fifo_only">fifo_only</a><br>
+ <a href="command.html#port_only">inet_only</a><br>
+ <a href="command.html#port">port</a><br>
+ <a href="command.html#port_only">port_only</a><br>
+ <a href="command.html#unix">unix</a><br>
+ <a href="command.html#unix_only">unix_only</a>
+ </tt>
+ </blockquote>
+ <p>The default parameters are: </p>
+ <blockquote>
+ <tt>
+ fifo /dev/imt1<br>
+ port 5137<br>
+ unix /tmp/.IMT%d</tt>
+ </blockquote>
+ <p><b> Configuration</b></p>
+ <p>An <i>IRAF</i> image server uses a configuration
+ file to specify the number of available buffers and their sizes.
+ What actually
+ passes from IRAF is not the buffer size, but an index number into
+ this file. </p>
+ <p>So when an image server starts (DS9), it will attempt to locate
+ this file as <tt>$HOME/.imtoolrc</tt> and /<tt>usr/local/lib/imtoolrc</tt>.
+ If
+ not found, it will look for shell environment variables <tt>IMTOOLRC</tt>
+ and <tt>imtoolrc</tt>, that contains the name of the configuration
+ file. </p>
+ <p>If no configuration file is found, DS9 will assume the following
+ default configuration: </p>
+ <blockquote>
+ <tt>
+ 1 2 512 512 # imt1|imt512 <br>
+ 2 2 800 800 # imt2|imt800 <br>
+ 3 2 1024 1024 # imt3|imt1024 <br>
+ 4 1 1600 1600 # imt4|imt1600 <br>
+ 5 1 2048 2048 # imt5|imt2048 <br>
+ 6 1 4096 4096 # imt6|imt4096 <br>
+ 7 1 8192 8192 # imt7|imt8192 <br>
+ 8 1 1024 4096 # imt8|imt1x4 <br>
+ 9 2 1144 880 # imt9|imtfs full screen
+ (1152x900 minus frame) <br>
+ 10 2 1144 764 # imt10|imtfs35 full screen at
+ 35mm film aspect ratio <br>
+ 11 2 128 128 # imt11|imt128 <br>
+ 12 2 256 256 # imt12|imt256 <br>
+ 13 2 128 1056 # imt13|imttall128 tall &amp;
+ narrow for spectro. <br>
+ 14 2 256 1056 # imt14|imttall256 tall &amp;
+ wider for spectro. <br>
+ 15 2 1056 128 # imt15|imtwide128 wide &amp;
+ thin for spectro. <br>
+ 16 2 1056 256 # imt16|imtwide256 wide &amp;
+ fatter for spectro. <br>
+ 17 2 1008 648 # imt17|imtssy Solitaire fmt w/
+ imtool border <br>
+ 18 2 1024 680 # imt18|imtssn Solitaire fmt
+ w/out imtool border <br>
+ 19 1 4096 1024 # imt19|imt4x1</tt>
+ </blockquote>
+ <p>If on the other hand, IRAF assumes a different buffer size, the
+ image
+ will appear corrupted and DS9 may issue a number of error messages. </p>
+ <p>Another problem is that this file must be in sync with <tt>dev$graphcap</tt>.
+ If
+ your system administrator has made changes to <tt>graphcap</tt>,
+ they must also be implemented in <tt>imtoolrc</tt>. </p>
+ <p>Here is a note from NOAO: </p>
+ <blockquote>
+ <p><tt>The messages means that there is no /usr/local/lib/imtoolrc
+ file on the machine. This is created as a symlink to dev$imtoolrc by
+ the iraf install script but only if the /usr/local/lib dir already
+ exists on the machine. The fix is the create the dir and rerun the
+ install
+ script or else make the link by hand. Users can also just copy
+ dev$imtoolrc to $HOME/.imtoolrc and restart the server to also
+ workaround
+ it. Note that an existing .imtoolrc might define old frame buffer
+ configs which might confuse things, so if the system file exists check
+ for a
+ private copy screwing things up.</tt></p>
+ </blockquote>
+ <p><b> Windows DS9 and IRAF</b></p>
+ <p>To direct image output from IRAF to DS9 running under windows, use
+ the <tt>IMTDEV</tt>
+ environment variable. For example, if the windows machine is named
+ 'foo.bar.edu', define <tt>IMTDEV</tt> to the follow value before
+ entering IRAF. </p>
+ <blockquote>
+ <tt>$ setenv IMTDEV inet:5137:foo.bar.edu<br>
+ $ cl <br>
+ cl&gt; display dev$pix</tt>
+ </blockquote>
+ <p><b> Scale Menu Disabled</b></p>
+ <p>When you display an image from <i>IRAF</i> into DS9, <i>IRAF</i>
+ actually does the color scale distribution. In <tt>Display</tt>,
+ use the <tt>ztrans</tt> and <tt>z1</tt>,<tt>z2</tt><tt>zscale</tt>
+ parameter to auto determine <tt>z1,z2. Here</tt> are the <tt>DISPLAY</tt>
+ parameters in question: parameters to set
+ the upper/lower bounds and distribution. You can also use the </p>
+ <blockquote>
+ <tt>
+ ztrans=[linear|log|none|user]<br>
+ z1=min<br>
+ z2=max<br>
+ zscale=[yes|no]</tt>
+ </blockquote>
+ <p>What actually is sent from <i>IRAF</i> to DS9 is one byte per
+ pixel,
+ values 0-200, which already has applied both the upper and lower
+ clipping bounds and the distribution. So this is why, the <tt>SCALE </tt>menu
+ is
+ disabled in DS9 when it receives a image from <i>IRAF</i>.</p>
+ <p><b>MSCRED/MSCZERO<br>
+ </b></p>
+ <p>DS9 now supports IRAF's new IIS image display protocol. However,
+ there
+ is one minor problem with the <b>mscred</b> task <b>msczero.</b>
+ Before using <b>msczero</b>, issue the following command in the cl:</p>
+ <blockquote>
+ <tt>cl&gt; set disable_wcs_maps=""<br>
+ cl&gt; flpr</tt><br>
+ </blockquote>
+ <p><b>IMEXAMINE</b></p>
+ <p>Due to the unique relationship between DS9 and IRAF, if you use
+ the <b>imexamine</b>
+ task, you can take advantage of a special feature of DS9. Instead of
+ loading the image from IRAF with the <b>display</b> task, load the
+ image directly into DS9. Then, from the <b>cl</b> prompt, invoke <b>imexamine</b>
+ without a filename. IRAF will ask DS9 for the current filename and use
+ it for analysis. This approach provides several advantages over
+ previous methods. First, it
+ will work with compound fits images such as mosaics, data cubes, and
+ rgb images.
+ Second, the image displays includes true image data and WCS
+ information,
+ not
+ the approximated data from IRAF.
+ </p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/keyboard.html b/ds9/doc/ref/keyboard.html
new file mode 100644
index 0000000..dae00be
--- /dev/null
+++ b/ds9/doc/ref/keyboard.html
@@ -0,0 +1,230 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Mouse and Keyboard</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> Mouse and Keyboard</h3>
+ <blockquote>
+ <p><b> Mouse Buttons</b></p>
+ <p>The following table contains the event bindings for the mouse
+ buttons. </p>
+ <center>
+ <table nosave="" border="1" width="75%">
+ <tbody>
+ <tr>
+ <td>
+ <center>Mouse Button</center>
+ </td>
+ <td>
+ <center>Description</center>
+ </td>
+ </tr>
+ <tr>
+ <td><font face="Courier New,Courier">Button 1</font></td>
+ <td>Depends on current MODE, which may be selected by the
+ EDIT menu option.<br>
+ In Region mode, create/edit/delete regions.<br>
+ In Crosshair mode, will move current crosshair.<br>
+ In Colorbar mode, will change contrast and bias of
+ colormap.<br>
+ In Pan mode, will move or pan to clicked location.<br>
+ In Zoom mode, will zoom about clicked location.<br>
+ In Rotate mode, will rotate image about center.<br>
+ In Crop mode, will select 2-D crop region. For 3-D <i>Shift-click</i>
+ will edit front clip plane, <i>Control-click</i> will
+ edit back clip plane.<br>
+ In Catalog mode, will select catalog regions.<br>
+ In examine mode, will follow IRAF examine protocol.<br>
+ </td>
+ </tr>
+ <tr>
+ <td><font face="Courier New,Courier">Button 2</font></td>
+ <td>Pan mode: will move or pan to clicked location.
+ Behavior depends on the PAN preference settings.</td>
+ </tr>
+ <tr>
+ <td><font face="Courier New,Courier">Button 3</font></td>
+ <td>Colorbar mode: will change the contrast and bias of
+ the colormap.</td>
+ </tr>
+ </tbody>
+ </table>
+ </center>
+ <p><b>Greek and other special characters.</b> </p>
+ <p>The concept of a separate <tt>SYMBOL</tt> font is no longer
+ implemented with the latest OS font and scripting support,
+ especially with scalable anti-alias fonts such as Xft for Linux.
+ Most newer fonts (if not all) now have greek characters as part
+ of the font. The greek characters start at unicode \u0391 for
+ 'A' and \u03b1 for 'a'. Each OS has a tool used to build and
+ copy a string of characters. Then use the Edit:Paste menu of DS9
+ to insert the character string.</p>
+ <blockquote>
+ <p>Linux- Gnome: <b>gucharmap<br>
+ </b>Linux- KDE: <b>kcharselect<br>
+ </b>MacOSX: <b>Character Viewer</b> (Select <tt>Edit:Special
+ Characters</tt>) Now click and drag the characters to a
+ terminal window. Then select the string and select <tt>Edit:Copy</tt>.<br>
+ Windows: <b>Character Map</b> (from <tt>Start</tt> button,
+ select <tt>All Programs</tt>, <tt>Accessories</tt>, <tt>System
+
+
+ Tools</tt> and then <tt>Character Map</tt>)</p>
+ </blockquote>
+ <p><b>Keyboard Shortcuts</b></p>
+ <p>The following table contains the list of keyboard shortcuts and
+ the resulting action taken.&nbsp; </p>
+ <center>
+ <table nosave="" border="1" width="75%">
+ <tbody>
+ <tr>
+ <td align="center"> Key Stroke </td>
+ <td>
+ <center>Description</center>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><tt>TAB</tt></td>
+ <td><font face="Courier New,Courier">G</font>oto next
+ frame</td>
+ </tr>
+ <tr>
+ <td align="center" valign="top"><tt>Shift-TAB</tt><br>
+ </td>
+ <td valign="top">Goto previous frame<br>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><tt>DELETE</tt></td>
+ <td>Deletes selected regions</td>
+ </tr>
+ <tr>
+ <td align="center">c<br>
+ </td>
+ <td>Print Mouse Coordinates and Pixel value.</td>
+ </tr>
+ <tr>
+ <td align="center">f<br>
+ </td>
+ <td>Toggles Infobox freeze</td>
+ </tr>
+ <tr>
+ <td align="center">i<br>
+ </td>
+ <td>Set include property for region</td>
+ </tr>
+ <tr>
+ <td align="center">e<br>
+ </td>
+ <td>Set exclude property for region</td>
+ </tr>
+ <tr>
+ <td align="center">s<br>
+ </td>
+ <td>Set source property for region</td>
+ </tr>
+ <tr>
+ <td align="center">b<br>
+ </td>
+ <td>Set background property for region</td>
+ </tr>
+ <tr>
+ <td align="center">g<br>
+ </td>
+ <td>Create a new group</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Shift-g</tt></td>
+ <td>Create a new group with default name</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>+</tt></td>
+ <td>Goto next 3D Fits Slice</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>-</tt></td>
+ <td>Goto previous 3D Fits Slice</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Up Arrow<br>
+ k<br>
+ </tt></td>
+ <td>Will move selected regions up one pixel. <br>
+ In Pointer mode, will move the cursor up one pixel. <br>
+ In Crosshair mode, will move the crosshair up one pixel.
+ <br>
+ In Pan mode, will pan the image up one pixel.</td>
+ </tr>
+ <tr nosave="">
+ <td align="center"><tt>Right</tt><font face="Courier
+ New,Courier"> </font><tt>Arrow<br>
+ l<br>
+ </tt></td>
+ <td nosave="">Will move selected regions to the right one
+ pixel. <br>
+ In Pointer mode, will move the cursor to the right one
+ pixel. <br>
+ In Crosshair mode, will move the crosshair to the right
+ one pixel. <br>
+ In Pan mode, will pan the image to the right one pixel.</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Left</tt><font face="Courier
+ New,Courier"> </font><tt>Arrow<br>
+ h<br>
+ </tt></td>
+ <td>Will move selected regions to the left one pixel. <br>
+ In Pointer mode, will move the cursor to the left one
+ pixel. <br>
+ In Crosshair mode, will move the crosshair to the left
+ one pixel. <br>
+ In Pan mode, will pan the image to the left one pixel.</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Down</tt><font face="Courier
+ New,Courier"> </font><tt>Arrow<br>
+ j<br>
+ </tt></td>
+ <td>Will move selected regions down one pixel. <br>
+ In Pointer mode, will move the cursor up down one pixel.
+ <br>
+ In Crosshair mode, will also move the crosshair down one
+ pixel. <br>
+ In Pan mode, will pan the image down one pixel.</td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Shift</tt><font face="Courier
+ New,Courier">-</font><tt>Drag</tt></td>
+ <td>In Pointer mode, will select all regions within the
+ indicated region.<br>
+ In Crop mode, for 3D frame, will move front crop plane
+ forward.<br>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><tt>Control-Drag</tt></td>
+ <td>In Poiner mode, on selected <tt>ANNULUS</tt> Regions,
+ will create new radii.<br>
+ In Crop mode, for 3D frame, will move back crop plane
+ backward.<br>
+ </td>
+ </tr>
+ <tr>
+ <td align="center" valign="top"><tt>Command-`</tt><br>
+ </td>
+ <td valign="top">Rotate thur all open windows<br>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </center>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/prefs.html b/ds9/doc/ref/prefs.html
new file mode 100644
index 0000000..05ffb9e
--- /dev/null
+++ b/ds9/doc/ref/prefs.html
@@ -0,0 +1,34 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Preferences</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Preferences</h3>
+ <blockquote>
+ <p>Allows the user to customize the appearance and behavior of the
+ GUI . Please note: some preferences take effect immediately,
+ while others require DS9 to be restarted. Changes to the
+ preferences can be saved by selecting the <tt>Save</tt> button<tt>.
+ </tt>Use the <tt>Clear Preferences </tt>button to restore
+ default settings.</p>
+ <p>User preferences are stored in <tt>$HOME/.ds9.prf</tt>. DO NOT
+ EDIT this file, since it will be deleted or overwritten by DS9.
+ The file permissions must be group/world readonly.<br>
+ </p>
+ <p>Users may have several different preference files. DS9 looks
+ for a preference file with its own name. By default, if the
+ application is named <tt>ds9</tt>, it will look for <tt>.ds9.prf.</tt>
+ However, if the DS9 application is named <tt>foo</tt>, then DS9
+ will look for <tt>.foo.prf.</tt> In this manner, the user can
+ have several predefined preference files that are activated by
+ invoking DS9 with a different application names. </p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/print.html b/ds9/doc/ref/print.html
new file mode 100644
index 0000000..4ff3272
--- /dev/null
+++ b/ds9/doc/ref/print.html
@@ -0,0 +1,57 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Printing</title>
+ </head>
+ <body link="#0000ee" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Printing</h3>
+ <blockquote>
+ <p>DS9 provides strong Postscript printing support. This is not a
+ screen capture method, but a full level 1/2/3 postscript driver.
+ The postscript images generated are detailed and accurate as
+ possible, given the resolution of the data, and the printing
+ resolution. </p>
+ <p><b> Postscript Level</b></p>
+ <blockquote>
+ <p> Level 1-- The postscript generated consist of a color lookup
+ table and image data, encoded in <tt>ASCIIHEX</tt>. All line
+ graphics and text are postscript elements.</p>
+ <p> Level 2-- The postscript generated consist of a color lookup
+ table and image data, compressed with RLE, and encoded in <tt>ASCIIHEX85.
+
+
+
+
+ </tt>All line graphics and text are postscript elements.</p>
+ </blockquote>
+ <blockquote>
+ <p> Level 3-- The postscript generated consist of a color lookup
+ table and image data, compressed with GZIP<tt>. </tt>All line
+ graphics and text are postscript elements.</p>
+ </blockquote>
+ <p><b>Postscript Color Model</b></p>
+ <p>DS9 supports three color models for level 2/3 postscript. All
+ three color models generate approximately the same size files. </p>
+ <blockquote><tt> RGB<br>
+ CMYK<br>
+ Grayscale<br>
+ </tt></blockquote>
+ <p><b> Resolution</b></p>
+ <p>Unlike graphic elements, image data must be sampled when
+ encoded into postscript. The specified resolution parameter is
+ in "pixels per inch" and is independent of the current screen
+ resolution. A value of 96 maps to the current screen resolution.
+ Any value over 96 will over sample the image, while any value
+ under 96 will under sample. For high resolution printers and
+ posters, the higher resolution sampling, the better. However,
+ keep in mind the size of the postscript file grows with the
+ square of the increase in resolution.</p>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/region.html b/ds9/doc/ref/region.html
new file mode 100644
index 0000000..fcd8601
--- /dev/null
+++ b/ds9/doc/ref/region.html
@@ -0,0 +1,808 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>Regions</title>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ </head>
+ <body link="#0000ff" alink="#ff0000" bgcolor="#ffffff" text="#000000"
+ vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" height="98" align="middle"
+ width="100"> Regions</h3>
+ <blockquote>
+ <p>Regions provide a means for marking particular areas of an
+ image for further analysis. Regions may also be used for
+ presentation purposes. DS9 supports a number of region
+ descriptions, each of which may be edited, moved, rotated,
+ displayed, saved and loaded, via the GUI and XPA.</p>
+ <a href="#RegionDescriptions">Region Descriptions</a><br>
+ <a href="#RegionProperties">Region Properties</a><br>
+ <a href="#RegionFileFormat">Region File Format</a><br>
+ <a href="#CompositeRegion">Composite Region</a><br>
+ <a href="#TemplateRegion">Template Region</a><br>
+ <a href="#ExternalRegionFiles">External Region Files</a><br>
+ <p><b> <a name="RegionDescriptions"></a>Region Descriptions</b></p>
+ <p><tt>Circle<br>
+ Usage: circle x y radius<br>
+ </tt></p>
+ <p><tt>Ellipse<br>
+ Usage: ellipse x y radius radius angle<br>
+ </tt></p>
+ <p><tt>Box <br>
+ Usage: box x y width height angle<br>
+ </tt></p>
+ <p><tt>Polygon <br>
+ Usage: polygon x1 y1 x2 y2 x3 y3 ...<br>
+ </tt></p>
+ <p><tt>Point <br>
+ Usage: point x y #
+ point=[circle|box|diamond|cross|x|arrow|boxcircle] [size]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; circle point x y&nbsp;</tt></p>
+ <p><tt>Line <br>
+ Usage: line x1 y1 x2 y2 # line=[0|1] [0|1] </tt></p>
+ <p><tt>Vector <br>
+ Usage: vector x1 y1 length angle # vector=[0|1] </tt></p>
+ <p><tt>Text <br>
+ Usage: text x y # text={Your Text Here}<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text x y {Your Text Here}
+ </tt></p>
+ <p><tt>Ruler <br>
+ Usage: ruler x1 y1 x2 y2 #
+ ruler=[pixels|degrees|arcmin|arcsec]</tt></p>
+ <p><tt>Compass <br>
+ Usage: compass x1 y1 length # compass=&lt;coordinate
+ system&gt; &lt;north label&gt; &lt;east label&gt; [0|1] [0|1]
+ </tt></p>
+ <p><tt>Projection <br>
+ Usage: projection x1 y1 x2 y2 width</tt></p>
+ <p><tt>Annulus <br>
+ Usage: annulus x y inner outer n=# <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; annulus x y r1 r2 r3... </tt></p>
+ <p><tt>Ellipse Annulus <br>
+ Usage: ellipse x y r11 r12 r21 r22 n=# [angle]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ellipse x y r11 r12 r21
+ r22 r31 r32 ... [angle] </tt></p>
+ <p><tt>Box Annulus <br>
+ Usage: box x y w1 h1 w2 h2 [angle] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; box x y w1 h1 w2 h2 w3 h3
+ ... [angle] </tt></p>
+ <p><tt>Panda <br>
+ Usage: panda x y startangle stopangle nangle inner outer
+ nradius</tt></p>
+ <p><tt>Epanda <br>
+ Usage: epanda x y startangle stopangle nangle inner outer
+ nradius [angle]</tt></p>
+ <p><tt>Bpanda <br>
+ Usage: bpanda x y startangle stopangle nangle inner outer
+ nradius [angle]</tt></p>
+ <p><tt>Composite<br>
+ Usage: # composite x y angle</tt></p>
+ <p><b> <a name="RegionProperties"></a>Region Properties</b></p>
+ <p>Each region has a number of properties associated with the
+ region, which indicates how the region is to be rendered or
+ manipulated. Properties are defined for a region in the comment
+ section of the region description. The exception is the
+ Include/Exclude property. It is set via '+' or '-' preceding the
+ region. In addition, the Line, Point, and Ruler regions have
+ unique properties, not shared by others. Not all properties are
+ available via the GUI or are applicable for all regions. </p>
+ <blockquote>
+ <p><b> Text</b></p>
+ <p>All regions may have text associated with them. Use the text
+ property to set the text. Strings may be quoted with " or ' or
+ {}. For best results, use {}. Use <tt>textangle</tt> to
+ specify angle in degress based on current coordinate system
+ axes.<br>
+ </p>
+ <tt>Example: circle(100,100,20) # text={This message has both a
+ " and ' in it} textangle=30</tt>
+ <p><b> Color</b></p>
+ <p>The color property specifies the color of the region when
+ rendered. DS9 recognizes many symbolic color names (i.e.
+ "red", "green", "blue", "pink", etc) along with 3, 6, and 9
+ digit RGB hex values (#fff, #ffffff, #fffffffff)<br>
+ </p>
+ <tt>Example: <br>
+ circle(100,100,20) # color=green<br>
+ </tt><tt>circle(100,100,20) # color=#48f</tt>
+ <p><b>Dash List</b></p>
+ <p>Sets dashed line parameters. This does not render the region
+ in dashed lines.</p>
+ <tt>Example: circle(100,100,20) # dashlist=8 3</tt><br>
+ <p><b>Width</b></p>
+ <p>Sets the line width used to render the region.</p>
+ <tt>Example: circle(100,100,20) # width=2</tt><br>
+ <p><b>Font</b></p>
+ <p>The font property specifies the font family, size, weight,
+ and slant of any text to be displayed along with the region. </p>
+ <tt>Example: circle(100,100,20) # font="times 12 bold italic"</tt>
+ <p><b> Can Select</b></p>
+ <p>The Select property specifies if the user is allowed to
+ select (hence, edit) the region via the GUI. For Regions used
+ for catalogs and such, it is desirable that the user is unable
+ to edit, move, or delete the region.<br>
+ </p>
+ <tt>Example: circle(100,100,20) # select=1</tt><br>
+ <p><b>Can Highlite</b></p>
+ The Highlite property specifies if the edit handles become
+ visible when the region is selected.<br>
+ <tt>Example: circle(100,100,20) # hightlite=1</tt><br>
+ <p><b>Dash</b></p>
+ <p>Render region using dashed lines using current <tt>dashlist</tt>
+ value.</p>
+ <tt>Example: circle(100,100,20) # dash=1</tt><br>
+ <p><b>Fixed in Size</b></p>
+ <p>The Fixed in Size property specifies that the region does not
+ change in size as the image magnification factor changes. This
+ allows the user to build complex pointer type regions. </p>
+ <tt>Example: circle(100,100,20) # fixed=1</tt>
+ <p><b> Can Edit</b></p>
+ <p>The Edit property specifies if the user is allowed to edit
+ the region via the GUI. </p>
+ <tt>Example: circle(100,100,20) # edit=1</tt>
+ <p><b> Can Move</b></p>
+ <p>The Move property specifies if the user is allowed to move
+ the region via the GUI. </p>
+ <tt>Example: circle(100,100,20) # move=1</tt>
+ <p><b> Can Rotate</b></p>
+ <p>The Rotate property specifies if the user is allowed to
+ rotate the region via the GUI. </p>
+ <tt>Example: circle(100,100,20) # rotate=1</tt>
+ <p><b> Can Delete</b></p>
+ <p>The Delete property specifies if the user is allowed to
+ delete the region via the GUI. </p>
+ <tt>Example: circle(100,100,20) # delete=1</tt>
+ <p><b> Include/Exclude</b></p>
+ <p>The Include/Exclude properties flags the region with a
+ boolean <tt>NOT </tt>for later analysis. Use '+' for include
+ (default), '-' for exclude. </p>
+ <tt>Example: -circle(100,100,20)<br>
+ </tt>
+ <p><b>Source/Background</b></p>
+ <p>The Source/Background properties flag the region for use with
+ other analysis applications. The default is <tt>source</tt></p>
+ <tt>Example: circle(100,100,20) # source<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;circle(200,200,10)
+ # background</tt><br>
+ <p><b>Tag</b></p>
+ <p>All regions may have zero or more tags associated with it,
+ which may be used for grouping and searching. </p>
+ <tt>Example:&nbsp; circle(100,100,20) # tag={Group 1} tag={Group
+ 2}</tt>
+ <p><b> Line</b></p>
+ <p>The line region may be rendered with arrows, one at each end.
+ To indicate arrows, use the line property. A '1' indicates an
+ arrow, '0' indicates no arrow. </p>
+ <tt>Example: line(100,100,200,200) # line=1 1</tt>
+ <p><b> Ruler</b></p>
+ <p>The ruler region may display information in 'pixels',
+ 'degrees', 'arcmin', or 'arcsec'. Use the ruler property to
+ indicate which format to display distances in. </p>
+ <tt>Example: ruler(100,100,200,200) # ruler=arcmin</tt>
+ <p><b> Point</b></p>
+ <p>Point regions have an associated type and size. Use the point
+ property to set the point type. </p>
+ <tt>Example: point(100,100) # point=diamond 31</tt>
+ <p><b> Default Properties</b></p>
+ <p>The default properties are: </p>
+ <blockquote> <tt>text={}</tt> <br>
+ <tt>color=green</tt> <br>
+ <tt>font="helvetica 10 normal roman"</tt> <br>
+ <tt>select=1</tt> <br>
+ <tt>edit=1</tt> <br>
+ <tt>move=1</tt> <br>
+ <tt>delete=1</tt> <br>
+ <tt>highlite=1</tt> <br>
+ <tt>include=1</tt> <br>
+ <tt>fixed=0</tt> </blockquote>
+ </blockquote>
+ <p><b><a name="RegionFileFormat"></a>Region File Format</b></p>
+ <blockquote>
+ <p><b> Syntax</b></p>
+ <p>Region arguments may be separated with either a comma or
+ space. Optional parentheses may be used a the beginning and
+ end of a description. </p>
+ <blockquote> <tt>circle 100 100 10</tt> <br>
+ <tt>circle(100 100 10)</tt> <br>
+ <tt>circle(100,100,10)</tt> </blockquote>
+ <p><b> Comments</b></p>
+ <p>All lines that begin with <tt>#</tt> are comments and will
+ be ignored.</p>
+ <blockquote> <tt># This is a comment</tt> </blockquote>
+ <p><b> Delimiter</b></p>
+ <p>All lines may be delimited with either a new-line or
+ semi-colon. </p>
+ <blockquote> <tt>circle 100 100 10</tt> <br>
+ <tt>ellipse 200 200 20 40 ; box 300 300 20 40</tt> </blockquote>
+ <p><b> Header</b></p>
+ <p>A DS9 region file may start with the following optional
+ header: </p>
+ <blockquote> <tt># Region file format: DS9 version 4.0</tt> </blockquote>
+ <p><b> Global Properties</b></p>
+ <p>Global properties affect all regions unless a local property
+ is specified. The <tt>global</tt> keyword is first, followed
+ by a list of keyword = value pairs. Multiple global property
+ lines may be used within a region file. </p>
+ <blockquote> <tt>global color=green font="helvetica 10 normal
+ roman" edit=1 move=1 delete=1 highlite=1 include=1 wcs=wcs</tt>
+ </blockquote>
+ <p><b> Local Properties</b></p>
+ <p>Local properties start with a # after a region description
+ and only affect the region it is specified with. </p>
+ <blockquote> <tt>physical;circle(504,513,20) # color=red
+ text={This is a Circle}</tt> </blockquote>
+ <p><b> Coordinate Systems</b></p>
+ <p>For each region, it is important to specify the coordinate
+ system used to interpret the region, i.e., to set the context
+ in which the position and size values are interpreted. For
+ this purpose, the following keywords are recognized: </p>
+ <blockquote>
+ <blockquote> <tt>PHYSICAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of original file using LTM/LTV</tt> <br>
+ <tt>IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of current file</tt> <br>
+ <tt><tt><tt>FK4,B1950&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &nbsp;
+ # sky coordinate systems</tt> <br>
+ FK5,J2000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ </tt><tt><tt><tt>ICRS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+ sky coordinate systems</tt> <br>
+ </tt>GALACTIC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ <tt>ECLIPTIC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ <tt>WCS&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp;&nbsp; # primary WCS<br>
+ </tt><tt>WCSA &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #
+ secondary WCS<br>
+ </tt><tt>LINEAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ linear primary WCS</tt> <tt><br>
+ </tt></blockquote>
+ <tt></tt> </blockquote>
+ <p><b> Mosaic Images</b></p>
+ <p>While some coordinate systems are unique across mosaic
+ images, others coordinate systems, such as <tt>image</tt>, or
+ <tt>physical</tt> , are valid on a per segment basis. In this
+ case, use <tt>tile</tt> to specify which header to use in all
+ coordinate conversions. The default is the first header, or <tt>tile
+
+
+
+
+
+
+
+ 1</tt>. </p>
+ <tt>Example: tile 2;fk5;point(100,100)</tt>
+ <p><b> Multiple WCS</b></p>
+ <p>If an image has multiple wcs's defined, use <tt>wcs#</tt> to
+ specify which wcs to use for all wcs references. Valid values
+ are <tt>wcs, wcsa, wcsb, wcsc... wcsz.</tt><br>
+ <tt>Example: wcsa;linear;point(100,100) # point=diamond</tt></p>
+ <p><b> Specifying Positions and Sizes</b></p>
+ <p>The arguments to region shapes can be floats or integers
+ describing positions and sizes. They can be specified as pure
+ numbers or using explicit formatting directives: </p>
+ <blockquote>
+ <p><b>position arguments</b> </p>
+ <tt>[num]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ context-dependent (see below)</tt> <br>
+ <tt>[num]d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ degrees</tt> <br>
+ <tt>[num]r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ radians</tt> <br>
+ <tt>[num]p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ physical pixels</tt> <br>
+ <tt>[num]i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ image pixels</tt> <br>
+ <tt>[num]:[num]:[num]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
+ hms for 'odd' position arguments</tt> <br>
+ <tt>[num]:[num]:[num]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
+ dms for 'even' position arguments</tt> <br>
+ <tt>[num]h[num]m[num]s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
+ explicit hms</tt> <br>
+ <tt>[num]d[num]m[num]s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
+ explicit dms</tt>
+ <p><b>size arguments</b> </p>
+ <tt>[num]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ context-dependent (see below)</tt> <br>
+ <tt>[num]"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ arc sec</tt> <br>
+ <tt>[num]'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ arc min</tt> <br>
+ <tt>[num]d&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ degrees</tt> <br>
+ <tt>[num]r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ radians</tt> <br>
+ <tt>[num]p&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ physical pixels</tt> <br>
+ <tt>[num]i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ image pixels</tt>
+ <p></p>
+ </blockquote>
+ <p>When a "pure number" (i.e. one without a format directive
+ such as 'd' for 'degrees') is specified, its interpretation
+ depends on the context defined by the 'coordsys' keyword. In
+ general, the rule is: </p>
+ <p><i>All pure numbers have implied units corresponding to the
+ current coordinate system.</i> </p>
+ <p>If no such system is explicitly specified, the default system
+ is implicitly assumed to be <tt>PHYSICAL</tt>. In practice
+ this means that for <tt>IMAGE</tt> and <tt>PHYSICAL</tt>
+ systems, pure numbers are pixels. Otherwise, for all systems
+ other than linear, pure numbers are degrees. For <tt>LINEAR</tt>
+ systems, pure numbers are in the units of the linear system.
+ This rule covers both positions and sizes. The input values to
+ each shape can be specified in several coordinate systems
+ including: </p>
+ <blockquote> <tt>IMAGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of current file</tt> <br>
+ <br>
+ <tt>LINEAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ linear wcs as defined in file</tt>
+ <p><tt>FK4,
+ B1950&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ sky coordinate systems</tt> <br>
+ <tt>FK5, J2000</tt> <br>
+ <tt>GALACTIC</tt> <br>
+ <tt>ECLIPTIC</tt> <br>
+ <tt>ICRS</tt> <br>
+ <tt>PHYSICAL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ pixel coords of original file using LTM/LTV</tt> <br>
+ <tt>AMPLIFIER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ mosaic coords of original file using ATM/ATV</tt> <br>
+ <tt>DETECTOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+#
+
+
+
+
+
+
+
+
+ mosaic coords of original file using DTM/DTV</tt><br>
+ <br>
+ <tt>WCS,WCSA-WCSZ&nbsp;&nbsp; &nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp;&nbsp; # specify which WCS system to be
+ used for <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #
+ linear and sky coordinate systems<br>
+ </tt></p>
+ </blockquote>
+ <p>If no coordinate system is specified, <tt>PHYSICAL</tt> is
+ assumed. <tt>PHYSICAL</tt> or a World Coordinate System such
+ as <tt>J2000</tt> is preferred and most general. The
+ coordinate system specifier should appear at the beginning of
+ the region description, on a separate line (in a file), or
+ followed by a new-line or semicolon; e.g., </p>
+ <blockquote> <tt>image; circle 100 100 10</tt> <br>
+ <tt>physical; ellipse 200 200 10 20</tt> <br>
+ <tt>fk5; point 30 50</tt><br>
+ <tt>wcsa; fk4; point 202 47</tt><br>
+ <tt>wcsp; linear; point 100 100</tt><br>
+ </blockquote>
+ <p>The use of celestial input units automatically implies WORLD
+ coordinates of the reference image. Thus, if the world
+ coordinate system of the reference image is <tt>J2000</tt>,
+ then</p>
+ <blockquote> <tt>circle 10:10:0 20:22:0 3'</tt> </blockquote>
+ <p>is equivalent to: <br>
+ </p>
+ <blockquote> <tt>j2000; circle 10:10:0 20:22:0 3'</tt> </blockquote>
+ <p>Note that by using units as described above, you may mix
+ coordinate systems within a region specifier; e.g., </p>
+ <blockquote> <tt>physical; circle 6500 9320 3'<br>
+ </tt></blockquote>
+ <p>Note that, for regions which accept a rotation angle such as:
+ </p>
+ <blockquote> <tt>ellipse (x, y, r1, r2, angle)<br>
+ box(x, y, w, h, angle)</tt>
+ <p></p>
+ </blockquote>
+ <p>the angle is relative to the specified coordinate system. In
+ particular, if the region is specified in WCS coordinates, the
+ angle is related to the WCS system, not x/y image coordinate
+ axis. For WCS systems with no rotation, this obviously is not
+ an issue. However, some images do define an implicit rotation
+ (e.g., by using a non-zero CROTA value in the WCS parameters)
+ and for these images, the angle will be relative to the WCS
+ axes. In such case, a region specification such as:</p>
+ <blockquote> <tt>fk4;ellipse(22:59:43.985, +58:45:26.92,320",
+ 160", 30)</tt> </blockquote>
+ <p>will not, in general, be the same region specified as:</p>
+ <blockquote> <tt>physical;ellipse(465, 578, 40, 20, 30)</tt> </blockquote>
+ <p>even when positions and sizes match. The angle is relative to
+ WCS axes in the first case, and relative to physical x,y axes
+ in the second.</p>
+ </blockquote>
+ <p><b><a name="CompositeRegion"></a>Composite Region</b></p>
+ <p>A Composite Region is a region which is a collection of other
+ regions, which share common properties. A composite region is
+ composed of a center point and a rotation angle, of which all
+ its members are rendered in reference to. A composite region is
+ defined by the # composite x y angle declaration followed by a
+ number of regions who are or'd together. A composite region is
+ manipulated as a single region within ds9. A composite region
+ maybe created from the current selection of regions by selecting
+ the Create Composite Region menu option. Likewise, a composite
+ region can be dissolved by selecting the Dissolve Composite
+ Region menu option.</p>
+ <p><b> <a name="TemplateRegion"></a>Template Region</b></p>
+ <p>A Template Region is a special form of a region which is saved
+ in a special wcs coordinate system WCS0. WCS0 indicates that the
+ ra and dec values are relative to the current WCS location, not
+ absolute. A template region can be loaded at any location into
+ any fits image which contains a valid wcs. For example, a user
+ may create a series of regions, which represent an instrument
+ template. Then, by selecting the Save As Template menu option, a
+ template region saved. The user may now load this templated into
+ any other fits image which contains a valid WCS. </p>
+ <p><b> <a name="ExternalRegionFiles"></a>External Region Files</b></p>
+ <p>DS9 can read and write a number of region file formats. Not all
+ formats support all the functionality of DS9 regions. Therefore,
+ the user may loose some information when writing and then
+ reading back from a region file in a format other that DS9. On
+ output, the regions File Format menu or the <a
+ href="xpa.html#regions">XPA</a> regions point is used specify
+ the output coordinate system and format. On input, the menu or
+ xpa point is used only for the <tt>X Y </tt>format. For all
+ other formats, the input coordinate system is specified in the
+ regions file itself. </p>
+ <blockquote>
+ <p><b> <a name="FUNTools"></a><a
+ href="http://hea-www.harvard.edu/RD/funtools/regions.html">Funtools</a></b><tt></tt><br>
+ </p>
+ <blockquote> <tt>When using DS9 regions file in FUNTOOLS:<br>
+ LINE is ignored<br>
+ </tt> <tt>VECTOR is ignored</tt> <br>
+ <tt>PROJECTION is ignored<br>
+ SEGMENT is ignored<br>
+ TEXT is ignored<br>
+ </tt> <tt>RULER is ignored</tt><br>
+ <tt>COMPASS is ignored</tt><br>
+ </blockquote>
+ <a name="Ciao"></a>CIAO
+ <blockquote> <tt><tt>When importing from CIAO into DS9:<br>
+ POINT is translated into BOX CIRCLE POINT</tt><br>
+ </tt><tt>ROTBOX is translated into BOX<br>
+ RECTANGLE is translated into BOX<br>
+ </tt><tt>PANDA is translated as PIE<br>
+ SECTOR is ignored<br>
+ FIELD is ignored</tt><br>
+ <tt><tt>REGION is ignored<br>
+ </tt><br>
+ When exporting from DS9 into CIAO:<br>
+ </tt> <tt>PANDA is translated into PIE<br>
+ LINE is ignored</tt><br>
+ <tt>VECTOR is ignored</tt> <br>
+ <tt><tt>PROJECTION is ignored</tt><br>
+ </tt><tt><tt>SEGMENT is ignored<br>
+ </tt></tt><tt><tt>TEXT is ignored</tt><br>
+ RULER is ignored</tt><br>
+ <tt>COMPASS is ignored</tt><br>
+ <tt>ELLIPSE ANNULUS is ignored</tt><br>
+ <tt>BOX ANNULUS is ignored</tt><br>
+ <tt>EPANDA is ignored</tt><br>
+ <tt>BPANDA is ignored</tt><br>
+ </blockquote>
+ <a name="SAOimage"></a><a
+ href="http://tdc-www.harvard.edu/software/saoimage/saoimage.region.html">SAOimage</a>
+ <blockquote> <tt><tt><tt>When importing from SAOIMAGE into DS9:<br>
+ POINT is translated into BOX CIRCLE POINT</tt></tt></tt><br>
+ <tt><tt><tt><tt>ROTBOX is translated into BOX<br>
+ </tt></tt> </tt></tt><tt><br>
+ </tt><tt><tt>When exporting from DS9 into SAOIMAGE:<br>
+ </tt> </tt><tt><tt><tt>LINE is ignored</tt><br>
+ <tt>VECTOR is ignored</tt> <br>
+ <tt><tt>PROJECTION is ignored</tt><br>
+ </tt><tt><tt>SEGMENT is ignored<br>
+ </tt></tt><tt><tt>TEXT is ignored</tt><br>
+ RULER is ignored</tt><br>
+ <tt>COMPASS is ignored</tt><br>
+ </tt></tt><tt><tt>ELLIPSE ANNULUS is ignored</tt><br>
+ <tt>BOX ANNULUS is ignored</tt><br>
+ PANDA is ignored</tt><br>
+ <tt>EPANDA is ignored</tt><br>
+ <tt>BPANDA is ignored</tt><br>
+ </blockquote>
+ <a name="IRAFPROS"></a>IRAF PROS
+ <blockquote> <tt><tt><tt><tt>When importing from PROS into DS9:<br>
+ POINT is translated into BOX CIRCLE POINT</tt></tt></tt><br>
+ </tt><tt><tt><tt><tt>ROTBOX is translated into BOX<br>
+ </tt></tt> </tt></tt><tt><br>
+ </tt><tt><tt><tt>When exporting from DS9 into SAOIMAGE:<br>
+ </tt> </tt><tt><tt><tt>LINE is ignored</tt><br>
+ <tt>VECTOR is ignored</tt> <br>
+ <tt><tt>PROJECTION is ignored</tt><br>
+ </tt><tt><tt>SEGMENT is ignored<br>
+ </tt></tt><tt><tt>TEXT is ignored</tt><br>
+ RULER is ignored</tt><br>
+ <tt>COMPASS is ignored</tt><br>
+ </tt></tt><tt><tt>ELLIPSE ANNULUS is ignored</tt><br>
+ <tt>BOX ANNULUS is ignored</tt><br>
+ PANDA is ignored</tt><br>
+ <tt>EPANDA is ignored</tt><br>
+ <tt>BPANDA is ignored</tt></tt><br>
+ </blockquote>
+ <a name="FITSREGIONBinaryTable"></a>FITS REGION Binary Table
+ <blockquote> <tt><tt><tt><tt><tt>When importing from FITS
+ REGION into DS9:<br>
+ POINT is translated into BOX CIRCLE POINT</tt></tt></tt><br>
+ </tt><tt><tt><tt><tt>ROTBOX is translated into BOX</tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>RECTANGLE is translated into BOX</tt><br>
+ <tt>ROTRECTANGLE is translated into a BOX</tt><br>
+ <tt>PIE is translated into PANDA<br>
+ ELLIPTANNULUS is translated into EPANDA<br>
+ SECTOR is ignored<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>FIELD
+
+ is ignored</tt><br>
+ </tt><tt>DIAMOND</tt><tt><tt> is ignored<br>
+ </tt>RHOMBUS</tt><tt><tt> is ignored<br>
+ </tt>ROTDIAMOND</tt><tt><tt> is ignored<br>
+ </tt>ROTRHOMBUS</tt><tt> is ignored<br>
+ </tt>&nbsp;</tt></tt></tt></tt><tt><br>
+ </tt>DS9 currently can not export into this format.</tt><br>
+ </blockquote>
+ <a name="XY"></a>X Y <br>
+ <p>This format consists of a number of coordinate pairs, one per
+ line. The coordinate format for both input and output is
+ specified via the Save Regions Parameters menu or <a
+ href="xpa.html#regions">XPA</a> regions point. The first two
+ coordinates are read, the rest of the line is ignored. The
+ comment character '#' may be used at the beginning of line and
+ the line is ignored. This format is very useful for reading in
+ coordinates from other external analysis programs, such as
+ IRAF. </p>
+ <blockquote> <tt>Example:</tt> <tt># this is a comment</tt> <br>
+ <tt>physical # this overrides the specified coordinate system</tt><br>
+ <tt>300 300</tt> <br>
+ <tt>400 400 # this is a comment</tt> <br>
+ </blockquote>
+ </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/samp.html b/ds9/doc/ref/samp.html
new file mode 100644
index 0000000..485d76e
--- /dev/null
+++ b/ds9/doc/ref/samp.html
@@ -0,0 +1,6367 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>SAMP</title>
+ </head>
+ <body alink="#ff0000" link="#0000ff" vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> SAMP</h3>
+ <blockquote>
+ <p>SAMP is a messaging protocol that enables astronomy software
+ tools to interoperate and communicate. Broadly speaking, SAMP is
+ an abstract framework for loosely-coupled, asynchronous,
+ RPC-like and/or event-based communication, based on a central
+ service providing multi-directional publish/subscribe message
+ brokering. The message semantics are extensible and use
+ structured but weakly-typed data. For more information on SAMP,
+ please click <a
+ href="http://www.ivoa.net/Documents/latest/SAMP.html">here</a>.</p>
+ <p>The samp implementation for DS9 is based on the <a
+ href="xpa.html">XPA</a> model with 2 private calls:</p>
+ <tt> ds9.get<br>
+ &nbsp;&nbsp;&nbsp; Arguments<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cmd (string) required<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; url (string) optional<br>
+ &nbsp;&nbsp;&nbsp; Returned value<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OK (samp.result map)<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; value
+ (string) optional<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; url (string) optional<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ERROR (samp.error map)<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ samp.errortxt (string)<br>
+ &nbsp;<br>
+ ds9.set<br>
+ &nbsp;&nbsp;&nbsp; Arguments<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cmd (string) required<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; url (string) optional<br>
+ &nbsp;&nbsp;&nbsp; Returned value<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OK<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ERROR (samp.error map)<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ samp.errortxt (string)<br>
+ </tt>
+ <p><tt>ds9.set</tt> maybe called via notification, call and
+ call/wait. <tt>ds9.get</tt> can only be called via call and
+ call/wait. Most of the <tt>ds9.get</tt> calls return a value
+ string, but a few will return a url instead.</p>
+ <tt> <a href="#2mass">2mass</a><br>
+ <a href="#3d">3d</a><br>
+ <a href="#about">about</a><br>
+ <a href="#analysis">analysis</a><br>
+ <a href="#array">array</a><br>
+ <a href="#background">background</a><br>
+ <a href="#backup">backup</a><br>
+ <a href="#bin">bin</a><br>
+ <a href="#blink">blink</a><br>
+ <a href="#block">block</a><br>
+ <a href="#catalog">catalog</a><br>
+ <a href="#cd">cd</a><br>
+ <a href="#cmap">cmap</a><br>
+ <a href="#colorbar">colorbar</a><br>
+ <a href="#console">console</a><br>
+ <a href="#contour">contour</a><br>
+ <a href="#crop">crop</a><br>
+ <a href="#crosshair">crosshair</a><br>
+ <a href="#cube">cube</a><br>
+ <a href="#cursor">cursor</a><br>
+ <a href="#data">data</a><br>
+ <a href="#dsssao">dsssao</a><br>
+ <a href="#dsseso">dsseso</a><br>
+ <a href="#dssstsci">dssstsci</a><br>
+ <a href="#envi">envi</a><br>
+ <a href="#exit">exit</a><br>
+ <a href="#export">export</a><br>
+ <a href="#file">file</a><br>
+ <a href="#fits">fits</a><br>
+ <a href="#frame">frame</a><br>
+ <a href="#gif">gif</a><br>
+ <a href="#grid">grid</a><br>
+ <a href="#header">header</a><br>
+ <a href="#height">height</a><br>
+ <a href="#iconify">iconify</a><br>
+ </tt><tt><tt><a href="#iexam">iexam</a><br>
+ </tt><a href="#iis">iis</a><br>
+ <a href="#jpeg">jpeg</a><br>
+ <a href="#lock">lock</a><br>
+ <a href="#lower">lower</a><br>
+ <a href="#magnifier">magnifier</a><br>
+ <a href="#mask">mask</a><br>
+ <a href="#match">match</a><br>
+ <a href="#mecube">mecube</a><br>
+ <a href="#minmax">minmax</a><br>
+ <a href="#mode">mode</a><br>
+ <a href="#mosaic">mosaic</a><br>
+ <a href="#mosaicimage">mosaicimage</a><br>
+ <a href="#movie">movie</a><br>
+ <a href="#multiframe">multiframe</a><br>
+ <a href="#nameserver">nameserver</a><br>
+ <a href="#nan">nan</a><br>
+ <a href="#nrrd">nrrd</a><br>
+ <a href="#nvss">nvss</a><br>
+ <a href="#orient">orient</a><br>
+ <a href="#pagesetup">pagesetup</a><br>
+ <a href="#pan">pan</a><br>
+ <a href="#pixeltable">pixeltable</a><br>
+ <a href="#plot">plot</a><br>
+ <a href="#png">png</a><br>
+ <a href="#prefs">prefs</a><br>
+ <a href="#preserve">preserve</a><br>
+ <a href="#psprint">psprint</a><br>
+ <a href="#print">print</a><br>
+ <a href="#exit">quit</a><br>
+ <a href="#raise">raise</a><br>
+ <a href="#regions">regions</a><br>
+ <a href="#restore">restore</a><br>
+ <a href="#rgb">rgb</a><br>
+ <a href="#rgbarray">rgbarray</a><br>
+ <a href="#rgbcube">rgbcube</a><br>
+ <a href="#rgbimage">rgbimage</a><br>
+ <a href="#rotate">rotate</a><br>
+ <a href="#samp">samp</a><br>
+ <a href="#save">save</a><br>
+ <a href="#saveimage">saveimage</a><br>
+ <a href="#scale">scale</a><br>
+ <a href="#shm">shm</a><br>
+ </tt><tt><tt><a href="#sia">sia</a><br>
+ </tt><a href="#single">single</a><br>
+ <a href="#skyview">skyview</a><br>
+ <a href="#sleep">sleep</a><br>
+ <a href="#smooth">smooth</a><br>
+ <a href="#source">source</a><br>
+ <a href="#tcl">tcl</a><br>
+ <a href="#threads">threads</a><br>
+ <a href="#tiff">tiff</a><br>
+ <a href="#tile">tile</a><br>
+ <a href="#update">update</a><br>
+ <a href="#url">url</a><br>
+ <a href="#version">version</a><br>
+ <a href="#view">view</a><br>
+ <a href="#vla">vla</a></tt><br>
+ <tt><tt><a href="#vlss">vlss</a><br>
+ </tt> <a href="#vo">vo</a><br>
+ <a href="#wcs">wcs</a><br>
+ <a href="#web">web</a><br>
+ <a href="#width">width</a><br>
+ <a href="#zscale">zscale</a><br>
+ <a href="#zoom">zoom</a><br>
+ </tt>
+ <p><b> <a name="2mass"></a>2mass</b></p>
+ <p>Support for 2MASS Digital Sky Survey.</p>
+ <tt> Syntax: <br>
+ 2mass []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [survey j|h|k]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ 2mass name <br>
+ 2mass coord <br>
+ 2mass size<br>
+ 2mass save<br>
+ 2mass frame<br>
+ 2mass survey <br>
+ ds9.set(string cmd)<br>
+ 2mass<br>
+ 2mass m31 <br>
+ 2mass name m31 <br>
+ 2mass coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ 2mass size 60 60 arcmin<br>
+ 2mass save yes<br>
+ 2mass frame current<br>
+ 2mass update frame<br>
+ 2mass survey j<br>
+ 2mass open<br>
+ 2mass close<br>
+ </tt>
+ <p><b> <a name="3d"></a>3d</b></p>
+ <p>Support for 3D frame.</p>
+ <tt> Syntax: <br>
+ </tt><tt>3d []<br>
+ &nbsp;&nbsp; [view &lt;az&gt; &lt;el&gt;]<br>
+ &nbsp;&nbsp; [az &lt;az&gt;]<br>
+ &nbsp;&nbsp; [el &lt;el&gt;]<br>
+ &nbsp;&nbsp; [scale &lt;scale&gt;]<br>
+ &nbsp;&nbsp; [method mip|aip]</tt><br>
+ <tt><tt>&nbsp;&nbsp; [background none|azimuth|elevation]<br>
+ </tt>&nbsp;</tt><tt>&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp; [border color &lt;color&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; [highlite yes|no]<br>
+ &nbsp;&nbsp; [hightlite color &lt;color&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; [open|close]</tt><tt><br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ </tt><tt>3d view<br>
+ 3d az<br>
+ 3d el<br>
+ 3d scale<br>
+ 3d method</tt><br>
+ <tt>3d background<br>
+ </tt><tt>3d border<br>
+ 3d border color<br>
+ </tt> <tt> </tt><tt>3d highlite<br>
+ 3d highlite color<br>
+ </tt> <tt> ds9.set(string cmd)<br>
+ </tt><tt>3d # create new 3D frame<br>
+ 3d view 45 30<br>
+ 3d az 45<br>
+ 3d el 30<br>
+ 3d scale 10<br>
+ 3d method mip</tt><br>
+ <tt>3d background azimuth<br>
+ </tt><tt>3d border yes<br>
+ 3d border color red<br>
+ </tt><tt>3d highlite yes<br>
+ 3d highlite color red<br>
+ 3d open<br>
+ 3d close</tt><br>
+ <p><b><a name="about"></a>about</b></p>
+ <p>Get DS9 credits.</p>
+ <tt> Syntax: <br>
+ about <br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ about<br>
+ </tt>
+ <p><b> <a name="align"></a>align</b></p>
+ <p>Controls the World Coordinate System alignment for the current
+ frame.</p>
+ <tt> Syntax: <br>
+ align []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd) <br>
+ </tt>align<br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>align yes</tt><br>
+ <p><b> <a name="analysis"></a>analysis</b></p>
+ <p>Control external analysis tasks. Tasks are numbered as they are
+ loaded, starting with 0. Can also be used to display a message
+ and display text in the text dialog window. </p>
+ <tt> Syntax: <br>
+ analysis [&lt;task number&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [task &lt;task
+ number&gt;|&lt;task name&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear][load
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [message
+ ok|okcancel|yesno &lt;message&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [entry
+ &lt;message&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [text]</tt><tt><tt><tt><tt><tt><br>
+ </tt></tt> &nbsp; </tt></tt> <br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ analysis<br>
+ analysis task<br>
+ analysis entry Please enter something<br>
+ analysis entry okcancel Please enter something<br>
+ ds9.set(string cmd)<br>
+ analysis 0 # invoke first analysis task<br>
+ analysis task 0<br>
+ analysis task foobar<br>
+ analysis task {foo bar}<br>
+ analysis my.ans<br>
+ analysis load my.ans <br>
+ analysis clear <br>
+ analysis clear load my.ans<br>
+ analysis message ok {This is a message}<br>
+ analysis text {this is text}</tt><tt><tt><br>
+ </tt> ds9.set(string cmd, string url)<br>
+ analysis load <br>
+ analysis text</tt><b><br>
+ </b>
+ <p><b> <a name="array"></a>array</b></p>
+ <p>Load raw data array into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ array [native|big|little]<br>
+ array [new|mask]
+[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],zdim=&lt;z&gt;,bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string url = ds9.get(string cmd)<br>
+ </tt>array<br>
+ array little<br>
+ </tt><tt><tt>ds9.set(string command, string url)<br>
+ </tt>array foo.arr[dim=512,bitpix=-32,endian=little]<br>
+ array new foo.arr[dim=512,bitpix=</tt><tt>-32,endian=little]</tt><br>
+ <tt><tt>array mask foo.arr[dim=512,bitpix=</tt></tt><tt>-32,endian=little]</tt><tt><br>
+ </tt>
+ <p><b> <a name="background"></a>bg<br>
+ background</b></p>
+ <p>Set image background color. </p>
+ <tt> Syntax: <br>
+ bg &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt>string url = ds9.get(string cmd)</tt><tt><br>
+ bg<br>
+ </tt><tt>ds9.set(string cmd)<br>
+ </tt><tt>bg red</tt><tt><br>
+ <tt>bg red</tt></tt><br>
+ <p><b> <a name="backup"></a>backup</b></p>
+ <p>Create a backup save set. </p>
+ <tt> Syntax: <br>
+ backup &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt>ds9.set(string cmd)<br>
+ </tt><tt>backup ds9.bck</tt><br>
+ <p><b> <a name="bin"></a>bin</b></p>
+ <p>Controls binning factor, binning buffer size, and&nbsp; binning
+ function for binning FITS bin tables. The access point blocking
+ is provided for backward compatibility. </p>
+ <tt> Syntax: <br>
+ bin [about &lt;x&gt; &lt;y&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [about center]<br>
+ &nbsp;&nbsp;&nbsp; [buffersize &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [cols &lt;x&gt; &lt;y&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [colsz &lt;x&gt; &lt;y&gt; &lt;z&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [factor &lt;value&gt; [&lt;vector&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [depth &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [filter &lt;string&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [function average|sum] <br>
+ &nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ bin about<br>
+ bin buffersize<br>
+ bin cols<br>
+ bin factor<br>
+ bin depth<br>
+ bin filter<br>
+ bin function<br>
+ bin smooth<br>
+ bin smooth function<br>
+ bin smooth radius<br>
+ bin lock<br>
+ ds9.set(string cmd)<br>
+ bin about 4096 4096<br>
+ bin about center<br>
+ bin buffersize 512<br>
+ bin cols detx dety<br>
+ bin colsz detx dety time<br>
+ bin factor 4<br>
+ bin factor 4 2<br>
+ bin depth 10<br>
+ bin filter 'pha &gt; 5'<br>
+ bin filter ''<br>
+ bin function sum<br>
+ bin in<br>
+ bin out<br>
+ bin to fit<br>
+ bin match<br>
+ bin lock yes<br>
+ bin open<br>
+ bin close<br>
+ </tt>
+ <p><b> <a name="blink"></a>blink</b></p>
+ <p>Blink mode parameters. Interval is in seconds. <br>
+ </p>
+ <tt> Syntax: <br>
+ blink []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;value&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ blink<br>
+ blink interval<br>
+ ds9.set(string cmd)<br>
+ blink<br>
+ blink yes<br>
+ blink interval 1</tt><br>
+ <p><b> <a name="block"></a>block</b></p>
+ <p>Controls blocking parameters. </p>
+ <tt> Syntax: <br>
+ block</tt><tt><tt> [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>block<br>
+ block lock<br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt></tt><tt><tt><tt>block</tt></tt> 4<br>
+ </tt><tt><tt><tt>block</tt></tt> 4 2<br>
+ </tt><tt><tt><tt><tt><tt>block</tt></tt> to 4<br>
+ </tt><tt><tt><tt>block</tt></tt> to 4 2<br>
+ </tt></tt><tt><tt><tt>block</tt></tt> in<br>
+ </tt></tt><tt><tt><tt><tt><tt>block</tt></tt> out<br>
+ </tt></tt></tt><tt><tt><tt>block</tt></tt> to fit<br>
+ </tt><tt><tt><tt>block</tt></tt> match<br>
+ </tt><tt><tt><tt>block</tt></tt> lock yes<br>
+ </tt><tt><tt><tt>block</tt></tt> open<br>
+ </tt><tt><tt><tt>block</tt></tt> close</tt><tt><br>
+ </tt>
+ <p><b> <a name="catalog"></a>catalog<br>
+ cat<br>
+ </b></p>
+ <p>Support for catalogs. The first three commands will create a
+ new catalog search. All other commands operated on the last
+ search created, unless indicated otherwise.</p>
+ <tt> Syntax:<br>
+ </tt><tt>catalog []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ned|simbad|denis|skybot]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ascss|cmc|gsc1|gsc2|gsc3|ac|nomad|ppmx|sao|sdss5|sdss6|</tt><tt>sdss7|sdss8|</tt><tt>tycho|ua2|ub1|ucac2]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2mass|iras]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [csc|xmm|rosat]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [first|nvss]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [chandralog|cfhtlog|esolog|stlog|xmmlog]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [cds &lt;catalogname&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cds
+ &lt;catalogid&gt;]<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [import sb|tsv
+ &lt;filename&gt;]<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [allcols]<br>
+ </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
+ [&lt;ref&gt;] [allrows]<br>
+ &nbsp;</tt><tt>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [clear]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [coordinate &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [dec
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [edit
+ yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [export sb|tsv &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [filter &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [filter load
+ &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [header]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [hide]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [location
+ &lt;code&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [match &lt;ref&gt; &lt;ref&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match error &lt;value&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match function 1and2|1not2|2not1]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match return 1and2|1only|2only]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match unique yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [maxrows
+ &lt;number&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [name
+ &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [panto yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [plot
+ &lt;xcol&gt; &lt;ycol&gt; &lt;xerrcol&gt; &lt;yerrcol&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psky
+ &lt;skyframe&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psystem
+ &lt;coordsys&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [ra
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [regions]</tt><br>
+ <tt> </tt><tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [&lt;ref&gt;] [retrieve]</tt><br>
+ <tt> </tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [samp]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ broadcast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ send &lt;application&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [save &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [server cds|sao|cadc|adac|iucaa|bejing|cambridge|ukirt]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [show]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [sky &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [skyformat &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [sort
+ &lt;col&gt; incr|decr]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ [#]
+ condition|shape|color|text|font|fontsize|fontweight|fontslant
+ &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol [#] text|size|size2|units|angle &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol shape {circle point}|{box point}|{diamond point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; {cross point}|{x point}|{arrow
+ point}|{boxcircle point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
+ &nbsp;&nbsp; circle|ellipse|box|text]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ add| [#] remove]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ save|load &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [system
+ &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [update]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [x
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [y
+ &lt;col&gt;]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ catalog<br>
+ catalog header<br>
+ <br>
+ ds9.set(string cmd)<br>
+ </tt><tt>catalog<br>
+ catalog 2mass<br>
+ catalog cds 2mass<br>
+ catalog cds </tt><tt>{I/252}</tt><br>
+ <tt> <br>
+ </tt><tt>catalog load foo.xml<br>
+ catalog import tsv foo.tsv<br>
+ <br>
+ </tt><tt>catalog allrows<br>
+ catalog allcols<br>
+ </tt><tt>catalog cancel<br>
+ </tt><tt>catalog clear<br>
+ </tt><tt>catalog close<br>
+ </tt><tt>catalog coordinate 202.48 47.21 fk5<br>
+ </tt><tt>catalog crosshair<br>
+ </tt><tt>catalog dec DEC<br>
+ </tt><tt>catalog edit yes<br>
+ </tt><tt>catalog export tsv bar.tsv<br>
+ </tt><tt>catalog filter {$Jmag&gt;10}<br>
+ catalog filter load foo.flt<br>
+ catalog header<br>
+ </tt><tt>catalog hide<br>
+ </tt><tt>catalog location 500</tt><br>
+ <tt>catalog match error 2 arcsec<br>
+ catalog match function 1and2<br>
+ catalog match unique no<br>
+ catalog match return 1only<br>
+ catalog match 2mass csc<br>
+ </tt><tt>catalog maxrows 2000<br>
+ </tt><tt>catalog name m51<br>
+ catalog panto no<br>
+ </tt><tt>catalog plot </tt><tt>{$Jmag} {$Hmag} {$e_Jmag}
+ {$e_Hmag}</tt><tt><br>
+ </tt><tt>catalog print</tt><br>
+ <tt>catalog psky fk5</tt><br>
+ <tt>catalog psystem wcs</tt><br>
+ <tt>catalog ra RA</tt><br>
+ <tt>catalog regions<br>
+ </tt><tt>catalog retrieve<br>
+ </tt><tt> </tt><tt>catalog samp broadcast<br>
+ catalog samp send aladin<br>
+ catalog save foo.xml<br>
+ </tt><tt>catalog server sao<br>
+ </tt><tt>catalog show</tt><br>
+ <tt> catalog size 1 1 degrees</tt><br>
+ <tt>catalog symbol condition </tt><tt>{$Jmag&gt;15}</tt><br>
+ <tt> catalog symbol 2 shape </tt><tt>{boxcircle point}</tt><br>
+ <tt> catalog symbol color red<br>
+ catalog symbol font times<br>
+ </tt><tt>catalog symbol fontsize 14<br>
+ </tt><tt>catalog symbol fontweight bold<br>
+ </tt><tt>catalog symbol fontslant italic<br>
+ </tt><tt>catalog symbol add<br>
+ catalog symbol 2 remove<br>
+ catalog symbol load foo.sym<br>
+ catalog symbol save bar.sym</tt><tt><br>
+ catalog sky fk5<br>
+ catalog skyformat degrees<br>
+ </tt><tt>catalog sort {Jmag} incr<br>
+ </tt><tt>catalog system wcs</tt><tt><br>
+ </tt><tt>catalog update<br>
+ </tt><tt>catalog x RA<br>
+ catalog y DEC</tt><br>
+ <p><b><a name="cd"></a>cd</b></p>
+ <p>Sets/Returns the current working directory. </p>
+ <tt> Syntax: <br>
+ cd [&lt;directory&gt;] <br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ cd<br>
+ ds9.set(string cmd)<br>
+ cd /home/mrbill<br>
+ </tt>
+ <p><b> <a name="cmap"></a>cmap</b></p>
+ <p>Controls the colormap for the current frame. The colormap name
+ is not case sensitive. A valid contrast value is&nbsp; from 0 to
+ 10 and bias value from 0 to 1. </p>
+ <tt> Syntax: <br>
+ cmap [&lt;colormap&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [file]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [invert yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [value &lt;constrast&gt; &lt;bias&gt;]
+ <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [tag [load|save]
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [tag delete]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ cmap <br>
+ cmap file <br>
+ cmap invert <br>
+ cmap value <br>
+ </tt><tt>cmap lock</tt><br>
+ <tt> ds9.set(string cmd)<br>
+ cmap Heat <br>
+ cmap load foo.sao <br>
+ cmap save bar.sao<br>
+ cmap invert yes <br>
+ cmap value 5 .5<br>
+ </tt><tt>cmap tag load foo.tag<br>
+ cmap tag save foo.tag<br>
+ cmap tag delete</tt><br>
+ <tt>cmap match<br>
+ cmap lock yes</tt><br>
+ <tt> cmap open<br>
+ cmap close<br>
+ </tt>
+ <p><b><a name="colorbar"></a>colorbar</b></p>
+ <p>Controls colorbar parameters.</p>
+ <tt> Syntax: <br>
+ colorbar []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
+ [horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [orientation
+ horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [space
+ value|distance] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontsize
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontweight
+ normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontslant
+ roman|italic]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [size]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ticks]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ colorbar<br>
+ colorbar orientation<br>
+ colorbar numerics<br>
+ colorbar space<br>
+ colorbar font<br>
+ colorbar fontsize<br>
+ colorbar fontweight<br>
+ colorbar fontslant<br>
+ colorbar size<br>
+ colorbar ticks<br>
+ ds9.set(string cmd)<br>
+ colorbar yes<br>
+ colorbar vertical<br>
+ colorbar orientation vertical<br>
+ colorbar numerics yes<br>
+ colorbar space value<br>
+ colorbar font times<br>
+ colorbar fontsize 14<br>
+ colorbar fontwieght bold<br>
+ colorbar fontslant italic<br>
+ colorbar size 20<br>
+ colorbar ticks 11<br>
+ </tt>
+ <p><b> <a name="console"></a>console</b></p>
+ <p>Display tcl console window.</p>
+ <tt> Syntax: <br>
+ -console<br>
+ &nbsp;<br>
+ Example:<br>
+ ds9.set(string cmd)<br>
+ console<br>
+ </tt>
+ <p><b> <a name="contour"></a>contour</b></p>
+ <p>Controls contours in the current frame. </p>
+ <tt> Syntax: <br>
+ contour []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;coordsys&gt;
+ [&lt;skyframe&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [generate]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;
+ &lt;coordsys&gt; &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [convert]<br>
+ </tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [loadlevels &lt;filename&gt;]<br>
+ </tt></tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [savelevels &lt;filename&gt;]<br>
+ </tt></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [paste
+ &lt;coordsys&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [width &lt;width&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [dash yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [smooth &lt;smooth&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [method block|smooth]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [nlevels &lt;number of
+ levels&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale
+ linear|log|pow|squared|sqrt|asinh|sinh|histequ]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]scale log exp
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [limits &lt;min&gt;
+ &lt;max&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [levels &lt;value
+ value value...&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ contour<br>
+ contour color<br>
+ contour width<br>
+ contour dash<br>
+ contour smooth<br>
+ contour method<br>
+ contour nlevels<br>
+ contour scale<br>
+ contour log exp<br>
+ contour mode<br>
+ contour limits<br>
+ contour levels<br>
+ string url = ds9.get(string cmd)<br>
+ contour wcs fk5<br>
+ ds9.set(string cmd)<br>
+ contour<br>
+ contour yes<br>
+ contour clear<br>
+ contour generate<br>
+ contour load ds9.ctr<br>
+ contour load ds9.ctr red 2 yes<br>
+ contour save ds9.con wcs fk5<br>
+ contour convert<br>
+ </tt><tt><tt>contour loadlevels ds9.ctr<br>
+ </tt></tt><tt><tt><tt>contour savelevels ds9.lev<br>
+ </tt></tt>contour copy<br>
+ contour paste wcs red 2 no<br>
+ contour color yellow<br>
+ contour width 2<br>
+ contour dash yes<br>
+ contour smooth 5<br>
+ contour method smooth<br>
+ contour nlevels 10<br>
+ contour scale sqrt<br>
+ contour log exp 1000<br>
+ contour mode zscale<br>
+ contour limits 1 100<br>
+ contour levels "{1 10 100 1000}"<br>
+ contour open<br>
+ contour close<br>
+ </tt>
+ <p><b><a name="crop"></a>crop</b> </p>
+ <p>Set current image display area. </p>
+ <tt> Syntax: <br>
+ crop [&lt;x&gt; &lt;y&gt; &lt;width&gt; &lt;height&gt;
+[&lt;coordsys&gt;][&lt;skyframe&gt;][&lt;skyformat&gt;][degrees|arcmin|arcsec]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]</tt><tt><br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ </tt><tt>crop # get crop in physical coords <br>
+ </tt><tt>crop wcs galactic sexagesimal arcsec<br>
+ crop lock<br>
+ </tt><tt>ds9.set(string cmd)</tt><br>
+ <tt> crop 40 30 10 20 # set crop in physical coords<br>
+ crop +104:51:06.915 +68:33:40.761&nbsp; 28.144405 22.000204 wcs
+ galactic arcsec<br>
+ crop match wcs<br>
+ crop lock wcs</tt><br>
+ <p><b> <a name="crosshair"></a>crosshair</b></p>
+ <p>Controls the current position of the crosshair in the current
+ frame. DS9 is placed in crosshair mode when the crosshair is
+ set. </p>
+ <tt> Syntax: <br>
+ crosshair [&lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;]] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [lock
+ &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ crosshair # get crosshair in physical coords <br>
+ crosshair wcs fk4 sexagesimal # get crosshair in wcs coords <br>
+ crosshair lock<br>
+ ds9.set(string cmd)<br>
+ crosshair 100 100 physical # set crosshair in physical <br>
+ crosshair 345 58.8 wcs fk5 # set crosshair in wcs coords <br>
+ crosshair 23:01:00 +58:52:51 wcs fk5<br>
+ crosshair match wcs<br>
+ crosshair lock wcs<br>
+ </tt>
+ <p><b><a name="cube"></a>cube<br>
+ </b></p>
+ <p>Controls FITS cube. </p>
+ <tt> Syntax: <br>
+ cube [play|stop|next|prev|first|last]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;slice&gt;
+ [&lt;coordsys&gt;][&lt;axis&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;numeric&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axis &lt;axis&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp; [order 123|132|213|231|312|321]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axes lock [yes|no]]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ cube<br>
+ cube interval<br>
+ cube lock<br>
+ cube order<br>
+ cube axes lock<br>
+ ds9.set(string cmd)<br>
+ cube play<br>
+ cube last<br>
+ cube 3<br>
+ cube 4.5 wcs 3<br>
+ cube interval 2<br>
+ cube axis 3<br>
+ cube match wcs<br>
+ cube lock wcs<br>
+ cube order 123<br>
+ cube axes lock yes<br>
+ cube open<br>
+ cube close</tt><br>
+ <p><b> <a name="cursor"></a>cursor</b></p>
+ <p>Move mouse pointer or crosshair in image pixels in the current
+ frame. Note, this will move selected Regions also. </p>
+ <tt> Syntax: <br>
+ cursor [&lt;x&gt; &lt;y&gt;] <br>
+ &nbsp;<br>
+ Example:<br>
+ ds9.set(string cmd)<br>
+ cursor 10 10<br>
+ </tt>
+ <p><b><a name="data"></a>data</b></p>
+ <p>Return an array of data values given a lower left corner and a
+ width and height in specified coordinate system. The last
+ argument of yes indicates to strip the coordinates from the
+ output and just list the data values. The default is yes.<br>
+ </p>
+ <tt> Syntax: <br>
+ data [&lt;coordsys&gt; [&lt;skyframe&gt;] &lt;x&gt; &lt;y&gt;
+ &lt;width&gt; &lt;height&gt; [yes|no]]<br>
+ &nbsp;<br>
+ Example:<br>
+ string url = ds9.get(string cmd) <br>
+ data image 450 520 3 3 yes<br>
+ data physical 899 1039 6 6 no<br>
+ data fk5 202.47091 47.196811 0.00016516669 0.00016516669 no<br>
+ data wcs fk5 13:29:53.018 +47:11:48.52 0.00016516669
+ 0.00016516669 no</tt><tt><br>
+ </tt>
+ <p><b> <a name="dsssao"></a>dsssao<br>
+ dss<br>
+ </b></p>
+ <p>Support for Digital Sky Survey at SAO. </p>
+ <tt> Syntax:<br>
+ dsssao []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ dsssao name <br>
+ dsssao coord <br>
+ dsssao size<br>
+ dsssao save<br>
+ dsssao frame<br>
+ ds9.set(string cmd)<br>
+ dsssao<br>
+ dsssao m31 <br>
+ dsssao name m31 <br>
+ dsssao coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ dsssao size 60 60 arcmin<br>
+ dsssao save yes<br>
+ dsssao frame current<br>
+ dsssao update frame<br>
+ dsssao open<br>
+ dsssao close<br>
+ </tt>
+ <p><b> <a name="dsseso"></a>dsseso</b></p>
+ <p>Support for Digital Sky Survey at ESO. </p>
+ <tt> Syntax:<br>
+ dsseso []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp; &nbsp; &nbsp; [survey
+ DSS1|DSS2-red|DSS2-blue|DSS2-infrared]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ dsseso name <br>
+ dsseso coord <br>
+ dsseso size<br>
+ dsseso save<br>
+ dsseso frame<br>
+ dsseso survey<br>
+ ds9.set(string cmd)<br>
+ dsseso<br>
+ dsseso m31 <br>
+ dsseso name m31 <br>
+ dsseso coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ dsseso size 60 60 arcmin<br>
+ dsseso save yes<br>
+ dsseso frame current<br>
+ dsseso update frame<br>
+ dsseso survey DSS2-red <br>
+ dsseso open<br>
+ dsseso close<br>
+ </tt>
+ <p><b> <a name="dssstsci"></a>dssstsci</b></p>
+ <p>Support for Digital Sky Survey at STSCI.</p>
+ <tt> Syntax:<br>
+ dssstsci []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord
+ &lt;ra&gt; &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame
+ new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss2ukstu_red|poss2ukstu_ir|poss2ukstu_blue] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss1_blue|poss1_red]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ all|quickv|phase2_gsc2|phase2_gsc1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ dssstsci name <br>
+ dssstsci coord <br>
+ dssstsci size<br>
+ dssstsci save<br>
+ dssstsci frame<br>
+ dssstsci survey<br>
+ ds9.set(string cmd)<br>
+ dssstsci<br>
+ dssstsci m31 <br>
+ dssstsci name m31 <br>
+ dssstsci coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ dssstsci size 60 60 arcmin<br>
+ dssstsci save yes<br>
+ dssstsci frame current<br>
+ dssstsci update frame<br>
+ dssstsci survey all<br>
+ dssstsci open<br>
+ dssstsci close</tt><br>
+ <p><b> <a name="envi"></a>envi</b></p>
+ <p>Load an ENVI header and file. Optional parameter: array endian.<br>
+ </p>
+ <tt> Syntax: <br>
+ envi &lt;header&gt; [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt><tt>envi foo.hdr</tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>envi foo.hdr foo.bsq</tt></tt><br>
+ envi new foo.hdr foo.bsq</tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><br>
+ </tt></tt></tt></tt></tt></tt>
+ <p><b> <a name="exit"></a>exit<br>
+ quit<br>
+ </b></p>
+ <p>Quits DS9. </p>
+ <tt> Syntax: <br>
+ exit<br>
+ quit<br>
+ &nbsp;<br>
+ Example:<br>
+ ds9.set(string cmd)<br>
+ exit</tt><br>
+ <p><b> <a name="export"></a>export<br>
+ </b></p>
+ <p>Export loaded image data of current frame in specified image
+ format. Optional parameters: array endian, nrrd endian, jpeg
+ quality (1-100) and tiff compression method.</p>
+ <tt> Syntax: </tt><tt><br>
+ </tt><tt> export </tt><tt>[array|nrrd|envi|gif|tiff|jpeg|png] </tt><tt>&lt;filename&gt;</tt><tt><br>
+ </tt><tt>export array &lt;filename&gt;</tt><tt> </tt><tt>[big|little</tt><tt>|native]</tt><tt><br>
+ </tt><tt>export nrrd &lt;filename&gt; </tt><tt>[big|little</tt><tt>|native]</tt><br>
+ <tt>export envi &lt;header&gt; [&lt;filename&gt;] </tt><tt>[big|little</tt><tt>|native]</tt><tt><br>
+ </tt><tt> </tt><tt>export jpeg &lt;filename&gt;</tt><tt> [1-100]</tt><tt><br>
+ </tt><tt> </tt><tt>export tiff &lt;filename</tt><tt>&gt;</tt><tt>
+ [none|jpeg|packbits|deflate]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt><tt>ds9.set (string cmd)<br>
+ </tt>export array foo.arr little</tt></tt><br>
+ <tt><tt>export nrrd foo.nrrd little<br>
+ export envi foo.hdr little<br>
+ export envi foo.hdr foo.bsq little<br>
+ </tt></tt> <tt><tt><tt><tt>export tiff foo.tiff jpeg</tt></tt></tt><br>
+ export jpeg foo.jpeg 75<br>
+ export png foo.png</tt><br>
+ <p><b> <a name="file"></a>file</b></p>
+ <p>Query currently loaded file information. </p>
+ <tt> Syntax:<br>
+ file <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ file</tt><tt><br>
+ </tt>
+ <p><b> <a name="fits"></a>fits</b></p>
+ <p>Load a FITS image into the current frame or query the currently
+ loaded image.<br>
+ </p>
+ <tt> Syntax: <br>
+ fits </tt><tt><tt>[new|mask|slice] [&lt;filename&gt;]</tt><tt><br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; [width|height|depth|bitpix|type]<br>
+ &nbsp; &nbsp;&nbsp; [size [wcs|wcsa...wcsz]
+ [fk4|fk5|icrs|galactic|ecliptic] [degrees|arcmin|arcsecs]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[header [&lt;ext&gt;] [keyword
+ &lt;string&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [image|table|slice]</tt><tt><br>
+ &nbsp;<br>
+ Example: </tt><br>
+ <tt><tt>string value = ds9.get(string cmd)</tt><br>
+ fits<br>
+ fits width<br>
+ fits height<br>
+ fits depth<br>
+ fits bitpix</tt><br>
+ <tt>fits type </tt><br>
+ <tt><tt>fits size<br>
+ </tt> fits size wcs fk5 arcmin<br>
+ fits header # primary<br>
+ fits header 2 # hdu 2<br>
+ fits header -2 # hdu 2 with inherit<br>
+ fits header keyword "'BITPIX'"<br>
+ fits header 1 keyword "'BITPIX'"</tt><br>
+ <tt><tt>fits image<br>
+ fits table</tt></tt><tt><br>
+ fits slice<br>
+ ds9.set(string cmd, string url)</tt><tt><tt><br>
+ </tt> fits foo.fits<br>
+ fits new foo.fits<br>
+ fits bar.fits[bin=detx,dety]<br>
+ fits slice foo.fits<br>
+ fits mask foo.fits<br>
+ fits <br>
+ fits new<br>
+ fits -[bin=detx,dety]<br>
+ fits slice<br>
+ fits mask</tt>
+ <p>Syntax: <br>
+ </p>
+ <tt> fits [size|width|height|depth|bitpix]<br>
+ &nbsp; &nbsp;&nbsp; [size [wcs|wcsa...wcsz]
+ [fk4|fk5|icrs|galactic|ecliptic] [degrees|arcmin|arcsecs]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [type]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[header [&lt;ext&gt;] [keyword
+ &lt;string&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [image|table|resample] [gz] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new|mask][&lt;options&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new][slice &lt;options&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[new][mecube &lt;options&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new|mask][mosaicimage
+ [iraf|wcs|wcsa...wcsz|wfpc2] &lt;options&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new|mask][mosaic
+ [iraf|wcs|wcsa...wcsz] &lt;options&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new][rgbcube &lt;options&gt;]<br>
+ &nbsp; &nbsp; &nbsp;[new][rgbimage &lt;options&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ fits size<br>
+ fits width<br>
+ fits height<br>
+ fits depth<br>
+ fits bitpix<br>
+ fits size wcs fk5 arcmin<br>
+ fits type <br>
+ fits header keyword BITPIX<br>
+ fits header 1 keyword BITPIX<br>
+ string url = ds9.get(string cmd)<br>
+ fits<br>
+ fits image<br>
+ fits image gz<br>
+ fits table<br>
+ fits table gz<br>
+ fits resample<br>
+ fits resample gz<br>
+ fits header # primary<br>
+ fits header 2 # hdu 2<br>
+ fits header -2 # hdu 2 with inherit<br>
+ ds9.set(string cmd, string url)<br>
+ fits <br>
+ fits [2] <br>
+ fits new [bin=detx,dety]<br>
+ fits slice<br>
+ fits mecube <br>
+ fits mosaicimage iraf<br>
+ fits mosaicimage wcs<br>
+ fits mosaicimage wcsa<br>
+ fits mosaicimage wfpc2<br>
+ fits mosaic iraf<br>
+ fits mosaic wcs<br>
+ fits rgbcube<br>
+ fits rgbimage </tt>
+ <p><b> <a name="frame"></a>frame</b></p>
+ <p>Controls frame functions. Frames may be created, deleted,
+ reset, and centered. While return the current frame number. If
+ you goto a frame that does not exists, it will be created. If
+ the frame is hidden, it will be shown. The 'frameno' option is
+ available for backward compatibility. </p>
+ <tt> Syntax: <br>
+ frame [center [#|all]]<br>
+ &nbsp; &nbsp; &nbsp; [clear [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [new [rgb|3d]]<br>
+ &nbsp; &nbsp; &nbsp; [delete [#|all]] <br>
+ &nbsp; &nbsp; &nbsp; [reset [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [refresh [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [hide [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [show [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move first]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move forward]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move last]<br>
+ &nbsp; &nbsp; &nbsp; [first]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [prev]<br>
+ &nbsp; &nbsp; &nbsp; [next]<br>
+ &nbsp; &nbsp; &nbsp; [last]<br>
+ &nbsp; &nbsp; &nbsp; [frameno #]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [#]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has
+[amplifier|datamin|datasec|detector|grid|iis|irafmin|physical|smooth]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has contour [aux]]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has fits [ |bin|cube|mosaic]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has marker
+ [highlite|paste|select|undo]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has wcs
+ [&lt;wcssys&gt;|equatorial &lt;wcssys&gt;|linear
+ &lt;wcssys&gt;]]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ frame # returns the id of the current frame <br>
+ frame frameno # returns the id of the current frame <br>
+ frame all # returns the id of all frames <br>
+ frame active # returns the id of all active frames<br>
+ frame lock<br>
+ frame has amplifier<br>
+ frame has datamin<br>
+ frame has datasec<br>
+ frame has detector<br>
+ frame has grid<br>
+ frame has iis<br>
+ frame has irafmin<br>
+ frame has physical<br>
+ frame has smooth<br>
+ frame has contour<br>
+ frame has contour aux<br>
+ frame has fits<br>
+ frame has fits bin<br>
+ frame has fits cube<br>
+ frame has fits mosaic<br>
+ frame has marker highlite<br>
+ frame has marker paste<br>
+ frame has marker select<br>
+ frame has marker undo<br>
+ frame has system physical<br>
+ frame has wcs wcsa<br>
+ frame has wcs equatorial wcsa<br>
+ frame has wcs linear wcsa<br>
+ ds9.set(string cmd)<br>
+ frame center # center current frame<br>
+ frame center 1 # center 'Frame1' <br>
+ frame center all # center all frames <br>
+ frame clear # clear current frame<br>
+ frame new # create new frame <br>
+ frame new rgb # create new rgb frame<br>
+ frame delete # delete current frame <br>
+ frame reset # reset current frame <br>
+ frame refresh # refresh current frame <br>
+ frame hide # hide current frame <br>
+ frame show 1 # show frame 'Frame1'<br>
+ frame move first # move frame to first in order<br>
+ frame move back # move frame back in order<br>
+ frame move forward # move frame forward in order<br>
+ frame move last # move frame to last in order<br>
+ frame first # goto first frame <br>
+ frame prev # goto prev frame <br>
+ frame next # goto next frame<br>
+ frame last # goto last frame<br>
+ frame frameno 4 # goto frame 'Frame4', create if needed<br>
+ frame 3 # goto frame 'Frame3', create if needed <br>
+ frame match wcs<br>
+ frame lock wcs</tt><br>
+ <p><b> <a name="gif"></a>gif</b></p>
+ <p>Load GIF image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ gif [new|slice] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>gif</tt><br>
+ <tt><tt>ds9.set(string cmd)<br>
+ </tt>gif foo.gif</tt><br>
+ <tt><tt>gif new foo.gif<br>
+ </tt></tt><tt><tt><tt>gif slice foo.gif<br>
+ </tt></tt>gif</tt><br>
+ <tt><tt>gif</tt><tt> new<br>
+ </tt>gif</tt><tt> slice</tt>
+ <p><b> <a name="grid"></a>grid</b></p>
+ <p> Controls coordinate grid. For grid numeric format
+ syntax,&nbsp; click <a href="grid.html#Format">here</a>.</p>
+ <tt> Syntax: <br>
+ grid&nbsp; []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [type analysis|publication] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [system &lt;coordsys&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sky &lt;skyframe&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat &lt;skyformat&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes type interior|exterior]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes origin
+ lll|llu|lul|luu|ull|ulu|uul|uuu]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp; &nbsp; [format1 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format2 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics type interior|exterior]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics vertical yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title text &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title def yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title gap &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text1 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def1 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text2 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def2 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [reset]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ grid <br>
+ grid type <br>
+ grid system <br>
+ grid sky <br>
+ grid skyformat <br>
+ grid grid <br>
+ grid grid color <br>
+ grid grid width <br>
+ grid grid style <br>
+ grid grid gap1 <br>
+ grid grid gap2 <br>
+ grid axes <br>
+ grid axes color <br>
+ grid axes width <br>
+ grid axes style <br>
+ grid axes type <br>
+ grid axes origin<br>
+ grid format1<br>
+ grid format2<br>
+ grid tickmarks <br>
+ grid tickmarks color <br>
+ grid tickmarks width <br>
+ grid tickmarks style <br>
+ grid border <br>
+ grid border color <br>
+ grid border width <br>
+ grid border style <br>
+ grid numerics <br>
+ grid numerics font <br>
+ grid numerics fontsize <br>
+ grid numerics fontweight<br>
+ grid numerics fontslant<br>
+ grid numerics color <br>
+ grid numerics gap1 <br>
+ grid numerics gap2 <br>
+ grid numerics type <br>
+ grid numerics vertical <br>
+ grid title <br>
+ grid title text<br>
+ grid title def <br>
+ grid title gap <br>
+ grid title font <br>
+ grid title fontsize <br>
+ grid title fontweight<br>
+ grid title fontslant<br>
+ grid title color <br>
+ grid labels <br>
+ grid labels text1 <br>
+ grid labels def1 <br>
+ grid labels gap1 <br>
+ grid labels text2 <br>
+ grid labels def2 <br>
+ grid labels gap2 <br>
+ grid labels font <br>
+ grid labels fontsize <br>
+ grid labels fontweight<br>
+ grid labels fontslant<br>
+ grid labels color <br>
+ ds9.set(string cmd)<br>
+ grid <br>
+ grid yes<br>
+ grid type analysis <br>
+ grid system wcs <br>
+ grid sky fk5 <br>
+ grid skyformat degrees<br>
+ grid grid yes<br>
+ grid grid color red<br>
+ grid grid width 2<br>
+ grid grid style 1<br>
+ grid grid gap1 10<br>
+ grid grid gap2 10<br>
+ grid axes yes<br>
+ grid axes color red<br>
+ grid axes width 2<br>
+ grid axes style 1<br>
+ grid axes type exterior<br>
+ grid axes origin lll<br>
+ grid format1 d.2<br>
+ grid format2 d.2<br>
+ grid tickmarks yes<br>
+ grid tickmarks color red<br>
+ grid tickmarks width 2<br>
+ grid tickmarks style 1<br>
+ grid border yes<br>
+ grid border color red<br>
+ grid border width 2<br>
+ grid border style 1<br>
+ grid numerics yes<br>
+ grid numerics font courier<br>
+ grid numerics fontsize 12<br>
+ grid numerics fontweight bold<br>
+ grid numerics fontslant italic<br>
+ grid numerics color red<br>
+ grid numerics gap1 10<br>
+ grid numerics gap2 10<br>
+ grid numerics type exterior<br>
+ grid numerics vertical yes<br>
+ grid title yes<br>
+ grid title text {Hello World}<br>
+ grid title def yes<br>
+ grid title gap 10<br>
+ grid title fontsize 12<br>
+ grid title font courier<br>
+ grid title fontweight bold<br>
+ grid title fontslant italic<br>
+ grid title color red<br>
+ grid labels yes<br>
+ grid labels text1 {Hello World}<br>
+ grid labels def1 yes<br>
+ grid labels gap1 10<br>
+ grid labels text2 {Hello World}<br>
+ grid labels def2 yes<br>
+ grid labels gap2 10<br>
+ grid labels font courier<br>
+ grid labels fontsize 12<br>
+ grid labels fontweight bold<br>
+ grid labels fontslant italic<br>
+ grid labels color red<br>
+ grid reset<br>
+ grid load foo.grd <br>
+ grid save foo.grd<br>
+ grid open<br>
+ grid close<br>
+ </tt>
+ <p><b> <a name="header"></a>header</b></p>
+ <p>Display current fits header dialog. Optional extension number
+ maybe specified. Please note, this differs from samp fits
+ header.</p>
+ <tt> Syntax: <br>
+ header [&lt;ext&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [close [&lt;ext&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save [&lt;ext&gt;]
+ &lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ header<br>
+ header 2<br>
+ header close<br>
+ </tt>
+ <p><b> <a name="height"></a>height</b></p>
+ <p>Set the height of the image display window. </p>
+ <tt> Syntax: <br>
+ height [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ height<br>
+ ds9.set(string cmd)<br>
+ height 512<br>
+ </tt>
+ <p><b> <a name="iconify"></a>iconify</b></p>
+ <p>Toggles iconification. </p>
+ <tt> Syntax: <br>
+ iconify []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ iconify <br>
+ ds9.set(string cmd)<br>
+ iconify<br>
+ iconify yes</tt><br>
+ <p><b><a name="iexam"></a>iexam</b></p>
+ <p>Interactive examine function. A blinking cursor will indicate
+ to the user to click on a point on an image. The specified
+ information will be returned at that time. The default event is
+ <tt>button</tt>. In the last form, the following macros will be
+ expanded if present: <tt>$width, $height, $depth, $bitpix,
+ $filename, $regions, $filename[$regions], $env, $pan, $value,
+ $x, $y, $z.</tt> See <a
+ href="file:///Users/joye/saods9/doc/ref/analysis.html#macros">Analysis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Macros</a> for more information.</p>
+ <tt> Syntax: <br>
+ iexam []<br>
+ </tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[]|button|key|any]
+ coordinate &lt;coordsys&gt; [&lt;skyframe&gt;]
+ [&lt;skyformat&gt;]<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [[]|button|key|any] data
+ [width][height]<br>
+ </tt><tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; [[]|button|key|any]
+ &lt;macro string&gt;]<br>
+ &nbsp; </tt></tt><br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ </tt><tt><tt>iexam<br>
+ </tt>iexam coordinate image<br>
+ iexam key coordinate image # return coordinate and key event<br>
+ iexam coordinate wcs fk5 degrees<br>
+ iexam coordinate wcs galactic sexagesimal<br>
+ iexam coordinate fk5<br>
+ iexam data # return data value<br>
+ iexam key data # return data value and key event<br>
+ iexam data 3 3 # return all data in 3x3 box about selected point<br>
+ iexam {Click at $x,$y in file $filename}</tt><br>
+ <p><b><a name="iis"></a>iis</b></p>
+ <p>Set/Get IIS Filename. Optional mosaic number maybe supplied.</p>
+ <tt> Syntax: <br>
+ iis [filename &lt;filename&gt; [#]]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ iis filename<br>
+ iis filename 4<br>
+ ds9.set(string cmd)<br>
+ iis filename foo.fits<br>
+ iis filename bar.fits 4</tt><br>
+ <p><b> <a name="jpeg"></a>jpeg</b></p>
+ <p>Load JPEG image into current frame. Optional parameters: <tt>jpeg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>quality (1-100) </p>
+ <tt> Syntax:<br>
+ jpeg [new|slice] [&lt;filename&gt;] [1-100]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>jpeg</tt><br>
+ <tt><tt>jpeg 100</tt><br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>jpeg foo.jpeg</tt><br>
+ <tt><tt>jpeg new foo.jpeg<br>
+ </tt></tt><tt><tt><tt>jpeg slice foo.jpeg<br>
+ </tt></tt>jpeg</tt><br>
+ <tt><tt>jpeg</tt><tt> new<br>
+ </tt>jpeg</tt><tt> slice</tt>
+ <p><b> <a name="lock"></a>lock</b></p>
+ <p>Lock all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ </tt><tt>lock</tt><tt> </tt><tt>[frame &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;|none] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [crop &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp; [slice &lt;coordsys&gt;|none]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [bin [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axes [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [scale [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [scalelimits [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [colorbar [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [block [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [smooth [yes|no]]</tt><tt><br>
+ </tt><tt>&nbsp; </tt><tt><br>
+ Example:<br>
+ </tt><tt>string value = ds9.get(string cmd) <br>
+ </tt><tt>lock frame<br>
+ lock crosshair<br>
+ </tt><tt>lock crop</tt><br>
+ <tt> lock slice</tt><br>
+ <tt>lock bin<br>
+ lock axes<br>
+ lock scale<br>
+ lock scalelimits<br>
+ lock color</tt><tt>bar<br>
+ lock block<br>
+ lock smooth<br>
+ </tt><tt>ds9.set(string cmd)<br>
+ </tt><tt>lock frame wcs</tt><tt><br>
+ </tt><tt>lock crosshair wcs<br>
+ </tt><tt>lock crop wcs</tt><br>
+ <tt>lock slice wcs</tt><br>
+ <tt>lock bin yes<br>
+ lock axes yes<br>
+ </tt><tt>lock scale yes<br>
+ lock scalelimits yes<br>
+ </tt><tt>lock colorbar yes</tt><tt><br>
+ lock block yes<br>
+ lock smooth yes<br>
+ <br>
+ </tt><b><a name="lower"></a>lower</b>
+ <p>Lower in the window stacking order. </p>
+ <tt> Syntax: <br>
+ lower <br>
+ &nbsp;<br>
+ Example: <br>
+ ds9.set(string cmd)<br>
+ lower</tt><tt><br>
+ </tt>
+ <p><b> <a name="magnifier"></a>magnifier</b></p>
+ <p>Controls the magnifier settings. </p>
+ <tt> Syntax: <br>
+ magnifier [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [zoom
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cursor
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [region
+ yes|no]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ magnifier color<br>
+ magnifier zoom<br>
+ magnifier cursor<br>
+ magnifier region<br>
+ ds9.set(string cmd)<br>
+ magnifier color yellow<br>
+ magnifier zoom 2<br>
+ magnifier cursor no<br>
+ magnifier region no<br>
+ </tt>
+ <p><b><a name="mask"></a>mask<br>
+ </b></p>
+ <p>Controls mask parameters. </p>
+ <tt> Syntax: <br>
+ mask [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mark 1|0]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [transparency &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ mask color<br>
+ mask mark<br>
+ mask transparency<br>
+ ds9.set(string cmd)<br>
+ mask color red<br>
+ mask mark 0<br>
+ mask transparency 50<br>
+ mask clear<br>
+ mask open<br>
+ mask close<br>
+ </tt>
+ <p><b> <a name="match"></a>match</b></p>
+ <p>Match all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ </tt><tt>match </tt><tt>[frame &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [crop &lt;coordsys&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [slice &lt;coordsys&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [bin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scalelimits]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [block]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [smooth]</tt><tt><br>
+ </tt><tt>&nbsp; <br>
+ Example:<br>
+ ds9.set(string cmd)<br>
+ </tt><tt>match frame wcs <br>
+ </tt><tt>match crosshair wcs<br>
+ </tt><tt>match crop wcs</tt><br>
+ <tt> match slice wcs<br>
+ match bin<br>
+ match axes<br>
+ match scale<br>
+ match scalelimits<br>
+ match color</tt><tt>bar<br>
+ match block<br>
+ match smooth</tt><br>
+ <p><b> <a name="mecube"></a>mecube</b></p>
+ <p>Load FITS multiple extension file as data cube.<br>
+ </p>
+ <tt> Syntax:<br>
+ mecube [new] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: </tt><br>
+ <tt>string value = ds9.get(string cmd)</tt><tt><tt><br>
+ </tt>mecube<br>
+ </tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt></tt>mecube foo.fits</tt><br>
+ <tt><tt>mecube new foo.fits<br>
+ </tt>mecube</tt><br>
+ <tt>mecube</tt><tt> new</tt>
+ <p><b> <a name="minmax"></a>minmax</b></p>
+ <p>This is how DS9 determines&nbsp; the min and max data values
+ from the data. <tt>SCAN</tt> will scan all data.</p>
+ <tt> Syntax: <br>
+ minmax [scan|sample|datamin|irafmin] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ scan|sample|datamin|irafmin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval #]<br>
+ &nbsp; <br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ minmax mode<br>
+ minmax sample <br>
+ ds9.set(string cmd)<br>
+ minmax scan <br>
+ minmax mode scan<br>
+ minmax interval 100<br>
+ </tt>
+ <p><b> <a name="mode"></a>mode</b></p>
+ <p>Controls the first mouse button mode. </p>
+ <tt> Syntax: <br>
+ mode
+ [none|region|crosshair|colorbar|pan|zoom|rotate|catalog|examine]
+ <br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ mode <br>
+ ds9.set(string cmd)<br>
+ mode crosshair</tt><br>
+ <p><b> <a name="mosaic"></a>mosaic</b></p>
+ <p>Load FITS mosaic segment into current frame.</p>
+ <tt> Syntax:<br>
+ mosaic [wcs|wcsa...wcsz|iraf] [new|mask] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>mosaic</tt><tt><br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>mosaic foo.fits</tt><br>
+ <tt><tt>mosaic wcs foo.fits</tt></tt><br>
+ <tt><tt>mosaic wcs new foo.fits</tt></tt><br>
+ <tt><tt>mosaic wcs mask foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>mosaic</tt><br>
+ <tt><tt>mosaic wcs<br>
+ mosaic wcs</tt><tt> new<br>
+ </tt>mosaic wcs</tt><tt> mask<br>
+ </tt>
+ <p><b> <a name="mosaicimage"></a>mosaicimage</b></p>
+ <p>Load FITS mosaic image into current frame.</p>
+ <tt> Syntax:<br>
+ mosaicimage [wcs|wcsa...wcsz|iraf|wfpc2] [new|mask]
+ [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>mosaicimage</tt><tt><br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>mosaicimage foo.fits</tt><br>
+ <tt><tt>mosaicimage wcs foo.fits</tt></tt><br>
+ <tt><tt>mosaicimage wcs new foo.fits</tt></tt><br>
+ <tt><tt>mosaicimage wcs mask foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>mosaicimage</tt><br>
+ <tt><tt>mosaicimage wcs<br>
+ mosaicimage wcs new</tt><tt><br>
+ </tt>mosaicimage wcs mask</tt>
+ <p><b><a name="movie"></a>movie</b></p>
+ <p>Create mpeg1 movie from snap shots of the DS9 window. A <tt>slice</tt>
+ movie cycles though all slices of a cube. A <tt>frame</tt>
+ movie cycles through all active frames. A <tt>3d</tt> movie
+ cycles through specified viewing angles. The default is <tt>frame</tt>.
+ Optional parameters for <tt>3d</tt>: number of frames, azimuth
+ from/to, elevation from/to, slice from/to, oscillate/repeat
+ times.</p>
+ <tt> Syntax:<br>
+ movie </tt><tt>[slice|frame|3d] </tt><tt>&lt;filename&gt;<br>
+ </tt><tt>movie 3d &lt;filename&gt;
+ [number|azfrom|azto|elfrom|elto|slfrom|slto|oscillate|repeat
+ &lt;#&gt;]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ ds9.set(string cmd)<br>
+ movie slice ds9.mpg<br>
+ </tt><tt>movie 3d ds9.mpg number 10 azfrom -60 azto 60 oscillate 1</tt><br>
+ <p><b> <a name="multiframe"></a>multiframe</b></p>
+ <p>Load FITS multiple extension file as multiple images.<br>
+ </p>
+ <tt> Syntax:<br>
+ multiframe [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>multiframe foo.fits</tt><tt><tt><br>
+ </tt>multiframe</tt><br>
+ <p><b> <a name="nameserver"></a>nameserver</b></p>
+ <p>Support Name Server functions. Coordinates are in fk5. </p>
+ <tt> Syntax: <br>
+ nameserver [&lt;object&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [server ned-sao|ned-eso|simbad-sao|simbad-eso]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [skyformat degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [pan]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [crosshair]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ nameserver<br>
+ nameserver server<br>
+ nameserver skyformat<br>
+ nameserver m31<br>
+ ds9.set(string cmd)<br>
+ nameserver m31 <br>
+ nameserver name m31 <br>
+ nameserver server ned-sao <br>
+ nameserver skyformat sexagesimal<br>
+ nameserver pan<br>
+ nameserver crosshair<br>
+ nameserver open<br>
+ nameserver close<br>
+ </tt>
+ <p><b> <a name="nan"></a>nan</b></p>
+ <p>Set image not-a-number color. </p>
+ <tt> Syntax: <br>
+ nan &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt>string value = ds9.get(string cmd)<br>
+ nan</tt><br>
+ <tt>ds9.set(string cmd)<br>
+ nan red</tt><br>
+ <p><b> <a name="nrrd"></a>nrrd</b></p>
+ <p>Load an NRRD (Nearly Raw Raster Data) file. Optional parameter:
+ array endian.<br>
+ </p>
+ <tt> Syntax: <br>
+ nrrd [&lt;filename&gt;] [little|big]<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>nrrd</tt><br>
+ <tt><tt>nrrd big<br>
+ </tt></tt><tt><tt><tt>ds9.set(string cmd</tt><tt>, string url</tt><tt>)<br>
+ </tt>nrrd foo.nrrd</tt></tt><br>
+ <tt><tt><tt><tt>nrrd new foo.nrrd</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>nrrd mask foo.nrrd<br>
+ </tt></tt></tt></tt></tt>nrrd</tt><br>
+ <tt>nrrd</tt><tt> new<br>
+ nrrd mask</tt><br>
+ <p><b> <a name="nvss"></a>nvss</b></p>
+ <p>Support for NRAO VLA Sky Survey.</p>
+ <tt> Syntax: <br>
+ nvss []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt; &lt;height&gt;
+ degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ nvss name <br>
+ nvss coord <br>
+ nvss size<br>
+ nvss save<br>
+ nvss frame<br>
+ ds9.set(string cmd)<br>
+ nvss<br>
+ nvss m31 <br>
+ nvss name m31 <br>
+ nvss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ nvss size 60 60 arcmin<br>
+ nvss save yes<br>
+ nvss frame current<br>
+ nvss update frame<br>
+ nvss open<br>
+ nvss close<br>
+ </tt>
+ <p><b> <a name="orient"></a>orient</b></p>
+ <p>Controls the orientation of the current frame. </p>
+ <tt> Syntax: <br>
+ orient [none|x|y|xy] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ orient <br>
+ ds9.set(string cmd)<br>
+ orient xy<br>
+ orient open<br>
+ orient close<br>
+ </tt>
+ <p><b> <a name="pagesetup"></a>pagesetup</b></p>
+ <p>Controls Page Setup options. </p>
+ <tt> Syntax: <br>
+ pagesetup [orient portrait|landscape]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale
+ &lt;numeric&gt;]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ pagesetup orient<br>
+ pagesetup scale <br>
+ pagesetup size <br>
+ ds9.set(string cmd)<br>
+ pagesetup orient portrait <br>
+ pagesetup scale 50<br>
+ pagesetup size poster<br>
+ </tt>
+ <p><b> <a name="pan"></a>pan</b></p>
+ <p>Controls the current image cursor location for the current
+ frame. </p>
+ <tt> Syntax: <br>
+ pan [&lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;]] # relative<br>
+ &nbsp;&nbsp;&nbsp; [to &lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;] # absolute<br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;&nbsp;&nbsp; [close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ pan # get current image coords <br>
+ pan wcs fk4 sexagesimal # get current wcs coords <br>
+ ds9.set(string cmd)<br>
+ pan 200 200 image # pan relative <br>
+ pan to 400 400 physical # pan to physical coords <br>
+ pan to 13:29:55 47:11:50 wcs fk5 # pan to wcs coords<br>
+ pan open<br>
+ pan close<br>
+ </tt>
+ <p><b> <a name="pixeltable"></a>pixeltable</b></p>
+ <p>Display/Hide the pixel table. </p>
+ <tt> Syntax: <br>
+ pixeltable []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [yes|open] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [no|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string url = ds9.get(string cmd)<br>
+ pixeltable <br>
+ ds9.set(string cmd)<br>
+ pixeltable<br>
+ pixeltable yes<br>
+ pixeltable open<br>
+ pixeltable close<br>
+ </tt>
+ <p><b> <a name="plot"></a>plot</b></p>
+ <p>Display and configure data plots. All plot commands take an
+ optional second command, the plot name. If no plot name is
+ specified, the last plot created is assumed. Plot data is
+ assumed to be a pair of coordinates, with optional error values.
+ The follow are valid data descriptions:</p>
+ <blockquote>xy &nbsp;&nbsp; &nbsp; &nbsp; x and y coordinates<br>
+ xyex&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with x errors<br>
+ xyey&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with y errors<br>
+ xyexey&nbsp;&nbsp;&nbsp; x,y coordinates with&nbsp; x and y
+ errors<br>
+ </blockquote>
+ <p>To create a new plot, use the plot new command.</p>
+ <tt> Syntax: <br>
+ # create new empty plot window<br>
+ plot<br>
+ plot [bar|scatter]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter] &lt;title&gt; &lt;xaxis label&gt; &lt;yaxis
+ label&gt; </tt><tt>xy|xyex|xyey|xyexey</tt><tt>]<br>
+ <br>
+ # create new plot with data<br>
+ plot [new [name &lt;plotname&gt;] </tt><tt>[line|bar|scatter] </tt><tt>stdin]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # title, title xaxis, title yaxis, dimension on line 1<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[new [name &lt;plotname&gt;]
+ [line|bar|scatter] &lt;title&gt; &lt;xaxis label&gt; &lt;yaxis
+ label&gt; xy|xyex|xyey|xyexey]<br>
+ <br>
+ # load dataset into an existing plot<br>
+ plot [&lt;plotname&gt;] [data xy|xyex|xyey|xyexey]<br>
+ </tt><tt><tt><br>
+ plot [&lt;plotname&gt;] load &lt;filename&gt;
+ [xy|xyex|xyey|xyexey]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] save
+ &lt;filename&gt;<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] clear<br>
+ </tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ duplicate<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>[&lt;plotname&gt;] stats<br>
+ </tt></tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ list<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loadconfig &lt;filename&gt;<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] saveconfig
+ &lt;filename&gt;<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;] pagesetup orient [portrait|landscape]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] pagesetup
+ size [letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;] print<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] print destination
+ [printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ command &lt;command&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ filename &lt;filename&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print color
+ [rgb|gray]<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+ close<br>
+ </tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><br>
+ plot </tt>[&lt;plotname&gt;] mode [pointer|zoom]<br>
+ </tt></tt></tt></tt></tt></tt><tt><br>
+ # configure graph<br>
+ plot [&lt;plotname&gt;] axis [x|y] grid [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] log
+ [yes|no]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y]
+ flip [yes|no]</tt><br>
+ <tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y] auto
+ [yes|no]<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] min
+ &lt;value&gt;<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] max
+ &lt;value&gt;</tt><tt><br>
+ </tt><tt><tt>&nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y]
+ format &lt;string&gt;</tt><tt><br>
+ </tt></tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ legend [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] legend position
+ [right|left|top|bottom]</tt><br>
+ </tt><tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font
+ [title|labels|numbers] font [times|helvetica|courier]<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ size &lt;value&gt;<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ weight [normal|bold]<br>
+ &nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ slant [roman|italic]<br>
+ </tt></tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] title
+ &lt;string&gt;</tt><br>
+ <tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] title [x|y]
+ &lt;string&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] barmode
+ [normal|stacked|aligned|overlap]<br>
+ </tt></tt><tt><tt><tt><br>
+ # configure current dataset<br>
+ </tt>plot [&lt;plotname&gt;] show [yes|no]<br>
+ </tt>&nbsp; &nbsp;&nbsp; </tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape
+ [circle|square|diamond|plus|splus|scross|triangle|arrow]</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape fill [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+ shape color &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ smooth
+ [step|linear|cubic|quadratic|catrom]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ width
+ &lt;value&gt;<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dash [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error width
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name
+ &lt;string&gt;<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><br>
+ # select current dataset<br>
+ </tt></tt></tt>plot [&lt;plotname&gt;] select &lt;value&gt;<br>
+ &nbsp; </tt><tt> <br>
+ Example: <br>
+ # return all plotnames<br>
+ string value = ds9.get(string cmd)<br>
+ plot<br>
+ <br>
+ # create new empty plot window<br>
+ ds9.set(string cmd)<br>
+ plot<br>
+ plot scatter<br>
+ plot new<br>
+ plot new bar<br>
+ plot new name foo<br>
+ plot new name foo scatter<br>
+ <br>
+ # create new plot with data<br>
+ ds9.set(string cmd, string url)<br>
+ plot new stdin <br>
+ plot new name foo stdin<br>
+ plot new "{The Title}" "{X}" "{Y}" xy<br>
+ plot new name foo "{The Title}" "{X}" "{Y}" xy<br>
+ <br>
+ # load additional dataset into an existing plot<br>
+ ds9.set(string cmd, string url)<br>
+ plot data xy # plot additional data<br>
+ plot foo data xy # plot additional data<br>
+ </tt><tt><tt><tt><tt><tt><tt><tt><br>
+ </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ value = ds9.get(string cmd)<br>
+ </tt></tt></tt></tt></tt></tt>plot
+ stats<br>
+ plot list<br>
+ </tt></tt></tt>ds9.set(string cmd)<br>
+ </tt></tt></tt></tt>plot load foo.dat xy # load new
+ dataset with dimension xy<br>
+ plot save bar.dat # save current dataset<br>
+ </tt></tt><tt><tt>plot clear # clear all datasets<br>
+ plot duplicate # duplicate current dataset<br>
+ plot stats<br>
+ plot list<br>
+ </tt></tt><tt><tt>plot loadconfig foo.plt # load plot
+ configuration <br>
+ plot saveconfig bar.plt # save current plot configuration<br>
+ </tt></tt><tt><tt>plot pagesetup orient portrait<br>
+ plot pagesetup size letter<br>
+ </tt></tt><tt><tt>plot print<br>
+ plot print destination file<br>
+ plot print command "lp"<br>
+ plot print filename "foo.ps"<br>
+ plot print color rgb<br>
+ </tt>plot close # close current plot<br>
+ </tt></tt><tt><tt><tt><tt><br>
+ string value = ds9.get(string cmd)<br>
+ </tt>plot mode<br>
+ </tt></tt></tt><tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>plot mode pointer</tt><br>
+ </tt><tt><br>
+ # configure plot<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>string value = ds9.get(string
+ cmd)<br>
+ </tt></tt></tt></tt>plot axis x grid<br>
+ </tt><tt><tt>plot axis x log<br>
+ </tt></tt><tt><tt><tt>plot axis x flip</tt></tt></tt><br>
+ </tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ axis x auto<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ axis x min<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ axis x max<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ axis x format<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ legend<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt>plot legend
+ position<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>plot
+ font numbers font<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ font numbers size<br>
+ </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ font numbers weight<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ font numbers slant<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ title<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ title x<br>
+ plot barmode<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>
+ </tt></tt></tt></tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>plot axis x grid yes<br>
+ plot axis x log yes</tt><br>
+ <tt>plot axis x flip yes</tt><tt><br>
+ </tt></tt><tt><tt><tt><tt>plot axis x auto no<br>
+ plot axis x min 0<br>
+ plot axis x max 100<br>
+ </tt></tt><tt><tt><tt><tt>plot axis x format {%f}<br>
+ </tt></tt></tt></tt>plot legend yes # show legend<br>
+ </tt><tt>plot legend position left</tt><tt><tt><tt><tt><br>
+ </tt></tt>plot font numbers font times<br>
+ plot font numbers size 12<br>
+ plot font numbers weight bold<br>
+ plot font numbers slant italic<br>
+ </tt></tt></tt><tt><tt>plot title {The Title}<br>
+ plot title x {X Axis}<br>
+ plot barmode aligned<br>
+ <br>
+ # configure current dataset<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>string value = ds9.get(string
+ cmd)<br>
+ </tt></tt></tt></tt>plot show<br>
+ plot shape</tt> <br>
+ <tt><tt>plot shape fill<br>
+ </tt></tt><tt><tt><tt>plot shape color<br>
+ </tt></tt></tt><tt><tt><tt><tt>plot smooth<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt>plot color<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>plot
+ width<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dash<br>
+ </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error color<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error width<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>plot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt>ds9.set(string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cmd)<br>
+ </tt>plot show yes<br>
+ plot shape circle<br>
+ </tt><tt><tt>plot shape fill no<br>
+ </tt></tt><tt><tt><tt>plot shape color cyan<br>
+ </tt></tt></tt><tt><tt>plot smooth step<br>
+ </tt>plot color red<br>
+ plot width 2<br>
+ plot dash yes<br>
+ plot error yes<br>
+ plot error color red</tt><br>
+ <tt>plot error width 2</tt><br>
+ <tt>plot name {My Data}</tt><br>
+ <tt><br>
+ # select current dataset<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>string value = ds9.get(string
+ cmd)<br>
+ </tt></tt></tt></tt>plot select<br>
+ </tt></tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>plot select 2</tt><br>
+ <br>
+ </tt><b><b><a name="png"></a></b>png</b>
+ <p>Load PNG image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ png [new|slice] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>png</tt><br>
+ <tt><tt>ds9.set(string cmd)<br>
+ </tt>png foo.png</tt><br>
+ <tt><tt>png new foo.png<br>
+ </tt></tt><tt><tt><tt>png slice foo.png<br>
+ </tt></tt>png</tt><br>
+ <tt><tt>png</tt><tt> new<br>
+ </tt>png</tt><tt> slice</tt><br>
+ <p><b> <a name="prefs"></a>prefs</b></p>
+ <p>Controls various preference settings. </p>
+ <tt> Syntax: <br>
+ prefs [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [irafalign yes|no]<br>
+ &nbsp; <br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ prefs irafalign<br>
+ ds9.set(string cmd)<br>
+ prefs clear<br>
+ prefs irafalign<br>
+ <br>
+ </tt><b><a name="preserve"></a>preserve</b>
+ <p>Preserve the follow attributes while loading a new image. </p>
+ <tt> Syntax: <br>
+ preserve [pan yes|no]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; [regions yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd) <br>
+ preserve pan<br>
+ preserve regions<br>
+ ds9.set(string cmd)<br>
+ preserve pan yes<br>
+ preserve regions yes<br>
+ </tt>
+ <p><b><a name="psprint"></a>psprint</b></p>
+ <p>Invokes postscript printing. Please see <a
+ href="file:///Users/joye/saods9/ds9/doc/ref/command.html#print">print</a>
+ for further details.</p>
+ <p><b> <a name="print"></a>print</b></p>
+ <p>Controls printing. Use print option to set printing options.</p>
+ <tt> Syntax: <br>
+ print [destination printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command &lt;command&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [filename &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color rgb|cmyk|gray] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [level 1|2] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [resolution 53|72|75|150|300|600]
+ <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd) <br>
+ print destination <br>
+ print command <br>
+ print filename <br>
+ print color<br>
+ print level <br>
+ print resolution <br>
+ ds9.set(string cmd)<br>
+ print <br>
+ print destination file <br>
+ print command '{gv -}' <br>
+ print filename foo.ps <br>
+ print color cmyk <br>
+ print level 2 <br>
+ print resolution 75 </tt>
+ <p><b> <a name="raise"></a>raise</b></p>
+ <p>Raise in the window stacking order. </p>
+ <tt> Syntax: <br>
+ raise <br>
+ &nbsp;<br>
+ Example: <br>
+ ds9.set(string cmd)<br>
+ raise </tt>
+ <p><b> <a name="regions"></a>regions</b></p>
+ <p>Controls regions in the current frame. </p>
+ <tt> Syntax: <br>
+ regions&nbsp;[&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load [all]
+ &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save
+ &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [list [close]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [epsilon
+ &lt;integer&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [show yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [showtext yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid auto
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid radius
+ &lt;value&gt;|iteration &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [getinfo]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move front] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select all]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select none] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select invert]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [delete all] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [delete select] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format
+ ds9|xml|ciao|saotng|saoimage|pros|xy] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [system
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sky
+ fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [strip yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [shape &lt;shape&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color
+ &amp;ltcolor&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [width &lt;width&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [fixed|edit|rotate|delete yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [include|exclude|source|background]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [delim
+ [nl|&lt;char&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command &lt;marker
+ command&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [composite]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [dissolve]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [template
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [template &lt;filename&gt;
+ at &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt; &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [savetemplate
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [groups] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group new]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ new]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ update]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; select]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; color
+ &lt;color&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; copy] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; delete]
+ <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; font
+ &lt;font&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; move
+ &lt;int&gt; &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ movefront] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ moveback] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ property &lt;property&gt; yes|no] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [paste
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [undo]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [include|exclude|source|background|selected]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-format
+ ds9|ciao|saotng|saoimage|pros|xy]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-system
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-sky
+ fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-delim [nl|&lt;char&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-prop
+ select|edit|move|rotate|delete|fixed|include|source 1|0] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-group &lt;tag&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-strip yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-wcs yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ string url = ds9.get(string cmd)<br>
+ regions<br>
+ regions -format ds9 -system wcs -sky fk5 -skyformat sexagesimal
+ -prop edit 1 -group foo <br>
+ string value = ds9.get(string cmd) <br>
+ regions epsilon<br>
+ regions show<br>
+ regions showtext<br>
+ regions centroid<br>
+ regions centroid auto<br>
+ regions centroid radius<br>
+ regions centroid iteration<br>
+ regions selected<br>
+ regions format <br>
+ regions system <br>
+ regions sky <br>
+ regions skyformat <br>
+ regions strip<br>
+ regions shape <br>
+ regions color <br>
+ regions width<br>
+ regions delim<br>
+ regions source <br>
+ regions background <br>
+ regions include <br>
+ regions exclude <br>
+ regions selected<br>
+ regions groups<br>
+ ds9.set(string cmd, string url)<br>
+ regions -format xy -system wcs -sky fk5<br>
+ regions -format ds9<br>
+ ds9.set(string cmd)<br>
+ regions foo.reg <br>
+ regions -format ciao bar.reg # load as ciao format<br>
+ regions foo.fits # FITS regions files do not need a format
+ specification<br>
+ regions load foo.reg # load foo.reg into current frame<br>
+ regions load all foo.reg # load foo.reg into all frames<br>
+ regions load *.reg# expand *.reg and load into current frame<br>
+ regions load all *.reg # expand *.reg and load into all frames<br>
+ regions save foo.reg<br>
+ regions list <br>
+ regions list close<br>
+ regions epsilon 5<br>
+ regions show yes<br>
+ regions showtext no<br>
+ regions centroid<br>
+ regions centroid auto yes<br>
+ regions centroid radius 10<br>
+ regions centroid iteration 20<br>
+ regions getinfo<br>
+ regions move back <br>
+ regions move front <br>
+ regions select all <br>
+ regions select none <br>
+ regions select invert<br>
+ regions delete all <br>
+ regions delete select <br>
+ regions format ds9 <br>
+ regions system wcs<br>
+ regions sky fk5 <br>
+ regions skyformat degrees <br>
+ regions delim nl <br>
+ regions strip yes<br>
+ regions shape ellipse <br>
+ regions color red <br>
+ regions width 3<br>
+ regions edit yes<br>
+ regions include<br>
+ regions command "circle 100 100 20 # color=red"<br>
+ regions composite<br>
+ regions dissolve<br>
+ regions template foo.tpl<br>
+ regions template foo.tpl at 13:29:55.92 +47:12:48.02 fk5<br>
+ regions savetemplate foo.tpl<br>
+ regions group new<br>
+ regions group foo new<br>
+ regions group foo update<br>
+ regions group foo select<br>
+ regions group foo color red<br>
+ regions group foo copy<br>
+ regions group foo delete<br>
+ regions group foo cut<br>
+ regions group foo font 'times 14 bold'<br>
+ regions group foo move 100 100 <br>
+ regions group foo movefront <br>
+ regions group foo moveback <br>
+ regions group foo property delete no <br>
+ regions copy<br>
+ regions cut<br>
+ regions paste wcs<br>
+ regions undo<br>
+ </tt>
+ <p><b> <a name="restore"></a>restore</b></p>
+ <p>Restore DS9 to a previous state from a backup save set. </p>
+ <tt> Syntax: <br>
+ restore &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ restore ds9.bck</tt><br>
+ <p><b> <a name="rgb"></a>rgb</b></p>
+ <p>Create RGB frame and control RGB frame parameters.</p>
+ <tt> Syntax: <br>
+ rgb&nbsp; []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[red|green|blue]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[channel [red|green|blue]]<br>
+ &nbsp;&nbsp; &nbsp; [view [red|green|blue] [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[lock
+ wcs|crop|slice|bin|scale|scalelimits|colorbar|block|smooth
+ [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ rgb channel<br>
+ </tt><tt>rgb lock wcs</tt><br>
+ <tt>rgb lock crop</tt><br>
+ <tt>rgb lock slice</tt><br>
+ <tt> rgb lock bin<br>
+ rgb lock scale<br>
+ rgb lock scalelimits<br>
+ rgb lock colorbar<br>
+ rgb lock block<br>
+ rgb lock smooth<br>
+ rgb system<br>
+ rgb view red<br>
+ rgb view green<br>
+ rgb view blue<br>
+ ds9.set(string cmd)<br>
+ rgb # create new rgb frame<br>
+ rgb red # set current channel to red<br>
+ rgb channel red # set current channel to red<br>
+ rgb view blue no # turn off blue channel<br>
+ rgb system wcs # set rgb coordinate system<br>
+ </tt><tt>rgb lock wcs yes</tt><br>
+ <tt>rgb lock crop yes</tt><br>
+ <tt>rgb lock slice yes</tt><br>
+ <tt>rgb lock bin yes</tt><br>
+ <tt> rgb lock scale yes<br>
+ rgb lock scalelimits yes<br>
+ rgb lock colorbar yes<br>
+ rgb lock block yes<br>
+ rgb lock smooth yes<br>
+ rgb open<br>
+ rgb close</tt><br>
+ <p><b> <a name="rgbarray"></a>rgbarray</b></p>
+ <p>Load raw data array cube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbarray [native|big|little]<br>
+ rgbarray [new|mask]
+[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],[zdim=3],bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt></tt>rgbarray<br>
+ rgbarray little<br>
+ </tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt></tt>rgbarray
+ foo.arr[dim=512,zdim=3,bitpix=-32,endian=little]<br>
+ rgbarray new foo.arr[dim=512,zdim=3,bitpix=</tt><tt>-32,endian=little]</tt><br>
+ <p><b> <a name="rgbcube"></a>rgbcube</b></p>
+ <p>Load FITS rgbcube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbcube [new] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>rgbcube<br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>rgbcube foo.fits</tt><br>
+ <tt><tt>rgbcube new foo.fits<br>
+ </tt>rgbcube</tt><br>
+ <tt>rgbcube</tt><tt> new</tt><br>
+ <p><b> <a name="rgbimage"></a>rgbimage</b></p>
+ <p>Load FITS rgbimage into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbimage [new] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt></tt>rgbimage<br>
+ </tt><tt><tt><tt>ds9.set(string cmd)<br>
+ </tt></tt>rgbimage foo.fits</tt><br>
+ <tt><tt>rgbimage new foo.fits<br>
+ </tt>rgbimage</tt><br>
+ <tt>rgbimage</tt><tt> new</tt>
+ <p><b> <a name="rotate"></a>rotate</b></p>
+ <p>Controls the rotation angle (in degrees) of the current frame.
+ </p>
+ <tt> Syntax: <br>
+ rotate [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ rotate <br>
+ ds9.set(string cmd)<br>
+ rotate 45 <br>
+ rotate to 30<br>
+ rotate open<br>
+ rotate close</tt><br>
+ <p><b><a name="samp"></a>samp</b></p>
+ <p>Configure SAMP protocol. </p>
+ <tt> Syntax: <br>
+ samp [no|disconnect] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [broadcast [image|table]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [send [image|table]
+ &lt;application&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>samp no<br>
+ </tt><tt><tt>samp disconnect<br>
+ </tt>samp broadcast image<br>
+ samp send image aladin</tt>
+ <p><b> <a name="save"></a>save<br>
+ </b></p>
+ <p>Save loaded image data of current frame as FITS.</p>
+ <tt> Syntax: <br>
+ save </tt><tt>[fits|rgbimage|rgbcube|mecube|mosaic|mosaicimage]
+ &lt;filename&gt; [image|table|slice]</tt> <br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>ds9.set(string cmd) <br>
+ </tt>save foo.fits</tt><br>
+ <tt>save fits foo.fits image</tt><br>
+ <tt>save fits foo.fits table<br>
+ save fits foo.fits slice</tt><br>
+ <tt>save rgbimage foo.fits<br>
+ </tt><tt>save rgbcube foo.fits</tt><br>
+ <tt>save mecube foo.fits</tt><br>
+ <tt>save mosaic foo.fits</tt><br>
+ <tt>save mosaicimage foo.fits</tt><br>
+ <p><b> <a name="saveimage"></a>saveimage</b></p>
+ <p>Create a snap shot of the current DS9 window and save in
+ specified image format. If no format specified, the file name
+ extension is used to determine the output format. Optional
+ parameters: <tt>jpeg</tt> quality (1-100) and <tt>tiff</tt>
+ compression method. </p>
+ <tt> Syntax: <br>
+ saveimage </tt><tt>[fits|eps|gif|tiff|jpeg|png] </tt><tt>&lt;filename&gt;<br>
+ saveimage &lt;filename&gt;.jpeg [1-100]<br>
+ saveimage &lt;filename&gt;.tiff [none|jpeg|packbits|deflate]<br>
+ &nbsp;<br>
+ Example:<br>
+ ds9.set(string cmd) <br>
+ saveimage ds9.tiff<br>
+ saveimage jpeg ds9.jpeg 75</tt><br>
+ <p><b> <a name="scale"></a>scale</b></p>
+ <p>Controls the limits and color scale distribution. </p>
+ <tt> Syntax: <br>
+ scale [linear|log|pow|sqrt|squared|asinh|sinh|histequ]<br>
+ &nbsp; &nbsp; &nbsp; [log exp &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [datasec yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [limits &lt;minvalue&gt;
+ &lt;maxvalue&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scope local|global]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match limits]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock limits [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ scale<br>
+ scale log exp <br>
+ scale datasec <br>
+ scale limits <br>
+ scale mode <br>
+ scale scope <br>
+ scale lock<br>
+ scale lock limits<br>
+ ds9.set(string cmd)<br>
+ scale linear<br>
+ scale log exp 100<br>
+ scale datasec yes <br>
+ scale histequ <br>
+ scale limits 1 100 <br>
+ scale mode zscale <br>
+ scale mode 99.5 <br>
+ scale scope local<br>
+ scale match<br>
+ scale match limits<br>
+ scale lock yes<br>
+ scale lock limits yes<br>
+ scale open<br>
+ scale close<br>
+ </tt>
+ <p><b> <a name="shm"></a>shm</b></p>
+ <p>Load a shared memory segment into the current frame. </p>
+ <tt> Syntax: <br>
+ shm [&lt;key&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [key &lt;key&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [shmid &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [fits [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaicimage [iraf|wcs|wcsa...wcsz|wfpc2]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaicimagenext [wcs|wcsa...wcsz]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaic [iraf|wcs|wcsa...wcsz] [key|shmid]
+ &lt;id&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [rgbcube [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [rgbimage [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [rgbarray [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;,zdim=3],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [array [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [startload|finishload]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ shm <br>
+ ds9.set(string cmd)<br>
+ shm 102 <br>
+ shm key 102<br>
+ shm shmid 102 foo<br>
+ shm fits key 100 foo <br>
+ shm mosaicimage iraf key 100 foo <br>
+ shm mosaicimage wcs key 100 foo <br>
+ shm mosaicimage wcsa key 100 foo <br>
+ shm mosaicimage wfpc2 key 100 foo <br>
+ shm mosaicimagenext wcs key 100 foo<br>
+ shm mosaic iraf key 100 foo <br>
+ shm mosaic wcs key 100 foo <br>
+ shm rgbcube key 100 foo <br>
+ shm rgbimage key 100 foo<br>
+ shm rgbarray key 100 [dim=200,zdim=3,bitpix=-32]<br>
+ shm array shmid 102 [dim=32,bitpix=-32]<br>
+ shm startload # start a multiple load sequence without updating
+ the display<br>
+ shm finishload # finish multiple load sequence</tt><br>
+ <p><b> <a name="sia"></a>sia<br>
+ </b></p>
+ <p>Support for VO Simple Image Access protocol. The first command
+ will create a new search. All other commands operated on the
+ last search created, unless indicated otherwise.</p>
+ <tt> Syntax:<br>
+ sia</tt><tt> </tt><tt><tt><tt>[2mass|akari|astrowise|cadc|cxc|mast|sdss|skyview|tgssadr</tt><tt>]</tt></tt><br>
+ <br>
+ </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [&lt;ref&gt;] [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [clear]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [coordinate &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [export sb|tsv &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [name
+ &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [retrieve]</tt><br>
+ <tt> </tt></tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [&lt;ref&gt;] [save &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [sky &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [skyformat &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [system &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [update]</tt><br>
+ &nbsp; <tt><br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ sia<br>
+ <br>
+ ds9.set(string cmd)<br>
+ sia</tt><tt> 2mass<br>
+ sia</tt><tt> cancel<br>
+ sia</tt><tt> clear<br>
+ sia</tt><tt> close<br>
+ sia</tt><tt> coordinate 202.48 47.21 fk5<br>
+ sia</tt><tt> crosshair<br>
+ sia</tt><tt> export tsv bar.tsv<br>
+ sia</tt><tt> name m51<br>
+ sia</tt><tt> print</tt><br>
+ <tt>sia</tt><tt> retrieve<br>
+ sia</tt><tt> save foo.xml<br>
+ sia</tt><tt> size 1 1 degrees</tt><br>
+ <tt>sia</tt><tt> sky fk5<br>
+ sia skyformat degrees<br>
+ sia</tt><tt> system wcs</tt><tt><br>
+ sia</tt><tt> update<br>
+ <br>
+ </tt><b><a name="single"></a>single</b>
+ <p>Select Single Display mode </p>
+ <tt> Syntax: <br>
+ single <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ single <br>
+ ds9.set(string cmd)<br>
+ single<br>
+ </tt>
+ <p><b><a name="skyview"></a>skyview </b></p>
+ <p>Support for SkyView image server at HEASARC. </p>
+ <p> </p>
+ <tt> Syntax: <br>
+ skyview []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [pixels &lt;width&gt;
+ &lt;height&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [survey &lt;survey&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ skyview name <br>
+ skyview coord <br>
+ skyview size<br>
+ skyview pixels<br>
+ skyview save<br>
+ skyview frame<br>
+ skyview survey<br>
+ ds9.set(string cmd)<br>
+ skyview<br>
+ skyview m31 <br>
+ skyview name m31 <br>
+ skyview coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ skyview size 60 60 arcmin<br>
+ skyview pixels 600 600<br>
+ skyview save yes<br>
+ skyview frame current<br>
+ skyview update frame<br>
+ skyview survey sdssi<br>
+ skyview open<br>
+ skyview close<br>
+ </tt>
+ <p><b><a name="sleep"></a>sleep </b></p>
+ <p>Delays execution for specified number of seconds. Default is 1
+ second. </p>
+ <p> </p>
+ <tt> Syntax: <br>
+ sleep [#]<br>
+ &nbsp;<br>
+ Example: <br>
+ ds9.set(string cmd)<br>
+ sleep<br>
+ sleep 2<br>
+ </tt>
+ <p><b><a name="smooth"></a>smooth</b></p>
+ <p>Smooth current image or set smooth parameters.</p>
+ <tt> Syntax:<br>
+ smooth []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [function
+ boxcar|tophat|gaussian]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [radius &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ smooth<br>
+ smooth function<br>
+ smooth radius<br>
+ smooth lock<br>
+ ds9.set(string cmd)<br>
+ smooth<br>
+ smooth yes<br>
+ smooth function tophat<br>
+ smooth radius 4<br>
+ smooth open<br>
+ smooth close<br>
+ smooth match<br>
+ smooth lock yes<br>
+ </tt>
+ <p><b> <a name="source"></a>source</b></p>
+ <p>Source TCL code from a file. </p>
+ <tt> Syntax: <br>
+ source [filename] <br>
+ &nbsp;<br>
+ Example: <br>
+ ds9.set(string cmd)<br>
+ source foo.tcl</tt><br>
+ <p><b> <a name="tcl"></a>tcl</b></p>
+ <p>Execute one TCL command.<br>
+ </p>
+ <tt> Syntax:<br>
+ tcl &lt;tcl command&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>tcl puts "Hello, World"<br>
+ </tt>
+ <p><b> <a name="threads"></a>threads</b></p>
+ <p>Set number of process threads for functions which are
+ multi-threaded. </p>
+ <tt> Syntax:<br>
+ threads #<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt>string value = ds9.get(string cmd)<br>
+ </tt><tt>threads</tt><br>
+ <tt>ds9.set(string cmd)<br>
+ </tt><tt>threads 8</tt><br>
+ <p><b> <a name="tiff"></a>tiff</b></p>
+ <p>Load TIFF image into current frame. Optional parameters: <tt>tiff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>compression method. </p>
+ <tt> Syntax:<br>
+ tiff [new|slice] [&lt;filename&gt;] [none|jpeg|packbits|deflate]<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>string value = ds9.get(string cmd)<br>
+ </tt>tiff</tt><br>
+ <tt><tt>tiff jpeg</tt><br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>tiff foo.tiff<br>
+ tiff new foo.tiff<br>
+ tiff slice foo.tiff</tt><tt><tt><br>
+ </tt>tiff<br>
+ tiff new<br>
+ tiff slice</tt><br>
+ <p><b> <a name="tile"></a>tile</b></p>
+ <p>Controls the tile display mode. </p>
+ <tt> Syntax: <br>
+ tile []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mode grid|column|row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid mode automatic|manual]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid direction x|y]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid layout &lt;col&gt; &lt;row&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid gap &lt;pixels&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [column] <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ tile <br>
+ tile mode <br>
+ tile grid mode<br>
+ tile grid direction <br>
+ tile grid layout <br>
+ tile grid gap <br>
+ ds9.set(string cmd)<br>
+ tile<br>
+ tile yes <br>
+ tile mode row <br>
+ tile grid <br>
+ tile grid mode manual<br>
+ tile grid direction x <br>
+ tile grid layout 5 5 <br>
+ tile grid gap 10 <br>
+ tile row <br>
+ tile column </tt>
+ <p><b> <a name="update"></a>update</b></p>
+ <p>Updates the current frame or region of frame. In the second
+ form, the first argument is the number of the fits HDU (starting
+ with 1) and the remaining args are a bounding box in IMAGE
+ coordinates. By default, the screen is updated the next
+ available idle cycle. However, you may force an immediate update
+ by specifying the NOW option. </p>
+ <tt> Syntax: <br>
+ update [] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [# x1 y1 x2 y2] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now # x1 y1 x2 y2]<br>
+ &nbsp; <br>
+ Example: <br>
+ ds9.set(string cmd)<br>
+ update <br>
+ update 1 100 100 300 400 <br>
+ update now <br>
+ update now 1 100 100 300 400</tt><br>
+ <p><b> <a name="url"></a>url</b></p>
+ <p>Load FITS from URL into the current frame</p>
+ <tt> Syntax: <br>
+ url &lt;url&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>ds9.set(string cmd)<br>
+ </tt>url http://foo.bar.edu/foo.fits </tt>
+ <p><b> <a name="version"></a>version</b></p>
+ <p>Returns the current version of DS9. </p>
+ <tt> Syntax: <br>
+ version <br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ version </tt>
+ <p><b> <a name="view"></a>view</b></p>
+ <p>Controls the GUI. </p>
+ <tt> Syntax: <br>
+ view&nbsp; [layout horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [keyvalue &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [info yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [panner yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [magnifier yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [buttons yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar numerics yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [graph horizontal|vertical
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [filename yes|no[<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [object yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [keyword yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [minmax yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [lowhigh yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [units yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [image|physical|wcs|wcsa...wcsz
+ yes|no]<br>
+ </tt><tt><tt>&nbsp;&nbsp;&nbsp; &nbsp; [frame yes|no] <br>
+ </tt>&nbsp;&nbsp;&nbsp; &nbsp; [red yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [green yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [blue yes|no]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ view layout<br>
+ view keyvalue<br>
+ view info <br>
+ view panner<br>
+ view magnifier<br>
+ view buttons<br>
+ view colorbar<br>
+ view graph horizontal<br>
+ view filename<br>
+ view object<br>
+ view keyword<br>
+ view minmax<br>
+ view lowhigh<br>
+ view units<br>
+ view image<br>
+ view wcsa<br>
+ </tt><tt><tt>view frame<br>
+ </tt>view red<br>
+ ds9.set(string cmd)<br>
+ view layout vertical<br>
+ view keyvalue BITPIX<br>
+ view info yes<br>
+ view panner yes<br>
+ view magnifier yes<br>
+ view buttons yes<br>
+ view colorbar yes<br>
+ view graph horizontal yes<br>
+ view filename yes<br>
+ view object yes<br>
+ view keyword yes<br>
+ view minmax yes<br>
+ view lowhigh yes<br>
+ view units yes<br>
+ view wcsa yes<br>
+ </tt><tt><tt>view frame yes <br>
+ </tt>view red yes<br>
+ view green yes<br>
+ view blue yes</tt><br>
+ <p><b> <a name="vla"></a>vla</b></p>
+ <p>Support for VLA Sky Survey. </p>
+ <tt> Syntax:<br>
+ vla []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey first|stripe82]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ vla name <br>
+ vla coord <br>
+ vla size<br>
+ vla save<br>
+ vla frame<br>
+ vla survey<br>
+ ds9.set(string cmd)<br>
+ vla<br>
+ vla m31 <br>
+ vla name m31 <br>
+ vla coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ vla size 60 60 arcmin<br>
+ vla save yes<br>
+ vla frame current<br>
+ vla update frame <br>
+ vla survey stripe82<br>
+ vla open<br>
+ vla close<br>
+ </tt>
+ <p><b> <a name="vlss"></a>vlss</b></p>
+ <p>Support for NRAO VLSS Sky Survey.</p>
+ <tt> Syntax: <br>
+ vlss []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt; &lt;height&gt;
+ degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ vlss name <br>
+ vlss coord <br>
+ vlss size<br>
+ vlss save<br>
+ vlss frame<br>
+ ds9.set(string cmd)<br>
+ vlss<br>
+ vlss m31 <br>
+ vlss name m31 <br>
+ vlss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ vlss size 60 60 arcmin<br>
+ vlss save yes<br>
+ vlss frame current<br>
+ vlss update frame<br>
+ vlss open<br>
+ vlss close</tt><br>
+ <p><b> <a name="vo"></a>vo</b></p>
+ <p>Invoke an connection to a Virtual Observatory site. </p>
+ <tt> Syntax: <br>
+ vo [method xpa|mime]<br>
+ &nbsp;&nbsp; [server &lt;url&gt;]<br>
+ &nbsp;&nbsp; [internal yes|no]<br>
+ &nbsp;&nbsp; [delay #]<br>
+ &nbsp;&nbsp; [&lt;url&gt;]<br>
+ &nbsp;&nbsp; [connect &lt;url&gt;]<br>
+ &nbsp;&nbsp; [disconnect &lt;url&gt;]<br>
+ &nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ vo<br>
+ vo method<br>
+ vo server<br>
+ vo internal<br>
+ vo delay<br>
+ vo connect<br>
+ ds9.set(string cmd)<br>
+ vo method xpa<br>
+ vo server "http://foo.bar.edu/list.txt"<br>
+ vo internal yes<br>
+ vo delay 15<br>
+ vo chandra-ed<br>
+ vo connect chandra-ed<br>
+ vo disconnect chandra-ed<br>
+ vo open<br>
+ vo close<br>
+ </tt>
+ <p><b> <a name="wcs"></a>wcs</b></p>
+ <p>Controls the World Coordinate System for the current frame. If
+ the wcs system, skyframe, or skyformat is modified, the info
+ panel, compass, grid, and alignment will be modified
+ accordingly. Also, using this access point, a new WCS
+ specification can be loaded and used by the current image
+ regardless of the WCS that was contained in the image file. WCS
+ specification can be sent to DS9 as an ASCII file . Please see <a
+ href="file.html#WCS">WCS</a> for more information. </p>
+ <tt> Syntax: <br>
+ wcs [[system] wcs|wcsa...wcsz] <br>
+ &nbsp;&nbsp;&nbsp; [[sky] fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp; [[skyformat] degrees|sexagesimal] <br>
+ &nbsp;&nbsp;&nbsp; [align yes|no] <br>
+ &nbsp;&nbsp;&nbsp; [reset [#]] <br>
+ &nbsp;&nbsp;&nbsp; [replace [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [append [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ string value = ds9.get(string cmd)<br>
+ wcs <br>
+ wcs system <br>
+ wcs sky <br>
+ wcs skyformat <br>
+ wcs align <br>
+ ds9.set(string cmd)<br>
+ wcs wcs <br>
+ wcs system wcs<br>
+ </tt><tt>wcs fk5<br>
+ </tt><tt>wcs sky fk5<br>
+ </tt><tt>wcs sexagesimal <br>
+ </tt><tt>wcs skyformat sexagesimal <br>
+ wcs align yes <br>
+ wcs reset <br>
+ wcs reset 3<br>
+ wcs replace foo.wcs <br>
+ wcs replace 3 foo.wcs <br>
+ wcs append foo.wcs <br>
+ wcs append 3 foo.wcs <br>
+ ds9.set(string cmd, string url)<br>
+ wcs replace <br>
+ wcs append<br>
+ wcs open<br>
+ wcs close<br>
+ </tt>
+ <p><b> <a name="web"></a>web</b></p>
+ <p>Display specified URL in the web display. </p>
+ <tt> Syntax:<br>
+ web [new|&lt;webname&gt;] [&lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [click
+ back|forward|stop|reload|#]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [clear]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ web <br>
+ ds9.set(string cmd)<br>
+ web www.cnn.com<br>
+ web new www.cnn.com<br>
+ web hvweb www.apple.com<br>
+ web click back<br>
+ web click 2<br>
+ web clear<br>
+ web close<br>
+ </tt>
+ <p><b> <a name="width"></a>width</b></p>
+ <p>Set the width of the image display window.</p>
+ <tt> Syntax: <br>
+ width [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ width<br>
+ ds9.set(string cmd)<br>
+ width 512<br>
+ </tt>
+ <p><b> <a name="zscale"></a>zscale</b></p>
+ <p>Set Scale Limits based&nbsp; on the <i>IRAF</i> algorithm. </p>
+ <tt> Syntax: <br>
+ zscale []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [contrast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sample]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [line]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd)<br>
+ zscale contrast<br>
+ zscale sample<br>
+ zscale line<br>
+ ds9.set(string cmd)<br>
+ zscale<br>
+ zscale contrast .25<br>
+ zscale sample 600<br>
+ zscale line 120<br>
+ </tt>
+ <p><b> <a name="zoom"></a>zoom</b></p>
+ <p>Controls the current zoom value for the current frame. </p>
+ <tt> Syntax: <br>
+ zoom [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example:<br>
+ string value = ds9.get(string cmd) <br>
+ zoom <br>
+ ds9.set(string cmd)<br>
+ zoom 2 <br>
+ zoom 2 4<br>
+ zoom to 4 <br>
+ zoom to 2 4<br>
+ zoom in<br>
+ zoom out<br>
+ zoom to fit<br>
+ zoom open<br>
+ zoom close<br>
+ </tt> </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/vo.html b/ds9/doc/ref/vo.html
new file mode 100644
index 0000000..3547d42
--- /dev/null
+++ b/ds9/doc/ref/vo.html
@@ -0,0 +1,69 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=ISO-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>Virtual Observatory</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" vlink="#551a8b" text="#000000"
+ link="#0000ff">
+ <h3><img alt="" src="../sun.gif" align="middle" width="100" height="98">
+ Virtual Observatory Reference</h3>
+ <blockquote>
+ <p><b>Summary</b></p>
+ <p>Use the Web proxy connection if your firewall does not allow your
+ computer to connect directly to external computers. In this case, you
+ also must use DS9's internal browser.</p>
+ <p><b>Details</b></p>
+ <p>When you click on one of the Virtual Observatory servers in the VO
+ list, DS9 will attempt to connect to that server and (if the internal
+ Web display is enabled) display its Web page. The square box to the left
+ of the server name turns yellow while the connection is being
+ established and then green to signal success. </p>
+ <p>A direct connection is fast and flexible. Among other things, it
+ allows
+ you to perform analysis on your own local data (the VO server will
+ retrieve the image from DS9) and also allows you to use an
+ external browser to load images. </p>
+ <p>Some system managers configure their firewall explicitly to
+ prevent
+ computers in their care from making a direct connection to an external
+ host. Instead, they only allow external access through a Web proxy<br>
+ server (such as SOCKS). If you are using a computer behind a restricted
+ firewall of this sort, then DS9 will not be able to connect directly to
+ a VO server. The yellow box will not turn green and
+ eventually DS9 will display an error message. </p>
+ <p>In this case, you can choose to have DS9 communicate with the VO
+ servers through your Web proxy server. DS9 will use your proxy to send
+ its commands and retrieve its data and analysis results, rather than
+ doing this directly. Note that the following restrictions apply:<br>
+ </p>
+ <blockquote> <i>The transfer of data is slower.<br>
+ You must use the internal Web browser for loading images, etc.<br>
+ You cannot perform analysis on local data.<br>
+ There is a (large but finite) restriction on the number of
+ annuli, and number of polygon points you can specify in a region, as
+ well as the total number of regions allowed.</i><br>
+ </blockquote>
+ <p>If your computer and firewall have been configured to require use
+ of a
+ Web proxy server, you will have to tell DS9 about this server.
+ Click the <b>Configure Web Proxy</b> button and type the relevant
+ information into the boxes. (Your systems administrator will be able to
+ tell you the details.) At this point,
+ you should be able to connect to a VO server successfully. Please let
+ us know if you have problems! </p>
+ <blockquote>
+ <p> <i>A final note: you may, of course, choose to use the Web
+ proxy
+ even
+ if your computer and firewall are configured to allow direct
+ connections. In this case, there is no need to configure the proxy
+ server.<br>
+ </i></p>
+ </blockquote>
+ </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/ref/xpa.html b/ds9/doc/ref/xpa.html
new file mode 100644
index 0000000..db0c3de
--- /dev/null
+++ b/ds9/doc/ref/xpa.html
@@ -0,0 +1,6216 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=windows-1252">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>XPA Access Points</title>
+ </head>
+ <body alink="#ff0000" link="#0000ff" vlink="#551a8b">
+ <h3><img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> XPA Access Points</h3>
+ <blockquote>
+ <p>The <a href="http://hea-www.harvard.edu/RD/xpa/index.html">XPA
+ </a> messaging system provides seamless communication between
+ DS9 and other Unix programs, including X programs, Perl, <a
+ href="http://space.mit.edu/cxc/software/slang/modules/xpa/">
+ S-Lang,</a> and Tcl/Tk. It also provides an easy way for users
+ to communicate with DS9 by executing XPA client commands in the
+ shell or by utilizing such commands in scripts. Because XPA
+ works both at the programming level and the shell level, it is a
+ powerful tool for unifying any analysis environment.</p>
+ <tt> <a href="#2mass">2mass</a><br>
+ <a href="#3d">3d</a><br>
+ <a href="#about">about</a><br>
+ <a href="#align">align</a><br>
+ <a href="#analysis">analysis</a><br>
+ <a href="#array">array</a><br>
+ <a href="#background">background</a><br>
+ <a href="#backup">backup</a><br>
+ <a href="#bin">bin</a><br>
+ <a href="#blink">blink</a><br>
+ <a href="#block">block</a><br>
+ <a href="#catalog">catalog</a><br>
+ <a href="#cd">cd</a><br>
+ <a href="#cmap">cmap</a><br>
+ <a href="#colorbar">colorbar</a><br>
+ <a href="#console">console</a><br>
+ <a href="#contour">contour</a><br>
+ <a href="#crop">crop</a><br>
+ <a href="#crosshair">crosshair</a><br>
+ <a href="#cube">cube</a><br>
+ <a href="#cursor">cursor</a><br>
+ <a href="#data">data</a><br>
+ <a href="#dsssao">dsssao</a><br>
+ <a href="#dsseso">dsseso</a><br>
+ <a href="#dssstsci">dssstsci</a><br>
+ <a href="#envi">envi</a><br>
+ <a href="#exit">exit</a><br>
+ <a href="#export">export</a><br>
+ <a href="#file">file</a><br>
+ <a href="#fits">fits</a><br>
+ <a href="#frame">frame</a><br>
+ <a href="#gif">gif</a><br>
+ <a href="#grid">grid</a><br>
+ <a href="#header">header</a><br>
+ <a href="#height">height</a><br>
+ <a href="#iconify">iconify</a><br>
+ </tt><tt><tt><a href="#iexam">iexam</a><br>
+ </tt><a href="#iis">iis</a><br>
+ <a href="#jpeg">jpeg</a><br>
+ <a href="#lock">lock</a><br>
+ <a href="#lower">lower</a><br>
+ <a href="#magnifier">magnifier</a><br>
+ <a href="#mask">mask</a><br>
+ <a href="#match">match</a><br>
+ <a href="#mecube">mecube</a><br>
+ <a href="#minmax">minmax</a><br>
+ <a href="#mode">mode</a><br>
+ <a href="#mosaic">mosaic</a><br>
+ <a href="#mosaicimage">mosaicimage</a><br>
+ <a href="#movie">movie</a><br>
+ <a href="#multiframe">multiframe</a><br>
+ <a href="#nameserver">nameserver</a><br>
+ <a href="#nrrd">nrrd</a><br>
+ <a href="#nvss">nvss</a><br>
+ <a href="#orient">orient</a><br>
+ <a href="#pagesetup">pagesetup</a><br>
+ <a href="#pan">pan</a><br>
+ <a href="#pixeltable">pixeltable</a><br>
+ <a href="#plot">plot</a><br>
+ <a href="#png">png</a><br>
+ <a href="#prefs">prefs</a><br>
+ <a href="#preserve">preserve</a><br>
+ <a href="#print">psprint</a><br>
+ <a href="#print">print</a><br>
+ <a href="#exit">quit</a><br>
+ <a href="#raise">raise</a><br>
+ <a href="#regions">regions</a><br>
+ <a href="#restore">restore</a><br>
+ <a href="#rgb">rgb</a><br>
+ <a href="#rgbarray">rgbarray</a><br>
+ <a href="#rgbcube">rgbcube</a><br>
+ <a href="#rgbimage">rgbimage</a><br>
+ <a href="#rotate">rotate</a><br>
+ <a href="#save">save</a><br>
+ <a href="#saveimage">saveimage</a><br>
+ <a href="#scale">scale</a><br>
+ <a href="#shm">shm</a></tt><br>
+ <tt><tt><a href="#sia">sia</a><br>
+ </tt> <a href="#single">single</a><br>
+ <a href="#skyview">skyview</a><br>
+ <a href="#sleep">sleep</a><br>
+ <a href="#smooth">smooth</a><br>
+ <a href="#source">source</a><br>
+ <a href="#tcl">tcl</a><br>
+ <a href="#threads">threads</a><br>
+ <a href="#tile">tile</a><br>
+ <a href="#update">update</a><br>
+ <a href="#url">url</a><br>
+ <a href="#version">version</a><br>
+ <a href="#view">view</a><br>
+ <a href="#vla">vla</a></tt><br>
+ <tt><tt><a href="#vlss">vlss</a><br>
+ </tt> <a href="#vo">vo</a><br>
+ <a href="#wcs">wcs</a><br>
+ <a href="#web">web</a><br>
+ <a href="#width">width</a><br>
+ <a href="#xpa">xpa</a><br>
+ <a href="#zscale">zscale</a><br>
+ <a href="#zoom">zoom</a><br>
+ </tt>
+ <p><b> <a name="2mass"></a>2mass</b></p>
+ <p> Support for 2MASS Digital Sky Survey.</p>
+ <tt> Syntax: <br>
+ 2mass []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp; [survey j|h|k]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ </tt><tt>&nbsp; <br>
+ Example:<br>
+ $xpaget ds9 2mass name <br>
+ $xpaget ds9 2mass coord <br>
+ $xpaget ds9 2mass size<br>
+ $xpaget ds9 2mass save<br>
+ $xpaget ds9 2mass frame<br>
+ $xpaget ds9 2mass survey <br>
+ $xpaset -p ds9 2mass<br>
+ </tt><tt>$xpaset -p ds9 2mass m31<br>
+ $xpaset -p ds9 2mass name m31 <br>
+ $xpaset -p ds9 2mass coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $xpaset -p ds9 2mass size 60 60 arcmin<br>
+ $xpaset -p ds9 2mass save yes<br>
+ $xpaset -p ds9 2mass frame current<br>
+ $xpaset -p ds9 2mass update frame<br>
+ $xpaset -p ds9 2mass survey j<br>
+ </tt><tt>$xpaset -p ds9 2mass open<br>
+ $xpaset -p ds9 2mass close</tt><br>
+ <p><b> <a name="3d"></a>3d</b></p>
+ <p> Support for 3D frame.</p>
+ <tt> Syntax: <br>
+ 3d []<br>
+ &nbsp;&nbsp; [view &lt;az&gt; &lt;el&gt;]<br>
+ &nbsp;&nbsp; [az &lt;az&gt;]<br>
+ &nbsp;&nbsp; [el &lt;el&gt;]<br>
+ &nbsp;&nbsp; [scale &lt;scale&gt;]<br>
+ &nbsp;&nbsp; [method mip|aip]</tt><br>
+ <tt><tt>&nbsp;&nbsp; [background none|azimuth|elevation]<br>
+ </tt>&nbsp;</tt><tt>&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp; [border color &lt;color&gt;]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp; [highlite yes|no]<br>
+ &nbsp;&nbsp; [highlite color &lt;color&gt;]<br>
+ </tt><tt>&nbsp;&nbsp; [open|close]<br>
+ </tt><tt>&nbsp; <br>
+ Example:<br>
+ $xpaget ds9 3d view<br>
+ $xpaget ds9 3d az<br>
+ $xpaget ds9 3d el<br>
+ $xpaget ds9 3d scale<br>
+ $xpaget ds9 3d method<br>
+ </tt><tt>$xpaget ds9 3d background<br>
+ </tt><tt>$xpaget ds9 3d border<br>
+ $xpaget ds9 3d border color</tt><br>
+ <tt>$xpaget ds9 3d highlite<br>
+ $xpaget ds9 3d highlite color<br>
+ $xpaset -p ds9 3d # create new 3D frame<br>
+ $xpaset -p ds9 3d view 45 30<br>
+ $xpaset -p ds9 3d az 45<br>
+ $xpaset -p ds9 3d el 30<br>
+ $xpaset -p ds9 3d scale 10<br>
+ $xpaset -p ds9 3d method mip</tt><br>
+ <tt>$xpaset -p ds9 3d background azimuth<br>
+ </tt><tt>$xpaset -p ds9 3d border yes<br>
+ $xpaset -p ds9 3d border color red</tt><br>
+ <tt>$xpaset -p ds9 3d highlite yes<br>
+ $xpaset -p ds9 3d highlite color red<br>
+ $xpaset -p ds9 3d open<br>
+ $xpaset -p ds9 3d close<br>
+ </tt>
+ <p><b><a name="about"></a>about</b></p>
+ <p>Get DS9 credits. </p>
+ <tt> Syntax: <br>
+ about <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 about<br>
+ </tt>
+ <p><b> <a name="align"></a>align</b></p>
+ <p>Controls the World Coordinate System alignment for the current
+ frame.</p>
+ <tt> Syntax: <br>
+ align []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 align<br>
+ $xpaset -p ds9 align yes<br>
+ </tt>
+ <p><b> <a name="analysis"></a>analysis</b></p>
+ <p>Control external analysis tasks. Tasks are numbered as they are
+ loaded, starting with 0. Can also be used to display a message
+ and display text in the text dialog window. </p>
+ <tt> Syntax: <br>
+ analysis [&lt;task number&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [task &lt;task
+ number&gt;|&lt;task name&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [clear][load
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [message
+ ok|okcancel|yesno &lt;message&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [entry
+ &lt;message&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [text]</tt><tt><tt><br>
+ <br>
+ </tt> Example: <br>
+ $xpaget ds9 analysis<br>
+ $xpaget ds9 analysis task<br>
+ $xpaget ds9 analysis entry 'Please enter something'<br>
+ $xpaget ds9 analysis entry okcancel 'Please enter something'<br>
+ $xpaset -p ds9 analysis 0 # invoke first analysis task<br>
+ $xpaset -p ds9 analysis task 0<br>
+ $xpaset -p ds9 analysis task foobar<br>
+ $xpaset -p ds9 analysis "{foo bar}"<br>
+ $xpaset -p ds9 analysis my.ans<br>
+ $xpaset -p ds9 analysis load my.ans <br>
+ $xpaset -p ds9 analysis clear <br>
+ $xpaset -p ds9 analysis clear load my.ans<br>
+ $xpaset -p ds9 analysis message ok {This is a message}<br>
+ $xpaset -p ds9 analysis text {this is text}<br>
+ $cat my.ans | xpaset ds9 analysis load <br>
+ $cat foo.txt | xpaset ds9 analysis text <br>
+ </tt>
+ <p><b> <a name="array"></a>array</b></p>
+ <p>Load raw data array into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ array [native|big|little]<br>
+ array [new|mask]
+[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],zdim=&lt;z&gt;,bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 array &gt; foo.arr<br>
+ $xpaget ds9 array little &gt; foo.arr<br>
+ $xpaset -p ds9 array foo.arr[dim=512,bitpix=-32,endian=little]<br>
+ $xpaset -p ds9 array new foo.arr[dim=512,bitpix=</tt><tt>-32,endian=little]</tt><br>
+ <tt><tt>$xpaset -p ds9 array mask foo.arr[dim=512,bitpix=</tt></tt><tt>-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | xpaset ds9 array
+ [dim=512,bitpix=-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | xpaset ds9 array new
+ [dim=512,bitpix=-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | xpaset ds9 array mask
+ [dim=512,bitpix=-32,endian=little]</tt> <tt> </tt>
+ <p><b> <a name="background"></a>bg<br>
+ background</b></p>
+ <p>Set image background color. </p>
+ <tt> Syntax: <br>
+ bg &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaget ds9 bg</tt><tt><br>
+ <tt>$xpaset -p ds9 bg red</tt><br>
+ </tt>
+ <p><b> <a name="backup"></a>backup</b></p>
+ <p>Create a backup save set. </p>
+ <tt> Syntax: <br>
+ backup &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaset -p ds9 backup ds9.bck</tt><br>
+ <p><b> <a name="bin"></a>bin</b></p>
+ <p>Controls binning factor, binning buffer size, and&nbsp; binning
+ function for binning FITS bin tables. The access point blocking
+ is provided for backward compatibility. </p>
+ <tt> Syntax: <br>
+ bin [about &lt;x&gt; &lt;y&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [about center]<br>
+ &nbsp;&nbsp;&nbsp; [buffersize &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [cols &lt;x&gt; &lt;y&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [colsz &lt;x&gt; &lt;y&gt; &lt;z&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [factor &lt;value&gt; [&lt;vector&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [depth &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [filter &lt;string&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [function average|sum]<br>
+ &nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 bin about<br>
+ $xpaget ds9 bin buffersize<br>
+ $xpaget ds9 bin cols<br>
+ $xpaget ds9 bin factor<br>
+ $xpaget ds9 bin depth<br>
+ $xpaget ds9 bin filter<br>
+ $xpaget ds9 bin function<br>
+ $xpaget ds9 bin smooth<br>
+ $xpaget ds9 bin smooth function<br>
+ $xpaget ds9 bin smooth radius<br>
+ $xpaget ds9 bin lock<br>
+ $xpaset -p ds9 bin about 4096 4096<br>
+ $xpaset -p ds9 bin about center<br>
+ $xpaset -p ds9 bin buffersize 512<br>
+ $xpaset -p ds9 bin cols detx dety<br>
+ $xpaset -p ds9 bin colsz detx dety time<br>
+ $xpaset -p ds9 bin factor 4<br>
+ $xpaset -p ds9 bin factor 4 2<br>
+ $xpaset -p ds9 bin depth 10<br>
+ $xpaset -p ds9 bin filter 'pha &gt; 5'<br>
+ $xpaset -p ds9 bin filter ''<br>
+ $xpaset -p ds9 bin function sum<br>
+ $xpaset -p ds9 bin in<br>
+ $xpaset -p ds9 bin out<br>
+ $xpaset -p ds9 bin to fit<br>
+ $xpaset -p ds9 bin match<br>
+ $xpaset -p ds9 bin lock yes<br>
+ $xpaset -p ds9 bin open<br>
+ $xpaset -p ds9 bin close</tt><tt><br>
+ </tt>
+ <p><b> <a name="blink"></a>blink</b></p>
+ <p>Blink mode parameters. Interval is in seconds. <br>
+ </p>
+ <tt> Syntax: <br>
+ blink []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 blink<br>
+ $xpaget ds9 blink interval<br>
+ $xpaset -p ds9 blink<br>
+ $xpaset -p ds9 blink yes<br>
+ $xpaset -p ds9 blink interval 1</tt><br>
+ <p><b> <a name="block"></a>block</b></p>
+ <p>Controls blocking parameters. </p>
+ <tt> Syntax: <br>
+ block</tt><tt><tt> [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 block<br>
+ $xpaget ds9 block lock<br>
+ </tt><tt>$xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> 4<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> 4 2<br>
+ </tt><tt><tt><tt>$xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt>
+ to 4<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> to 4 2<br>
+ </tt>$xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> in<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt>
+ out<br>
+ </tt></tt>$xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> to
+ fit<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> match<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> lock yes<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> open<br>
+ $xpaset -p ds9 </tt><tt><tt><tt>block</tt></tt> close</tt><tt><br>
+ </tt>
+ <p><b> <a name="catalog"></a>catalog<br>
+ cat<br>
+ </b></p>
+ <p>Support for catalogs. The first three commands will create a
+ new catalog search. All other commands operated on the last
+ search created, unless indicated otherwise.</p>
+ <tt> Syntax: <br>
+ catalog []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ned|simbad|denis|skybot]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [ascss|cmc|gsc1|gsc2|gsc3|ac|nomad|ppmx|sao|sdss5|sdss6|</tt><tt>sdss7|sdss8|</tt><tt>tycho|ua2|ub1|ucac2]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [2mass|iras]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [csc|xmm|rosat]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [first|nvss]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [chandralog|cfhtlog|esolog|stlog|xmmlog]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [cds &lt;catalogname&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cds
+ &lt;catalogid&gt;]<br>
+ <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [import sb|tsv
+ &lt;filename&gt;]<br>
+ <br>
+ </tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [allcols]<br>
+ </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
+ [&lt;ref&gt;] [allrows]<br>
+ &nbsp;</tt><tt>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [clear]<br>
+ </tt><tt>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [coordinate &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [dec
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [edit
+ yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [export sb|tsv &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [filter &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [filter load
+ &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [header]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [hide]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [location
+ &lt;code&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [match &lt;ref&gt; &lt;ref&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match error &lt;value&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match function 1and2|1not2|2not1]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match return 1and2|1only|2only]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [match unique yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [maxrows
+ &lt;number&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [name
+ &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [panto yes|no]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [plot
+ &lt;xcol&gt; &lt;ycol&gt; &lt;xerrcol&gt; &lt;yerrcol&gt;]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psky
+ &lt;skyframe&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [psystem
+ &lt;coordsys&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [ra
+ &lt;col&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [regions]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [retrieve]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ broadcast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [samp
+ send &lt;application&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [save &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [server cds|sao|cadc|adac|iucaa|bejing|cambridge|ukirt]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [show]</tt><br>
+ <tt>&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&lt;ref&gt;] [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [sky &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [skyformat &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [sort
+ &lt;col&gt; incr|decr]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ [#]
+ condition|shape|color|text|font|fontsize|fontweight|fontslant
+ &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol [#] text|size|size2|units|angle &lt;value&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;]
+ [symbol shape {circle point}|{box point}|{diamond point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ &nbsp;&nbsp;&nbsp; {cross point}|{x point}|{arrow
+ point}|{boxcircle point}|<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
+ &nbsp;&nbsp; circle|ellipse|box|text]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ add| [#] remove]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [symbol
+ save|load &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [system
+ &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </tt><tt>[&lt;ref&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [update]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [x
+ &lt;col&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [y
+ &lt;col&gt;]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 catalog<br>
+ </tt><tt>$xpaget ds9 catalog header</tt><br>
+ <tt><br>
+ $xpaset -p ds9 catalog<br>
+ $xpaset -p ds9 catalog 2mass<br>
+ $xpaset -p ds9 catalog cds 2mass<br>
+ $xpaset -p ds9 catalog cds "I/252"<br>
+ <br>
+ </tt><tt>$xpaset -p ds9 catalog load foo.xml<br>
+ $xpaset -p ds9 catalog import tsv foo.tsv<br>
+ <br>
+ </tt><tt>$xpaset -p ds9 catalog allrows<br>
+ $xpaset -p ds9 catalog allcols<br>
+ </tt><tt>$xpaset -p ds9 catalog cancel<br>
+ </tt><tt>$xpaset -p ds9 catalog clear<br>
+ </tt><tt>$xpaset -p ds9 catalog close<br>
+ </tt><tt>$xpaset -p ds9 catalog coordinate 202.48 47.21 fk5<br>
+ </tt><tt>$xpaset -p ds9 catalog crosshair<br>
+ </tt><tt>$xpaset -p ds9 catalog dec DEC<br>
+ </tt><tt>$xpaset -p ds9 catalog edit yes<br>
+ </tt><tt>$xpaset -p ds9 catalog export tsv bar.tsv<br>
+ </tt><tt>$xpaset -p ds9 catalog filter '$Jmag&gt;10'<br>
+ $xpaset -p ds9 catalog filter load foo.flt<br>
+ $xpaset -p ds9 catalog header<br>
+ </tt><tt>$xpaset -p ds9 catalog hide<br>
+ </tt><tt>$xpaset -p ds9 catalog location 500</tt><br>
+ <tt>$xpaset -p ds9 catalog match error 2 arcsec<br>
+ $xpaset -p ds9 catalog match function 1and2<br>
+ $xpaset -p ds9 catalog match unique no<br>
+ $xpaset -p ds9 catalog match return 1only<br>
+ $xpaset -p ds9 catalog match 2mass csc<br>
+ </tt><tt>$xpaset -p ds9 catalog maxrows 2000<br>
+ </tt><tt>$xpaset -p ds9 catalog name m51<br>
+ $xpaset -p ds9 catalog panto no<br>
+ </tt><tt>$xpaset -p ds9 catalog plot '$Jmag' '$Hmag' '$e_Jmag'
+ '$e_Hmag'<br>
+ </tt><tt>$xpaset -p ds9 catalog print</tt><br>
+ <tt>$xpaset -p ds9 catalog psky fk5</tt><br>
+ <tt>$xpaset -p ds9 catalog psystem wcs</tt><br>
+ <tt>$xpaset -p ds9 catalog ra RA<br>
+ $xpaset -p ds9 catalog regions</tt><br>
+ <tt>$xpaset -p ds9 catalog retrieve<br>
+ </tt><tt> $xpaset -p ds9 catalog samp broadcast<br>
+ $xpaset -p ds9 catalog samp send aladin<br>
+ $xpaset -p ds9 catalog save foo.xml<br>
+ </tt><tt>$xpaset -p ds9 catalog server sao<br>
+ </tt><tt>$xpaset -p ds9 catalog show</tt><br>
+ <tt>$xpaset -p ds9 catalog size 1 1 degrees</tt><br>
+ <tt>$xpaset -p ds9 catalog symbol condition '$Jmag&gt;15'<br>
+ $xpaset -p ds9 catalog symbol 2 shape "boxcircle point"<br>
+ $xpaset -p ds9 catalog symbol color red<br>
+ $xpaset -p ds9 catalog symbol font times<br>
+ </tt><tt>$xpaset -p ds9 catalog symbol fontsize 14<br>
+ </tt><tt>$xpaset -p ds9 catalog symbol fontweight bold<br>
+ </tt><tt>$xpaset -p ds9 catalog symbol fontslant italic<br>
+ </tt><tt>$xpaset -p ds9 catalog symbol add<br>
+ $xpaset -p ds9 catalog symbol 2 remove<br>
+ $xpaset -p ds9 catalog symbol load foo.sym<br>
+ $xpaset -p ds9 catalog symbol save bar.sym</tt><tt><br>
+ $xpaset -p ds9 catalog sky fk5<br>
+ $xpaset -p ds9 catalog skyformat degrees<br>
+ </tt><tt>$xpaset -p ds9 catalog sort "Jmag" incr<br>
+ </tt><tt>$xpaset -p ds9 catalog system wcs</tt><tt><br>
+ </tt><tt>$xpaset -p ds9 catalog update<br>
+ </tt><tt>$xpaset -p ds9 catalog x RA<br>
+ $xpaset -p ds9 catalog y DEC</tt><br>
+ <p><b> <a name="cd"></a>cd</b></p>
+ <p>Sets/Returns the current working directory. </p>
+ <tt> Syntax: <br>
+ cd [&lt;directory&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 cd<br>
+ $xpaset -p ds9 cd /home/mrbill<br>
+ </tt>
+ <p><b> <a name="cmap"></a>cmap</b></p>
+ <p>Controls the colormap for the current frame. The colormap name
+ is not case sensitive. A valid contrast value is&nbsp; from 0 to
+ 10 and bias value from 0 to 1. </p>
+ <tt> Syntax: <br>
+ cmap [&lt;colormap&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [file]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;] <br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [invert yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [value &lt;constrast&gt; &lt;bias&gt;]
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [tag [load|save] &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [tag delete]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock [yes|no]]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 cmap <br>
+ $xpaget ds9 cmap file <br>
+ $xpaget ds9 cmap invert <br>
+ $xpaget ds9 cmap value <br>
+ </tt><tt>$xpaget ds9 cmap lock</tt><br>
+ <tt> $xpaset -p ds9 cmap Heat <br>
+ $xpaset -p ds9 cmap load foo.sao <br>
+ </tt><tt>$xpaset -p ds9 cmap save bar.sao <br>
+ </tt><tt>$xpaset -p ds9 cmap invert yes <br>
+ $xpaset -p ds9 cmap value 5 .5<br>
+ $xpaset -p ds9 cmap tag load foo.tag<br>
+ $xpaset -p ds9 cmap tag save foo.tag<br>
+ $xpaset -p ds9 cmap tag delete<br>
+ </tt><tt>$xpaset -p ds9 cmap match<br>
+ $xpaset -p ds9 cmap lock yes</tt><br>
+ <tt> $xpaset -p ds9 cmap open<br>
+ $xpaset -p ds9 cmap close<br>
+ </tt>
+ <p><b> <a name="colorbar"></a>colorbar<br>
+ </b></p>
+ <p>Controls colorbar parameters.</p>
+ <tt> Syntax: <br>
+ colorbar []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
+ [horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [orientation
+ horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [space
+ value|distance] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontsize
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [fontweight
+ normal|bold]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [fontslant
+ roman|italic]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [size]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ticks]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 colorbar<br>
+ $xpaget ds9 colorbar orientation<br>
+ $xpaget ds9 colorbar numerics<br>
+ $xpaget ds9 colorbar space<br>
+ $xpaget ds9 colorbar font<br>
+ $xpaget ds9 colorbar fontsize<br>
+ $xpaget ds9 colorbar fontweight<br>
+ $xpaget ds9 colorbar fontslant<br>
+ $xpaget ds9 colorbar size<br>
+ $xpaget ds9 colorbar ticks<br>
+ $xpaset -p ds9 colorbar yes<br>
+ $xpaset -p ds9 colorbar vertical<br>
+ $xpaset -p ds9 colorbar orientation vertical<br>
+ $xpaset -p ds9 colorbar numerics yes<br>
+ $xpaset -p ds9 colorbar space value<br>
+ $xpaset -p ds9 colorbar font times<br>
+ $xpaset -p ds9 colorbar fontsize 14<br>
+ $xpaset -p ds9 colorbar fontweight bold<br>
+ $xpaset -p ds9 colorbar fontslant italic<br>
+ $xpaset -p ds9 colorbar size 20<br>
+ $xpaset -p ds9 colorbar ticks 11<br>
+ </tt>
+ <p><b> <a name="console"></a>console</b></p>
+ <p>Display tcl console window.</p>
+ <tt> Syntax: <br>
+ -console<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaset -p ds9 console<br>
+ </tt>
+ <p><b> <a name="contour"></a>contour<br>
+ </b></p>
+ <p>Controls contours in the current frame. </p>
+ <tt> Syntax: <br>
+ contour []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [&lt;coordsys&gt;
+ [&lt;skyframe&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [generate]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load
+ &lt;filename&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;
+ &lt;coordsys&gt; &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [convert]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [loadlevels
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [savelevels
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [paste
+ &lt;coordsys&gt; [&lt;color&gt; &lt;width&gt; yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [width &lt;width&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [dash yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [smooth &lt;smooth&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [method block|smooth]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [nlevels &lt;number of
+ levels&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale
+ linear|log|pow|squared|sqrt|asinh|sinh|histequ]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [log exp &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [limits &lt;min&gt;
+ &lt;max&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [levels &lt;value
+ value value...&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 contour<br>
+ $xpaget ds9 contour wcs fk5<br>
+ $xpaget ds9 contour color<br>
+ $xpaget ds9 contour width<br>
+ $xpaget ds9 contour dash<br>
+ $xpaget ds9 contour smooth<br>
+ $xpaget ds9 contour method<br>
+ $xpaget ds9 contour nlevels<br>
+ $xpaget ds9 contour scale<br>
+ $xpaget ds9 contour log exp<br>
+ $xpaget ds9 contour mode<br>
+ $xpaget ds9 contour limits<br>
+ $xpaget ds9 contour levels<br>
+ $xpaset -p ds9 contour<br>
+ $xpaset -p ds9 contour yes<br>
+ $xpaset -p ds9 contour clear<br>
+ $xpaset -p ds9 contour generate<br>
+ </tt><tt><tt>$xpaset -p ds9 contour load ds9.ctr<br>
+ </tt></tt><tt>$xpaset -p ds9 contour load ds9.ctr red 2 yes<br>
+ $xpaset -p ds9 contour save ds9.ctr wcs fk5<br>
+ $xpaset -p ds9 contour convert<br>
+ $xpaset -p ds9 contour loadlevels ds9.ctr</tt><br>
+ <tt><tt>$xpaset -p ds9 contour savelevels ds9.lev<br>
+ </tt> $xpaset -p ds9 contour copy<br>
+ $xpaset -p ds9 contour paste wcs red 2 no<br>
+ $xpaset -p ds9 contour color yellow<br>
+ $xpaset -p ds9 contour width 2<br>
+ $xpaset -p ds9 contour dash yes<br>
+ $xpaset -p ds9 contour smooth 5<br>
+ $xpaset -p ds9 contour method smooth<br>
+ $xpaset -p ds9 contour nlevels 10<br>
+ $xpaset -p ds9 contour scale sqrt<br>
+ $xpaset -p ds9 contour log exp 1000<br>
+ $xpaset -p ds9 contour mode zscale<br>
+ $xpaset -p ds9 contour limits 1 100<br>
+ $xpaset -p ds9 contour levels "{1 10 100 1000}"<br>
+ $xpaset -p ds9 contour open<br>
+ $xpaset -p ds9 contour close<br>
+ </tt>
+ <p><b><a name="crop"></a>crop</b> </p>
+ <p>Set current image display area. </p>
+ <tt> Syntax: <br>
+ crop [&lt;x&gt; &lt;y&gt; &lt;width&gt; &lt;height&gt;
+ [&lt;coordsys&gt;][&lt;skyframe&gt;][&lt;skyformat&gt;][degrees|arcmin|arcsec]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 crop # get crop in physical coords <br>
+ $xpaget ds9 crop wcs galactic sexagesimal arcsec<br>
+ $xpaget ds9 crop lock<br>
+ $xpaset -p ds9 crop 40 30 10 20 # set crop in physical coords<br>
+ $xpaset -p ds9 crop +104:51:06.915 +68:33:40.761&nbsp; 28.144405
+ 22.000204 wcs galactic arcsec<br>
+ $xpaset -p ds9 crop match wcs<br>
+ $xpaset -p ds9 crop lock wcs</tt><br>
+ <p><b> <a name="crosshair"></a>crosshair</b></p>
+ <p>Controls the current position of the crosshair in the current
+ frame. DS9 is placed in crosshair mode when the crosshair is
+ set. </p>
+ <tt> Syntax: <br>
+ crosshair [&lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match
+ &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; [lock
+ &lt;coordsys&gt;|none]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 crosshair # get crosshair in physical coords <br>
+ $xpaget ds9 crosshair wcs fk4 sexagesimal # get crosshair in wcs
+ coords <br>
+ $xpaget ds9 crosshair lock<br>
+ $xpaset -p ds9 crosshair 100 100 physical # set crosshair in
+ physical <br>
+ $xpaset -p ds9 crosshair 345 58.8 wcs fk5 # set crosshair in wcs
+ coords <br>
+ $xpaset -p ds9 crosshair 23:01:00 +58:52:51 wcs fk5<br>
+ $xpaset -p ds9 crosshair match wcs<br>
+ $xpaset -p ds9 crosshair lock wcs<br>
+ </tt>
+ <p><b> <a name="cube"></a>cube<br>
+ </b></p>
+ <p>Controls FITS cube dialog. </p>
+ <tt> Syntax: <br>
+ cube [play|stop|next|prev|first|last]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;slice&gt;
+ [&lt;coordsys&gt;][&lt;axis&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [interval &lt;numeric&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axis &lt;axis&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [order 123|132|213|231|312|321]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axes lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 cube<br>
+ $xpaget ds9 cube interval<br>
+ $xpaget ds9 cube axis<br>
+ $xpaget ds9 cube lock<br>
+ $xpaget ds9 cube order<br>
+ $xpaget ds9 cube axes lock<br>
+ $xpaset -p ds9 cube play<br>
+ $xpaset -p ds9 cube last<br>
+ $xpaset -p ds9 cube 3<br>
+ $xpaset -p ds9 cube 4.4 wcs 3<br>
+ $xpaset -p ds9 cube interval 2<br>
+ $xpaset -p ds9 cube axis 3<br>
+ $xpaset -p ds9 cube match wcs<br>
+ $xpaset -p ds9 cube lock wcs<br>
+ $xpaset -p ds9 cube order 123<br>
+ $xpaset -p ds9 cube axes lock yes<br>
+ $xpaset -p ds9 cube open<br>
+ $xpaset -p ds9 cube close</tt><br>
+ <p><b> <a name="cursor"></a>cursor</b></p>
+ <p>Move mouse pointer or crosshair in image pixels in the current
+ frame. Note, this will move selected Regions also. </p>
+ <tt> Syntax: <br>
+ cursor [&lt;x&gt; &lt;y&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 cursor 10 10<br>
+ </tt>
+ <p><b> <a name="data"></a>data</b></p>
+ <p>Return an array of data values given a lower left corner and a
+ width and height in specified coordinate system. The last
+ argument of yes indicates to strip the coordinates from the
+ output and just list the data values. The default is yes.</p>
+ <tt> Syntax: <br>
+ data [&lt;coordsys&gt; [&lt;skyframe&gt;] &lt;x&gt; &lt;y&gt;
+ &lt;width&gt; &lt;height&gt; [yes|no]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 data image 450 520 3 3 yes<br>
+ $xpaget ds9 data physical 899 1039 6 6 no<br>
+ $xpaget ds9 data fk5 202.47091 47.196811 0.00016516669
+ 0.00016516669 no<br>
+ $xpaget ds9 data wcs fk5 13:29:53.018 +47:11:48.52 0.00016516669
+ 0.00016516669 no</tt><tt><br>
+ </tt>
+ <p><b> <a name="dsssao"></a>dsssao<br>
+ dss<br>
+ </b></p>
+ <p>Support for Digital Sky Survey at SAO. </p>
+ <tt> Syntax:<br>
+ dsssao []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 dsssao name <br>
+ $xpaget ds9 dsssao coord <br>
+ $xpaget ds9 dsssao size<br>
+ $xpaget ds9 dsssao save<br>
+ $xpaget ds9 dsssao frame<br>
+ $xpaset -p ds9 dsssao<br>
+ $xpaset -p ds9 dsssao m31 <br>
+ $xpaset -p ds9 dsssao name m31 <br>
+ $xpaset -p ds9 dsssao coord 00:42:44.404 +41:16:08.78
+ sexagesimal<br>
+ $xpaset -p ds9 dsssao size 60 60 arcmin<br>
+ $xpaset -p ds9 dsssao save yes<br>
+ $xpaset -p ds9 dsssao frame current<br>
+ $xpaset -p ds9 dsssao update frame<br>
+ $xpaset -p ds9 dsssao open<br>
+ </tt><tt>$xpaset -p ds9 dsssao close</tt><br>
+ <p><b> <a name="dsseso"></a>dsseso</b></p>
+ <p>Support for Digital Sky Survey at ESO. </p>
+ <tt> Syntax:<br>
+ dsseso []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp; &nbsp; &nbsp; [survey
+ DSS1|DSS2-red|DSS2-blue|DSS2-infrared]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 dsseso name <br>
+ $xpaget ds9 dsseso coord <br>
+ $xpaget ds9 dsseso size<br>
+ $xpaget ds9 dsseso save<br>
+ $xpaget ds9 dsseso frame<br>
+ $xpaget ds9 dsseso survey<br>
+ $xpaset -p ds9 dsseso<br>
+ $xpaset -p ds9 dsseso m31 <br>
+ $xpaset -p ds9 dsseso name m31 <br>
+ $xpaset -p ds9 dsseso coord 00:42:44.404 +41:16:08.78
+ sexagesimal<br>
+ $xpaset -p ds9 dsseso size 60 60 arcmin<br>
+ $xpaset -p ds9 dsseso save yes<br>
+ $xpaset -p ds9 dsseso frame current<br>
+ $xpaset -p ds9 dsseso update frame<br>
+ $xpaset -p ds9 dsseso survey DSS2-red <br>
+ $xpaset -p ds9 dsseso open<br>
+ </tt><tt>$xpaset -p ds9 dsseso close</tt><br>
+ <p><b> <a name="dssstsci"></a>dssstsci</b></p>
+ <p>Support for Digital Sky Survey at STSCI.</p>
+ <tt> Syntax:<br>
+ dssstsci []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [&lt;object&gt;]<br>
+ &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord
+ &lt;ra&gt; &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ &lt;width&gt; &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame
+ new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss2ukstu_red|poss2ukstu_ir|poss2ukstu_blue] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ poss1_blue|poss1_red]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [survey
+ all|quickv|phase2_gsc2|phase2_gsc1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example:<br>
+ $xpaget ds9 dssstsci name <br>
+ $xpaget ds9 dssstsci coord <br>
+ $xpaget ds9 dssstsci size<br>
+ $xpaget ds9 dssstsci save<br>
+ $xpaget ds9 dssstsci frame<br>
+ $xpaget ds9 dssstsci survey<br>
+ $xpaset -p ds9 dssstsci<br>
+ $xpaset -p ds9 dssstsci m31 <br>
+ $xpaset -p ds9 dssstsci name m31 <br>
+ $xpaset -p ds9 dssstsci coord 00:42:44.404 +41:16:08.78
+ sexagesimal<br>
+ $xpaset -p ds9 dssstsci size 60 60 arcmin<br>
+ $xpaset -p ds9 dssstsci save yes<br>
+ $xpaset -p ds9 dssstsci frame current<br>
+ $xpaset -p ds9 dssstsci update frame<br>
+ $xpaset -p ds9 dssstsci survey all<br>
+ $xpaset -p ds9 dssstsci open<br>
+ $xpaset -p ds9 dssstsci close</tt><br>
+ <p><b> <a name="envi"></a>envi</b></p>
+ <p>Load an ENVI header and file. Optional parameter: array endian.<br>
+ </p>
+ <tt> Syntax: <br>
+ envi &lt;header&gt; [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ </tt><tt><tt>$xpaset -p ds9 envi foo.hdr</tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>$xpaset -p ds9 envi foo.hdr foo.bsq</tt></tt><br>
+ $xpaset -p ds9 envi new foo.hdr foo.bsq</tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><br>
+ </tt></tt></tt></tt></tt></tt>
+ <p><b> <a name="exit"></a>exit<br>
+ quit<br>
+ </b></p>
+ <p>Quits DS9. </p>
+ <tt> Syntax: <br>
+ exit<br>
+ quit<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 exit<br>
+ </tt>
+ <p><b> <a name="export"></a>export<br>
+ </b></p>
+ <p>Export loaded image data of current frame in specified image
+ format. Optional parameters: array endian, nrrd endian, jpeg
+ quality (1-100) and tiff compression method.</p>
+ <tt> Syntax: </tt><tt><br>
+ </tt><tt> export </tt><tt>[array|nrrd|envi|gif|tiff|jpeg|png] </tt><tt>&lt;filename&gt;</tt><tt><br>
+ </tt><tt>export array &lt;filename&gt;</tt><tt> </tt><tt>[big|little</tt><tt>|native]<br>
+ </tt><tt>export nrrd &lt;filename&gt; </tt><tt>[big|little</tt><tt>|native]</tt><tt><br>
+ export envi &lt;header&gt; [&lt;filename&gt;] </tt><tt>[big|little</tt><tt>|native]</tt><tt>
+ </tt><tt><br>
+ export jpeg &lt;filename&gt;</tt><tt> [1-100]</tt><tt><br>
+ </tt><tt> </tt><tt>export tiff &lt;filename</tt><tt>&gt;</tt><tt>
+ [none|jpeg|packbits|deflate]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ </tt><tt><tt>$xpaset -p ds9 export array foo.arr little</tt></tt><br>
+ <tt><tt>$xpaset -p ds9 export nrrd foo.nrrd little</tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>$xpaset -p ds9 export envi foo.hdr little</tt></tt><br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -p ds9 export envi foo.hdr foo.bsq little</tt></tt><br>
+ </tt></tt></tt></tt>$xpaset -p ds9 export tiff
+ foo.tiff jpeg</tt></tt></tt><br>
+ $xpaset -p ds9 export jpeg foo.jpeg 75<br>
+ $xpaset -p ds9 export png foo.png</tt><br>
+ <p><b> <a name="file"></a>file</b></p>
+ <p>Query currently loaded file information. </p>
+ <tt> Syntax:<br>
+ file <br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 file </tt><br>
+ <p><b> <a name="fits"></a>fits</b></p>
+ <p>Load a FITS image into the current frame or query the currently
+ loaded image.<br>
+ </p>
+ <tt> Syntax: <br>
+ fits </tt><tt><tt>[new|mask|slice] [&lt;filename&gt;]</tt><tt><br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; [width|height|depth|bitpix|type]<br>
+ &nbsp; &nbsp;&nbsp; [size [wcs|wcsa...wcsz]
+ [fk4|fk5|icrs|galactic|ecliptic] [degrees|arcmin|arcsecs]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[header [&lt;ext&gt;] [keyword
+ &lt;string&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [image|table|slice]</tt><tt><br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 fits &gt; foo.fits<br>
+ $xpaget ds9 fits width<br>
+ $xpaget ds9 fits height<br>
+ $xpaget ds9 fits depth<br>
+ $xpaget ds9 fits bitpix</tt><br>
+ <tt>$xpaget ds9 fits type </tt><br>
+ <tt><tt>$xpaget ds9 fits size<br>
+ </tt> $xpaget ds9 fits size wcs fk5 arcmin<br>
+ $xpaget ds9 fits header # primary<br>
+ $xpaget ds9 fits header 2 # hdu 2<br>
+ $xpaget ds9 fits header -2 # hdu 2 with inherit<br>
+ $xpaget ds9 fits header keyword BITPIX<br>
+ $xpaget ds9 fits header 1 keyword BITPIX</tt><br>
+ <tt><tt>$xpaget ds9 fits image &gt; foo.fits<br>
+ $xpaget ds9 fits table &gt; bar.fits<br>
+ $xpaget ds9 fits slice &gt; foo.fits<br>
+ </tt> $xpaset -p ds9 fits foo.fits<br>
+ $xpaset -p ds9 fits new foo.fits<br>
+ $xpaset -p ds9 fits bar.fits[bin=detx,dety]<br>
+ $xpaset -p ds9 fits slice foo.fits<br>
+ $xpaset -p ds9 fits mask foo.fits<br>
+ $cat foo.fits | xpaset ds9 fits <br>
+ $cat foo.fits | xpaset ds9 fits new<br>
+ $cat bar.fits | xpaset ds9 fits -[bin=detx,dety]<br>
+ $cat foo.fits | xpaset ds9 fits slice<br>
+ $cat foo.fits | xpaset ds9 fits mask<br>
+ </tt>
+ <p><b> <a name="frame"></a>frame</b></p>
+ <p>Controls frame functions. Frames may be created, deleted,
+ reset, and centered. While return the current frame number. If
+ you goto a frame that does not exists, it will be created. If
+ the frame is hidden, it will be shown. The 'frameno' option is
+ available for backward compatibility. </p>
+ <tt> Syntax: <br>
+ frame [center [#|all]]<br>
+ &nbsp; &nbsp; &nbsp; [clear [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [new [rgb|3d]]<br>
+ &nbsp; &nbsp; &nbsp; [delete [#|all]] <br>
+ &nbsp; &nbsp; &nbsp; [reset [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [refresh [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [hide [#|all]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [show [#|all]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move first]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move forward]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move last]<br>
+ &nbsp; &nbsp; &nbsp; [first]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [prev]<br>
+ &nbsp; &nbsp; &nbsp; [next]<br>
+ &nbsp; &nbsp; &nbsp; [last]<br>
+ &nbsp; &nbsp; &nbsp; [frameno #]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [#]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has
+[amplifier|datamin|datasec|detector|grid|iis|irafmin|physical|smooth]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has contour [aux]]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has fits [bin|cube|mosaic]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has marker
+ [highlite|paste|select|undo]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [has wcs
+ [&lt;wcssys&gt;|equatorial &lt;wcssys&gt;|linear
+ &lt;wcssys&gt;]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 frame # returns the id of the current frame <br>
+ $xpaget ds9 frame frameno # returns the id of the current frame
+ <br>
+ $xpaget ds9 frame all # returns the id of all frames <br>
+ $xpaget ds9 frame active # returns the id of all active frames<br>
+ </tt><tt>$xpaget ds9 frame lock</tt><br>
+ <tt> $xpaget ds9 frame has amplifier<br>
+ $xpaget ds9 frame has datamin<br>
+ $xpaget ds9 frame has datasec<br>
+ $xpaget ds9 frame has detector<br>
+ $xpaget ds9 frame has grid<br>
+ $xpaget ds9 frame has iis<br>
+ $xpaget ds9 frame has irafmin<br>
+ $xpaget ds9 frame has physical<br>
+ $xpaget ds9 frame has smooth<br>
+ $xpaget ds9 frame has contour<br>
+ $xpaget ds9 frame has contour aux<br>
+ $xpaget ds9 frame has fits<br>
+ $xpaget ds9 frame has fits bin<br>
+ $xpaget ds9 frame has fits cube<br>
+ $xpaget ds9 frame has fits mosaic<br>
+ $xpaget ds9 frame has marker highlite<br>
+ $xpaget ds9 frame has marker paste<br>
+ $xpaget ds9 frame has marker select<br>
+ $xpaget ds9 frame has marker undo<br>
+ $xpaget ds9 frame has system physical<br>
+ $xpaget ds9 frame has wcs wcsa<br>
+ $xpaget ds9 frame has wcs equatorial wcsa<br>
+ $xpaget ds9 frame has wcs linear wcsa<br>
+ $xpaset -p ds9 frame center # center current frame<br>
+ $xpaset -p ds9 frame center 1 # center 'Frame1' <br>
+ $xpaset -p ds9 frame center all # center all frames <br>
+ $xpaset -p ds9 frame clear # clear current frame<br>
+ $xpaset -p ds9 frame new # create new frame <br>
+ $xpaset -p ds9 frame new rgb # create new rgb frame<br>
+ $xpaset -p ds9 frame delete # delete current frame <br>
+ $xpaset -p ds9 frame reset # reset current frame <br>
+ $xpaset -p ds9 frame refresh # refresh current frame <br>
+ $xpaset -p ds9 frame hide # hide current frame <br>
+ $xpaset -p ds9 frame show 1 # show frame 'Frame1'<br>
+ $xpaset -p ds9 frame move first # move frame to first in order<br>
+ $xpaset -p ds9 frame move back # move frame back in order<br>
+ $xpaset -p ds9 frame move forward # move frame forward in order<br>
+ $xpaset -p ds9 frame move last # move frame to last in order<br>
+ $xpaset -p ds9 frame first # goto first frame <br>
+ $xpaset -p ds9 frame prev # goto prev frame <br>
+ $xpaset -p ds9 frame next # goto next frame<br>
+ $xpaset -p ds9 frame last # goto last frame<br>
+ $xpaset -p ds9 frame frameno 4 # goto frame 'Frame4', create if
+ needed<br>
+ $xpaset -p ds9 frame 3 # goto frame 'Frame3', create if needed <br>
+ $xpaset -p ds9 frame match wcs<br>
+ $xpaset -p ds9 frame lock wcs</tt><br>
+ <p><b> <a name="gif"></a>gif</b></p>
+ <p>Load GIF image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ gif [new|slice] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 gif &gt; foo.gif</tt><br>
+ <tt>$xpaset -p ds9 gif foo.gif</tt><br>
+ <tt><tt>$xpaset -p ds9 gif new foo.gif<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 gif slice foo.gif<br>
+ </tt></tt>$cat foo.gif | xpaset ds9 gif # not available
+ windows</tt> <br>
+ <tt><tt>$cat foo.gif | xpaset ds9 gif</tt><tt> new # not available
+ windows<br>
+ </tt>$cat foo.gif | xpaset ds9 gif</tt><tt> slice</tt><tt><tt><tt>
+ # not available windows</tt></tt></tt>
+ <p><b> <a name="grid"></a>grid</b></p>
+ <p> Controls coordinate grid. For grid numeric format
+ syntax,&nbsp; click <a href="grid.html#Format">here</a>.</p>
+ <tt> Syntax: <br>
+ grid&nbsp; []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [type analysis|publication] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [system &lt;coordsys&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sky &lt;skyframe&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat &lt;skyformat&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [grid gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes type interior|exterior]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes origin
+ lll|llu|lul|luu|ull|ulu|uul|uuu]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format1 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format2 &lt;format&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [tickmarks style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border width &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [border style 0|1]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics type interior|exterior]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [numerics vertical yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title text &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title def yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title gap &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [title color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text1 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def1 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap1 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels text2 &lt;text&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels def2 yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels gap2 &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels font
+ times|helvetica|courier]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontsize &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontweight normal|bold]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels fontslant roman|italic]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [labels color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [reset]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [load &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 grid <br>
+ $xpaget ds9 grid type <br>
+ $xpaget ds9 grid system <br>
+ $xpaget ds9 grid sky <br>
+ $xpaget ds9 grid skyformat <br>
+ $xpaget ds9 grid grid <br>
+ $xpaget ds9 grid grid color <br>
+ $xpaget ds9 grid grid width <br>
+ $xpaget ds9 grid grid style <br>
+ $xpaget ds9 grid grid gap1 <br>
+ $xpaget ds9 grid grid gap2 <br>
+ $xpaget ds9 grid axes <br>
+ $xpaget ds9 grid axes color <br>
+ $xpaget ds9 grid axes width <br>
+ $xpaget ds9 grid axes style <br>
+ $xpaget ds9 grid axes type <br>
+ $xpaget ds9 grid axes origin<br>
+ $xpaget ds9 grid format1<br>
+ $xpaget ds9 grid format2<br>
+ $xpaget ds9 grid tickmarks <br>
+ $xpaget ds9 grid tickmarks color <br>
+ $xpaget ds9 grid tickmarks width <br>
+ $xpaget ds9 grid tickmarks style <br>
+ $xpaget ds9 grid border <br>
+ $xpaget ds9 grid border color <br>
+ $xpaget ds9 grid border width <br>
+ $xpaget ds9 grid border style <br>
+ $xpaget ds9 grid numerics <br>
+ $xpaget ds9 grid numerics font <br>
+ $xpaget ds9 grid numerics fontsize <br>
+ $xpaget ds9 grid numerics fontweight<br>
+ $xpaget ds9 grid numerics fontslant<br>
+ $xpaget ds9 grid numerics color <br>
+ $xpaget ds9 grid numerics gap1 <br>
+ $xpaget ds9 grid numerics gap2 <br>
+ $xpaget ds9 grid numerics type <br>
+ $xpaget ds9 grid numerics vertical <br>
+ $xpaget ds9 grid title <br>
+ $xpaget ds9 grid title text<br>
+ $xpaget ds9 grid title def <br>
+ $xpaget ds9 grid title gap <br>
+ $xpaget ds9 grid title font <br>
+ $xpaget ds9 grid title fontsize <br>
+ $xpaget ds9 grid title fontweight<br>
+ $xpaget ds9 grid title fontslant<br>
+ $xpaget ds9 grid title color <br>
+ $xpaget ds9 grid labels <br>
+ $xpaget ds9 grid labels text1 <br>
+ $xpaget ds9 grid labels def1 <br>
+ $xpaget ds9 grid labels gap1 <br>
+ $xpaget ds9 grid labels text2 <br>
+ $xpaget ds9 grid labels def2 <br>
+ $xpaget ds9 grid labels gap2 <br>
+ $xpaget ds9 grid labels font <br>
+ $xpaget ds9 grid labels fontsize <br>
+ $xpaget ds9 grid labels fontweight<br>
+ $xpaget ds9 grid labels fontslant<br>
+ $xpaget ds9 grid labels color <br>
+ $xpaset -p ds9 grid <br>
+ $xpaset -p ds9 grid yes<br>
+ $xpaset -p ds9 grid type analysis <br>
+ $xpaset -p ds9 grid system wcs <br>
+ $xpaset -p ds9 grid sky fk5 <br>
+ $xpaset -p ds9 grid skyformat degrees<br>
+ $xpaset -p ds9 grid grid yes<br>
+ $xpaset -p ds9 grid grid color red<br>
+ $xpaset -p ds9 grid grid width 2<br>
+ $xpaset -p ds9 grid grid style 1<br>
+ $xpaset -p ds9 grid grid gap1 10<br>
+ $xpaset -p ds9 grid grid gap2 10<br>
+ $xpaset -p ds9 grid axes yes<br>
+ $xpaset -p ds9 grid axes color red<br>
+ $xpaset -p ds9 grid axes width 2<br>
+ $xpaset -p ds9 grid axes style 1<br>
+ $xpaset -p ds9 grid axes type exterior<br>
+ $xpaset -p ds9 grid axes origin lll<br>
+ $xpaset -p ds9 grid format1 d.2<br>
+ $xpaset -p ds9 grid format2 d.2<br>
+ $xpaset -p ds9 grid tickmarks yes<br>
+ $xpaset -p ds9 grid tickmarks color red<br>
+ $xpaset -p ds9 grid tickmarks width 2<br>
+ $xpaset -p ds9 grid tickmarks style 1<br>
+ $xpaset -p ds9 grid border yes<br>
+ $xpaset -p ds9 grid border color red<br>
+ $xpaset -p ds9 grid border width 2<br>
+ $xpaset -p ds9 grid border style 1<br>
+ $xpaset -p ds9 grid numerics yes<br>
+ $xpaset -p ds9 grid numerics font courier<br>
+ $xpaset -p ds9 grid numerics fontsize 12<br>
+ $xpaset -p ds9 grid numerics fontweight bold<br>
+ $xpaset -p ds9 grid numerics fontslant italic<br>
+ $xpaset -p ds9 grid numerics color red<br>
+ $xpaset -p ds9 grid numerics gap1 10<br>
+ $xpaset -p ds9 grid numerics gap2 10<br>
+ $xpaset -p ds9 grid numerics type exterior<br>
+ $xpaset -p ds9 grid numerics vertical yes<br>
+ $xpaset -p ds9 grid title yes<br>
+ $xpaset -p ds9 grid title text {Hello World}<br>
+ $xpaset -p ds9 grid title def yes<br>
+ $xpaset -p ds9 grid title gap 10<br>
+ $xpaset -p ds9 grid title font courier<br>
+ $xpaset -p ds9 grid title fontsize 12<br>
+ $xpaset -p ds9 grid title fontweight bold<br>
+ $xpaset -p ds9 grid title fontslant italic<br>
+ $xpaset -p ds9 grid title color red<br>
+ $xpaset -p ds9 grid labels yes<br>
+ $xpaset -p ds9 grid labels text1 {Hello World}<br>
+ $xpaset -p ds9 grid labels def1 yes<br>
+ $xpaset -p ds9 grid labels gap1 10<br>
+ $xpaset -p ds9 grid labels text2 {Hello World}<br>
+ $xpaset -p ds9 grid labels def2 yes<br>
+ $xpaset -p ds9 grid labels gap2 10<br>
+ $xpaset -p ds9 grid labels font courier<br>
+ $xpaset -p ds9 grid labels fontsize 12<br>
+ $xpaset -p ds9 grid labels fontweight boldj<br>
+ $xpaset -p ds9 grid labels fontslant italic<br>
+ $xpaset -p ds9 grid labels color red<br>
+ $xpaset -p ds9 grid reset<br>
+ $xpaset -p ds9 grid load foo.grd <br>
+ $xpaset -p ds9 grid save foo.grd<br>
+ $xpaset -p ds9 grid open<br>
+ $xpaset -p ds9 grid close<br>
+ </tt>
+ <p><b> <a name="header"></a>header</b></p>
+ <p>Display current fits header dialog. Optional extension number
+ maybe specified. Please note, this differs from xpa fits header.</p>
+ <tt> Syntax: <br>
+ header [&lt;ext&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [close [&lt;ext&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save [&lt;ext&gt;]
+ &lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaset -p ds9 header<br>
+ $xpaset -p ds9 header 2<br>
+ $xpaset -p ds9 header close<br>
+ $xpaset -p ds9 header save 1 foo.txt<br>
+ </tt>
+ <p><b> <a name="height"></a>height</b></p>
+ <p>Set the height of the image display window. </p>
+ <tt> Syntax: <br>
+ height [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 height<br>
+ $xpaset -p ds9 height 512<br>
+ </tt>
+ <p><b> <a name="iconify"></a>iconify</b></p>
+ <p>Toggles iconification. </p>
+ <tt> Syntax: <br>
+ iconify []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 iconify <br>
+ $xpaset -p ds9 iconify</tt><br>
+ <tt> $xpaset -p ds9 iconify yes</tt><br>
+ <p><b><a name="iexam"></a>iexam</b> </p>
+ <p>Interactive examine function. A blinking cursor will indicate
+ to the user to click on a point on an image. The specified
+ information will be returned at that time. The default event is
+ <tt>button</tt>. In the last form, the following macros will be
+ expanded if present: <tt>$width, $height, $depth, $bitpix,
+ $filename, $regions, $filename[$regions], $env, $pan, $value,
+ $x, $y, $z.</tt> See <a href="analysis.html#macros">Analysis
+ Macros</a> for more information.<br>
+ </p>
+ <tt> Syntax: <br>
+ iexam []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[]|button|key|any] coordinate
+ &lt;coordsys&gt; [&lt;skyframe&gt;] [&lt;skyformat&gt;]<br>
+ &nbsp;&nbsp; &nbsp;&nbsp; [[]|button|key|any] data
+ [width][height]<br>
+ </tt><tt><tt>&nbsp;&nbsp; &nbsp;&nbsp; [[]|button|key|any]
+ &lt;macro string&gt;]<br>
+ &nbsp; </tt><br>
+ Example: <br>
+ $xpaget ds9 iexam # image coordinates<br>
+ </tt><tt><tt>$xpaget ds9 iexam coordinate image<br>
+ </tt>$xpaget ds9 iexam key coordinate image # return coordinate
+ and key event<br>
+ $xpaget ds9 iexam coordinate wcs fk5 degrees<br>
+ $xpaget ds9 iexam coordinate wcs galactic sexagesimal<br>
+ $xpaget ds9 iexam coordinate fk5<br>
+ $xpaget ds9 iexam data # return data value<br>
+ $xpaget ds9 iexam key data # return data value and key event<br>
+ $xpaget ds9 iexam data 3 3 # return all data in 3x3 box about
+ selected point<br>
+ $xpaget ds9 iexam 'Click at $x,$y in file $filename'</tt><br>
+ <p><b> <a name="iis"></a>iis</b></p>
+ <p>Set/Get IIS Filename. Optional mosaic number maybe supplied.</p>
+ <tt> Syntax: <br>
+ iis [filename &lt;filename&gt; [#]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 iis filename<br>
+ $xpaget ds9 iis filename 4<br>
+ $xpaset -p ds9 iis filename foo.fits<br>
+ $xpaset -p ds9 iis filename bar.fits 4</tt><br>
+ <p><b> <a name="jpeg"></a>jpeg</b></p>
+ <p>Load JPEG image into current frame. Optional parameters: <tt>jpeg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>quality (1-100) </p>
+ <tt> Syntax:<br>
+ jpeg [new|slice] [&lt;filename&gt;] [1-100]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 jpeg &gt; foo.jpeg</tt><br>
+ <tt><tt>$xpaget ds9 jpeg 100 &gt; foo.jpeg</tt><br>
+ $xpaset -p ds9 jpeg foo.jpeg</tt><br>
+ <tt><tt>$xpaset -p ds9 jpeg new foo.jpeg<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 jpeg slice foo.jpeg<br>
+ </tt></tt>$cat foo.jpeg | xpaset ds9 jpeg </tt><tt><tt><tt> #
+ not available windows</tt></tt></tt><br>
+ <tt><tt>$cat foo.jpeg | xpaset ds9 jpeg</tt><tt> new</tt></tt><tt><tt><tt><tt>
+ # not available windows</tt></tt><br>
+ </tt>$cat foo.jpeg | xpaset ds9 jpeg</tt><tt> slice </tt><tt><tt><tt>
+ # not available windows</tt></tt></tt>
+ <p><b> <a name="lock"></a>lock</b></p>
+ <p>Lock all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ lock</tt><tt> </tt><tt>[frame &lt;coordsys&gt;|none]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;|none] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [crop &lt;coordsys&gt;|none]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp; [slice &lt;coordsys&gt;|none]]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [bin [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [axes [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [scale [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [scalelimites [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [colorbar [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [block [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [smooth [yes|no]]</tt><br>
+ <tt><tt>&nbsp; </tt><br>
+ Example:<br>
+ $xpaget -p ds9 lock frame<br>
+ $xpaget -p ds9 lock crosshair<br>
+ </tt><tt>$xpaget -p ds9 lock crop</tt><br>
+ <tt> $xpaget -p ds9 lock slice</tt><br>
+ <tt>$xpaget -p ds9 lock bin<br>
+ $xpaget -p ds9 lock axes<br>
+ $xpaget -p ds9 lock scale<br>
+ $xpaget -p ds9 lock scalelimits<br>
+ $xpaget -p ds9 lock colorbar<br>
+ $xpaget -p ds9 lock block <br>
+ $xpaget -p ds9 lock smooth<br>
+ $xpaset -p ds9 lock frame wcs</tt><tt><br>
+ </tt><tt>$xpaset -p ds9 lock crosshair wcs<br>
+ </tt><tt>$xpaset -p ds9 lock crop wcs</tt><br>
+ <tt>$xpaset -p ds9 lock slice wcs</tt><br>
+ <tt>$xpaset -p ds9 lock bin yes<br>
+ $xpaset -p ds9 lock axes yes<br>
+ </tt><tt>$xpaset -p ds9 lock scale yes<br>
+ $xpaset -p ds9 lock scalelimits yes<br>
+ </tt><tt>$xpaset -p ds9 lock colorbar yes<br>
+ $xpaset -p ds9 lock block yes<br>
+ $xpaset -p ds9 lock smooth yes<br>
+ <br>
+ </tt><b><a name="lower"></a>lower</b>
+ <p>Lower in the window stacking order. </p>
+ <tt> Syntax: <br>
+ lower <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 lower</tt><tt><br>
+ </tt>
+ <p><b> <a name="magnifier"></a>magnifier</b></p>
+ <p>Controls the magnifier settings. </p>
+ <tt> Syntax: <br>
+ magnifier [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [zoom
+ &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [cursor
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [region
+ yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 magnifier color<br>
+ $xpaget ds9 magnifier zoom<br>
+ $xpaget ds9 magnifier cursor<br>
+ $xpaget ds9 magnifier region<br>
+ $xpaset -p ds9 magnifier color yellow<br>
+ $xpaset -p ds9 magnifier zoom 2<br>
+ $xpaset -p ds9 magnifier cursor no<br>
+ $xpaset -p ds9 magnifier region no</tt><br>
+ <p><b> <a name="mask"></a>mask<br>
+ </b></p>
+ <p>Controls mask parameters. </p>
+ <tt> Syntax: <br>
+ mask [color &lt;color&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mark 1|0]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [transparency &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example:<br>
+ $xpaget ds9 mask color<br>
+ $xpaget ds9 mask mark<br>
+ $xpaget ds9 mask transparency<br>
+ $xpaset -p ds9 mask color red<br>
+ $xpaset -p ds9 mask mark 0<br>
+ $xpaset -p ds9 mask transparency 50<br>
+ $xpaset -p ds9 mask clear<br>
+ $xpaset -p ds9 mask open<br>
+ $xpaset -p ds9 mask close<br>
+ </tt>
+ <p><b> <a name="match"></a>match</b></p>
+ <p>Match all other frames to the current frame. </p>
+ <tt> Syntax: <br>
+ </tt><tt>match </tt><tt>[frame &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt>[crosshair
+ &lt;coordsys&gt;] </tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [crop &lt;coordsys&gt;]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [slice &lt;coordsys&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [bin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [axes]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scalelimits]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [block]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [smooth]</tt><br>
+ <tt><tt><br>
+ </tt> <tt> </tt> Example: <br>
+ $xpaset -p ds9 match frame wcs <br>
+ </tt><tt>$xpaset -p ds9 match crosshair wcs<br>
+ </tt><tt>$xpaset -p ds9 match crop wcs</tt><br>
+ <tt>$xpaset -p ds9 match slice</tt><tt> wcs<br>
+ </tt><tt>$xpaset -p ds9 match bin<br>
+ $xpaset -p ds9 match axes<br>
+ $xpaset -p ds9 match scale<br>
+ $xpaset -p ds9 match scalelimits<br>
+ $xpaset -p ds9 match colorbar<br>
+ $xpaset -p ds9 match block<br>
+ $xpaset -p ds9 match smooth<br>
+ <br>
+ </tt><b><a name="mecube"></a>mecube</b>
+ <p>Load FITS multiple extension file as data cube.<br>
+ </p>
+ <tt> Syntax:<br>
+ mecube [new] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 mecube &gt; foo.fits<br>
+ $xpaset -p ds9 mecube foo.fits</tt><br>
+ <tt><tt>$xpaset -p ds9 mecube new foo.fits<br>
+ </tt>$cat foo.fits | xpaset ds9 mecube</tt><br>
+ <tt>$cat foo.fits | xpaset ds9 mecube</tt><tt> new</tt>
+ <p><b> <a name="minmax"></a>minmax</b></p>
+ <p>This is how DS9 determines&nbsp; the min and max data values
+ from the data. <tt>SCAN</tt> will scan all data.&nbsp;<tt>DATAMIN</tt>
+ and <tt>IRAFMIN</tt> will use the values of the keywords if
+ present.<br>
+ </p>
+ <tt> Syntax: <br>
+ minmax [scan|sample|datamin|irafmin]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ scan|sample|datamin|irafmin]<br>
+ &nbsp; &nbsp; &nbsp;&nbsp; [interval #] <br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 minmax mode<br>
+ $xpaget ds9 minmax interval <br>
+ $xpaset -p ds9 minmax scan <br>
+ $xpaset -p ds9 minmax mode scan<br>
+ $xpaset -p ds9 minmax interval 100<br>
+ </tt>
+ <p><b> <a name="mode"></a>mode</b></p>
+ <p>Controls the first mouse button mode. </p>
+ <tt> Syntax: <br>
+ mode
+ [none|region|crosshair|colorbar|pan|zoom|rotate|catalog|examine]
+ <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 mode <br>
+ $xpaset -p ds9 mode crosshair</tt><br>
+ <p><b> <a name="mosaic"></a>mosaic</b></p>
+ <p>Load FITS mosaic segment into current frame.</p>
+ <tt> Syntax:<br>
+ mosaic [wcs|wcsa...wcsz|iraf] [new|mask] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 mosaic &gt; foo.fits</tt><tt><br>
+ $xpaset -p ds9 mosaic foo.fits</tt><br>
+ <tt><tt>$xpaset -p ds9 mosaic wcs foo.fits</tt></tt><br>
+ <tt><tt>$xpaset -p ds9 mosaic wcs new foo.fits</tt></tt><br>
+ <tt><tt>$xpaset -p ds9 mosaic wcs mask foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>$cat foo.fits | xpaset ds9 mosaic</tt><br>
+ <tt><tt>$cat foo.fits | xpaset ds9 mosaic wcs<br>
+ $cat foo.fits | xpaset ds9 mosaic wcs</tt><tt> new<br>
+ </tt>$cat foo.fits | xpaset ds9 mosaic wcs</tt><tt> mask<br>
+ </tt>
+ <p><b> <a name="mosaicimage"></a>mosaicimage</b></p>
+ <p>Load FITS mosaic image into current frame.</p>
+ <tt> Syntax:<br>
+ mosaicimage [wcs|wcsa...wcsz|iraf|wfpc2] [new|mask]
+ [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 mosaicimage &gt; foo.fits</tt><tt><br>
+ $xpaset -p ds9 mosaicimage foo.fits</tt><br>
+ <tt><tt>$xpaset -p ds9 mosaicimage wcs foo.fits</tt></tt><br>
+ <tt><tt>$xpaset -p ds9 mosaicimage wcs new foo.fits</tt></tt><br>
+ <tt><tt>$xpaset -p ds9 mosaicimage wcs mask foo.fits</tt></tt><tt><tt><tt><br>
+ </tt></tt>$cat foo.fits | xpaset ds9 mosaicimage</tt><br>
+ <tt><tt>$cat foo.fits | xpaset ds9 mosaicimage wcs<br>
+ $cat foo.fits | xpaset ds9 mosaicimage wcs new</tt><tt><br>
+ </tt>$cat foo.fits | xpaset ds9 mosaicimage wcs mask</tt><br>
+ <p><b> <a name="movie"></a>movie<br>
+ savempeg<br>
+ </b></p>
+ <p>Create mpeg1 movie from snap shots of the DS9 window. A <tt>slice</tt>
+ movie cycles though all slices of a cube. A <tt>frame</tt>
+ movie cycles through all active frames. A <tt>3d</tt> movie
+ cycles through specified viewing angles. The default is <tt>frame</tt>.
+ Optional parameters for <tt>3d</tt>: number of frames, azimuth
+ from/to, elevation from/to, slice from/to, oscillate/repeat
+ times.</p>
+ <tt> Syntax:<br>
+ movie </tt><tt>[slice|frame|3d] </tt><tt>&lt;filename&gt;<br>
+ </tt><tt>movie 3d &lt;filename&gt;
+ [number|azfrom|azto|elfrom|elto|slfrom|slto|oscillate|repeat
+ &lt;#&gt;]</tt><br>
+ <tt> &nbsp;<br>
+ Example:<br>
+ $xpaset -p ds9 movie slice ds9.mpg<br>
+ </tt><tt>$xpaset -p ds9 movie 3d ds9.mpg number 10 azfrom -60 azto
+ 60 oscillate 1</tt><br>
+ <p><b> <a name="multiframe"></a>multiframe</b></p>
+ <p>Load FITS multiple extension file as multiple images.<br>
+ </p>
+ <tt> Syntax:<br>
+ multiframe [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 multiframe foo.fits</tt><tt><tt><br>
+ </tt>$cat foo.fits | xpaset ds9 multiframe</tt><tt><tt><tt> #
+ not available windows</tt></tt></tt><br>
+ <p><b> <a name="nameserver"></a>nameserver</b></p>
+ <p>Support Name Server functions. Coordinates are in fk5. </p>
+ <tt> Syntax: <br>
+ nameserver [&lt;object&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [server ned-sao|ned-eso|simbad-sao|simbad-eso]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [skyformat degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [pan]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [crosshair] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [open|close]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 nameserver<br>
+ $xpaget ds9 nameserver server<br>
+ $xpaget ds9 nameserver skyformat<br>
+ $xpaget ds9 nameserver m31<br>
+ $xpaset -p ds9 nameserver m31 <br>
+ $xpaset -p ds9 nameserver name m31 <br>
+ $xpaset -p ds9 nameserver server ned-sao <br>
+ $xpaset -p ds9 nameserver skyformat sexagesimal<br>
+ $xpaset -p ds9 nameserver pan<br>
+ $xpaset -p ds9 nameserver crosshair<br>
+ $xpaset -p ds9 nameserver open<br>
+ $xpaset -p ds9 nameserver close<br>
+ </tt>
+ <p><b> <a name="nan"></a>nan</b></p>
+ <p>Set image not-a-number color. </p>
+ <tt> Syntax: <br>
+ nan &lt;color&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaget ds9 nan<br>
+ $xpaset -p ds9 nan red</tt><tt><br>
+ </tt>
+ <p><b> <a name="nrrd"></a>nrrd</b></p>
+ <p>Load an NRRD (Nearly Raw Raster Data) file. Optional parameter:
+ array endian.<br>
+ </p>
+ <tt> Syntax: <br>
+ nrrd [&lt;filename&gt;] [little|big]<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaget ds9 nrrd</tt><br>
+ <tt><tt>$xpaget ds9 nrrd big<br>
+ $xpaset -p ds9 nrrd foo.nrrd</tt></tt><br>
+ <tt><tt><tt><tt>$xpaset -p ds9 nrrd new foo.nrrd</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt>$xpaset -p ds9 nrrd mask foo.nrrd<br>
+ </tt></tt></tt></tt></tt>$cat foo.nrrd | xpaset ds9 nrrd</tt><br>
+ <tt>$cat foo.nrrd | xpaset ds9 nrrd</tt><tt> new<br>
+ $cat foo.nrrd | xpaset ds9 nrrd mask</tt>
+ <p><b> <a name="nvss"></a>nvss</b></p>
+ <p>Support for NRAO VLA Sky Survey.</p>
+ <tt> Syntax: <br>
+ nvss []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt; &lt;height&gt;
+ degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 nvss name <br>
+ $xpaget ds9 nvss coord <br>
+ $xpaget ds9 nvss size<br>
+ $xpaget ds9 nvss save<br>
+ $xpaget ds9 nvss frame<br>
+ $xpaset -p ds9 nvss<br>
+ $xpaset -p ds9 nvss m31 <br>
+ $xpaset -p ds9 nvss name m31 <br>
+ $xpaset -p ds9 nvss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $xpaset -p ds9 nvss size 60 60 arcmin<br>
+ $xpaset -p ds9 nvss save yes<br>
+ $xpaset -p ds9 nvss frame current<br>
+ $xpaset -p ds9 nvss update frame<br>
+ $xpaset -p ds9 nvss open<br>
+ </tt><tt>$xpaset -p ds9 nvss close</tt><br>
+ <p><b> <a name="orient"></a>orient</b></p>
+ <p>Controls the orientation of the current frame. </p>
+ <tt> Syntax: <br>
+ orient [none|x|y|xy] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 orient <br>
+ $xpaset -p ds9 orient xy<br>
+ $xpaset -p ds9 orient open<br>
+ $xpaset -p ds9 orient close<br>
+ </tt>
+ <p><b> <a name="pagesetup"></a>pagesetup</b></p>
+ <p>Controls Page Setup options.<br>
+ </p>
+ <tt> Syntax: <br>
+ pagesetup [orient portrait|landscape] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scale
+ &lt;numberic&gt;]</tt><br>
+ <tt> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size
+ letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 pagesetup orient<br>
+ $xpaget ds9 pagesetup scale <br>
+ $xpaget ds9 pagesetup size <br>
+ $xpaset -p ds9 pagesetup orient portrait <br>
+ $xpaset -p ds9 pagesetup scale 50<br>
+ $xpaset -p ds9 pagesetup size poster<br>
+ </tt>
+ <p><b> <a name="pan"></a>pan</b></p>
+ <p>Controls the current image cursor location for the current
+ frame. </p>
+ <tt> Syntax: <br>
+ pan [&lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;]] # relative<br>
+ &nbsp;&nbsp;&nbsp; [to &lt;x&gt; &lt;y&gt; &lt;coordsys&gt;
+ [&lt;skyframe&gt;][&lt;skyformat&gt;] # absolute<br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 pan # get current image coords <br>
+ $xpaget ds9 pan wcs fk4 sexagesimal # get current wcs coords <br>
+ $xpaset -p ds9 pan 200 200 image # pan relative <br>
+ $xpaset -p ds9 pan to 400 400 physical # pan to physical coords
+ <br>
+ $xpaset -p ds9 pan to 13:29:55 47:11:50 wcs fk5 # pan to wcs
+ coords<br>
+ $xpaset -p ds9 pan open<br>
+ $xpaset -p ds9 pan close<br>
+ </tt>
+ <p><b> <a name="pixeltable"></a>pixeltable</b></p>
+ <p>Display/Hide the pixel table. </p>
+ <tt> Syntax: <br>
+ pixeltable []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [yes|open]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ [no|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 pixeltable <br>
+ $xpaset -p ds9 pixeltable<br>
+ $xpaset -p ds9 pixeltable yes<br>
+ $xpaset -p ds9 pixeltable open<br>
+ $xpaset -p ds9 pixeltable close</tt><br>
+ <p><b> <a name="plot"></a>plot</b></p>
+ <p>Display and configure data plots. All plot commands take an
+ optional second command, the plot name. If no plot name is
+ specified, the last plot created is assumed. Plot data is
+ assumed to be a pair of coordinates, with optional error values.
+ The follow are valid data descriptions:</p>
+ <blockquote>xy &nbsp;&nbsp; &nbsp; &nbsp; x and y coordinates<br>
+ xyex&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with x errors<br>
+ xyey&nbsp;&nbsp;&nbsp; &nbsp; x,y coordinates with y errors<br>
+ xyexey&nbsp;&nbsp;&nbsp; x,y coordinates with&nbsp; x and y
+ errors<br>
+ </blockquote>
+ <p>To create a new plot, use the plot new command.</p>
+ <tt> Syntax: <br>
+ # create new empty plot window<br>
+ plot<br>
+ plot [bar|scatter]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [new [name &lt;plotname&gt;]
+ [line|bar|scatter] &lt;title&gt; &lt;xaxis label&gt; &lt;yaxis
+ label&gt; </tt><tt>xy|xyex|xyey|xyexey</tt><tt>]<br>
+ <br>
+ # create new plot with data<br>
+ plot [new [name &lt;plotname&gt;] </tt><tt>[line|bar|scatter] </tt><tt>stdin]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # title, title xaxis, title yaxis, dimension on line 1<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[new [name &lt;plotname&gt;]
+ [line|bar|scatter] &lt;title&gt; &lt;xaxis label&gt; &lt;yaxis
+ label&gt; xy|xyex|xyey|xyexey]<br>
+ <br>
+ # load dataset into an existing plot<br>
+ plot [&lt;plotname&gt;] [data xy|xyex|xyey|xyexey]<br>
+ </tt><tt><tt><br>
+ plot [&lt;plotname&gt;] load &lt;filename&gt;
+ [xy|xyex|xyey|xyexey]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] save
+ &lt;filename&gt;<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] clear<br>
+ </tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ duplicate<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>[&lt;plotname&gt;] stats<br>
+ </tt></tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ list<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ loadconfig &lt;filename&gt;<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] saveconfig
+ &lt;filename&gt;<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;] pagesetup orient [portrait|landscape]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] pagesetup
+ size [letter|legal|tabloid|poster|a4]</tt><br>
+ <tt> </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;] print<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] print destination
+ [printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ command &lt;command&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print
+ filename &lt;filename&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] print color
+ [rgb|gray]<br>
+ </tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt>[&lt;plotname&gt;]
+ close<br>
+ </tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><br>
+ plot </tt>[&lt;plotname&gt;] mode [pointer|zoom]<br>
+ </tt></tt></tt></tt></tt></tt><tt><br>
+ # configure graph<br>
+ plot [&lt;plotname&gt;] axis [x|y] grid [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] log
+ [yes|no]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y]
+ flip [yes|no]</tt><br>
+ <tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] axis [x|y] auto
+ [yes|no]<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] min
+ &lt;value&gt;<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y] max
+ &lt;value&gt;</tt><tt><br>
+ </tt><tt><tt>&nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] axis [x|y]
+ format &lt;string&gt;</tt><tt><br>
+ </tt></tt>&nbsp;&nbsp;&nbsp;&nbsp; </tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ legend [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[&lt;plotname&gt;] legend position
+ [right|left|top|bottom]</tt><br>
+ </tt><tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font
+ [title|labels|numbers] font [times|helvetica|courier]<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ size &lt;value&gt;<br>
+ &nbsp; &nbsp; &nbsp;[&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ weight [normal|bold]<br>
+ &nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] font </tt></tt><tt><tt><tt><tt>[title|labels|numbers]</tt></tt>
+ slant [roman|italic]<br>
+ </tt></tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] title
+ &lt;string&gt;</tt><br>
+ <tt><tt>&nbsp; &nbsp;&nbsp; [&lt;plotname&gt;] title [x|y]
+ &lt;string&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ barmode [normal|stacked|aligned|overlap]<br>
+ <br>
+ </tt> # configure current dataset<br>
+ </tt>plot [&lt;plotname&gt;] show [yes|no]<br>
+ </tt>&nbsp; &nbsp;&nbsp; <tt></tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape
+ [circle|square|diamond|plus|splus|scross|triangle|arrow]</tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ shape fill [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp; <tt>
+ </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+ shape color &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ smooth
+ [step|linear|cubic|quadratic|catrom]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ width
+ &lt;value&gt;<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dash [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error [yes|no]</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ color
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ error width
+ &lt;value&gt;</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <tt> </tt></tt><tt><tt><tt><tt>[&lt;plotname&gt;]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name
+ &lt;string&gt;<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><br>
+ # select current dataset<br>
+ </tt></tt></tt>plot [&lt;plotname&gt;] select &lt;value&gt;<br>
+ &nbsp; <br>
+ Example: <br>
+ </tt><tt><tt> </tt><tt><tt># return all plotnames<br>
+ </tt></tt>$xpaget ds9 plot</tt><tt><tt><br>
+ </tt><br>
+ # create new empty plot window<br>
+ $xpaset -p ds9 plot<br>
+ $xpaset -p ds9 plot scatter<br>
+ $xpaset -p ds9 plot new<br>
+ $xpaset -p ds9 plot new bar<br>
+ $xpaset -p ds9 plot new name foo<br>
+ $xpaset -p ds9 plot new name foo scatter<br>
+ <br>
+ # create new plot with data<br>
+ $cat foo.dat | xpaset ds9 plot new stdin <br>
+ $cat foo.dat | xpaset ds9 plot new name foo stdin<br>
+ $cat bar.dat | xpaset ds9 plot new "{The Title}" "{X}" "{Y}" xy<br>
+ $cat bar.dat | xpaset ds9 plot new name foo "{The Title}" "{X}"
+ "{Y}" xy<br>
+ <br>
+ # load additional dataset into an existing plot<br>
+ $cat bar.dat | xpaset ds9 plot data xy # plot additional data<br>
+ $cat bar.dat | xpaset ds9 plot foo data xy # plot additional
+ data<br>
+ </tt><tt><tt><br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>$xpaget ds9 plot stats<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt>$xpaget
+ ds9 plot list<br>
+ </tt></tt>$xpaset -p ds9 plot load foo.dat xy # load new
+ dataset with dimension xy<br>
+ $xpaset -p ds9 plot save bar.dat # save current dataset<br>
+ </tt></tt><tt><tt>$xpaset -p ds9 plot clear # clear all datasets<br>
+ $xpaset -p ds9 plot duplicate # duplicate current dataset<br>
+ </tt></tt><tt><tt><tt><tt><tt><tt>$xpaset -p ds9 plot stats<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt>$xpaset -p ds9
+ plot list<br>
+ </tt></tt><tt><tt>$xpaset -p ds9 plot loadconfig foo.plt # load
+ plot configuration <br>
+ $xpaset -p ds9 plot saveconfig bar.plt # save current plot
+ configuration<br>
+ </tt></tt><tt><tt>$xpaset -p ds9 plot pagesetup orient portrait<br>
+ $xpaset -p ds9 plot pagesetup size letter<br>
+ </tt></tt><tt><tt>$xpaset -p ds9 plot print<br>
+ $xpaset -p ds9 plot print destination file<br>
+ $xpaset -p ds9 plot print command "lp"<br>
+ $xpaset -p ds9 plot print filename "foo.ps"<br>
+ $xpaset -p ds9 plot print color rgb<br>
+ </tt>$xpaset -p ds9 plot close # close current plot<br>
+ </tt><tt><tt><br>
+ $xpaget ds9 plot mode<br>
+ $xpaset -p ds9 plot mode pointer</tt><br>
+ </tt><tt><br>
+ # configure plot<br>
+ $xpaget ds9 plot axis x grid<br>
+ </tt><tt><tt>$xpaget ds9 plot axis x log<br>
+ </tt></tt><tt><tt><tt>$xpaget ds9 plot axis x flip</tt></tt></tt><br>
+ <tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+ ds9 plot axis x auto<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot axis x min<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot axis x max<br>
+ $xpaget ds9 plot axis x format<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot legend<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt>$xpaget ds9 plot
+ legend position<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>$xpaget
+ ds9 plot font numbers font<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot font numbers size<br>
+ </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot font numbers weight<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot font numbers slant<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot title<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot title x</tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><br>
+ $xpaget ds9 plot barmode<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>
+ </tt></tt>$xpaset -p ds9 plot axis x grid yes<br>
+ $xpaset -p ds9 plot axis x log yes</tt><br>
+ <tt>$xpaset -p ds9 plot axis x flip yes</tt><tt><br>
+ </tt><tt><tt>$xpaset -p ds9 plot axis x auto no<br>
+ $xpaset -p ds9 plot axis x min 0<br>
+ $xpaset -p ds9 plot axis x max 100<br>
+ $xpaset -p ds9 plot axis x format {%f}<br>
+ </tt>$xpaset -p ds9 plot legend yes # show legend<br>
+ </tt><tt>$xpaset -p ds9 plot legend position left</tt><tt><tt><tt><tt><br>
+ </tt></tt>$xpaset -p ds9 plot font numbers font times<br>
+ $xpaset -p ds9 plot font numbers size 12<br>
+ $xpaset -p ds9 plot font numbers weight bold<br>
+ $xpaset -p ds9 plot font numbers slant italic<br>
+ </tt></tt><tt>$xpaset -p ds9 plot title {The Title}<br>
+ $xpaset -p ds9 plot title x {X Axis}<br>
+ $xpaset -p ds9 plot barmode aligned<br>
+ <br>
+ # configure current dataset<br>
+ $xpaget ds9 plot show<br>
+ $xpaget ds9 plot shape</tt> <br>
+ <tt><tt>$xpaget ds9 plot shape fill<br>
+ </tt></tt><tt><tt><tt>$xpaget ds9 plot shape color<br>
+ </tt></tt></tt><tt><tt><tt><tt>$xpaget ds9 plot smooth<br>
+ </tt></tt></tt></tt><tt><tt><tt><tt><tt>$xpaget ds9 plot
+ color<br>
+ </tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt>$xpaget
+ ds9 plot width<br>
+ </tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot dash<br>
+ </tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot error<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot error
+ color<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot error
+ width<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt><tt>$xpaget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ds9 plot name<br>
+ </tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt></tt>$xpaset
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -p ds9 plot show yes<br>
+ $xpaset -p ds9 plot shape circle<br>
+ </tt><tt><tt>$xpaset -p ds9 plot shape fill no<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 plot shape color cyan<br>
+ </tt></tt></tt><tt><tt>$xpaset -p ds9 plot smooth step<br>
+ </tt>$xpaset -p ds9 plot color red<br>
+ $xpaset -p ds9 plot width 2<br>
+ $xpaset -p ds9 plot dash yes<br>
+ $xpaset -p ds9 plot error yes<br>
+ $xpaset -p ds9 plot error color red</tt><br>
+ <tt>$xpaset -p ds9 plot error width 2</tt><br>
+ <tt>$xpaset -p ds9 plot name {My Data}</tt><br>
+ <tt><br>
+ # select current dataset<br>
+ $xpaget ds9 plot select<br>
+ $xpaset -p ds9 plot select 2</tt><br>
+ <p><b><b><a name="png"></a></b>png</b></p>
+ <p>Load PNG image into current frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ png [new|slice] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 png &gt; foo.png</tt><br>
+ <tt>$xpaset -p ds9 png foo.png</tt><br>
+ <tt><tt>$xpaset -p ds9 png new foo.png<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 png slice foo.png<br>
+ </tt></tt>$cat foo.png | xpaset ds9 png</tt><tt><tt><tt> # not
+ available windows</tt></tt></tt><br>
+ <tt><tt>$cat foo.png | xpaset ds9 png</tt><tt> new </tt></tt><tt><tt><tt><tt>
+ # not available windows</tt></tt><br>
+ </tt>$cat foo.png | xpaset ds9 png</tt><tt> slice</tt><tt><tt><tt>
+ # not available windows</tt></tt></tt>
+ <p><b> <a name="prefs"></a>prefs</b></p>
+ <p>Controls various preference settings. </p>
+ <tt> Syntax: <br>
+ prefs [clear]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [irafalign yes|no]<br>
+ &nbsp; <br>
+ Example:<br>
+ $xpaget ds9 prefs irafalign <br>
+ $xpaset -p ds9 prefs clear<br>
+ $xpaset -p ds9 prefs iraf yes<br>
+ </tt>
+ <p><b><a name="preserve"></a>preserve</b> </p>
+ <p>Preserve the follow attributes while loading a new image. </p>
+ <tt> Syntax: <br>
+ preserve [pan yes|no]<br>
+ &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; [regions yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 preserve pan<br>
+ $xpaget ds9 preserve regions<br>
+ $xpaset -p ds9 preserve pan yes<br>
+ $xpaset -p ds9 preserve regions yes<br>
+ </tt>
+ <p><b> <a name="psprint"></a>psprint</b></p>
+ <p>Invokes postscript printing. Please see <a
+ href="command.html#print">print</a> for further details.</p>
+ <p><b> <a name="print"></a>print</b></p>
+ <p>Controls printing. Use print option to set printing options.
+ Only available for <tt>XPA_METHOD local.</tt> </p>
+ <tt> Syntax: <br>
+ print [destination printer|file] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command &lt;command&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [filename &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color rgb|cmyk|gray] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [level 1|2] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [resolution 53|72|75|150|300|600]
+ <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 print destination <br>
+ $xpaget ds9 print command <br>
+ $xpaget ds9 print filename <br>
+ $xpaget ds9 print color<br>
+ $xpaget ds9 print level <br>
+ $xpaget ds9 print resolution <br>
+ $xpaset -p ds9 print <br>
+ $xpaset -p ds9 print destination file <br>
+ $xpaset -p ds9 print command '{gv -}' <br>
+ $xpaset -p ds9 print filename foo.ps <br>
+ $xpaset -p ds9 print color cmyk <br>
+ $xpaset -p ds9 print level 2 <br>
+ $xpaset -p ds9 print resolution 75 </tt>
+ <p><b> <a name="raise"></a>raise</b></p>
+ <p>Raise in the window stacking order. </p>
+ <tt> Syntax: <br>
+ raise <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 raise </tt>
+ <p><b> <a name="regions"></a>regions</b></p>
+ <p>Controls regions in the current frame. </p>
+ <tt> Syntax: <br>
+ regions&nbsp;[&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [load [all]
+ &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save
+ &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [list [close]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [epsilon &lt;integer&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [show yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [showtext yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid auto
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [centroid radius
+ &lt;value&gt;|iteration &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [getinfo]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move front] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [move back]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select all]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select none] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [select invert]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [delete all] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [delete select] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [format
+ ds9|xml|ciao|saotng|saoimage|pros|xy] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [system
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sky
+ fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [strip yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [shape &lt;shape&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [color
+ &amp;ltcolor&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [width &lt;width&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [fixed|edit|rotate|delete yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
+ [include|exclude|source|background]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [delim
+ [nl|&lt;char&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [command &lt;marker
+ command&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [composite]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [dissolve]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [template
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [template &lt;filename&gt;
+ at &lt;ra&gt; &lt;dec&gt; &lt;coordsys&gt; &lt;skyframe&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [savetemplate
+ &lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [groups] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group new]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ new]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; update]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ select]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; color
+ &amp;ltcolor&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; copy] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; delete]
+ <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; font
+ &lt;font&gt;] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt; move
+ &lt;int&gt; &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ movefront] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ moveback] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [group &lt;tag&gt;
+ property &lt;property&gt; yes|no] <br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [copy]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [cut]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [paste
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [undo]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-format
+ ds9|ciao|saotng|saoimage|pros|xy]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-system
+ image|physical|wcs|wcsa...wcsz]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-sky
+ fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-skyformat
+ degrees|sexagesimal]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-delim [nl|&lt;char&gt;]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-prop
+ select|edit|move|rotate|delete|fixed|include|source 1|0] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-group &lt;tag&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-strip yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [-wcs yes|no]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 regions<br>
+ $xpaget ds9 regions -format ds9 -system wcs -sky fk5 -skyformat
+ sexagesimal -prop edit 1 -group foo <br>
+ $xpaget ds9 regions epsilon<br>
+ $xpaget ds9 regions show<br>
+ $xpaget ds9 regions showtext<br>
+ $xpaget ds9 regions centroid auto<br>
+ $xpaget ds9 regions centroid radius<br>
+ $xpaget ds9 regions centroid iteration<br>
+ $xpaget ds9 regions selected<br>
+ $xpaget ds9 regions format <br>
+ $xpaget ds9 regions system <br>
+ $xpaget ds9 regions sky <br>
+ $xpaget ds9 regions skyformat <br>
+ $xpaget ds9 regions strip<br>
+ $xpaget ds9 regions shape <br>
+ $xpaget ds9 regions color <br>
+ $xpaget ds9 regions width<br>
+ $xpaget ds9 regions delim<br>
+ $xpaget ds9 regions source <br>
+ $xpaget ds9 regions background <br>
+ $xpaget ds9 regions include <br>
+ $xpaget ds9 regions exclude <br>
+ $xpaget ds9 regions selected<br>
+ $xpaget ds9 regions groups<br>
+ $cat foo.reg | xpaset ds9 regions -format xy -system wcs -sky
+ fk5<br>
+ $cat bar.reg | xpaset ds9 regions -format ds9<br>
+ $echo "image; circle 100 100 20" | xpaset ds9 regions <br>
+ $echo "image; circle 100 100 20" | xpaset ds9 regions<br>
+ $echo "fk5; circle 13:29:55 47:11:50 .5'" | xpaset ds9 regions <br>
+ $echo "physical; ellipse 100 100 20 40" | xpaset ds9 regions <br>
+ $echo "box 100 100 20 40 25" | xpaset ds9 regions <br>
+ $echo "image; line 100 100 200 400" | xpaset ds9 regions <br>
+ $echo "physical; ruler 200 300 200 400" | xpaset ds9 regions <br>
+ $echo "image; text 100 100 # text={Hello, World}" | xpaset ds9
+ regions <br>
+ $echo "fk4; boxcircle point 13:29:55 47:11:50" | xpaset ds9
+ regions <br>
+ $xpaset -p ds9 regions foo.reg <br>
+ $xpaset -p ds9 regions -format ciao bar.reg # load as ciao
+ format<br>
+ $xpaset -p ds9 regions foo.fits # FITS regions files do not need
+ a format specification<br>
+ $xpaset -p ds9 regions load foo.reg # load foo.reg into current
+ frame<br>
+ $xpaset -p ds9 regions load all foo.reg # load foo.reg into all
+ frames<br>
+ $xpaset -p ds9 regions load '*.reg'# expand *.reg and load into
+ current frame<br>
+ $xpaset -p ds9 regions load all '*.reg' # expand *.reg and load
+ into all frames<br>
+ $xpaset -p ds9 regions save foo.reg<br>
+ $xpaset -p ds9 regions list <br>
+ $xpaset -p ds9 regions list close<br>
+ $xpaset -p ds9 regions epsilon 5<br>
+ $xpaset -p ds9 regions show yes<br>
+ $xpaset -p ds9 regions showtext no<br>
+ $xpaset -p ds9 regions centroid<br>
+ $xpaset -p ds9 regions centroid auto yes<br>
+ $xpaset -p ds9 regions centroid radius 10<br>
+ $xpaset -p ds9 regions centroid iteration 20<br>
+ $xpaset -p ds9 regions getinfo<br>
+ $xpaset -p ds9 regions move back <br>
+ $xpaset -p ds9 regions move front <br>
+ $xpaset -p ds9 regions select all <br>
+ $xpaset -p ds9 regions select none <br>
+ $xpaset -p ds9 regions select invert<br>
+ $xpaset -p ds9 regions delete all <br>
+ $xpaset -p ds9 regions delete select <br>
+ $xpaset -p ds9 regions format ds9 <br>
+ $xpaset -p ds9 regions system wcs<br>
+ $xpaset -p ds9 regions sky fk5 <br>
+ $xpaset -p ds9 regions skyformat degrees <br>
+ $xpaset -p ds9 regions delim nl <br>
+ $xpaset -p ds9 regions strip yes<br>
+ $xpaset -p ds9 regions shape ellipse <br>
+ $xpaset -p ds9 regions color red <br>
+ $xpaset -p ds9 regions width 3<br>
+ $xpaset -p ds9 regions edit yes<br>
+ $xpaset -p ds9 regions include<br>
+ $xpaset -p ds9 regions command '{circle 100 100 20 # color=red}'<br>
+ $xpaset -p ds9 regions composite<br>
+ $xpaset -p ds9 regions dissolve<br>
+ $xpaset -p ds9 regions template foo.tpl<br>
+ $xpaset -p ds9 regions template foo.tpl at 13:29:55.92
+ +47:12:48.02 fk5<br>
+ $xpaset -p ds9 regions savetemplate foo.tpl<br>
+ $xpaset -p ds9 regions group new<br>
+ $xpaset -p ds9 regions group foo new<br>
+ </tt><tt>$xpaset -p ds9 regions group foo update</tt><br>
+ <tt>$xpaset -p ds9 regions group foo select</tt><br>
+ <tt>$xpaset -p ds9 regions group foo color red<br>
+ $xpaset -p ds9 regions group foo copy<br>
+ $xpaset -p ds9 regions group foo delete<br>
+ $xpaset -p ds9 regions group foo cut<br>
+ $xpaset -p ds9 regions group foo font {times 14 bold}<br>
+ $xpaset -p ds9 regions group foo move 100 100 <br>
+ $xpaset -p ds9 regions group foo movefront <br>
+ $xpaset -p ds9 regions group foo moveback <br>
+ $xpaset -p ds9 regions group foo property delete no <br>
+ <br>
+ $xpaset -p ds9 regions copy<br>
+ $xpaset -p ds9 regions cut<br>
+ $xpaset -p ds9 regions paste wcs<br>
+ $xpaset -p ds9 regions undo<br>
+ </tt>
+ <p><b> <a name="restore"></a>restore</b></p>
+ <p>Restore DS9 to a previous state from a backup save set. </p>
+ <tt> Syntax: <br>
+ restore &lt;filename&gt;<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaset -p ds9 restore ds9.bck</tt><br>
+ <p><b> <a name="rgb"></a>rgb</b></p>
+ <p>Create RGB frame and control RGB frame parameters.</p>
+ <tt> Syntax: <br>
+ rgb&nbsp; []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[red|green|blue]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[channel [red|green|blue]]<br>
+ &nbsp;&nbsp; &nbsp; [view [red|green|blue] [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[system &lt;coordsys&gt;]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;[lock
+ wcs|crop|slice|bin|scale|scalelimits|colorbar|block|smooth
+ [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 rgb channel<br>
+ </tt><tt>$xpaget ds9 rgb lock wcs</tt><br>
+ <tt>$xpaget ds9 rgb lock crop</tt><br>
+ <tt>$xpaget ds9 rgb lock slice</tt><br>
+ <tt> $xpaget ds9 rgb lock bin<br>
+ $xpaget ds9 rgb lock scale<br>
+ $xpaset ds9 rgb lock scalelimits<br>
+ $xpaget ds9 rgb lock colorbar<br>
+ $xpaget ds9 rgb lock block<br>
+ $xpaget ds9 rgb lock smooth<br>
+ $xpaget ds9 rgb system<br>
+ $xpaget ds9 rgb view red<br>
+ $xpaget ds9 rgb view green<br>
+ $xpaget ds9 rgb view blue<br>
+ $xpaset -p ds9 rgb # create new rgb frame<br>
+ $xpaset -p ds9 rgb red # set current channel to red<br>
+ $xpaset -p ds9 rgb channel red # set current channel to red<br>
+ $xpaset -p ds9 rgb view blue no # turn off blue channel<br>
+ $xpaset -p ds9 rgb system wcs # set rgb coordinate system<br>
+ </tt><tt>$xpaset -p ds9 rgb lock wcs yes</tt><br>
+ <tt>$xpaset -p ds9 rgb lock crop yes</tt><br>
+ <tt>$xpaset -p ds9 rgb lock slice yes</tt><br>
+ <tt>$xpaset -p ds9 rgb lock bin yes</tt><br>
+ <tt> $xpaset -p ds9 rgb lock scale yes<br>
+ $xpaset -p ds9 rgb lock scalelimits yes<br>
+ $xpaset -p ds9 rgb lock colorbar yes<br>
+ $xpaset -p ds9 rgb lock block yes<br>
+ $xpaset -p ds9 rgb lock smooth yes<br>
+ $xpaset -p ds9 rgb open<br>
+ $xpaset -p ds9 rgb close</tt><br>
+ <p><b> <a name="rgbarray"></a>rgbarray</b></p>
+ <p>Load raw data array cube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbarray [native|big|little]<br>
+ rgbarray [new|mask]
+[[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],[zdim=3],bitpix=&lt;b&gt;,skip=&lt;s&gt;,endian=[little|big]]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 rgbarray &gt; foo.arr<br>
+ $xpaget ds9 rgbarray little &gt; foo.arr<br>
+ $xpaset -p ds9 rgbarray
+ foo.arr[dim=512,zdim=3,bitpix=-32,endian=little]<br>
+ $xpaset -p ds9 rgbarray new foo.arr[dim=512,zdim=3,bitpix=</tt><tt>-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | xpaset ds9 rgbarray
+ [dim=512,zdim=3,bitpix=-32,endian=little]</tt><br>
+ <tt>$cat foo.arr | xpaset ds9 rgbarray new
+ [dim=512,zdim=3,bitpix=-32,endian=little]</tt><br>
+ <p><b> <a name="rgbcube"></a>rgbcube</b></p>
+ <p>Load FITS rgbcube into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbcube [new] [&lt;filename&gt;]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 rgbcube &gt; foo.fits<br>
+ $xpaset -p ds9 rgbcube foo.fits</tt><br>
+ <tt><tt>$xpaset -p ds9 rgbcube new foo.fits<br>
+ </tt>$cat foo.fits | xpaset ds9 rgbcube</tt><br>
+ <tt>$cat foo.fits | xpaset ds9 rgbcube</tt><tt> new</tt><br>
+ <p><b> <a name="rgbimage"></a>rgbimage</b></p>
+ <p>Load FITS rgbimage into rgb frame.<br>
+ </p>
+ <tt> Syntax:<br>
+ rgbimage [new] [&lt;filename&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 rgbimage &gt; foo.fits<br>
+ $xpaset -p ds9 rgbimage foo.fits</tt><br>
+ <tt><tt>$xpaset -p ds9 rgbimage new foo.fits<br>
+ </tt>$cat foo.fits | xpaset ds9 rgbimage</tt><br>
+ <tt>$cat foo.fits | xpaset ds9 rgbimage</tt><tt> new<br>
+ </tt>
+ <p><b> <a name="rotate"></a>rotate</b></p>
+ <p>Controls the rotation angle (in degrees) of the current frame.
+ </p>
+ <tt> Syntax: <br>
+ rotate [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 rotate <br>
+ $xpaset -p ds9 rotate 45 <br>
+ $xpaset -p ds9 rotate to 30<br>
+ $xpaset -p ds9 rotate open<br>
+ $xpaset -p ds9 rotate close<br>
+ </tt>
+ <p><b> <a name="save"></a>save<br>
+ </b></p>
+ <p>Save loaded image data of current frame as FITS.</p>
+ <tt> Syntax: <br>
+ save </tt><tt>[fits|rgbimage|rgbcube|mecube|mosaic|mosaicimage]
+ &lt;filename&gt; [image|table|slice]</tt> <br>
+ <tt> &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 save foo.fits</tt><br>
+ <tt>$xpaset -p ds9 save fits foo.fits image</tt><br>
+ <tt>$xpaset -p ds9 save fits foo.fits table<br>
+ $xpaset -p ds9 save fits foo.fits slice</tt><br>
+ <tt>$xpaset -p ds9 save rgbimage foo.fits<br>
+ </tt><tt>$xpaset -p ds9 save rgbcube foo.fits</tt><br>
+ <tt>$xpaset -p ds9 save mecube foo.fits</tt><br>
+ <tt>$xpaset -p ds9 save mosaic foo.fits</tt><br>
+ <tt>$xpaset -p ds9 save mosaicimage foo.fits</tt><br>
+ <p><b> <a name="saveimage"></a>saveimage<br>
+ </b></p>
+ <p>Create a snap shot of the current DS9 window and save in
+ specified image format. If no format specified, the file name
+ extension is used to determine the output format. Optional
+ parameters: <tt>jpeg </tt>quality (1-100) and <tt>tiff </tt>compression
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ method. </p>
+ <tt> Syntax: <br>
+ saveimage </tt><tt>[fits|eps|gif|tiff|jpeg|png] </tt><tt>&lt;filename&gt;<br>
+ saveimage &lt;filename&gt;.jpeg [1-100]<br>
+ saveimage &lt;filename&gt;.tiff [none|jpeg|packbits|deflate]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 saveimage ds9.tiff<br>
+ $xpaset -p ds9 saveimage jpeg ds9.jpeg 75</tt><br>
+ <p><b> <a name="scale"></a>scale</b></p>
+ <p>Controls the limits and color scale distribution. </p>
+ <tt> Syntax: <br>
+ scale [linear|log|pow|sqrt|squared|asinh|sinh|histequ]<br>
+ &nbsp; &nbsp; &nbsp; [log exp &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [datasec yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [limits &lt;minvalue&gt;
+ &lt;maxvalue&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [mode
+ minmax|&lt;value&gt;|zscale|zmax] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [scope local|global] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [match limits]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [lock [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [lock limits [yes|no]]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 scale<br>
+ $xpaget ds9 scale log exp <br>
+ $xpaget ds9 scale datasec <br>
+ $xpaget ds9 scale limits <br>
+ $xpaget ds9 scale mode <br>
+ $xpaget ds9 scale scope <br>
+ $xpaget ds9 scale lock<br>
+ $xpaget ds9 scale lock limits<br>
+ $xpaset -p ds9 scale linear<br>
+ $xpaset -p ds9 scale log 100<br>
+ $xpaset -p ds9 scale datasec yes <br>
+ $xpaset -p ds9 scale histequ <br>
+ $xpaset -p ds9 scale limits 1 100 <br>
+ $xpaset -p ds9 scale mode zscale <br>
+ $xpaset -p ds9 scale mode 99.5 <br>
+ $xpaset -p ds9 scale scope local<br>
+ $xpaset -p ds9 scale match<br>
+ $xpaset -p ds9 scale match limits<br>
+ $xpaset -p ds9 scale lock yes<br>
+ $xpaset -p ds9 scale lock limits yes<br>
+ $xpaset -p ds9 scale open<br>
+ $xpaset -p ds9 scale close<br>
+ </tt>
+ <p><b> <a name="shm"></a>shm</b></p>
+ <p>Load a shared memory segment into the current frame. </p>
+ <tt> Syntax: <br>
+ shm [&lt;key&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [key &lt;key&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [shmid &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [fits [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaicimage [iraf|wcs|wcsa...wcsz|wfpc2]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaicimagenext [wcs|wcsa...wcsz]
+ [key|shmid] &lt;id&gt; [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [mosaic [iraf|wcs|wcsa...wcsz] [key|shmid]
+ &lt;id&gt; [&lt;filename&gt;]] <br>
+ &nbsp;&nbsp;&nbsp; [rgbcube [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [rgbimage [key|shmid] &lt;id&gt;
+ [&lt;filename&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [rgbarray [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;,zdim=3],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [array [key|shmid] &lt;id&gt;
+[xdim=&lt;x&gt;,ydim=&lt;y&gt;|dim=&lt;dim&gt;],bitpix=&lt;b&gt;,[skip=&lt;s&gt;]]<br>
+ &nbsp;&nbsp;&nbsp; [startload|finishload]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 shm <br>
+ $xpaset -p ds9 shm 102 <br>
+ $xpaset -p ds9 shm key 102<br>
+ $xpaset -p ds9 shm shmid 102 foo<br>
+ $xpaset -p ds9 shm fits key 100 foo <br>
+ $xpaset -p ds9 shm mosaicimage iraf key 100 foo <br>
+ $xpaset -p ds9 shm mosaicimage wcs key 100 foo <br>
+ $xpaset -p ds9 shm mosaicimage wcsa key 100 foo <br>
+ $xpaset -p ds9 shm mosaicimage wfpc2 key 100 foo <br>
+ $xpaset -p ds9 shm mosaicimagenext wcs key 100 foo<br>
+ $xpaset -p ds9 shm mosaic iraf key 100 foo <br>
+ $xpaset -p ds9 shm mosaic wcs key 100 foo <br>
+ $xpaset -p ds9 shm rgbcube key 100 foo <br>
+ $xpaset -p ds9 shm rgbimage key 100 foo<br>
+ $xpaset -p ds9 shm rgbarray key 100 [dim=200,zdim=3,bitpix=-32]<br>
+ $xpaset -p ds9 shm array shmid 102 [dim=32,bitpix=-32]<br>
+ $xpaset -p ds9 shm startload # start a multiple load sequence
+ without updating the display<br>
+ $xpaset -p ds9 shm finishload # finish multiple load sequence</tt><br>
+ <p><b> <a name="sia"></a>sia<br>
+ </b></p>
+ <p>Support for VO Simple Image Access protocol. The first command
+ will create a new search. All other commands operated on the
+ last search created, unless indicated otherwise.</p>
+ <tt> Syntax: <br>
+ sia [2mass|akari|astrowise|cadc|cxc|mast|sdss|skyview|tgssadr</tt><tt>]<br>
+ <br>
+ </tt><tt>&nbsp;</tt><tt>&nbsp;&nbsp; [&lt;ref&gt;] [cancel]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [clear]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [close]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [coordinate &lt;ra&gt;
+ &lt;dec&gt; &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;] [crosshair]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [export sb|tsv
+ &lt;filename&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [name &lt;object&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [print]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [retrieve]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [save
+ &lt;filename&gt;]</tt><br>
+ <tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]</tt><br>
+ <tt> </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [sky
+ &lt;skyframe&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [skyformat
+ &lt;skyformat&gt;]<br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; [&lt;ref&gt;] [system
+ &lt;coordsys&gt;]</tt><tt><br>
+ </tt><tt>&nbsp;&nbsp;&nbsp; </tt><tt>[&lt;ref&gt;] [update]</tt><br>
+ &nbsp; <tt><br>
+ Example: <br>
+ $xpaget ds9 sia<br>
+ </tt><tt><br>
+ $xpaset -p ds9 sia 2mass<br>
+ </tt><tt>$xpaset -p ds9 sia cancel<br>
+ </tt><tt>$xpaset -p ds9 sia clear<br>
+ </tt><tt>$xpaset -p ds9 sia close<br>
+ </tt><tt>$xpaset -p ds9 sia coordinate 202.48 47.21 fk5<br>
+ </tt><tt>$xpaset -p ds9 sia crosshair<br>
+ </tt><tt>$xpaset -p ds9 sia export tsv bar.tsv<br>
+ </tt><tt>$xpaset -p ds9 sia name m51<br>
+ </tt><tt>$xpaset -p ds9 sia print</tt><br>
+ <tt>$xpaset -p ds9 sia retrieve<br>
+ $xpaset -p ds9 sia save foo.xml<br>
+ </tt><tt> </tt><tt>$xpaset -p ds9 sia size 1 1 degrees</tt><br>
+ <tt>$xpaset -p ds9 sia sky fk5<br>
+ $xpaset -p ds9 sia skyformat degrees<br>
+ </tt><tt>$xpaset -p ds9 sia system wcs</tt><tt><br>
+ </tt><tt>$xpaset -p ds9 sia update<br>
+ <br>
+ </tt><b><a name="single"></a>single</b>
+ <p>Select Single Display mode </p>
+ <tt> Syntax: <br>
+ single <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 single <br>
+ $xpaset -p ds9 single<br>
+ </tt>
+ <p><b> <a name="skyview"></a>skyview </b></p>
+ <p>Support for SkyView image server at HEASARC. </p>
+ <tt> Syntax: <br>
+ skyview []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt;
+ &lt;dec&gt; degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [pixels &lt;width&gt;
+ &lt;height&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update
+ frame|crosshair]<br>
+ &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; [survey &lt;survey&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 skyview name <br>
+ $xpaget ds9 skyview coord <br>
+ $xpaget ds9 skyview size<br>
+ $xpaget ds9 skyview pixels<br>
+ $xpaget ds9 skyview save<br>
+ $xpaget ds9 skyview frame<br>
+ $xpaget ds9 skyview survey<br>
+ $xpaset -p ds9 skyview<br>
+ $xpaset -p ds9 skyview m31 <br>
+ $xpaset -p ds9 skyview name m31 <br>
+ $xpaset -p ds9 skyview coord 00:42:44.404 +41:16:08.78
+ sexagesimal<br>
+ $xpaset -p ds9 skyview size 60 60 arcmin<br>
+ $xpaset -p ds9 skyview pixels 600 600<br>
+ $xpaset -p ds9 skyview save yes<br>
+ $xpaset -p ds9 skyview frame current<br>
+ $xpaset -p ds9 skyview update frame<br>
+ $xpaset -p ds9 skyview survey sdssi<br>
+ $xpaset -p ds9 skyview open<br>
+ </tt><tt>$xpaset -p ds9 skyview close</tt><br>
+ <p><b> <a name="sleep"></a>sleep </b></p>
+ <p>Delays execution for specified number of seconds. Default is 1
+ second. <br>
+ </p>
+ <tt> Syntax: <br>
+ sleep [#]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 sleep<br>
+ $xpaset -p ds9 sleep 2<br>
+ </tt>
+ <p><b> <a name="smooth"></a>smooth</b></p>
+ <p>Smooth current image or set smooth parameters.</p>
+ <tt> Syntax:<br>
+ smooth []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [function
+ boxcar|tophat|gaussian]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [radius &lt;int&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [match]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [lock [yes|no]]<br>
+ <br>
+ Example:<br>
+ $xpaget ds9 smooth<br>
+ $xpaget ds9 smooth function<br>
+ $xpaget ds9 smooth radius<br>
+ $xpaget ds9 smooth lock<br>
+ $xpaset -p ds9 smooth<br>
+ $xpaset -p ds9 smooth yes<br>
+ $xpaset -p ds9 smooth function tophat<br>
+ $xpaset -p ds9 smooth radius 4<br>
+ $xpaset -p ds9 smooth open<br>
+ $xpaset -p ds9 smooth close<br>
+ $xpaset -p ds9 smooth match<br>
+ $xpaset -p ds9 smooth lock yes<br>
+ </tt>
+ <p><b> <a name="source"></a>source</b></p>
+ <p>Source TCL code from a file. Only available for <tt>XPA_METHOD
+ local.</tt></p>
+ <tt> Syntax: <br>
+ source [&lt;filename&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 source foo.tcl </tt>
+ <p><b> <a name="tcl"></a>tcl</b></p>
+ <p>Execute one tcl command. Only available for <tt>XPA_METHOD
+ local.</tt><tt></tt> </p>
+ <tt> Syntax: <br>
+ tcl [&lt;tcl command&gt;] <br>
+ &nbsp;<br>
+ Example: <br>
+ $echo 'puts "Hello, World"' | xpaset ds9 tcl<br>
+ $xpaset -p ds9 tcl 'puts "Hello, World"'</tt><tt><br>
+ </tt>
+ <p><b> <a name="threads"></a>threads</b></p>
+ <p>Set number of process threads for functions which are
+ multi-threaded.<br>
+ </p>
+ <tt> Syntax:<br>
+ threads #<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 threads<br>
+ $xpaset -p ds9 threads 8</tt><br>
+ <p><b> <a name="tiff"></a>tiff</b></p>
+ <p>Load TIFF image into current frame. Optional parameters: <tt>tiff
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </tt>compression method. </p>
+ <tt> Syntax:<br>
+ tiff [new|slice] [&lt;filename&gt;] [none|jpeg|packbits|deflate]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 tiff &gt; foo.tiff</tt><br>
+ <tt><tt>$xpaget ds9 tiff jpeg &gt; foo.tiff</tt><br>
+ $xpaset -p ds9 tiff foo.tiff</tt><br>
+ <tt><tt>$xpaset -p ds9 tiff new foo.tiff<br>
+ </tt></tt><tt><tt><tt>$xpaset -p ds9 tiff slice foo.tiff<br>
+ </tt></tt>$cat foo.tiff | xpaset ds9 tiff</tt><tt><tt><tt> #
+ not available windows</tt></tt></tt><br>
+ <tt><tt>$cat foo.tiff | xpaset ds9 tiff</tt><tt> new</tt></tt><tt><tt><tt><tt>
+ # not available windows</tt></tt><br>
+ </tt>$cat foo.tiff | xpaset ds9 tiff</tt><tt> slice</tt><tt><tt><tt>
+ # not available windows</tt></tt></tt>
+ <p><b> <a name="tile"></a>tile</b></p>
+ <p>Controls the tile display mode. </p>
+ <tt> Syntax: <br>
+ tile []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [mode grid|column|row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid mode automatic|manual]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid direction x|y]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid layout &lt;col&gt; &lt;row&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [grid gap &lt;pixels&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [row] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [column] <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 tile <br>
+ $xpaget ds9 tile mode <br>
+ $xpaget ds9 tile grid mode<br>
+ $xpaget ds9 tile grid direction <br>
+ $xpaget ds9 tile grid layout <br>
+ $xpaget ds9 tile grid gap <br>
+ $xpaset -p ds9 tile<br>
+ $xpaset -p ds9 tile yes <br>
+ $xpaset -p ds9 tile mode row <br>
+ $xpaset -p ds9 tile grid <br>
+ $xpaset -p ds9 tile grid mode manual<br>
+ $xpaset -p ds9 tile grid direction x <br>
+ $xpaset -p ds9 tile grid layout 5 5 <br>
+ $xpaset -p ds9 tile grid gap 10 <br>
+ $xpaset -p ds9 tile row <br>
+ $xpaset -p ds9 tile column </tt>
+ <p><b> <a name="update"></a>update</b></p>
+ <p>Updates the current frame or region of frame. In the second
+ form, the first argument is the number of the fits HDU (starting
+ with 1) and the remaining args are a bounding box in IMAGE
+ coordinates. By default, the screen is updated the next
+ available idle cycle. However, you may force an immediate update
+ by specifying the NOW option. </p>
+ <tt> Syntax: <br>
+ update [] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [# x1 y1 x2 y2] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [now # x1 y1 x2 y2]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 update <br>
+ $xpaset -p ds9 update 1 100 100 300 400 <br>
+ $xpaset -p ds9 update now <br>
+ $xpaset -p ds9 update now 1 100 100 300 400</tt><br>
+ <p><b> <a name="url"></a>url</b></p>
+ <p>Load FITS from URL into the current frame</p>
+ <tt> Syntax: <br>
+ url &lt;url&gt;<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaset -p ds9 url http://foo.bar.edu/foo.fits <br>
+ </tt>
+ <p><b> <a name="version"></a>version</b></p>
+ <p>Returns the current version of DS9. </p>
+ <tt> Syntax: <br>
+ version <br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 version </tt>
+ <p><b> <a name="view"></a>view</b></p>
+ <p>Controls the GUI. </p>
+ <tt> Syntax: <br>
+ view&nbsp; [layout horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [keyvalue &lt;string&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [info yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [panner yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [magnifier yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [buttons yes|no] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar horizontal|vertical]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [colorbar numerics yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [graph horizontal|vertical
+ yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [filename yes|no[<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [object yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [keyword yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [minmax yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [lowhigh yes|no]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [units yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [image|physical|wcs|wcsa...wcsz
+ yes|no]<br>
+ </tt><tt><tt><tt>&nbsp;&nbsp;&nbsp; &nbsp; [frame yes|no] <br>
+ </tt></tt>&nbsp;&nbsp;&nbsp; &nbsp; [red yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [green yes|no]<br>
+ &nbsp; &nbsp; &nbsp; [blue yes|no]</tt><br>
+ <tt><tt>&nbsp; </tt> <br>
+ Example: <br>
+ $xpaget ds9 view layout<br>
+ $xpaget ds9 view keyvalue<br>
+ $xpaget ds9 view info <br>
+ $xpaget ds9 view panner<br>
+ $xpaget ds9 view magnifier<br>
+ $xpaget ds9 view buttons<br>
+ $xpaget ds9 view colorbar<br>
+ $xpaget ds9 view graph horizontal<br>
+ $xpaget ds9 view filename<br>
+ $xpaget ds9 view object<br>
+ $xpaget ds9 view keyword<br>
+ $xpaget ds9 view minmax<br>
+ $xpaget ds9 view lowhigh<br>
+ $xpaget ds9 view units<br>
+ $xpaget ds9 view image<br>
+ $xpaget ds9 view wcsa</tt><br>
+ <tt>$xpaget ds9 view red<br>
+ </tt><tt><tt><tt>$xpaget ds9 view frame<br>
+ </tt> </tt>$xpaset -p ds9 view layout vertical<br>
+ $xpaset -p ds9 view keyvalue BITPIX<br>
+ $xpaset -p ds9 view info yes<br>
+ $xpaset -p ds9 view panner yes<br>
+ $xpaset -p ds9 view magnifier yes<br>
+ $xpaset -p ds9 view buttons yes<br>
+ $xpaset -p ds9 view colorbar yes<br>
+ $xpaset -p ds9 view graph horizontal yes<br>
+ $xpaset -p ds9 view filename yes<br>
+ $xpaset -p ds9 view object yes<br>
+ $xpaset -p ds9 view keyword yes<br>
+ $xpaset -p ds9 view minmax yes<br>
+ $xpaset -p ds9 view lowhigh yes<br>
+ $xpaset -p ds9 view units yes<br>
+ $xpaset -p ds9 view wcsa yes<br>
+ </tt><tt><tt>$xpaset -p ds9 view frame yes </tt></tt><br>
+ <b> </b><tt>$xpaset -p ds9 view red yes<br>
+ $xpaset -p ds9 view green yes<br>
+ $xpaset -p ds9 view blue yes</tt><br>
+ <br>
+ <b><a name="vla"></a>vla</b>
+ <p>Support for VLA Sky Survey. </p>
+ <tt> Syntax:<br>
+ vla []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt;
+ &lt;height&gt; degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp; &nbsp; [survey first|stripe82]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example:<br>
+ $xpaget ds9 vla name <br>
+ $xpaget ds9 vla coord <br>
+ $xpaget ds9 vla size<br>
+ $xpaget ds9 vla save<br>
+ $xpaget ds9 vla frame<br>
+ $xpaget ds9 vla survey<br>
+ $xpaset -p ds9 vla<br>
+ $xpaset -p ds9 vla m31 <br>
+ $xpaset -p ds9 vla name m31 <br>
+ $xpaset -p ds9 vla coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $xpaset -p ds9 vla size 60 60 arcmin<br>
+ $xpaset -p ds9 vla save yes<br>
+ $xpaset -p ds9 vla frame current<br>
+ $xpaset -p ds9 vla update frame<br>
+ $xpaset -p ds9 vla survey stripe82<br>
+ $xpaset -p ds9 vla open<br>
+ </tt><tt>$xpaset -p ds9 vla close<br>
+ </tt>
+ <p><b> <a name="vlss"></a>vlss</b></p>
+ <p>Support for NRAO VLSS Sky Survey.</p>
+ <tt> Syntax: <br>
+ vlss []<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [name &lt;object&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [coord &lt;ra&gt; &lt;dec&gt;
+ degrees|sexagesimal] # in wcs fk5<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [size &lt;width&gt; &lt;height&gt;
+ degrees|arcmin|arcsec]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [save yes|no]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [frame new|current]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [update frame|crosshair]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp; <br>
+ Example: <br>
+ $xpaget ds9 vlss name <br>
+ $xpaget ds9 vlss coord <br>
+ $xpaget ds9 vlss size<br>
+ $xpaget ds9 vlss save<br>
+ $xpaget ds9 vlss frame<br>
+ $xpaset -p ds9 vlss<br>
+ $xpaset -p ds9 vlss m31 <br>
+ $xpaset -p ds9 vlss name m31 <br>
+ $xpaset -p ds9 vlss coord 00:42:44.404 +41:16:08.78 sexagesimal<br>
+ $xpaset -p ds9 vlss size 60 60 arcmin<br>
+ $xpaset -p ds9 vlss save yes<br>
+ $xpaset -p ds9 vlss frame current<br>
+ $xpaset -p ds9 vlss update frame<br>
+ $xpaset -p ds9 vlss open<br>
+ </tt><tt>$xpaset -p ds9 vlss close</tt><br>
+ <b> </b><br>
+ <p><b> <a name="vo"></a>vo</b></p>
+ <p>Invoke an connection to a Virtual Observatory site. </p>
+ <tt> Syntax: <br>
+ vo [method xpa|mime]<br>
+ &nbsp;&nbsp; [server &lt;url&gt;]<br>
+ &nbsp;&nbsp; [internal yes|no]<br>
+ &nbsp;&nbsp; [delay #]<br>
+ &nbsp;&nbsp; [&lt;url&gt;]<br>
+ &nbsp;&nbsp; [connect &lt;url&gt;]<br>
+ &nbsp;&nbsp; [disconnect &lt;url&gt;]<br>
+ &nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example:<br>
+ $xpaget ds9 vo <br>
+ $xpaget ds9 vo method<br>
+ $xpaget ds9 vo server<br>
+ $xpaget ds9 vo internal<br>
+ $xpaget ds9 vo delay<br>
+ $xpaget ds9 vo connect<br>
+ $xpaset -p ds9 vo method xpa<br>
+ $xpaset -p ds9 vo server "http://foo.bar.edu/list.txt"<br>
+ $xpaset -p ds9 vo internal yes<br>
+ $xpaset -p ds9 vo delay 15 # keep-alive delay<br>
+ $xpaset -p ds9 vo chandra-ed<br>
+ $xpaset -p ds9 vo connect chandra-ed<br>
+ $xpaset -p ds9 vo disconnect chandra-ed<br>
+ $xpaset -p ds9 vo open<br>
+ $xpaset -p ds9 vo close<br>
+ </tt>
+ <p><b> <a name="wcs"></a>wcs</b></p>
+ <p>Controls the World Coordinate System for the current frame. If
+ the wcs system, skyframe, or skyformat is modified, the info
+ panel, compass, grid, and alignment will be modified
+ accordingly. Also, using this access point, a new WCS
+ specification can be loaded and used by the current image
+ regardless of the WCS that was contained in the image file. WCS
+ specification can be sent to DS9 as an ASCII file . Please see <a
+ href="file.html#WCS">WCS</a> for more information. </p>
+ <tt> Syntax: <br>
+ wcs [[system] wcs|wcsa...wcsz] <br>
+ &nbsp;&nbsp;&nbsp; [[sky] fk4|fk5|icrs|galactic|ecliptic] <br>
+ &nbsp;&nbsp;&nbsp; [[skyformat] degrees|sexagesimal] <br>
+ &nbsp;&nbsp;&nbsp; [align yes|no] <br>
+ &nbsp;&nbsp;&nbsp; [reset [#]] <br>
+ &nbsp;&nbsp;&nbsp; [replace [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [append [#] &lt;filename&gt;] <br>
+ &nbsp;&nbsp;&nbsp; [open|close]<br>
+ <br>
+ Example: <br>
+ $xpaget ds9 wcs <br>
+ $xpaget ds9 wcs system <br>
+ $xpaget ds9 wcs sky <br>
+ $xpaget ds9 wcs skyformat <br>
+ $xpaget ds9 wcs align <br>
+ $xpaset -p ds9 wcs wcs <br>
+ $xpaset -p ds9 wcs system wcs<br>
+ $xpaset -p ds9 wcs fk5 <br>
+ </tt><tt>$xpaset -p ds9 wcs sky fk5 <br>
+ </tt><tt>$xpaset -p ds9 wcs sexagesimal <br>
+ </tt><tt>$xpaset -p ds9 wcs skyformat sexagesimal <br>
+ $xpaset -p ds9 wcs align yes<br>
+ $xpaset -p ds9 wcs reset<br>
+ $xpaset -p ds9 wcs reset 3<br>
+ $xpaset -p ds9 wcs replace foo.wcs<br>
+ $xpaset -p ds9 wcs replace 3 foo.wcs <br>
+ $xpaset -p ds9 wcs append foo.wcs<br>
+ $xpaset -p ds9 wcs append 3 foo.wcs <br>
+ $cat foo.wcs | xpaset ds9 wcs replace <br>
+ $cat foo.wcs | xpaset ds9 wcs append <br>
+ $echo "OBJECT = 'foobar'" | xpaset ds9 wcs append<br>
+ $xpaset -p ds9 open<br>
+ $xpaset -p ds9 close<br>
+ </tt>
+ <p><b> <a name="web"></a>web</b></p>
+ <p>Display specified URL in the web display. </p>
+ <tt> Syntax:<br>
+ web [new|&lt;webname&gt;] [&lt;url&gt;]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [click
+ back|forward|stop|reload|#]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [clear]<br>
+ &nbsp;&nbsp;&nbsp; [&lt;webname&gt;] [close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 web <br>
+ $xpaset -p ds9 web www.cnn.com<br>
+ $xpaset -p ds9 web new www.cnn.com<br>
+ $xpaset -p ds9 web hvweb www.apple.com<br>
+ $xpaset -p ds9 web click back<br>
+ $xpaset -p ds9 web click 2<br>
+ $xpaset -p ds9 web clear<br>
+ $xpaset -p ds9 web close<br>
+ </tt>
+ <p><b> <a name="width"></a>width</b></p>
+ <p>Set the width of the image display window.</p>
+ <tt> Syntax: <br>
+ width [&lt;value&gt;]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 width<br>
+ $xpaset -p ds9 width 512</tt><br>
+ <p><b> <a name="xpa"></a>xpa</b></p>
+ <p>Configure XPA.</p>
+ <tt> Syntax:<br>
+ -xpa [disconnect] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [info] <br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaget ds9 info <br>
+ $xpaset -p ds9 disconnect <br>
+ $xpaset -p ds9 info <br>
+ </tt>
+ <p><b> <a name="zscale"></a>zscale</b></p>
+ <p>Set Scale Limits based&nbsp; on the <i>IRAF</i> algorithm. </p>
+ <tt> Syntax: <br>
+ zscale []<br>
+ &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [contrast]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [sample]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [line]<br>
+ &nbsp;<br>
+ Example:<br>
+ $xpaget ds9 zscale contrast<br>
+ $xpaget ds9 zscale sample<br>
+ $xpaget ds9 zscale line<br>
+ $xpaset -p ds9 zscale<br>
+ $xpaset -p ds9 zscale contrast .25<br>
+ $xpaset -p ds9 zscale sample 600<br>
+ $xpaset -p ds9 zscale line 120<br>
+ </tt>
+ <p><b> <a name="zoom"></a>zoom</b></p>
+ <p>Controls the current zoom value for the current frame. </p>
+ <tt> Syntax: <br>
+ zoom [&lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [&lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt;] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to &lt;value&gt; &lt;value&gt;]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [in]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [out]<br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [to fit] <br>
+ &nbsp;&nbsp;&nbsp;&nbsp; [open|close]<br>
+ &nbsp;<br>
+ Example: <br>
+ $xpaget ds9 zoom <br>
+ $xpaset -p ds9 zoom 2 <br>
+ $xpaset -p ds9 zoom 2 4<br>
+ $xpaset -p ds9 zoom to 4 <br>
+ $xpaset -p ds9 zoom to 2 4<br>
+ $xpaset -p ds9 zoom in<br>
+ $xpaset -p ds9 zoom out<br>
+ &lt;$xpaset -p ds9 zoom to fit<br>
+ $xpaset -p ds9 zoom open<br>
+ $xpaset -p ds9 zoom close<br>
+ </tt> </blockquote>
+ </body>
+</html>
diff --git a/ds9/doc/release/r1.5.html b/ds9/doc/release/r1.5.html
new file mode 100644
index 0000000..3cc70a9
--- /dev/null
+++ b/ds9/doc/release/r1.5.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 1.5 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+1.5 Release
+Notes</h3>
+<ul>
+ <h4> <b>Version 1.5</b></h4>
+ <ol>
+ <li> <tt>Fixed problem with Windows style Open file dialog box</tt></li>
+ <li> <tt>Now supports following coords systems:</tt></li>
+ <ul>
+ <li> <tt>Image (was Logical)</tt></li>
+ <li> <tt>CCD (was Physical)</tt></li>
+ <li> <tt>Detector (was Mosaic Physical)</tt></li>
+ <li> <tt>Amplifier</tt></li>
+ <li> <tt>WCS</tt></li>
+ </ul>
+ <li> <tt>New version of Doug Mink's WCS libs</tt></li>
+ <li> <tt>Fixed minor problems with interactive Pan Mode</tt></li>
+ <li> <tt>Added "Source TCL" file support</tt></li>
+ <li> <tt>Open Mosaic Image command</tt></li>
+ <br>
+ <tt>Will open multiple fits files as a mosaic.</tt> <br>
+ <tt>Supports following patterns:</tt> <br>
+ <tt>*#.fits</tt> <br>
+ <tt>*_#.fits</tt> <br>
+ <tt>*.IM*.fits</tt> <li><tt>Open Mosaic Segment command</tt></li>
+ <li> <tt>Fixed minor problem with zscale and high energy data</tt></li>
+ <li> <tt>The Magnifier now Works!</tt></li>
+ <br>
+ <tt>There are two algorithms available (under Preferences)</tt> <br>
+ <tt>Magnification can be selected via preferences</tt>
+ <ol>
+ <li> <tt>Fast (and less Accurate)</tt></li>
+ <li> <tt>More Accurate (and slower)</tt></li>
+ </ol>
+ <li> <tt>Improvements to Dialogs</tt></li>
+ <li> <tt>Now supports (unoffical)FITS data size -16 (unsigned
+short)</tt></li>
+ <li> <tt>Support for byte swapped processors</tt></li>
+ <li> <tt>Support large images &gt; 8k x 8k</tt></li>
+ <li> <tt>Loading images are now 10x faster</tt></li>
+ <li> <tt>Supports BLANK Fits keyword</tt></li>
+ <li> <tt>&nbsp;Menu Short Cuts have been added (use Alt key, such
+as
+Alt-f for
+Frame menu)</tt></li>
+ <li> <tt>Horizontal and Verticle Graphs now work in all modes (not
+just Crosshair)</tt></li>
+ <li> <tt>ds9 will accept fits files via STDIN (ie. $ cat foo.fits
+|
+ds9 -file
+-&nbsp; )</tt></li>
+ <li> <tt>command line argument support (ie. $ds9 -? for list)</tt></li>
+ <li> <tt>crosshair position is more accurate</tt></li>
+ <li> <tt>added new scales: 'ln' and 'log'.</tt></li>
+ <ol>
+ <li> <tt>ln --&nbsp; SAOimage natural log based algorithm</tt></li>
+ <li> <tt>log--&nbsp; IRAF log base 10 algorithm</tt></li>
+ </ol>
+ <li> <tt>Support for Postscript printing (Level 1 and Level 2)</tt></li>
+ <li> <tt>Blinking is now supported</tt></li>
+ </ol>
+</ul>
+</body>
+</html>
diff --git a/ds9/doc/release/r1.6.html b/ds9/doc/release/r1.6.html
new file mode 100644
index 0000000..bf7259d
--- /dev/null
+++ b/ds9/doc/release/r1.6.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 1.6 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+1.6 Release
+Notes</h3>
+<ul>
+ <h4> <b>Version 1.6.1</b></h4>
+ <ol>
+ <li> <tt>fix some minor problems with odd chars in filenames</tt></li>
+ <li> <tt>fix problems with fits image extensions</tt></li>
+ <li> <tt>removed minimal geometry restrictions</tt></li>
+ <li> <tt>fits file support is more robust</tt></li>
+ </ol>
+</ul>
+</body>
+</html>
diff --git a/ds9/doc/release/r1.7.html b/ds9/doc/release/r1.7.html
new file mode 100644
index 0000000..342df6a
--- /dev/null
+++ b/ds9/doc/release/r1.7.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 1.7 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+1.7 Release
+Notes</h3>
+<ul>
+ <h4> <b>Version 1.7.2</b></h4>
+ <ol>
+ <li> <tt>Fixes a rather nasty bug with coordinates.</tt></li>
+ <li> <tt>XPA version 2.b32</tt></li>
+ <br>
+ <tt>example:</tt> <br>
+ <tt>$ ds9&amp;</tt> <br>
+ <tt>$ xpaget DS9 # will list all public access points</tt> <br>
+ <tt>$ xpaset -p DS9 colormap BB # change colormap</tt> <br>
+ <tt>$ xpaset -p DS9 file snr.fits # load a fits file</tt> <br>
+ <tt>$ cat snr.fits | xpaset DS9 fits # load via XPA</tt> <br>
+ <tt>$ cat snr.fits | xpaset DS9 fits foo[key=RAWX,RAWY] # load via
+XPA</tt> <br>
+ <tt>Note: xpa class and name for ds9</tt> <br>
+ <tt>-- xpa class : 'DS9'</tt> <br>
+ <tt>-- xpa name&nbsp; : 'DS9'</tt> <br>
+ <tt>both class and name are case sensitive</tt> <br>
+ <tt>To specify a different xpa name for this application use the</tt>
+ <br>
+ <tt>-title command line option:</tt> <br>
+ <tt>$
+ds9&amp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+# default name of 'DS9'</tt> <br>
+ <tt>$ ds9 -title foo&amp; # name of 'foo'</tt> <br>
+ <tt>$ xpaset -p foo colormap BB # change colormap for 'foo'</tt> <br>
+ <tt>$ xpaset -p :foo colormap A # change colormap for 'foo'</tt> <br>
+ <tt>$ xpaset -p DS9:foo colormap BB # change colormap for 'foo'</tt>
+ <br>
+ <tt>$ xpaset -p DS9: colormap I8 # change colormap for 'DS9 &amp;
+foo'</tt> <li><tt>fixed bug with zscale and minmax preferences</tt></li>
+ <li> <tt>geometry command line option: $ ds9 -geometry 600x500</tt></li>
+ <br>
+ <tt>Note: this does not include space needed for menus.</tt> <li><tt>default
+wcs is 'fk5'</tt></li>
+ </ol>
+ <h4> <b>Version 1.7</b></h4>
+ <ol>
+ <li> <tt>new version of Fits I/O library</tt></li>
+ <li> <tt>.Z, .z, and .gz files are supported</tt></li>
+ <br>
+ <tt>example:</tt> <br>
+ <tt>$ ds9 snr.fits.Z</tt> <br>
+ <tt>$ ds9 snr.fits.z</tt> <li><tt>url's are now supported</tt></li>
+ <br>
+ <tt>example:</tt> <br>
+ <tt>$ ds9
+ftp://legacy.gsfc.nasa.gov/rosat/data/hri/images/fits/rh100193_img.fits</tt>
+ <br>
+ <tt>$ ds9
+http://legacy.gsfc.nasa.gov/FTP/rosat/data/cdrom/vol1/IMAGES/00h/p000s26b.img.Z</tt>
+ <li><tt>fixed some minor problems with Mosaic Images</tt></li>
+ <li> <tt>Support for FITS bin tables</tt></li>
+ <br>
+ <tt>example:</tt> <br>
+ <tt>$ ds9 snr.fits[2] # assume 'X' or 'x' and 'Y' or 'y' column</tt>
+ <br>
+ <tt>$ ds9 snr.fits[EVENTS]</tt> <br>
+ <tt>$ ds9 snr.fits # assumes EVENTS or STDEVT extension</tt> <br>
+ <tt>$ ds9 snr.fits[key=RAWX,RAWY] # bin on RAWX/RAWY column</tt> <li><tt>Backward
+compatible with Einstein .xpa data for bining</tt></li>
+ <li> <tt>Contours are now supported</tt></li>
+ <br>
+ <tt>You can generate contours for each frame and cut/paste them
+into
+other frames. When you paste a contour, you choose which coordinate
+system
+to translate the contour into. Obvisously, to paste via WCS, each image
+must have a valid WCS. Printing of image/contours also is supported.</tt>
+ <br>
+ <tt>The contour algorithm currently implemented is a general
+purpose
+algorithm, good for most images. However, there are some issues that
+make
+it less than optimal for sparse high energy data. Therefor, next on the
+list is implemention of the 'Pros Imcontour' algorithm.</tt> <li><tt>Now
+supports ICRS WCS</tt></li>
+ <li> <tt>Now Uses Tcl/Tk 8.0.4 and BLT 2.4g</tt></li>
+ <li> <tt>Now uses Doug Minks's wcssubs 2.6.</tt></li>
+ </ol>
+</ul>
+</body>
+</html>
diff --git a/ds9/doc/release/r1.8.html b/ds9/doc/release/r1.8.html
new file mode 100644
index 0000000..4abdf04
--- /dev/null
+++ b/ds9/doc/release/r1.8.html
@@ -0,0 +1,417 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 1.8 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+1.8 Release
+Notes</h3>
+<ol>
+ <h4> <b>Version 1.8.7.8</b></h4>
+ <ol>
+ <li> <tt>Dialog windows now use the same colormap as the parent
+window.</tt></li>
+ <li> <tt>Fixed a problem with the tile xpa point.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.7</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with updating the Contour dialog box.</tt></li>
+ <li> <tt>Fixed another problem with .gz, .Z, and .z</tt></li>
+ <li> <tt>Coordinate Grids now support WCS of projection TNX.</tt></li>
+ <li> <tt>Improved the appearance of Grids while in Internal Mode.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.6</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with running under linux and displaying
+on
+Solaris.</tt></li>
+ <li> <tt>Fixed a problem with Truecolor 8 support.</tt></li>
+ <li> <tt>Added Coordinate Grids!</tt></li>
+ <li> <tt>Mouse coordinates may be printed by pressing the 'C' key.
+Which coordinates
+are printed may be specified via the 'Edit:Preferences:Print
+Coordinates'
+menu.</tt></li>
+ <li> <tt>Default Region Parameters now can be specified via the
+Preferences
+menu.</tt></li>
+ <li> <tt>Contour Dialog has been redesigned and Contour scales and
+limits added.</tt></li>
+ <li> <tt>Fixed a problem with Contour scales log, squared, and
+sqrt.</tt></li>
+ <li> <tt>The user can save and load contours via the Contour
+Parameter
+Dialog
+Box. The contours may be any supported coordinate system.</tt></li>
+ <li> <tt>The user can save and load contour levels via the Contour
+Parameter
+Dialog Box.</tt></li>
+ <li> <tt>Fixed a problem with file names that contain .z, .Z, .gz</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.5</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with Truecolor 24 bit visuals under
+Solaris 7</tt></li>
+ <li> <tt>Fixed a problem with selecting Ruler Regions that are
+horizontal or
+vertical.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.4</b></h4>
+ <ol>
+ <li> <tt>Fixed a major bug with mosaics with an amplifier that
+reads
+out in
+reverse and the data has been flipped before writing.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.3</b></h4>
+ <ol>
+ <li> <tt>New wcssubs: Fixed a problem with wcs of RA--NCP and
+DEC--NCP</tt></li>
+ <li> <tt>Fixed a problem with 'Scale:User Limits'</tt></li>
+ <li> <tt>Removed a warning message if xpa is not available</tt></li>
+ <li> <tt>The coordinate info box is updated while editing regions</tt></li>
+ <li> <tt>Fixed a problem with the window manager closing region
+dialog
+boxes,
+regions list dialog box, and analysis result dialog box</tt></li>
+ <li> <tt>List Regions, Display Header, and the Analysis Dialog box
+now
+have
+options for printing, saving, and searching the contents.</tt></li>
+ <li> <tt>Display Header now supports multiple dialogs, one for
+each
+frame.</tt></li>
+ <li> <tt>Fixed a problem with parsing region files and the LINE
+region.</tt></li>
+ <li> <tt>Fixed a problem with polygon regions and PROS region file
+formats.</tt></li>
+ <li> <tt>All regions are deleted when 'Clear Frame' or 'Open'
+action
+taken.</tt></li>
+ <li> <tt>When creating Text regions, the 'Cancel' button now works.</tt></li>
+ <li> <tt>'Clear Frame' has been moved from 'File menu to 'Frame'
+menu.</tt></li>
+ <li> <tt>shell variable DS9_ARRAY may be used to define default
+array
+parameters.
+Example: $export DS9_ARRAY='[dim=512,bitpix=-32]'</tt></li>
+ <li> <tt>shell variable DS9_BINKEY may be used to define default
+FITS
+bin table
+cols. Example: $export DS9_BINKEY='[bin=rawx,rawy]'</tt></li>
+ <li> <tt>new 'Open Array...' menu item has been added to the
+'File'
+menu.</tt></li>
+ <li> <tt>Changes to following ommand line options:</tt></li>
+ <br>
+ <tt>-array, -mosaicimage, -mosaicimages, -mosaicsegment, -shared</tt>
+ </ol>
+ <h4> <b>Version 1.8.7.2</b></h4>
+ <ol>
+ <li> <tt>Add the -iconify command line option.</tt></li>
+ <li> <tt>FITS Region Binary Table Region file format is supported
+for
+input.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.7.1</b></h4>
+ <ol>
+ <li> <tt>Now using BLT 2.4l</tt></li>
+ <li> <tt>Now using X11R6</tt></li>
+ <li> <tt>Fixed a problem with selecting blink frames multiple
+times.</tt></li>
+ <li> <tt>Fixed a problem with Line Regions always printing with
+arrows.</tt></li>
+ <li> <tt>Fixed a problem when a printing error occurs.</tt></li>
+ <li> <tt>External File support is now available.</tt></li>
+ <li> <tt>External Analysis support is now available.</tt></li>
+ <li> <tt>Added Frame refresh menu item.</tt></li>
+ <li> <tt>Fixed a problem with shared memory size.</tt></li>
+ <li> <tt>XPA frame has changed. The argument is now only a number,
+not
+a name.
+This clears up some problems with syntax. If the frame does not exists,
+the frame is created. The option 'frameno' is provided for backward
+compatiblity.</tt></li>
+ <br>
+ <tt>Example: xpaset -p ds9 frame 2 # goto frame name 'frame2'</tt> <br>
+ <tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xpaset -p ds9
+frame frameno 4 # goto frame name 'frame4'</tt>
+ </ol>
+ <h4> <b>Version 1.8.7</b></h4>
+ <ol>
+ <li> <tt>Scale type 'Ln' has been removed.</tt></li>
+ <li> <tt>Contour scales Log, Sqrt, and Squared have been fixed.</tt></li>
+ <li> <tt>Contour Dialog box is now non-modal.</tt></li>
+ <li> <tt>Fixed a problem with the FITS Header Dialog box.</tt></li>
+ <li> <tt>Support for &gt; 256 colors in truecolor mode.</tt></li>
+ <li> <tt>New PS level 2 drivers that support more than 256 colors.</tt></li>
+ <li> <tt>Crosshairs will now appear in the magnifier if graphics
+enabled.</tt></li>
+ <li> <tt>Improved on the gui in terms of tile and blink. Now ds9
+is in
+one of
+3 display modes: single frame, tile frames, and blink frames.</tt></li>
+ <li> <tt>You can now Show or Hide frames, via the Frame:Show/Hide
+menu. When
+a frame is 'Hidden', it does not appear in Single, Tile, or Blink mode,
+and can not be selected via the Frames menu.</tt></li>
+ <li> <tt>Added a new mode: Examine. While in examine mode, if you
+click, a new
+frame is created, loaded with the same data, and scaled about the point
+you clicked. If the base frame is a FITS image, it is zoomed, if the
+base
+frame is a FITS binary table, it is blocked. The file is not loaded
+again,
+but shared between frames, requiring little additional memory. When you
+clear or delete a base frame, all examine frames are deleted. Options
+as
+to how many frames are created and the scale factor may be specified
+via
+the preferences menu.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.9</b></h4>
+ <ol>
+ <li> <tt>Support for FITS Bin Table Type 'U' (unsigned short) and
+Type
+'V' (unsigned
+long). Note these are not supported by the FITS standard.</tt></li>
+ <li> <tt>Added new default colormap 'Cool'</tt></li>
+ <li> <tt>SAOtng and PROS Regions file support: if wcs coords are
+used,
+yet no
+wcs system has been specified, the native wcs of the file is used.</tt></li>
+ <li> <tt>Regions now are available in the magnifier (user
+prerference)</tt></li>
+ <li> <tt>Fixed a problem with working with line regions at high
+zoom
+factors</tt></li>
+ <li> <tt>Fixed a problem with working with polygon regions at high
+zoom factors</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.8</b></h4>
+ <ol>
+ <li> <tt>Fixed again problems with FITS Tables, Binning, Physical
+Coords, and
+WCS</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.7</b></h4>
+ <ol>
+ <li> <tt>Binning on a third column is now supported</tt></li>
+ <li> <tt>Fixed a problem with FITS Tables and bit fields</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.6</b></h4>
+ <ol>
+ <li> <tt>Added new 'Zoom to Fit Window' function</tt></li>
+ <li> <tt>Added new 'Block to Fit Window' function</tt></li>
+ <li> <tt>Added 'Block to...' function</tt></li>
+ <li> <tt>'Mode' menu has been moved to under 'Edit' menu.</tt></li>
+ <li> <tt>Show/Hide Panner and Magnifier via the prefs, command
+line,
+and xpa</tt></li>
+ <li> <tt>Tear-Off menus now have window titles</tt></li>
+ <li> <tt>minor changes to xpa options syntax (no more -options),
+see <a href="xpa.html">XPA</a>
+for more info.</tt></li>
+ <li> <tt>xpa colormap is no longer case sensitive</tt></li>
+ <li> <tt>fixed a problem with tables and physical coordinates</tt></li>
+ <li> <tt>fixed a problem with interactive pan/zoom/rotate and
+coordinates</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.5</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with reading IRAF Pros regions files</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.4</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with Little Endian Machines and doubles
+in
+FITS bin
+tables</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.3</b></h4>
+ <ol>
+ <li> <tt>Now supports SAOtng regions files in physical coordinates.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.2</b></h4>
+ <ol>
+ <li> <tt>Improved Region clipping</tt></li>
+ <li> <tt>Fixed a problem with finding the Preferences File</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6.1</b></h4>
+ <ol>
+ <li> <tt>Fixed a rather nasty bug with rendering Circle Regions.
+This
+bug would
+sometimes cause the X Server to hang.</tt></li>
+ <li> <tt>Now does a better job of creating the default size
+regions.</tt></li>
+ <li> <tt>Frame buttons Prev and Next now will cycle thru all
+frames.</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.6</b></h4>
+ <ol>
+ <li> <tt>Automatic Tile Mode with multiple files on command line</tt></li>
+ <li> <tt>Fixed problems with HTTP and FTP access</tt></li>
+ <li> <tt>Fixed another problem with FITS Bin tables and regions</tt></li>
+ <li> <tt>There are now 2 modes for interactive panning-- default
+click
+to center</tt></li>
+ <ul>
+ <li> <tt>Click to Center (SAOimage method)</tt></li>
+ <li> <tt>Drag to Center (Native DS9 method)</tt></li>
+ </ul>
+ <li> <tt>New frames use the current user scale limits and
+colorscale.</tt></li>
+ <li> <tt>Added frameno option to FRAME xpa point</tt></li>
+ <li> <tt>REGION SAVE FORMAT menu now reflects coords available</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.5</b></h4>
+ <ol>
+ <li> <tt>New GUI Buttons Bar</tt></li>
+ <li> <tt>Rearranged Menus, smaller desktop footprint</tt></li>
+ <li> <tt>New Tiling algorithms</tt></li>
+ <li> <tt>Truecolor 8bit support</tt></li>
+ <br>
+ <tt>$ds9 -visual truecolor8</tt> <li><tt>Truecolor 16bit support</tt></li>
+ <br>
+ <tt>$ds9 -visual truecolor16</tt> <li><tt>Truecolor 24bit
+enhancements</tt></li>
+ <br>
+ <tt>$ds9 -visual truecolor24</tt> <li><tt>Pseudocolor 8bit
+enhancements</tt></li>
+ <br>
+ <tt>$ds9 -visual pseudocolor8</tt> <li><tt>Regions Modes now
+intergrated into Pointer Mode</tt></li>
+ <li> <tt>New colormaps have been added</tt></li>
+ <li> <tt>Fixed a problem with FITS ext names</tt></li>
+ <li> <tt>Editing RECTANGLE regions resizes about the opposite
+node,
+not the
+center</tt></li>
+ <li> <tt>Polished the GUI for creating regions</tt></li>
+ <li> <tt>list/save regions in saoimage format now outputs points</tt></li>
+ <li> <tt>Fixed a problem with existing regions and blocking</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.4.1</b></h4>
+ <ol>
+ <li> <tt>Fixed problem with rotate mode and updating menus</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.4</b></h4>
+ <ol>
+ <li> <tt>24 bit color support</tt></li>
+ <li> <tt>New Postscript drivers</tt></li>
+ <ul>
+ <li> <tt>CMYK support</tt></li>
+ <li> <tt>Variable resolution</tt></li>
+ </ul>
+ <li> <tt>Online Documentation!</tt></li>
+ <li> <tt>Fixed a problem with Physical Coordinates and FITS Bin
+Tables</tt></li>
+ <li> <tt>Sticky file names have been implemented</tt></li>
+ <li> <tt>Fixed a problem with standard dialogs and double/triple
+clicks</tt></li>
+ <li> <tt>If Header window is open, load will display the new header</tt></li>
+ <li> <tt>Delete Frame now asks for confirmation</tt></li>
+ <li> <tt>Fixed a problem with arrays and xpa</tt></li>
+ <li> <tt>Fixed a problem with FITS keyword inheritance</tt></li>
+ <li> <tt>for FITS bin tables, the keywords BIN, BINKEY, and KEY
+are
+equivalent</tt></li>
+ <li> <tt>Fixed a problem with regions and tiled frames</tt></li>
+ <li> <tt>Keystroke shortcuts have been added to the GUI</tt></li>
+ <li> <tt>Added WCS menu items to preferences saved</tt></li>
+ <li> <tt>Added 'Clear Preferences' to preferences menu</tt></li>
+ <li> <tt>Mouse button 2 is now bound to 'Pan' function</tt></li>
+ <li> <tt>Minor changes to layout of Small and Large Infomation
+Panel</tt></li>
+ <li> <tt>Fixed problem with pseudocolor 8 and private colormaps</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.3</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with arrays and xpa</tt></li>
+ <li> <tt>xpaget regions: you now can specify
+coord/coordformat/format</tt></li>
+ <li> <tt>$ xpaget ds9 regions -format pros -coord fk4 -coordformat
+hms</tt></li>
+ <li> <tt>Interactive rotation is now works!</tt></li>
+ <li> <tt>PanZoom Dialog and Rotate Dialog now have 'Apply' buttons</tt></li>
+ <li> <tt>Preferences have been implemented. 'Save Preferences'
+will
+save the
+current values of the 'Preferences' and 'View' menus in
+$HOME/.ds9.prefs.
+On startup, this values will be used.</tt></li>
+ <li> <tt>Source user tcl file has been implemented. If $HOME/.ds9
+exists, it
+will be sourced on start up.</tt></li>
+ <li> <tt>New Standard Dialog box has been implemented. User now
+has a
+choice
+of motif, windows, or 'blue plate special' dialog boxes.</tt></li>
+ <li> <tt>'$ xpaget ds9 file' now returns full file name</tt></li>
+ <li> <tt>More tolerant of non-existent or bad files.</tt></li>
+ <li> <tt>More robust checking of mosaic files</tt></li>
+ <li> <tt>FITS keyword inheritance is now supported.</tt></li>
+ <li> <tt>Mosaic Multiple Extension Fits files are now supported.</tt></li>
+ <li> <tt>Coordinate name 'CCD' has been changed to 'Physical'</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.2</b></h4>
+ <ol>
+ <li> <tt>Support for raw data arrays</tt></li>
+ <br>
+ <tt>$ ds9 "foo.arr[xdim=512,ydim=512,bitpix=-32]"</tt> <br>
+ <tt>$ ds9 "foo.arr[xdim=512,ydim=512,bitpix=16,skip=100]"</tt> <br>
+ <tt>$ ds9 "foo.arr[dim=1024,bitpix=8,bigendian]"</tt> <br>
+ <tt>$ ds9 "foo.arr[dim=1024,bitpix=8,arch=littleendian]"</tt> <li><tt>xpa
+support for raw data arrays</tt></li>
+ <br>
+ <tt>$ cat foo.arr | xpaset ds9 array "[dim=512,bitpix=16]"</tt>
+ </ol>
+ <h4> <b>Version 1.8.1.2</b></h4>
+ <ol>
+ <li> <tt>fixed problem with printing</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.1.1</b></h4>
+ <ol>
+ <li> <tt>fix problem with change of xpa api</tt></li>
+ </ol>
+ <h4> <b>Version 1.8.1</b></h4>
+ <ol>
+ <li> <tt>fix blockfactor,blockbuffersize, and blockfunction
+command
+line options.</tt></li>
+ <li> <tt>fixed problem with Marker type Line Dialog box.</tt></li>
+ <li> <tt>Added new marker type: Ruler.</tt></li>
+ <li> <tt>fixed major problem with regions files and loading via
+xpa.</tt></li>
+ <li> <tt>Added arrows to line marker.</tt></li>
+ <li> <tt>more robust error handling.</tt></li>
+ <li> <tt>bin table extension names and column names are no longer
+case
+sensitive.</tt></li>
+ <li> <tt>fixed problem with printing to different page sizes</tt></li>
+ </ol>
+ <h4> <b>Version 1.8</b></h4>
+ <ol>
+ <li> <tt>Fixed a major memory leak</tt></li>
+ <li> <tt>Fixed a XPA printing problem</tt></li>
+ <li> <tt>Fixed problem with LOG scale</tt></li>
+ <li> <tt>the xpa application name is now "ds9".</tt></li>
+ <li> <tt>the xpa class name is now "DS9"</tt></li>
+ <br>
+ <tt>example:</tt> <br>
+ <tt>$ xpaget ds9 version # get version number from just ds9</tt> <br>
+ <tt>$ xpaget DS9:ds9 version # get version number from just ds9</tt>
+ <li><tt>$ xpaget DS9: version # get version number for all DS9 apps</tt></li>
+ <li> <tt>Markers!</tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r1.9.html b/ds9/doc/release/r1.9.html
new file mode 100644
index 0000000..f3d3151
--- /dev/null
+++ b/ds9/doc/release/r1.9.html
@@ -0,0 +1,302 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 1.9 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+1.9 Release
+Notes</h3>
+<ol>
+ <h4> <b>Version 1.9.8</b></h4>
+ <ol>
+ <li> <tt>fixed a problem with listing regions that are very long.
+the
+size limit
+has been increased from 1024 to 8192</tt></li>
+ <li> <tt>completed MS Windows port</tt></li>
+ <li> <tt>fixed a problem with large polygons in FITS Regions bin
+table
+format</tt></li>
+ <li> <tt>ds9 will now correctly load a FITS Extension image
+without a
+primary
+header</tt></li>
+ <li> <tt>xpa wcs [reset|replace|append] function added</tt></li>
+ <li> <tt>the default nameserver is now 'simbad-sao'</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.7.2</b></h4>
+ <ol>
+ <li> <tt>fixed a problem with reading arrays via xpa and extra
+data an
+the end
+of the image</tt></li>
+ <li> <tt>fixed a problem with region callbacks and actions on
+regions
+within
+the callback</tt></li>
+ <li> <tt>fixed a memory leak with deleteing polygon vertices</tt></li>
+ <li> <tt>double click on region with select=0 no longers opens a
+dialog</tt></li>
+ <li> <tt>added select property to ds9 region properties list</tt></li>
+ <li> <tt>for default annulus, ellipse annulus, box annulus, the
+number
+of annuli
+is now used when the user click and drags</tt></li>
+ <li> <tt>fixed a problem with ellipse annulus and box annulus and
+zero
+inner
+radius</tt></li>
+ <li> <tt>fixed a problem with box and boxannuls and updating the
+region dialog
+coords</tt></li>
+ <li> <tt>fixed a problem with turning off/on active frames</tt></li>
+ <li> <tt>fixed a problem with saving fits images created from a
+fits
+image extension</tt></li>
+ <li> <tt>added new 'new' option to xpa points 'FITS' and 'ARRAY'
+to
+create a
+new frame before loading the new image</tt></li>
+ <li> <tt>completed port HP-UX</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.7.1</b></h4>
+ <ol>
+ <li> <tt>fixed a problem with prefs and sourcing external tcl files</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.7</b></h4>
+ <ol>
+ <li> <tt>mktclapp is now used to build the application from tcl</tt></li>
+ <li> <tt>fixed a problem with HMS and hour=0</tt></li>
+ <li> <tt>fixed a problem with parseing old ds9 region files and
+'global'</tt></li>
+ <li> <tt>support for SAOtng Regions file format has been restored</tt></li>
+ <li> <tt>upgraded to tcl/tk 8.3.2</tt></li>
+ <li> <tt>upgraded to blt2.4u</tt></li>
+ <li> <tt>minor changes made to ciao regions file format</tt></li>
+ <li> <tt>fixed a problem with Ciao FITS regions files</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.6</b></h4>
+ <ol>
+ <li> <tt>Added Truecolor Colorbar preference</tt></li>
+ <li> <tt>Fitsy++ now supports fixed and free format keyword
+strings
+correctly</tt></li>
+ <li> <tt>While in 'Pan' mode, the arrow keys may be used to pan
+the
+image</tt></li>
+ <li> <tt>Custom Page Setup in mm is now supported</tt></li>
+ <li> <tt>Region Text string can now contain both a ' and "</tt></li>
+ <li> <tt>Region File format for text now supports the following
+text
+strings:</tt></li>
+ <ol>
+ <tt>text="This is a test"</tt> <br>
+ <tt>text="This is a test of '"</tt> <br>
+ <tt>text='This is a test of "'</tt> <br>
+ <tt>text={This is a test of ' and "}</tt>
+ </ol>
+ <li> <tt>DS9 will now correctly parse a regions spec with a delim
+of
+';'</tt></li>
+ <li> <tt>XPA tcl command now runs in the same context frame as
+source
+and ds9</tt></li>
+ <li> <tt>Fixed a problem with the Colorbar contrat/bias dialog and
+truecolor</tt></li>
+ <li> <tt>Fixed a problem with BOX list/save format</tt></li>
+ <li> <tt>Fixed a problem with contours in that one extra level was
+generated
+when using the low/high and number of contours controls</tt></li>
+ <li> <tt>Updated to Doug Mink's wcssub version 2.8.1, which fixes
+a
+problem
+with keywords without an '='</tt></li>
+ <li> <tt>Fixed a problem with printing Region Text with '(', ')',
+or
+'\' in
+it.</tt></li>
+ <li> <tt>Region file format is now valid for both reading and
+writing
+Region
+files</tt></li>
+ <li> <tt>Implemented new Regions file format, version 3</tt></li>
+ <li> <tt>Fixed a problem with IRAF and the 'f' and 'c' keys</tt></li>
+ <li> <tt>Images with odd length will center on pixel boundaries</tt></li>
+ <li> <tt>The number of bins if determined from TLMIN/TLMAX will
+now
+vary, based
+on column type (integer or real). The bin space for integer is TLMIN-.5
+to TLMAX +.5 and for real TLMIN to TLMAX.</tt></li>
+ <li> <tt>Binning Dialog box is now non-modal</tt></li>
+ <li> <tt>Made improvements in the resolution of coordinates</tt></li>
+ <li> <tt>Added the -version command line option</tt></li>
+ <li> <tt>Fixed a problem with bad name resolution and NED-SAO</tt></li>
+ <li> <tt>Fixed a problem with -grid and -contour command line
+options</tt></li>
+ <li> <tt>Add -format, -coord, -coordformat, and -delim to xpaget
+regions</tt></li>
+ <li> <tt>Added FITS bin table filtering</tt></li>
+ <li> <tt>Changed XPA BLOCK to BIN</tt></li>
+ <li> <tt>bin factors of less than 1 but greater that 0 are now
+allowed</tt></li>
+ <li> <tt>fixed a problem with ecliptic coords and FITS BIN TABLES
+with
+wcs</tt></li>
+ <li> <tt>Fixed a problem with contours and high resolution values</tt></li>
+ <li> <tt>Added algorithm method to contours</tt></li>
+ <li> <tt>Fixed a problem with contours and re-binning a FITS bin
+table</tt></li>
+ <li> <tt>Changes to BIN commandline options to mirror BIN xpa
+options</tt></li>
+ <li> <tt>Added raise/lower command line options</tt></li>
+ <li> <tt>Added raise/lower xpa options</tt></li>
+ <li> <tt>Cut/Paste to/from the primary selection is now provided</tt></li>
+ <li> <tt>Added new type of grid, Exterior Axis with interior
+numerics</tt></li>
+ <li> <tt>Fixed problems with grid numerics and rotation of non-zero</tt></li>
+ <li> <tt>Fixed a problem with graphs and no FITS loaded</tt></li>
+ <li> <tt>Added Regions Delimiter menu</tt></li>
+ <li> <tt>Added ANNULUS, ELLIPSE ANNULUS, and BOX ANNULUS regions</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.5</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with Saving FITS images on byte swaped
+platforms</tt></li>
+ <li> <tt>FITS Bin table support now uses TLMIN/TLMAX to determine
+binning buffersize
+up to the user specified limit</tt></li>
+ <li> <tt>Fixed the XPA Regions format,coord, and coordformat calls</tt></li>
+ <li> <tt>Changed the behavior of $xpaget ds9 regions
+[format|coord|coordformat]</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.4</b></h4>
+ <ol>
+ <li> <tt>Added ability to save a FITS bin table as a FITS image</tt></li>
+ <li> <tt>Added xpa point to support the above</tt></li>
+ <li> <tt>Fixed a problem with loading arrays</tt></li>
+ <li> <tt>Added support for the Rosat All Sky Survey</tt></li>
+ <li> <tt>Added command line support for DSS and RASS</tt></li>
+ <li> <tt>Fixed a problem with displaying LINEAR WCS</tt></li>
+ <li> <tt>DS9 is now much more tolarent of FITS files in which the
+data
+segment
+is short in size, ie, is not a multiple of FITBLOCK (2880 bytes)</tt></li>
+ <li> <tt>Fixed a problem with FITS files with headers with 100's
+or
+1000's of
+comments or history keywords</tt></li>
+ <li> <tt>Enhanced Preferences support</tt></li>
+ <li> <tt>The information panel is now updated during blinking</tt></li>
+ <li> <tt>Fixed a problem with long frame names</tt></li>
+ <li> <tt>Added new fuctionality to the 'Frame' xpa point</tt></li>
+ <li> <tt>Fixed a memory problem that caused problems with the
+Alpha
+port</tt></li>
+ <li> <tt>Fixed a problem with regions in sexagesimal format and
+NATIVE
+WCS</tt></li>
+ <li> <tt>DS9 is now much mor tolerant of sexagesimal format
+regions
+that do
+not map directly on top of a image</tt></li>
+ <li> <tt>Implemented the new default region format</tt></li>
+ <li> <tt>Fixed a problem with Polygon regions and creating/moving
+vertices</tt></li>
+ <li> <tt>Added Colormap Contrast and Bias Dialog</tt></li>
+ <li> <tt>Fixed a problem with Box regions and negative width and
+height</tt></li>
+ <li> <tt>Angle has been added to the Ruler Region dialog box</tt></li>
+ <li> <tt>Length has been added to the Line Region dialog box</tt></li>
+ <li> <tt>Fixed a problem with Region Text and the '"' character</tt></li>
+ <li> <tt>Added XPA point for DSS</tt></li>
+ <li> <tt>Added XPA point for RASS</tt></li>
+ <li> <tt>Added XPA point for Name Servers</tt></li>
+ <li> <tt>Fixed a problem with rotated Regions and IRAF images</tt></li>
+ <li> <tt>Added XPA point xpaget fits</tt></li>
+ <li> <tt>Added XPA point xpaset file save &lt;filename&gt;</tt></li>
+ <li> <tt>xpa regions may now be delimited by nl or semicolon</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.3</b></h4>
+ <ol>
+ <li> <tt>Fixed a problem with preferences. The prefs file was not
+parsed.</tt></li>
+ <li> <tt>Fixed a problem with xpaset ds9 fits and multiple ext
+fits
+files</tt></li>
+ <li> <tt>Fixed some minor problems with xpa and blink,frame</tt></li>
+ <li> <tt>Added xpaset ds9 frame [first|next|prev|last]</tt></li>
+ <li> <tt>Added printing of pixel tables</tt></li>
+ <li> <tt>Added Copy/Paste support for pixel tables</tt></li>
+ <li> <tt>Fixed a problem with changing the size of pixel tables</tt></li>
+ <li> <tt>'F' toggles Info Pannel 'freeze' mode.</tt></li>
+ <li> <tt>Full shared memory support has been added</tt></li>
+ <br>
+ <tt>$xpaget ds9 shm</tt> <br>
+ <tt>$xpaset -p ds9 shm 102 8640</tt> <br>
+ <tt>$xpaset -p ds9 shm shmid 102 8640 foo[2]</tt> <br>
+ <tt>$xpaset -p ds9 shm mosaicimage key 100 10240 foo</tt> <br>
+ <tt>$xpaset -p ds9 shm mosaic key 100 10240 foo[3]</tt> <br>
+ <tt>$xpaset -p ds9 shm array shmid 102 8640 [dim=32,bitpix=16]</tt>
+ <p><tt>$xpaset -p ds9 update 1 100 100 200 200 # update HDU1 in
+image coords</tt> <br>
+ <tt>$xpaset -p ds9 update 3 400 400 500 500 # update HDU3 in image
+coords</tt></p>
+ </ol>
+ <h4> <b>Version 1.9.2</b></h4>
+ <ol>
+ <li> <tt>Fixed yet another problem with contours</tt></li>
+ <li> <tt>Fixed a problem with loading arrays with bitpix of -64</tt></li>
+ </ol>
+ <h4> <b>Version 1.9.1</b></h4>
+ <ol>
+ <li> <tt>Fixed the 'Analysis' menu item 'DSS'</tt></li>
+ <li> <tt>provided for more backward compatibility with old
+preference
+files</tt></li>
+ <li> <tt>Fixed a problem with IRAF support and changing buffer
+sizes</tt></li>
+ <li> <tt>Fixed a problem with contours and reading incorrectly
+levels</tt></li>
+ <li> <tt>Fixed a problem with printing and pan/rotation/zoom</tt></li>
+ <li> <tt>Fixed a problem with Grid Rotated numbers and MSB/LSB
+cross-platform</tt></li>
+ </ol>
+ <h4> <b>Version 1.9</b></h4>
+ <ol>
+ <li> <tt>DS9 now supports IRAF!</tt></li>
+ </ol>
+ <ol>
+ <li> <tt>point regions now have the include/exclude property</tt></li>
+ <li> <tt>crosshairs will now print</tt></li>
+ <li> <tt>fixed a problem with contours and the contour dialog is
+visible</tt></li>
+ <li> <tt>fixed a problem with the wcs of FITS files with very long
+headers</tt></li>
+ <li> <tt>added Pixel Table feature</tt></li>
+ <li> <tt>contours now appear in the magnifier with graphics enabled</tt></li>
+ <li> <tt>John Roll's Tcl Ast package has been added</tt></li>
+ <li> <tt>DS9 is now more tolerant of 'SIMPLE = F' type FITS files</tt></li>
+ <li> <tt>fixed a problem with render speed in single frame mode
+and
+multiple
+frames loaded</tt></li>
+ <li> <tt>The Pan Zoom Rotate Dialog Box is now Non-Modal</tt></li>
+ <li> <tt>Name Resolution support has been added</tt></li>
+ <li> <tt>DSS support has been added</tt></li>
+ <li> <tt>A problem with contours has been corrected. if contours
+levels = n,
+then n+1 contours are actually rendered</tt></li>
+ <li> <tt>DEC Alphas are now supported</tt></li>
+ <li> <tt>SGI is now supported</tt></li>
+ <li> <tt>LINEAR WCS is now fully supported</tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r2.0.html b/ds9/doc/release/r2.0.html
new file mode 100644
index 0000000..35a90ff
--- /dev/null
+++ b/ds9/doc/release/r2.0.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 2.0 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+2.0 Release
+Notes</h3>
+<ol>
+ <h4> <b>Version 2.0</b></h4>
+ <ol>
+ <li> <tt>changed xpa tcl received to remove eval statement</tt></li>
+ </ol>
+ <ol>
+ <li> <tt>fixed a problem clearing the magnifier in the windows
+version</tt></li>
+ <li> <tt>implemented a work around for a bug in dvips version 5.55
+and
+level
+2 postscript driver</tt></li>
+ <li> <tt>filename with a space in them will now load correctly</tt></li>
+ <li> <tt>fixed a problem with FITS Regions Files and optional
+columns</tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r2.1.html b/ds9/doc/release/r2.1.html
new file mode 100644
index 0000000..302db3a
--- /dev/null
+++ b/ds9/doc/release/r2.1.html
@@ -0,0 +1,529 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 2.1 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+2.1 Release
+Notes</h3>
+<ol>
+ <h4> <b>Version 2.1</b></h4>
+ <ol>
+ <li> <tt>04.05.2002 fixed a problem with xpa contour load.</tt></li>
+ <li> <tt>04.22.2002 ds9 version 2.1 released to the public.</tt></li>
+ </ol>
+ <h4> <b>Version 2.1b7</b></h4>
+ <ol>
+ <li> <tt>04.02.2002 upgrade to XPA 2.1.0e2. This fixes a problem
+with
+xpa and
+linux/linuxppc.</tt></li>
+ <li> <tt>04.03.2002 fixed a problem with AST. plot.c, line 19463,
+change parameter
+'force' from 1 to 0 in call to 'CheckLabels'. Sometimes we were seeing
+adj labels that where the same. This change makes sure that the labels
+are 'reduced' if we have this condition.</tt></li>
+ <li> <tt>04.03.2002 ds9 will now automatically open as a bin table
+fits extension
+named EVENTS, STDEVT, and RAYEVENT.</tt></li>
+ <li> <tt>04.03.2002 when trying to find an image to open in relax
+mode
+(ie the
+use did not specify an extension), ds9 will not find a valid image if
+the
+length of either axis is 0.</tt></li>
+ <li> <tt>04.03.2002 now check for Ghostscript version 6.50 or
+higher
+when invoking
+Save As.</tt></li>
+ <li> <tt>04.03.2002 add help application preference. Users can now
+choose between
+Netscape and Mozilla as the prefered help application.</tt></li>
+ <li> <tt>04.04.2002 ds9 version 2.1b7 released to the public.</tt></li>
+ </ol>
+ <h4> <b>Version 2.1b6</b></h4>
+ <ol>
+ <li> <tt>02.04.2002 upgraded to ast version 1.8.6. Modified ast to
+use
+sscanf()
+for all platforms except Darwin. Darwin uses astSscanf(), which works
+around
+a problem with sscanf() on MacOSX, with format strings of the following
+format: sscanf(str, " %s %n", foo, &amp;nc).</tt></li>
+ <li> <tt>02.04.2002 changed fity++ primary_/head_ header
+relationship.
+primary_
+is only set if there is a primary header is available and different
+from
+head_.</tt></li>
+ <li> <tt>02.04.2002 wsc's are init'd with both the head_ and the
+primary_ (if
+available) to handle the case where wcs keywords are spread between hdu
+nd primary headers in mulitiple extension files.</tt></li>
+ <li> <tt>02.06.2002 all xpa commands are now 'catch{}' to invoke a
+procedure
+that will unwind the watch cursor stack. Hopefully, no more stuck watch
+cursors.</tt></li>
+ <li> <tt>02.07.2002 add <i>color</i> and <i>width</i> parameters
+to
+contours
+paste command. defaults are <i>green</i> and <i>1</i></tt></li>
+ <li> <tt>02.08.2002 fixed a problem with the FRAME menu. It was
+cutting off
+the last separator.</tt></li>
+ <li> <tt>02.12.2002 AST grid still does not support ICRS properly.
+When a user
+sets the coordinate system to ICRS, the actually parameters sent to the
+AST grid code is FK5</tt></li>
+ <li> <tt>02.13.2002 for XPA points array, fits, regions, and wcs
+(fillbuf=false),
+manually flush the buffer at the end to make sure no data is left</tt></li>
+ <li> <tt>02.13.2002 ecliptic coords from wcssubs corrected by new
+version of
+wcs/wcscon.c</tt></li>
+ <li> <tt>02.13.2002 AST grids, corrected the MDJ-OBS keyword
+generated
+to generate
+the correct EPOCH.</tt></li>
+ <li> <tt>02.13.2002 adjusted the EQUINOX value for ECLIPTIC coords
+for
+ast grids
+to agree with wcssubs. Seems for ecliptic coords, wcssubs and ast use
+two
+slightly different interpretations of the EQUINOX value.</tt></li>
+ <li> <tt>02.13.2002 fixed a problem with histogram equalization
+introduced in
+version 2.1b5.</tt></li>
+ <li> <tt>02.14.2002 fixed a problem with titles in plot(stdin). We
+now
+take
+the first line, and starting from the end, pick off the dimension, x
+and
+y axis titles, and the remainder is taken as the plot title. It can
+contain
+spaces and special characters such as '[]'</tt></li>
+ <li> <tt>02.14.2002 add 'Always create new plot' option to prefs</tt></li>
+ <li> <tt>02.14.2002 add multiple analysis plots, unless prefs are
+unset</tt></li>
+ <li> <tt>02.14.2002 change default annulus and panda to 1 annuli</tt></li>
+ <li> <tt>02.14.2002 enable multiple array loads via blueplate
+dialog</tt></li>
+ <li> <tt>02.14.2002 reset,append, and replace wcs now processes
+OBJECT
+keyword</tt></li>
+ <li> <tt>02.15.2002 fixed a problem with grid format of degrees.
+Sometimes,
+the incorrect format would be used. This was corrected by up'ng the
+number
+of digits displayed to d.3</tt></li>
+ <li> <tt>02.21.2002 upgraded to AST 1.8.7</tt></li>
+ <li> <tt>02.21.2002 upgraded to WCS 3.0.7</tt></li>
+ <li> <tt>02.22.2002 fixed a problem with Ascii Tables in fitsy++.
+The
+column
+offset is now calculated from TBCOLn if present.</tt></li>
+ <li> <tt>02.22.2002 simplied columns in fitsy++. Now all columns
+have
+a value(char*
+ptr, int i) and str(char* ptr, int i) procedure.</tt></li>
+ <li> <tt>02.22.2002 add support for HST WFPC2 mosaics</tt></li>
+ <li> <tt>02.25.2002 fixed a problem with 'marker command'. The
+command
+STRING
+must be quoted by '\{' '\}' before being pasted to the Frame parser.</tt></li>
+ <li> <tt>02.26.2002 add $ERROR/ERROR: support for analysis
+$plot(stdin) macro.</tt></li>
+ <li> <tt>02.26.2002 analysis menus now support multiple levels of
+hierarchical
+menus</tt></li>
+ <li> <tt>02.26.2002 multiple hierarchical menus may have the same
+label</tt></li>
+ <li> <tt>02.26.2002 hierarchical menu label may have an imbedded
+spaces</tt></li>
+ <li> <tt>02.26.2002 add endhmenu endparam to analysis file parser</tt></li>
+ <li> <tt>02.26.2002 analysis file text maybe indented</tt></li>
+ <li> <tt>02.26.2002 add help support to analysis file</tt></li>
+ <li> <tt>02.27.2002 add $BEGINTEXT/$ENDTEXT to $plot(stdin) macro</tt></li>
+ <li> <tt>02.27.2002 add xpa get fits [type|image|table] command</tt></li>
+ <li> <tt>02.27.2002 minor tweak with the File:Save as menu</tt></li>
+ <li> <tt>02.27.2002 clean up some minor memory leaks with
+FitsImage::initwcs()</tt></li>
+ <li> <tt>02.27.2002 fixed a problem in dialog.tcl DialogWait and
+reseting errorInfo</tt></li>
+ <li> <tt>03.01.2002 dss non-save file now uses internal gz</tt></li>
+ <li> <tt>03.04.2002 plot windows can now support a second set of y
+and
+error
+values.</tt></li>
+ <li> <tt>03.05.2002 add debug iis option</tt></li>
+ <li> <tt>03.05.2002 filenames now always reflect fits extension
+name/number
+and filter.</tt></li>
+ <li> <tt>03.05.2002 the last step in analysis commands now
+replaces
+all ']['
+with ',', building up readable filters.</tt></li>
+ <li> <tt>03.06.2002 updated nan.C and nan.h to reflect erics new
+treatment of
+alpha</tt></li>
+ <li> <tt>03.08.2002 add support for save fits gz</tt></li>
+ <li> <tt>03.12.2002 keywords BSCALE/BZERO/BLANK are now ignored
+for
+FITS IEEE
+floating point data</tt></li>
+ <li> <tt>03.12.2002 IEEE nan and inf are supported as valid FITS
+IEEE
+floating
+point data</tt></li>
+ <li> <tt>03.13.2002 add fits.sh test suite which tests for bitpix
+=
+8,16,32,-32,-64
+and BLANK,BSCALE,BZERO keywords, and IEEE floating point data NaN and
+INF.</tt></li>
+ <li> <tt>03.15.2002 add save resample support</tt></li>
+ <li> <tt>03.18.2002 add support for Mosaic Fast Render. Only valid
+for
+IRAF
+mosaics. Basically, you track the current fitsimage til you have miss.</tt></li>
+ <li> <tt>03.19.2002 upgrade XPA 2.1.0e</tt></li>
+ <li> <tt>03.19.2002 upgrade FILTER 1.1.0e</tt></li>
+ <li> <tt>03.19.2002 upgrade FITSY 1.1.0e</tt></li>
+ <li> <tt>03.19.2002 fixed a problem when a user CUT a region that
+had
+a dialog
+box open. A CUT operation now calls the delete callback to remove any
+pending
+dialog boxes.</tt></li>
+ <li> <tt>03.19.2002 fixed a problem with -print command line
+option
+for truecolor
+visuals. We need to make sure that the window is realized so that the
+colormap
+has been created.</tt></li>
+ <li> <tt>03.20.2002 ds9 version 2.1b6 released to the public</tt></li>
+ </ol>
+ <h4> <b>Version 2.1b5</b></h4>
+ <ol>
+ <li> <tt>fixed a problem with bogus wcs data and replace wcs xpa
+command</tt></li>
+ <li> <tt>add view tickmarks to grid dialog box</tt></li>
+ <li> <tt>fixed a problem with loading a custom colormap and then
+printing</tt></li>
+ <li> <tt>add command line/xpa option load colormap file</tt></li>
+ <li> <tt>fixed problems with grid dialog box and switching between
+frames</tt></li>
+ <li> <tt>add command line option pan</tt></li>
+ <li> <tt>add command line option about</tt></li>
+ <li> <tt>add command line option view</tt></li>
+ <li> <tt>gzip compression is now built-in</tt></li>
+ <li> <tt>add xpa fits [mosaic|mosaicimage]</tt></li>
+ <li> <tt>fixed a problem with loading arrays via stdin</tt></li>
+ <li> <tt>fixed a problem with the panda region and rotation</tt></li>
+ <li> <tt>improved performance in plotting of large data sets</tt></li>
+ <li> <tt>fixed a problem with xpa analysis plot stdin and ';' in
+the
+title</tt></li>
+ <li> <tt>increased the histequ internal buffer size to 16k</tt></li>
+ <li> <tt>enhance xpa analysis load command</tt></li>
+ <li> <tt>add multiple preload analysis files</tt></li>
+ <li> <tt>add hiearch analysis menus</tt></li>
+ <li> <tt>fixed cancel support for Namesvr</tt></li>
+ <li> <tt>fixed cancel support for DSS</tt></li>
+ <li> <tt>add virtual observatory support</tt></li>
+ <li> <tt>add jpeg,tiff,pgn,ppm support, via ghostscript</tt></li>
+ <li> <tt>fix a problem with min/max and DATASEC</tt></li>
+ <li> <tt>added 'load incr' commands</tt></li>
+ <li> <tt>added 'load xxxxx incr' command</tt></li>
+ <li> <tt>fixed minor memory leaks</tt></li>
+ <li> <tt>added analysis command log</tt></li>
+ <li> <tt>add xpa grid load/save</tt></li>
+ <li> <tt>add command line option grid</tt></li>
+ <li> <tt>fixed a problem with loading fits from a stream where the
+primary hdu
+contains an image</tt></li>
+ <li> <tt>enhance xpa/command support for dss</tt></li>
+ <li> <tt>add nameserver command line option</tt></li>
+ <li> <tt>fix a problem with panner and magnifer preferences</tt></li>
+ <li> <tt>fixed a issue when gz files are a few bytes short</tt></li>
+ <li> <tt>add support for wcs mosaics</tt></li>
+ <li> <tt>added support for wcs grids for all types of mosaics</tt></li>
+ <li> <tt>speed up printing by factor of 5</tt></li>
+ <li> <tt>add new grid type</tt></li>
+ <li> <tt>updated to wcssubs 3.0.5</tt></li>
+ <li> <tt>updated to ast 1.8.3</tt></li>
+ <li> <tt>updated to filter 1.0b9</tt></li>
+ <li> <tt>updated to fitsy 1.0b9</tt></li>
+ <li> <tt>command line options -file, -mosaic, -mosaicimage,
+-array,
+-url are
+now modal</tt></li>
+ <li> <tt>add -debug [options] support</tt></li>
+ <li> <tt>fixed a problem with contours and NAN data</tt></li>
+ <li> <tt>fixed a problem with contours and DATASEC</tt></li>
+ <li> <tt>split the pros, saoimage, and saotng parsers</tt></li>
+ <li> <tt>fixed a problem with text with the saotng parser</tt></li>
+ <li> <tt>fixed a problem with saotng,saoimage, and pros regions
+parsers and
+\n terminators</tt></li>
+ <li> <tt>add thin width contours</tt></li>
+ <li> <tt>add thin width grids</tt></li>
+ <li> <tt>fixed a problem with iraf mosaics</tt></li>
+ <li> <tt>10.31.2001 Physical, Amplifier, and Detector coordinates
+are
+only displayed
+if keywords are present</tt></li>
+ <li> <tt>11.1.2001 Diplay header will display primary header if
+requested</tt></li>
+ <li> <tt>11.1.2001 add xpa cmap value command</tt></li>
+ <li> <tt>11.2.2001 removed support for analysis with files with
+spaces
+cause
+it created a problem with filename with extensions</tt></li>
+ <li> <tt>11.2.2001 fixed a problem with analysis regions files and
+special characters
+that was causing a problem with ellipse annlus</tt></li>
+ <li> <tt>11.2.2001 add analysis $file[$region] macro</tt></li>
+ <li> <tt>11.8.2001 fixed a problem with saving pixel table data</tt></li>
+ <li> <tt>11.8.2001 add John Rolls new blueplate special stand
+dialog
+box</tt></li>
+ <li> <tt>11.8.2001 removed 'Open Mosaic Images', since you can now
+do
+the same
+from the dialog box</tt></li>
+ <li> <tt>11.8.2001 fixed a problem with printing/saving text from
+SimpleTextDialog</tt></li>
+ <li> <tt>11.9.2001 load muliple files is now much faster</tt></li>
+ <li> <tt>11.13.2001 fixed a problem with Simple List Box and
+windows</tt></li>
+ <li> <tt>11.13.2001 default standard dialog box for windows is now
+the
+windows
+default</tt></li>
+ <li> <tt>12.3.2001 expand update to update [now]</tt></li>
+ <li> <tt>12.4.2001 fitsy++ now promotes all keyword finds to
+uppercase</tt></li>
+ <li> <tt>12.4.2001 add 'get fits header # keyword &lt;str&gt;'
+command</tt></li>
+ <li> <tt>12.4.2001 fix a problem with selecting projection region
+at
+high zoom
+factors</tt></li>
+ <li> <tt>12.5.2001 fixed problems with length and orientation of
+projection
+region</tt></li>
+ <li> <tt>12.6.2001 change 'get data values' syntax to include fits
+#</tt></li>
+ <li> <tt>12.14.2001 fixed a problem with mosaics with linear wcs
+that
+caused
+a core</tt></li>
+ <li> <tt>12.31.2001 supported added for regions and mosaics</tt></li>
+ <li> <tt>1.2.2002 projection regions now support mosaics</tt></li>
+ <li> <tt>1.3.2002 updated xparemote with proxy support</tt></li>
+ <li> <tt>1.3.2002 add vo prefs</tt></li>
+ <li> <tt>1.4.2002 add ciao pie region support</tt></li>
+ <li> <tt>1.7.2002 fixed panda and wcs with rotation problem</tt></li>
+ <li> <tt>1.9.2002 uprade ast to version 1.8.4</tt></li>
+ <li> <tt>1.15.2002 enable Blt_ZoomStack for data plots</tt></li>
+ <li> <tt>1.17.2002 fixed a problem with iraf mosaics with flipped
+segments and
+a round off problem</tt></li>
+ <li> <tt>1.18.2002 add support for multiple aux contours</tt></li>
+ <li> <tt>1.23.2002 fixed a problem with fits headers and the END
+keyword is
+not 8 chars</tt></li>
+ <li> <tt>1.23.2002 fixed many problems with no fits loaded and
+user
+gui actions</tt></li>
+ <li> <tt>1.24.2002 fixed a problem with looking for fits region
+extensions and
+a filter specified</tt></li>
+ <li> <tt>1.24.2002 add regions file format and coord system to
+prefs
+menu</tt></li>
+ <li> <tt>1.25.2002 get data values now spans mosaics and is in
+native
+coords</tt></li>
+ <li> <tt>1.31.2002 ds9 version 2.1b5 released to the public</tt></li>
+ </ol>
+ <h4> <b>Version 2.1b4</b></h4>
+ <ol>
+ <li> <tt>fixed a problem very, very large images and int overflow</tt></li>
+ <li> <tt>add Page Setup preferences</tt></li>
+ <li> <tt>plot data is filtered to remove all non numeric data</tt></li>
+ <li> <tt>fixed a problem with plotting x,y data on alpha</tt></li>
+ <li> <tt>add manual grid layout</tt></li>
+ <li> <tt>text regions can now be rotated</tt></li>
+ <li> <tt>regions text now appears in the magnifier</tt></li>
+ <li> <tt>added the PANDA region</tt></li>
+ <li> <tt>added analysis file macro $entry</tt></li>
+ <li> <tt>fixed a problem with multiple menu entries for analysis
+files
+with
+multiple file templates</tt></li>
+ <li> <tt>default values of Analysis file parameters are now updated</tt></li>
+ <li> <tt>fixed a problem with clear analysis commands</tt></li>
+ <li> <tt>analysis tasks are now non-blocking</tt></li>
+ <li> <tt>add xy regions file format</tt></li>
+ <li> <tt>fixed problem with ps level 2 psuedocolor8 printing and
+inverse colormaps</tt></li>
+ <li> <tt>in regions files, the comment char '#' comments out til a
+new-line
+char</tt></li>
+ <li> <tt>extended $regions macro to include multiple properties
+and
+regions
+format</tt></li>
+ <li> <tt>fixed a problem with loading array data on a little
+endian
+machine
+and the arch is not specified</tt></li>
+ <li> <tt>fixed a problem with histogram equalization</tt></li>
+ <li> <tt>fixed a major problem with all negative float or double
+data
+and min/max
+issues</tt></li>
+ <li> <tt>fixed a problem with $regions and no wcs</tt></li>
+ <li> <tt>fixed a problem with printing ps level 2 and fits with NAN</tt></li>
+ <li> <tt>fixed a problem with running on a msb machine, and
+displaying
+on a
+lsb 24bit machine</tt></li>
+ <li> <tt>unrolled all mosaic algorithms to cycle thru all segments
+for
+each
+pixel</tt></li>
+ <li> <tt>add DATASEC for rendering and printing</tt></li>
+ <li> <tt>upgraded to tcl/tk 8.3.3</tt></li>
+ <li> <tt>add http and ftp macro expand to analysis</tt></li>
+ <li> <tt>fixed a problem with contour log scale</tt></li>
+ <li> <tt>add button 2 bindinds for panner</tt></li>
+ <li> <tt>iraf -fifo default is now /dev/imt1</tt></li>
+ <li> <tt>commented out error messages for bad iraf -fifo, -port,
+-unix</tt></li>
+ <li> <tt>add default imtoolrc values to fb_config if no imtoolrc
+file
+is found
+at startup</tt></li>
+ <li> <tt>add iis support for windows port</tt></li>
+ <li> <tt>add command: get data coordsys x y dx dy var</tt></li>
+ <li> <tt>add plot limits to plot tool</tt></li>
+ <li> <tt>add PROJECTION region</tt></li>
+ <li> <tt>add GETURL analysis macro</tt></li>
+ <li> <tt>Fits bin table keywords TUNITx are now process if
+available</tt></li>
+ <li> <tt>add $filename(root) macro</tt></li>
+ <li> <tt>update filename on load</tt></li>
+ <li> <tt>fixed a problem with Colormaps with a name with a single
+character</tt></li>
+ <li> <tt>added iraf 'non-display' imexamine support</tt></li>
+ </ol>
+ <h4> <b>Version 2.1b3</b></h4>
+ <ol>
+ <li> <tt>fixed a problem with angles of regions specified in WCS</tt></li>
+ <li> <tt>add xpa point 'regions save'</tt></li>
+ <li> <tt>add xpa point 'regions load'</tt></li>
+ <li> <tt>regions file format <i>SAOIMAGE</i> now supports
+annulus,
+ellipse annulus,
+and box annulus</tt></li>
+ <li> <tt>the obsolete <i>Ftools</i> regions file format support
+has
+been removed</tt></li>
+ <li> <tt>fixed many problems with <i>IRAF</i> regions file format</tt></li>
+ <li> <tt>fixed many problems with <i>CIAO</i> regions file format</tt></li>
+ <li> <tt>removed all support for Rosat All Sky Survey</tt></li>
+ <li> <tt>all comments and global settings have been removed from
+regions output
+if delimiter is set to semicolon</tt></li>
+ <li> <tt>fixed a problem with regions defined in WCS degrees and
+do
+not lie
+on an image</tt></li>
+ <li> <tt>fixed a problem with ellipse annulus and box annulus
+regions
+in regions
+files that contain only one region</tt></li>
+ <li> <tt>check for radius of length 0 for circle, annulus,
+ellipse,
+and ellipse
+annulus</tt></li>
+ <li> <tt>Added Histogram Equalization colormap scale distribution</tt></li>
+ <li> <tt>removed <i>default</i> as font option</tt></li>
+ <li> <tt>default font is now <i>helvetica</i></tt></li>
+ <li> <tt>changed command line option -regionfile to -region</tt></li>
+ <li> <tt>fixed a problem with command line option -region and
+incorrect coordinates</tt></li>
+ <li> <tt>Change the 'Scale:User Limits...' dialog into non-modal
+'Scale Parameters...'</tt></li>
+ <li> <tt>Added 'ZMax' Scale Limits algorithm</tt></li>
+ <li> <tt>fixed a problem with loading regions files with full
+pathnames with
+'fits' in them</tt></li>
+ <li> <tt>Updated Prefs, command line options, and xpa points to
+reflect the
+new way minmax and scale options are handled</tt></li>
+ <li> <tt>Removed 'Scan On Load' prefs</tt></li>
+ <li> <tt>Added 'Source/Background' region property</tt></li>
+ <li> <tt>Add support for 'Source/Background' region property to
+SAOtng
+region
+parser</tt></li>
+ <li> <tt>Fixed a color problem with pseudocolor 8 frames and
+black/white. This
+showed up in new Sun hardware and Solaris 8 sofware</tt></li>
+ <li> <tt>Fixed a problem with Postscript printing in pseudocolor 8
+colormode</tt></li>
+ <li> <tt>The magnifier now updates during blinking</tt></li>
+ <li> <tt>Added pixel table commands to command line options and xpa</tt></li>
+ <li> <tt>Add -single command line option</tt></li>
+ <li> <tt>Add default region shape to preferences</tt></li>
+ <li> <tt>New Analysis File format supported, with new macros
+$message,
+$text,
+$plot</tt></li>
+ <li> <tt>Add -analysis command line option</tt></li>
+ <li> <tt>Add subcommands to xpa <i>analysis:</i>
+load,clear,message,text,plot</tt></li>
+ <li> <tt>Add Analysis File macros $data and $image</tt></li>
+ <li> <tt>Add autoload FITS regions option</tt></li>
+ <li> <tt>Add load FITS Region file to command line options and xpa
+regions</tt></li>
+ <li> <tt>DSS servers now have limits as to size of image downloaded</tt></li>
+ <li> <tt>Open Array now presents a dialog box if no specs are given</tt></li>
+ <li> <tt>Now supports compression with .ftz extension</tt></li>
+ <li> <tt>All non-modal windows raise to top when re-invoked</tt></li>
+ <li> <tt>Added Line Width to all regions</tt></li>
+ <li> <tt>Comments are now retained for regions files</tt></li>
+ <li> <tt>Add Line Width to contours</tt></li>
+ <li> <tt>Changed xpa delim to strip yes/no</tt></li>
+ <li> <tt>Contour methods are 'Faster' and 'Better'</tt></li>
+ <li> <tt>Add Convert Contours to polygons</tt></li>
+ <li> <tt>Add $xpa analysis macro</tt></li>
+ <li> <tt>Add $param analysis macros</tt></li>
+ <li> <tt>Fixed a problem with crosshair and rebinning</tt></li>
+ <li> <tt>Fixed a problem with pan click and drag and fits binary
+tables</tt></li>
+ <li> <tt>Add undo regions</tt></li>
+ <li> <tt>Add cut/copy/paste regions</tt></li>
+ <li> <tt>Changed the preferences file and startup file to be
+consistent across
+platforms</tt></li>
+ <li> <tt>Add 'Pan then Zoom' to button 2 options</tt></li>
+ <li> <tt>Add support for FITS 3D data cubes</tt></li>
+ <li> <tt>Add Edit button row</tt></li>
+ <li> <tt>Add default mode to prefs</tt></li>
+ <li> <tt>Fixed a problem with file names starting with 'file'</tt></li>
+ <li> <tt>Add xpa regions shape/color/width</tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r2.2.html b/ds9/doc/release/r2.2.html
new file mode 100644
index 0000000..44276b0
--- /dev/null
+++ b/ds9/doc/release/r2.2.html
@@ -0,0 +1,488 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 2.2 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3>
+<img alt="" src="../sun.gif" align="middle" height="98" width="100">Version
+2.2 Release
+Notes</h3>
+<ol>
+ <h4> <b>Version 2.2.1</b></h4>
+ <ol>
+ <li> <tt>11.04.2002 fixed bin smooth buttons.</tt></li>
+ <li> <tt>11.07.2002 remove debug statements in dss.tcl</tt></li>
+ <li> <tt>11.07.2002 fixed a problem with pure virtual method
+called
+when frame
+was deleted and histequ was the active scale.</tt></li>
+ <li> <tt>11.07.2002 fixed a problem with pasting filters that
+contains
+'\n'
+on the end of the string.</tt></li>
+ <li> <tt>11.14.2002 add W3Browse to archive menu</tt></li>
+ <li> <tt>11.14.2002 Web Display: for redirection, first use
+'location'
+meta
+data parameter, then look for first 'href' in html to find the
+redirection
+url.</tt></li>
+ <li> <tt>11.14.2002 move 'IISInit' after 'ProcessCommandLine' so
+that
+iis command
+line options take affect.</tt></li>
+ <li> <tt>11.14.2002 remove menu short cut options. Too many
+conflicts
+and unable
+to support multiple languages.</tt></li>
+ <li> <tt>11.18.2002 change prefs(scalemode) to prefs(scale,mode),
+prefs(scalescope)
+to prefs(scale,scope) and added prefs(scale,scope) to prefs written.</tt></li>
+ <li> <tt>11.18.2002 change prefs(minmaxmode) to
+prefs(minmax,mode),
+prefs(minmaxsample)
+to prefs(minmax,sample)</tt></li>
+ <li> <tt>11.18.2002 changes to Archive Servers preferences take
+effect
+immediately.</tt></li>
+ <li> <tt>11.19.2002 Web Display: improved support for fits
+mime-types.</tt></li>
+ <li> <tt>11.20.2002 Web Display: improved HVVerifyURL repairing
+urls.</tt></li>
+ <li> <tt>11.20.2002 Archive: add IRAS MSX support.</tt></li>
+ <li> <tt>11.22.2002 add 'update now' when a new display is
+received.
+This will
+allow 'movies' from iraf to display properly.</tt></li>
+ <li> <tt>11.22.2002 ds9 version 2.2.1 released to the public.</tt></li>
+ </ol>
+ <h4> <b>Version 2.2</b></h4>
+ <ol>
+ <li> <tt>09.03.2002 add Archive Server user prefs.</tt></li>
+ <li> <tt>09.03.2002 when HV window is unable to parse input, place
+a
+html header
+around it and display it as text.</tt></li>
+ <li> <tt>09.04.2002 update FITS Bin Table WCS keywords to conform
+to
+25 June
+2002 WCS FITS Documentation.</tt></li>
+ <li> <tt>09.04.2002 add support for FITS Bin Table Alt WCS
+keywords.</tt></li>
+ <li> <tt>09.04.2002 corrected minor errors in xpa documentation.</tt></li>
+ <li> <tt>09.04.2002 fixed a minor memory leak when frame is
+deleted
+and an image
+is still loaded.</tt></li>
+ <li> <tt>09.05.2002 added IPAC NED to archive menu.</tt></li>
+ <li> <tt>09.05.2002 add 'marker # move to canvas x y' command for
+CXC.</tt></li>
+ <li> <tt>09.05.2002 add 'marker # angle' command for CXC.</tt></li>
+ <li> <tt>09.09.2002 change ds9 regions syntax for ellipse annulus
+and
+box annulus
+from old saoimage to funtools syntax.</tt></li>
+ <li> <tt>09.10.2002 undid grid WIDGETBB fix. The results where not
+acceptable.</tt></li>
+ <li> <tt>09.12.2002 fixed a nasty bug with binning FITS bin tables
+and
+high
+bin factor values.</tt></li>
+ <li> <tt>09.13.2002 add Match Scales to Frame menu. This matches
+all
+scale parameters
+across all frames.</tt></li>
+ <li> <tt>09.16.2002 add Grid debug option.</tt></li>
+ <li> <tt>09.17.2002 upgrade to ast 1.8.9. This corrected two
+problems.
+First,
+incorrect grids were generated for dss images in the southern
+hemisphere.
+Second, a problem with galactic grids that crossed 0 degrees.</tt></li>
+ <li> <tt>09.17.2002 modify grid code to not to set attributes
+unless
+really
+needed. ast 1.8.9 tends to set attributes much more often than previous
+versions.</tt></li>
+ <li> <tt>09.17.2002 fixed a problem with reconizing non-standard
+wcs
+in the
+header.</tt></li>
+ <li> <tt>09.17.2002 add more xpa grid support for coordinate
+systems,
+grid type,
+and view options.</tt></li>
+ <li> <tt>09.18.2002 fixed grid axes label and title spacing
+problems
+in publication
+mode.</tt></li>
+ <li> <tt>09.18.2002 add optional grid axes label and title spacing
+parameters
+that override internal calculated values.</tt></li>
+ <li> <tt>09.18.2002 the grid x-axis is now plotted on the bottom
+of
+publication
+grid.</tt></li>
+ <li> <tt>09.18.2002 zoom to fit now makes room for labels for
+publication grid.</tt></li>
+ <li> <tt>09.19.2002 fixed a problem with Clear Analysis File that
+deleted too
+much of the Analysis Menu.</tt></li>
+ <li> <tt>09.19.2002 support new vo list syntax of a tab delimited
+newline terminated
+list of three parameters, xpa, title, and url.</tt></li>
+ <li> <tt>09.20.2002 PHYSICAL Coordinate System: first look for
+WCSNAMEx='PHYSICAL',
+then look for LTM/LTV keywords.</tt></li>
+ <li> <tt>09.24.2002 fixed yet another bug with binning, and
+TLMIN/TLMAX keywords
+whose values were not powers of 2.</tt></li>
+ <li> <tt>09.24.2002 fixed a problem with cores and bad wcs grids.
+ds9
+now checks
+to make sure ast generated a vaild grid.</tt></li>
+ <li> <tt>09.24.2002 WebDisplay: plain text is now displayed using
+&lt;pre&gt;.</tt></li>
+ <li> <tt>09.24.2002 WebDisplay: default method for forms is now
+GET.</tt></li>
+ <li> <tt>09.24.2002 WebDisplay: default width for TEXT form
+elements
+is 20</tt></li>
+ <li> <tt>09.24.2002 XPA nameserver: http has a error, so just
+clear
+errorInfo.</tt></li>
+ <li> <tt>09.25.2002 fixed a bug in wcsinit.c, line 328 and line
+409.</tt></li>
+ <li> <tt>09.25.2002 add Debug Bin option.</tt></li>
+ <li> <tt>09.26.2002 upgrade to xpa 2.1.3</tt></li>
+ <li> <tt>09.26.2002 upgrade to wcssubs 3.1.3</tt></li>
+ <li> <tt>09.26.2002 upgrade to filter 1.2b1</tt></li>
+ <li> <tt>09.26.2002 upgrade to fitsy 1.2b1</tt></li>
+ <li> <tt>10.01.2002 Web Display: more robust URL parseing</tt></li>
+ <li> <tt>10.01.2002 Web Display: add 'Save to Fits File' option</tt></li>
+ <li> <tt>10.01.2002 fixed 'xpaget ds9 bin cols' to return only 2
+cols
+if bin
+depth is 1.</tt></li>
+ <li> <tt>10.07.2002 Web Display: add support for new window with
+button click.</tt></li>
+ <li> <tt>10.08.2002 Change in saotk Makefiles to correct a problem
+with Bison
+and Flex.</tt></li>
+ <li> <tt>10.08.2002 Analysis Text now updates as text arrives.</tt></li>
+ <li> <tt>10.08.2002 add xpa/command line support for MatchFrames.</tt></li>
+ <li> <tt>10.08.2002 don't write WCS for Save Fits Resample and DSS
+fits.</tt></li>
+ <li> <tt>10.10.2002 Web Display: hidden fields are not totally
+encoded
+if url
+is present.</tt></li>
+ <li> <tt>10.17.2002 Fixed a problem with default fonts. Add the
+option
+of 'Default',
+which will not set any font options, if selected. This allows the
+native
+system to choose the best font/size combo.</tt></li>
+ <li> <tt>10.18.2002 Add ProcessFrameCmd.</tt></li>
+ <li> <tt>10.18.2002 Add system wide preference file support.</tt></li>
+ <li> <tt>10.18.2002 Add Default mode. It just updates the infobox
+and
+graphs,
+with no regions.</tt></li>
+ <li> <tt>10.21.2002 Fixed a problem with old prefs files and
+marker(system).</tt></li>
+ <li> <tt>10.22.2002 Fixed a problem with MINMAX Sample. Sample
+intervals are
+now equal in row and columns.</tt></li>
+ <li> <tt>10.25.2002 Fixed a problem with vo and errors that occur
+when
+connecting
+to the vo server.</tt></li>
+ <li> <tt>10.25.2002 Add Match Colorbars and Match Scales
+xpa/command
+line options.</tt></li>
+ <li> <tt>10.25.2002 Changed Analysis plot error reporting to
+include
+first line
+of received data.</tt></li>
+ <li> <tt>10.25.2002 Fixed a problem with DSS and editing the
+dialog
+with another
+image loaded.</tt></li>
+ <li> <tt>10.27.2002 Add filename to ds9/funtools regions file
+header.</tt></li>
+ <li> <tt>10.29.2002 Add Lock Crosshairs xpa/command line options.</tt></li>
+ <li> <tt>10.31.2002 ds9 version 2.2 released to public.</tt></li>
+ <h4> <b>Version 2.2b2</b></h4>
+ </ol>
+ <ol>
+ <li> <tt>07.31.2002 fixed a problem with hv and urls of the form
+foo.com/foo/bar.html#foo.
+Now, the html is not reloaded before the goto is executed.</tt></li>
+ <li> <tt>08.01.2002 add adjust text size support to web browser</tt></li>
+ <li> <tt>08.01.2002 add boxcar and tophat smooth support for
+binning.</tt></li>
+ <li> <tt>08.05.2002 add -vo commandline and xpa support</tt></li>
+ <li> <tt>08.05.2002 fixed a problem for the windows port where
+windows
+has been
+configured to open a fits file with ds9. In this case, the file path
+name
+passed to ds9 is actually in 'dos' format. So we used a cygwin function
+to convert to a posix format. This only occurs in a command line file
+name
+option.</tt></li>
+ <li> <tt>08.06.2002 fixed a problem with smooth and depth&gt;1.</tt></li>
+ <li> <tt>08.06.2002 fixed a problem with save fits resample.</tt></li>
+ <li> <tt>08.07.2002 the user can now display the horz and vert
+graphs,
+even
+in tile or blink mode</tt></li>
+ <li> <tt>08.07.2002 ds9 will operate in single mode, even if in
+tile
+or blink
+mode, if there is just one frame.</tt></li>
+ <li> <tt>08.08.2002 add Gaussian smooth support for binning.</tt></li>
+ <li> <tt>08.08.2002 fixed a problem with the plot tool and
+displaying
+discrete
+x y e1 y2 data. The correct colors are now used.</tt></li>
+ <li> <tt>08.08.2002 the plot tool will now always update the plot
+title, x axis
+label, and y axis label when receiving new data.</tt></li>
+ <li> <tt>08.08.2002 add xpaset -p ds9 analysis plot close support.</tt></li>
+ <li> <tt>08.08.2002 add Know Issues Documentation</tt></li>
+ <li> <tt>08.12.2002 add http proxy support.</tt></li>
+ <li> <tt>08.12.2002 fixed a problem with the close box for the bin
+dialog box.</tt></li>
+ <li> <tt>08.20.2002 add support for default fonts to preferences.</tt></li>
+ <li> <tt>08.23.2002 remove timeouts for all http requests with
+optional cancel
+support.</tt></li>
+ <li> <tt>08.23.2002 fixed a number of items with web display.</tt></li>
+ <li> <tt>08.26.2002 reformat all documentation to remove
+references to
+Helvetica</tt></li>
+ <li> <tt>08.26.2002 bring grid WIDGETBB in by one so that the
+border
+can be
+seen and printed.</tt></li>
+ <li> <tt>08.26.2002 fixed a problem with web gifs under windows.
+The
+output
+channel needed an -translation binary flag.</tt></li>
+ <li> <tt>08.26.2002 adjust font sizes for web display to more
+closely
+follow
+those of Netscape and IE.</tt></li>
+ <li> <tt>08.27.2002 add 'Save as Fits', 'Save as Image', and 'Page
+Setup' buttons.</tt></li>
+ <li> <tt>08.27.2002 add 'First' and 'NVSS' archive server menu
+items.</tt></li>
+ <li> <tt>08.28.2002 add auto coordinate feed to HV for archive
+servers.</tt></li>
+ <li> <tt>08.30.2002 ds9 version 2.2b2 released to public.</tt></li>
+ </ol>
+ <h4> <b>Version 2.2b1</b></h4>
+ <ol>
+ <li> <tt>04.05.2002 fixed a problem with xpa contour load.</tt></li>
+ <li> <tt>04.05.2002 improved parsing of analysis menu file. In
+particular, keywords
+like 'help', 'param', and 'end' can be used more freely.</tt></li>
+ <li> <tt>04.10.2002 add tag suppport for regions.</tt></li>
+ <li> <tt>04.11.2002 add background marker stack. The default stack
+is
+in the
+foreground.</tt></li>
+ <li> <tt>04.11.2002 fixed checks for can Edit, can Move, can
+Rotate,
+and can
+Delete properties thru out marker code.</tt></li>
+ <li> <tt>04.11.2002 add HIGHLITE marker property.</tt></li>
+ <li> <tt>04.12.2002 add $null macro to analysis support.</tt></li>
+ <li> <tt>04.17.2002 fitsy++ now builds an keyword index to search
+for
+keywords.
+Previously, it would search sequentially.</tt></li>
+ <li> <tt>04.18.2002 add a fix to ps level 2 driver to prevent a
+'\n%'
+in the
+image data. Seems the perl script 'assemble' does a global
+search/replace
+that results in corrupted image data. This fix includes a redesign of a
+previous fix that worked around an issue with old versions of dvips
+that
+will incorrectly process'\n%%'.</tt></li>
+ <li> <tt>04.18.2002 upgrade to WCS 3.1.0</tt></li>
+ <li> <tt>04.24.2002 start to add support for multiple wcs's.</tt></li>
+ <li> <tt>04.25.2002 add support for multiple wcs's in infobox.</tt></li>
+ <li> <tt>04.26.2002 improve tag support for regions. All
+functionality
+of selected
+regions are now available for tagged regions.</tt></li>
+ <li> <tt>04.30.2002 add marker command var command to support
+regions
+files
+in tcl vars.</tt></li>
+ <li> <tt>05.08.2002 recalc polygon center when adding or deleteing
+vertex.</tt></li>
+ <li> <tt>05.13.2002 complete implementation of multiple wcs
+support.
+ds9 now
+supports a total of 31 coordinate systems. Furthermore, of the 27 WCS
+coordinate
+systems, both sky coordinates and linear coordinates are fully
+supported.</tt></li>
+ <li> <tt>05.13.2002 complete re-implemenation of map() functions.
+Now
+all map
+functions are in the fits case, and only map between REF and
+IMAGE/PHYSICAL/AMPLIFIER/DETECTOR/WCS/WCSA...
+coordinate systems. This cleans up alot of code and confusion.</tt></li>
+ <li> <tt>05.14.2002 add support for TCROT and CDn_1 WCS keywords
+in
+FITS bin
+tables.</tt></li>
+ <li> <tt>05.16.2002 dramatically speed up parsing wcs keywords by
+substituting
+the fitsy++ index based keyword search routine for Doug Mink's
+'ksearch'
+routine. With multiple wcs's in a large mosaic this can save up to a
+minute
+at load time.</tt></li>
+ <li> <tt>05.16.2002 fixed a minor problem with xpa dss. http has a
+error, that
+carries over and is caught by xpa.</tt></li>
+ <li> <tt>05.16.2002 analysis $text windows will not appear if
+there is
+no output,
+or just an &lt;cr&gt;.</tt></li>
+ <li> <tt>05.16.2002 fixed display header to correctly display 80
+chars, not
+79.</tt></li>
+ <li> <tt>05.16.2002 fixed a problem with iis and very long file
+names.
+names
+up to 256 chars are now allowed.</tt></li>
+ <li> <tt>005.20.2002 AMPLIFER and DETECTOR coordinate menu entries
+are
+now an
+option, to be enabled via the Preferences:Misc menu option. Changes
+will
+take affect at startup.</tt></li>
+ <li> <tt>05.23.2002 add support for 3D binning of fits bin tables.</tt></li>
+ <li> <tt>05.24.2002 made changes to grid.C to handle the special
+LONG/NPOL skyframe
+coordinate system used by Chandra.</tt></li>
+ <li> <tt>05.24.2002 add -xpa and xpa prefs to allow a user to
+enable
+or disable
+initialization of XPA at startup</tt></li>
+ <li> <tt>05.28.2002 add -xpa [inet|local|unix|localhost] xpa point.</tt></li>
+ <li> <tt>05.29.2002 correct 3D binning to properly reflect filter
+params in
+the filename.</tt></li>
+ <li> <tt>06.03.2002 fixed a problem with Fits Bin Tables, odd
+length
+rows and
+referencing shorts.</tt></li>
+ <li> <tt>06.04.2002 add support for multiple wcs with skyframe
+panner
+compass,
+along with prefs.</tt></li>
+ <li> <tt>06.04.2002 add -xpa noxpans support.</tt></li>
+ <li> <tt>06.04.2002 match frames wcs now uses the wcs system and
+wcs
+skyframe
+specified in align to wcs.</tt></li>
+ <li> <tt>06.05.2002 upgrade to xpa 2.1.1</tt></li>
+ <li> <tt>06.06.2002 add wcs master menu and buttons</tt></li>
+ <li> <tt>06.06.2002 sync xpa wcs and command line wcs command.</tt></li>
+ <li> <tt>06.10.2002 xpa wcs and commanline -wcs now uses same code
+to
+process</tt></li>
+ <li> <tt>06.10.2002 xpa nameserver format now skyformat</tt></li>
+ <li> <tt>06.10.2002 added support for variable args for xpa
+contour
+and -contour.</tt></li>
+ <li> <tt>06.11.2002 add match frames physical, amplifier,
+detector.
+this does
+not handle rotation, nor orientation.</tt></li>
+ <li> <tt>06.11.2002 the master wcs menu now modifies the
+Region:File
+Coordinate
+System menu also</tt></li>
+ <li> <tt>06.11.2002 fixed a problem with list projection and
+linear
+wcs. the
+thickness parameter was not written correctly.</tt></li>
+ <li> <tt>06.12.2002 fixed a problem with -tile and -region
+commandline
+options.
+The ds9 window must be realized before processing region files.</tt></li>
+ <li> <tt>06.13.2002 fixed a problem with -pagesetup commandline
+option.</tt></li>
+ <li> <tt>06.13.2002 fixed a problem with ds9parser.Y,
+prosparser.Y,
+and tngparser.Y
+when processing coordinates when no coordinate system has been
+specified.</tt></li>
+ <li> <tt>06.13.2002 fixed a problem with -pan to command line
+option.
+The ds9
+window needs to be realized (and the matrices defined) before
+processing.</tt></li>
+ <li> <tt>06.13.2002 binning on a third column now invokes the data
+cube dialog
+box.</tt></li>
+ <li> <tt>06.14.2002 add smaller buffer sizes to binning menus. We
+want
+to do
+this for those building large 3D binning movies.</tt></li>
+ <li> <tt>06.19.2002 implemented new grid support. Grids now handle
+rotated images
+much better. Numerics are better positioned.</tt></li>
+ <li> <tt>06.27.2002 updated to WCSSUBS 3.1.1. This corrects a
+number
+of TNX
+problems.</tt></li>
+ <li> <tt>06.27.2002 add File:XPA info menu item.</tt></li>
+ <li> <tt>06.27.2002 add XPA regions selected feature.</tt></li>
+ <li> <tt>06.28.2002 Analysis $geturl macro calls are now logged.</tt></li>
+ <li> <tt>07.01.2002 add support for limited web browser</tt></li>
+ <li> <tt>07.01.2002 help reference manual now uses built-in
+brower,
+and is static.</tt></li>
+ <li> <tt>07.02.2002 fixed a problem with cross-platform displays
+and
+16 bit
+truecolor.</tt></li>
+ <li> <tt>07.08.2002 fixed a problem with regions and changes in
+the
+bin factor
+of fits bin tables.</tt></li>
+ <li> <tt>07.08.2002 add $xpa_method analysis macro.</tt></li>
+ <li> <tt>07.08.2002 add @@xpa_method@@ support in hv.html</tt></li>
+ <li> <tt>07.22.2002 fix numerous problems with internal web
+browser.</tt></li>
+ <li> <tt>07.23.2002 add async support for internal web browser.</tt></li>
+ <li> <tt>07.24.2002 changed Makefiles so that parser.C,
+parser.C.h,
+and lex.C
+are now archived. Therefor, builds no longer need bison and flex,
+unless
+changes have been made to the parser.Y. This gets around problems with
+different versions of bison.</tt></li>
+ <li> <tt>07.25.2002 add support for the Compass region.</tt></li>
+ <li> <tt>07.25.2002 add vo proxy and internal hv support.</tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r2.3.html b/ds9/doc/release/r2.3.html
new file mode 100644
index 0000000..f1a38da
--- /dev/null
+++ b/ds9/doc/release/r2.3.html
@@ -0,0 +1,78 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 2.3 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<div align="right">
+<div align="left"> </div>
+<h3 align="left"> <font size="-1"></font><img alt="" src="../sun.gif"
+ align="middle" height="98" width="100"> Version 2.3 Release Notes</h3>
+</div>
+<ol>
+ <ol>
+ </ol>
+ <h4> <b>Version 2.3b1</b></h4>
+ <ol>
+ <li> <tt>11.04.2002 add multi-language support structure.</tt></li>
+ <li> <tt>12.02.2002 configure http user agent to 'ds9'. This fixes
+a problem with www.google.com</tt></li>
+ <li> <tt>12.02.2002 add Help DS9 Home Page menu Item.</tt></li>
+ <li> <tt>12.03.2002 Web Display: implemented 'Content-Encoding'
+and modified 'Mime-Type' to use new proposed FITS Mime-Type RFC.</tt></li>
+ <li> <tt>12.03.2002 Web Display: when the mime-type is set
+to 'application/octet-stream', try to parse the url, looking for a
+valid fits or fits.gz image. If so, load as a fits. If not, save to
+disk.</tt></li>
+ <li> <tt>12.03.2002 Web Display: reduced the size of fonts
+by -2 to more closely match netscape and internet explorer.</tt></li>
+ <li> <tt>12.03.2002 Web Display: updated Archive menus to use new
+IRAS web interface.</tt></li>
+ <li> <tt>12.03.2002 Web Display: add font size argument to
+HV. Now, web sites can have different default font sizes, based on what
+looks the best.</tt></li>
+ <li> <tt>12.10.2002 Fixed a problem with calculating LTMV keywords
+from alt WCS keywords in the case of WCSNAME='PHYSICAL'</tt></li>
+ <li> <tt>12.10.2002 Add support for TDMIN and TDMAX FITS bin table
+keywords.</tt></li>
+ <li> <tt>12.10.2002 Add 'Delete All Frames' support.</tt></li>
+ <li> <tt>12.10.2002 only use fits keyword inheritence if INHERIT
+keyword is present in the header.</tt></li>
+ <li> <tt>12.11.2002 Fixed a problem with WCS headers and INHERIT,
+which resulted in duplicate keywords. This made wcssubs very confused.</tt></li>
+ <li> <tt>12.11.2002 Add 'Delete Selected Regions' to Regions menu.</tt></li>
+ <li> <tt>12.11.2002 Add confirmation dialog to 'Delete All
+Regions'.</tt></li>
+ <li> <tt>12.12.2002 Display Header List dialog is now 40 chars
+wide.</tt></li>
+ <li> <tt>12.12.2002 Web Display: add initial coordinates to ADS
+archive sites</tt></li>
+ <li> <tt>12.16.2002 Add *.fit and *.fts to fits dialog box
+templates.</tt></li>
+ <li> <tt>12.16.2002 Add support for GUI Groups, based on region
+tags.</tt></li>
+ <li> <tt>12.17.2002 Add HSV colormap.</tt></li>
+ <li> <tt>12.18.2002 Fixed a problem with the PANDA Region at zooms
+other than 1.</tt></li>
+ <li> <tt>12.19.2002 DS9 version 2.3b1 released to the public.</tt></li>
+ </ol>
+</ol>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>
diff --git a/ds9/doc/release/r3.0.html b/ds9/doc/release/r3.0.html
new file mode 100644
index 0000000..5f8c098
--- /dev/null
+++ b/ds9/doc/release/r3.0.html
@@ -0,0 +1,726 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 3.0 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3> <img alt="" src="../sun.gif" align="middle" height="98"
+ width="100">
+SAOImage DS9 Version 3.0 Release Notes</h3>
+<ol>
+ <h4> <b>Version 3.0</b></h4>
+ <ol>
+ <li> <tt>12.24.2002 TCL/TK: update to 8.4.1</tt></li>
+ <li> <tt>12.24.2002 BLT: update to 2.4z</tt></li>
+ <li> <tt>12.24.2002 TKIMG: update to 1.3rc</tt></li>
+ <li> <tt>01.03.2003 XPA: fixed a problem with 'xpaget ds9 regions
+selected'</tt></li>
+ <li><tt>01.28.2003 SAVEAS: now saves all slices of a data cube, if
+the display mode is single.</tt></li>
+ <li><tt>01.28.2003 GUI: Add 'wm protocol . WM_DELETE_WINDOW
+QuitDS9' for main window so that tcl/tk 8.4 does not segv when a user
+double clicks on a close window icon.</tt></li>
+ <li><tt>01.29.2003 GCC: add support for gcc 3.0/3.2</tt></li>
+ <li><tt>01.29.2002 GCC: updated saotk/FlexLexer.h from flex 2.5.27,
+available at http://lex.sourceforge.net/<br>
+ </tt></li>
+ <li><tt>02.04.2003 WINDOWS: modify configuration files for tkimg1.3
+and tkhtml to support windows.<br>
+ </tt></li>
+ <li><tt>02.05.2003 WCS: upgrade to 3.3.0</tt></li>
+ <li><tt>02.06.2003 ARCHIVE: the default ADS max search size is now
+a radius of .1
+arcmin.</tt></li>
+ <li><tt>02.06.2003 XPA: add '-xpa tcl' command line option. By
+default, disable xpa tcl access since it is a major security risk.</tt></li>
+ <li><tt>02.07.03 FITS: fixed a problem with loading fits files via
+the url menu or command line.<br>
+ </tt></li>
+ <li><tt>02.07.03 HTTP: loading images via url http processes the
+image based on the http header mime type and encoding, not the file
+name. images loaded via url ftp are still processed based on file name.</tt></li>
+ <li><tt>02.07.03 PLOT: fixed a problem with global vars and the
+plot widget.</tt></li>
+ <li><tt>02.11.03 BINNING: fixed a bug with the bin table smoothing
+support. If the bin factor is large enough to bin the entire image in
+the bin buffer, ds9 would segv by trying to read out of bounds.</tt></li>
+ <li><tt>02.25.03 XPA: fixed a bug with loading an image from xpa
+stdin without a filename.</tt></li>
+ <li><tt>02.25.03 XPA: add 'fillbuf=false' to all xpa receive
+commands that do not use $buf. This will speed up processing because
+the data socket is not opened.</tt></li>
+ <li><tt>02.25.03 XPA: fixed a problem with appending an wcs via
+xpa. The appended wcs is now positioned at the end, not the beginning.
+also, a problem occurred when the 'END' card was not the last card of
+the header. This has been fixed.</tt></li>
+ <li><tt>02.25.03 XPA: changes to xpa regions syntax.
+'moveback'/'movefront' are now 'move back'/'move front',
+'selectall'/'selectnone' are now 'select all'/'select none', and
+'deleteall' is 'delete all'. Backward compatibility has
+bee maintained</tt></li>
+ <li><tt>02.25.03 XPA: add 'select group &lt;groupname&gt;' and
+'delete select' to xpa regions access point.</tt></li>
+ <li><tt>02.26.03 HV: add support for gif,png,ppm,xbm,xpm file
+formats</tt></li>
+ <li><tt>02.27.03 </tt><tt>HV: </tt><tt>fixed some problems with
+tkhtml uri resolver. This cleans up a lot of tcl code.</tt></li>
+ <li><tt>03.04.03 HV: images are now scaled if the width/height args
+are provided in the html src.</tt></li>
+ <li><tt>03.04.03 ARCHIVE: add chandra archive web chaser.</tt></li>
+ <li><tt>03.12.03 COLORMAP: Fixed a problem with InitColorbar and a
+colormap of A or B.</tt></li>
+ <li><tt>03.12.03 ANALYSIS: all comments after # are ignored.</tt></li>
+ <li><tt>03.12.03 ANALYSIS: non macros can be escaped by using $$.</tt></li>
+ <li><tt>03.31.03 COMMAND: Add -frame command line option.</tt></li>
+ <li><tt>04.08.03 GUI: Remove Magnifier Mode option, along with
+Magnifier Replicate code.</tt></li>
+ <li><tt>04.23.03 HST WFPC: Mosaic images must be loaded directly.
+this fixes a problem in that it was not possible to autodect a WFPC2
+image in an incoming data stream, such as stdin.</tt></li>
+ <li><tt>05.12.03 API: *** CHANGE *** Frame load syntax has changed
+to make it consistent across all modes and file formats. In particular,
+the general syntax is: &lt;frame&gt; load fits|array &lt;filename&gt;
+mmap|alloc|alloc gz|channel|shared|socket|var &lt;options&gt;</tt></li>
+ <li><tt>05.12.03 API: *** CHANGE *** shared memory loads no longer
+require the size of the memory segment.</tt></li>
+ <li><tt>05.20.03 WCS: update to 3.3.4</tt></li>
+ <li><tt>05.20.03 AST: update to 2.0</tt></li>
+ <li><tt>05.22.03 GRID: fix a problem with grid.C interface to AST.
+The text bounding box code was returning the coordinates in a clockwise
+manner. It needs to be returned in an anti-clockwise manner.</tt></li>
+ <li><tt>05.22.03 GRID: Add support for user specified Grid Axes
+Numerics gap.</tt></li>
+ <li><tt>05.27.03 GRID: Fixed a problem with the bounding box of a
+publication grid. it was .5 pixels off.</tt></li>
+ <li><tt>05.28.03 GUI: Fixed a problem with 'get cursor'. Sometimes,
+as with loading dss images, the
+matrices were not updated in time, and 'get cursor' returned bogus
+values. Now all calls to 'get cursor' force an update.</tt></li>
+ <li><tt>06.02.03 GUI: fixed several problems with examine mode</tt></li>
+ <li><tt>06.02.03 ARCHIVE: add NOAO 4MASS and SIRTF and NOAO NSA to
+archive menu</tt></li>
+ <li><tt>06.09.03 RGB: support is FINISHED! now, lets see how its
+works!</tt></li>
+ <li><tt>06.11.03 RGB: Add Lock Channels to lock most Scale and Bin
+parameters between channels.</tt></li>
+ <li><tt>06.16.03 GRID: Add numerics spacing to save/load grid
+configuration</tt></li>
+ <li><tt>06.16.03 FITS: Add 3D array data cube</tt></li>
+ <li><tt>06.17.03 FITS: Fixed a problem with an incorrect data cube
+dialog and wfpc2 mosaics and rgb data cubes. Basically, these two cases
+are not really data cubes.</tt></li>
+ <li><tt>06.17.03 RGB: Replace RGB menu with RGB dialog.</tt></li>
+ <li><tt>06.17.03 XPA: Fixed a problem with xpaget ds9 regions
+[include|exclude|source|background].</tt></li>
+ <li><tt>06.18.03 REGION: fix a problem with non-linear physical
+coordinates and save/load regions.</tt></li>
+ <li><tt>06.18.03 WCS: fix a problem with determining the rotation
+of a wcs coordinate system. previously, CRPIX was used as the start
+point. This does not work in cases where the tangent point is very far
+off the image. Instead, (1,1) is used.</tt></li>
+ <li><tt>06.18.03 WCS: Remove preference Panner WCS origin. This is
+stupid and breaks with the previous change. Just remove it instead of
+trying to fix it.</tt></li>
+ <li><tt>06.26.03 FITS: Add support 3D array data cubes.</tt></li>
+ <li><tt>06.30.03 RGB: Add support for RGB array data cube.</tt></li>
+ <li><tt>07.01.03 DSS: Fixed namesrv.tcl and dss.tcl to promote more
+robust error handling. In particular, http error codes are now checked,
+and the results are verified before proceeding</tt></li>
+ <li><tt>07.01.03 XPA: fixed a problem with $ds9 -xpa tcl. The next
+argument was being ignored.</tt></li>
+ <li><tt>07.02.03 DSS: fixed another problem with namesrv.tcl.
+SAONED and SAOSIMBAD were returning incorrect values for southern
+hemisphere.</tt></li>
+ <li><tt>07.02.03 HTTP: remove http log from preferences and added
+http log and ftp log to debug menu</tt></li>
+ <li><tt>07.03.03 GUI: fixed a problem with open file dialog box. if
+the user clicked 'cancel', an error message would result. this has been
+corrected.</tt></li>
+ <li><tt>07.09.03 FITS: add Large File Support for Linux. Linux is
+still restricted to ~2.5Gb.</tt></li>
+ <li><tt>07.10.03 FITS: add FLUSH parameter for fitsy++ array.</tt></li>
+ <li><tt>07.10.03 FITS: Major change in behavior of fitsy++ streams
+and FLUSH. Only socket and socketgz will flush, all others will not
+flush the buffer after
+an error, or after successfull loading a fits image.</tt></li>
+ <li><tt>07.11.03 XPA: add DATACUBE support.</tt></li>
+ <li><tt>07.14.03 WCS: Fixed a problem with WCS XLON-TAN (NPOLE) and
+AST. NPOLE is a special wcs equ coord system, and has to be handed by
+wcs2ast().</tt></li>
+ <li><tt>07.15.03 XPA: add xpa iis access port for control of some
+iis functionality.</tt></li>
+ <li>
+ <p><b><tt>07.17.03 RELEASE version 3.0b4</tt></b></p>
+ </li>
+ <li><tt>07.25.03 FITS: add MMAPINCR memory access mode. This only
+mmaps the data needed, not the entire file. This allows a user to view
+many small segements of a very large file.</tt></li>
+ <li><tt>07.28.03 TCL/TK: upgrade to 8.4.4</tt></li>
+ <li><tt>07.30.03 XPA: add regions fg/bg support.</tt></li>
+ <li><tt>08.05.03 PLOT: reimplement analaysis plot widget to support
+unlimited number of data sets.</tt></li>
+ <li><tt>08.07.03 ARCHIVE: add Rosat All-Sky survey</tt></li>
+ <li><tt>08.08.03 XPA: add PLOT, which allows full control over all
+plot widgets via xpa.</tt></li>
+ <li><tt>08.13.03 COLORMAP: fixed a problem with loading lut
+colormaps under linux. ifstream behaves differently between solaris and
+linux.</tt></li>
+ <li><tt>08.14.03 XPA: changed xpaget array. Now returns the array
+data in the current frame.</tt></li>
+ <li>
+ <p><tt><b>08.15.03 RELEASE version 3.0b5</b></tt></p>
+ </li>
+ <li><tt>08.18.03 FITS: add Large file support for darwin and
+linuxppc</tt></li>
+ <li><tt>08.18.03 LINUXPPC: fixed a problem with linking linuxppc.
+The copy of libX11.a that comes with Yellow Dog 3.0 is bad.
+So we can't links static.</tt></li>
+ <li><tt>08.19.03 XPA: add options to xpa update so that 'update
+idletasks' is not run at the end of file loads. This allows the
+user to do several incremental loads without updating the screen.</tt></li>
+ <li><tt>08.19.03 API: only update idletasks for horz/vert graph if
+graphs are on</tt></li>
+ <li><tt>08.19.03 API: add debug idletasks support.</tt></li>
+ <li><tt>08.29.03 GCC: gcc 3.3 is now supported. For all code, if
+GNUC &gt;=3, new &lt;sstream&gt; are used. For all code, GNUC &lt;3,
+&lt;strstream&gt; is used.</tt></li>
+ <li><tt>08.29.03 PLOT: fixed a problem with saving plot data in
+x,y,ye format</tt></li>
+ <li><tt>08.29.03 FITS: add LFS for solaris.</tt></li>
+ <li><tt>08.29.03 COMMAND: add -analysismenu command line option at
+the request of CXC.</tt></li>
+ <li><tt>08.29.03 COMMAND: fixed a problem with -pan and -pan to and
+other comman line options that follow.</tt></li>
+ <li><tt>09.02.03 FITS: add LFS for alpha.</tt></li>
+ <li><tt>09.04.03 SOLARIS: add new solaris64 port. Requires gcc 3.3
+or greater.</tt></li>
+ <li><tt>09.04.03 XPA: upgrade to 2.1.4</tt></li>
+ <li><tt>09.04.03 FILTER: upgrade to 1.2.3b1</tt></li>
+ <li><tt>09.04.03 FITSY:
+upgrade to 1.2.3b1<br>
+ </tt></li>
+ <li><tt>09.06.03 SOLARIS: fixed a problem with 64bit machines and
+truecolor displays.</tt></li>
+ <li><tt>09.06.03 FITS: add support for multiple extension fits data
+cubes.</tt></li>
+ <li><tt>09.08.03 REGION: fixed a problem with projection regions
+and an undefined variable.</tt></li>
+ <li><tt>09.08.03 BINNING: fixed a problem with fits bin tables
+without TLMIN/TLMAX or TDMIN/TDMAX. the center was incorrectly being
+calculated.</tt></li>
+ <li><tt>09.08.03 ARCHIVE: fixed a problem with the NOAO archive web
+display with no images loaded. The variables 'ra' and 'dec' were not
+defined.</tt></li>
+ <li><tt>09.08.03 PLOT: ixed a problem with the plot widget and the
+preferences unique plot parameter.</tt></li>
+ <li><tt>09.09.03 PLOT: project plot xaxis are now in coordinate
+system specified via the marker dialog box.</tt></li>
+ <li><tt>09.11.03 PLOT: fixed a problem with the line, ruler, and
+projection regions and properly displaying wcs linear coordinates</tt></li>
+ <li><tt>09.11.03 WCS: cleaned up a lot of code for
+setting/adjusting coordinate menus</tt></li>
+ <li><tt>09.11.03 RGB: loading a new channel in a rgb image will no
+longer delete regions, grids, or aux contours.</tt></li>
+ <li><tt>09.15.03 FITS: removed BITPIX32 define. using &lt;int&gt;
+instead since it is defined as a consistent 4 bytes across all
+platforms.</tt></li>
+ <li><tt>09.18.03 RGB: split lock rgb into lock scale and lock bin.</tt></li>
+ <li><tt>09.21.03 BINNING: frames now have 'memory' of certain bin
+paramenters. It is now possiable to set bin parameters before loading a
+bin table.</tt></li>
+ <li><tt>09.22.03 RGB: InfoBox now displays all values for RGB
+images, not just the current channel value.</tt></li>
+ <li><tt>09.22.03 API: change names of various tcl marker variables</tt></li>
+ <li><tt>09.22.03 REGION: add prefs for regions color, width,
+properties, font</tt></li>
+ <li><tt>09.22.03 GUI: add HJKL key bindings as substitute for arrow
+keys</tt></li>
+ <li>
+ <p><tt><b>09.24.03 RELEASE version 3.0b6</b></tt></p>
+ </li>
+ <li><tt>09.29.03
+WCS: changes to getWCSRotation, getWCSOrientation to better reflect the
+actual rotation</tt></li>
+ <li><tt>09.30.03
+XPA: add xpa/command line options for configuration of info panel</tt></li>
+ <li><tt>09.30.03
+API: change variable 'mosaic(fast)' to 'ds9(mosaic,fast)'</tt></li>
+ <li><tt>09.30.03
+FITS: add new support for blank/Inf/NaN background color</tt></li>
+ <li><tt>10.01.03
+FITS: add support for image background color.</tt></li>
+ <li><tt>10.01.03
+RGB: add support for RGB lock colorbar</tt></li>
+ <li><tt>10.23.03 HV: add support for VO DIS</tt></li>
+ <li><tt>10.23.03 HV: fixed a problem with forms and encrypting
+field names, allow with the returned value</tt></li>
+ <li><tt>10.23.03 GUI: Change mode 'Default' to 'None'. We can't use
+the term 'default' because with problems with tcl switchs and
+the default keyword</tt></li>
+ <li><tt>10.24.03 WCS: add support for WCS AIPS projections via the
+preferences menu.</tt></li>
+ <li><tt>10.24.03 API: add acknowledgment</tt></li>
+ <li><tt>11.03.03 COMMAND: fixed a problem with command line options
+-mosaicimage, -mosaicimagewfpc2, -medatacube</tt></li>
+ <li><tt>11.03.03 FITS: fixed a problem with multiple extension data
+cube with all memory models except MMAPINCR.</tt></li>
+ <li><tt>11.03.03 COMMAND: fixed a problem with command line options
+-mosaicimagewcs, -mosaicimageiraf, -mosaicimagewfpc2, -medatacube and
+RGB frames</tt></li>
+ <li><tt>11.05.03 WCS: remove internal wcsZoom matrix. All wcsZoom
+actions are now applied to the current &nbsp;zoom matrix. This fixes a
+number of problems with 'Match Frames to WCS'</tt></li>
+ <li><tt>11.05.03 WCS: fixed a problem with rotated images and
+examine mode.</tt></li>
+ <li><tt>11.07.03 </tt><tt>REGION: f</tt><tt>fixed a problem with
+regular panda regions. The code incorrectly determined a regulier panda
+was
+irregulier and output it as such.</tt></li>
+ <li><tt>11.07.03 REGION: fixed a problem with region angles in
+general, where there there was a rotation in the wcs.</tt></li>
+ <li><tt>11.07.03 HV: add Server Apache Refresh support.</tt></li>
+ <li><tt>11.07.03 XPA: add xpaget ds9 fits size &lt;coordsys&gt;
+&lt;skyformat&gt;</tt></li>
+ <li><tt>11.11.03 XPA: add regions group support.</tt></li>
+ <li><tt>12.01.03 WCS:
+update to 3.5.0</tt></li>
+ <li><tt>12.01.03 XPA:
+add get contour &lt;coordinate system&gt; &lt;skyframe&gt; support.</tt></li>
+ <li><tt>12.05.03 WCS: update to 3.5.1</tt></li>
+ <li><tt>12.05.03 XPA: upgrade to 2.1.5</tt></li>
+ <li><tt>12.05.03 FILTER: upgrade to 1.2.3</tt></li>
+ <li><tt>12.05.03 FITSY:
+upgrade to 1.2.3</tt></li>
+ <li><tt>12.05.03 AST: upgrade to 3.0</tt></li>
+ <li><tt>12.05.03 IIS: upgrade to 1.0</tt></li>
+ <li><tt>12.10.03 REGION:
+casted all XPoint to short. There is a problem with rendering line
+segments at very high zoom. X11 overflows and the lines become random.
+We should check that screen coordinates never exceed
+SHRT_MAX</tt></li>
+ <li><tt>12.10.03 ANALYSIS: geturl() macro is formated before
+execution.</tt></li>
+ <li><tt>12.11.03 FITs: add mosaic image next wcs support.</tt></li>
+ <li><tt>12.15.03 RGB: fixed a problem with wcs matching when one of
+the wcs is flipped in XX</tt></li>
+ <li><tt>12.15.03 WCS: </tt><tt>fixed a problem with wcs matching
+when one of the wcs is flipped in XX</tt></li>
+ <li><tt>12.15.03 REGION: load fits regions now utilitize the
+current region color, width, and font</tt></li>
+ <li><tt>12.24.03 WCS: back
+out change #50. We have to use the projection tan point
+to correctly build mosaics and RGB images.</tt></li>
+ <li><tt>01.09.04 AST: upgrade to 3.1.1</tt></li>
+ <li><tt>01.09.04 GRID: pass PV,PROJP,PS keywords to AST<br>
+ </tt></li>
+ <li><tt>01.12.04 TCLLIB: add
+tcllib 1.4. This package contains a number of useful tcl
+packages<br>
+ </tt></li>
+ <li><tt>01.12.04 FTP: upgrade to 2.4</tt></li>
+ <li><tt>01.13.04 TCL: upgrade to 8.4.5</tt></li>
+ <li><tt>01.13.04 TK: upgrade
+to 8.4.5</tt></li>
+ <li><tt>01.13.04 HTTP: add support for proxy authentication.</tt></li>
+ <li><tt>01.14.04 COMMAND: fixed a problem with printing from the
+command line. The canvas widget was not fully realized before printing,
+resulting in
+no image.</tt></li>
+ <li><tt>01.15.04 MKTCLAPP: made two changes to the default init
+script of mktclapp. The first sees that the the virtual file system is
+init'd before the first call to Tcl. This allows Tcl to 'see' encoding
+files. The second, for windows only, makes sure that the Tcl windows
+file system is init'd before the first call to Tcl.</tt></li>
+ <li><tt>01.15.04 MKTCLAPP: add
+default encoding files to ds9.mta, now that we can use
+them.</tt></li>
+ <li><tt>01.22.04 GUI: Add preference for default temporary file
+directory.</tt></li>
+ <li><tt>01.23.04 XPA: add xpa imexam.</tt></li>
+ <li><tt>01.25.04 XPA: add xpa fits header.</tt></li>
+ <li><tt>01.25.04 XPA: add xpa fits depth.</tt></li>
+ <li><tt>01.25.04 XPA: modified xpa fits size.</tt></li>
+ <li><tt>01.25.04 GUI: add language
+support for info and error messages.</tt></li>
+ <li><tt>02.01.04 WCS: more on #50 and #141. If wcs projection is
+Zenithal, use CRPIX as reference point to determine wcs rotation and
+oriention. Otherwise, use image center point.</tt></li>
+ <li><tt>02.04.04 CONTOUR: modified smooth algorithm. We now SMOOTH
+the entire image with a gaussian kernal. Previously, we would block by
+2 before smoothing with a boxcar kernal. Finally, the default method is
+BLOCK.</tt></li>
+ <li><tt>02.04.04 CONTOUR:&nbsp;</tt><tt>A .5 error has been removed
+from the BLOCK algorithm.</tt></li>
+ <li><tt>02.04.04 CONTOUR: </tt><tt>the number of contour levels
+has been inconsistant in the pass.
+this has been fixed. </tt><tt>If the number of levels is 1,
+the high cut value is used.</tt></li>
+ <li><tt>02.04.04 CONTOUR: fixed log scale bug. it was incorrectly
+calculating the levels.</tt></li>
+ <li><tt>02.05.04 SAVEAS: jpeg,tiff,png,ppm support is now internal
+and available to all ports. gs is no longer needed.</tt></li>
+ <li><tt>02.10.04 REGION: add show/hide
+support for fg and bg regions.</tt></li>
+ <li><tt>02.10.04 COLORMAP: fixed a problem with the -cmap value x y
+command. On truecolor visuals, we need to be realized before we start
+to manipulate the colormap.</tt></li>
+ <li><tt>02.10.04 FITS: cleaned up smooth convolve code. same speed,
+easier to understand.</tt></li>
+ <li><tt>02.11.04 GUI: Add Colorbar Parameter dialog.</tt></li>
+ <li><tt>02.11.04 COLORBAR: add support for load/save contrast/bias.</tt></li>
+ <li><tt>02.12.04 EXPORT: split EXPORT from
+SAVEAS. Currently only FITS is supported.</tt></li>
+ <li><tt>02.17.04 CONTOUR: when update data cube slice,
+automatically regenerate contours.</tt></li>
+ <li><tt>02.18.04 REGION: the marker menu is now enabled if no frame
+or an empty frame is available.</tt></li>
+ <li><tt>02.20.04 SCALE: add Auto MinMax. by default, use SCAN for
+single and SAMPLE for Mosaic and DataCube files</tt></li>
+ <li><tt>02.20.04 SCALE: fixed a problem with scobe being reset to
+LOCAL.</tt></li>
+ <li><tt>02.23.04 CONTOUR: fixed a problem with
+incorrect contours for mosaics and rgb images at startup.</tt></li>
+ <li><tt>02.23.04 XPA: add cd (current directory) command</tt></li>
+ <li><tt>02.24.04 AST: upgrade 3.2.4</tt></li>
+ <li><tt>02.24.04 DOC: added support for generating postscript and
+pdf versions of the reference manual.</tt></li>
+ <li><tt>02.25.04 CONTOUR: convert contours to polygons will now
+also convert any aux contours.</tt></li>
+ <li><tt>02.27.04 PANDA: fixed probems with GUI add angle.</tt></li>
+ <li><tt>02.27.04 CIRCLE: new GUI edit algorithm.</tt></li>
+ <li><tt>02.27.04 ANNULUS: new GUI edit and add annulus algorithms.</tt></li>
+ <li><tt>02.27.04 ELLIPSE: new GU edit algorithm.</tt></li>
+ <li><tt>02.27.04 ELLIPSE ANNULUS: new GUI edit and add annulus
+algorithm. This fixed a problem with 0 radius annuli. Also fixed a
+problem with GUI rotate after close dialog box.</tt></li>
+ <li><tt>3.1.04 BOXANNULUS: new GUI edit and add size algorithms.
+This fixed a problem with 0 size annuli.</tt></li>
+ <li><tt>03.01.04 PANDA: new GUI edit and add annulus algorithms.</tt></li>
+ <li><tt>03.01.04 PANDA: fixed a problem with a full PANDA from 0 to
+360 degrees. Previously, it was displayed as 0 to
+0 degrees.</tt></li>
+ <li><tt>03.02.04 PANDA: fixed a problem with postscript and radial
+lines. The zoom was incorrectly being calculated..</tt></li>
+ <li><tt>03.02.04 PANDA: fixed a problem with render in magnifier.
+The wrong zoom factor was being used.</tt></li>
+ <li><tt>03.09.04 GUI: add Tab/Shift-Tab bindings to
+panner.</tt></li>
+ <li><tt>03.10.04 GRID: fixed a problem with single publication
+bounding box. It now takes into account DATASEC.</tt></li>
+ <li><tt>03.10.04 AST: upgrade to 3.2.6</tt></li>
+ <li><tt>03.12.04 GRAPH: graphs are now active for single,tile,and
+blink modes.</tt></li>
+ <li><tt>03.16.04 WCS LINEAR: fixed many problems with alignment of
+WCS LINEAR MOSAICS</tt></li>
+ <li><tt>03.16.04 RGB: fixed many problems with alignment of RGB WCS
+images</tt></li>
+ <li><tt>03.18.04 FITS: fixed a problem with random numbers beening
+displayed for BLANK/NaN</tt></li>
+ <li>
+ <p><tt><b>03.18.04 </b><b>RELEASE version 3.0b7</b></tt></p>
+ </li>
+ <li><tt>03.22.04 PIXELTABLE: fixed a problem with 'unset
+pixelValues'.</tt></li>
+ <li><tt>03.22.04 SAVEAS: fixed a problem with 'processSaveAs'.</tt></li>
+ <li><tt>03.22.04 RGB: fixed a problem with turning off all loaded
+channels within a frame.</tt></li>
+ <li><tt>03.31.04 IIS: fixed a problem with a old variable in
+DisplayCoordDialog.</tt></li>
+ <li><tt>03.31.04 BINNING: fixed a problem with dimensions of
+DBL_MIN,DBL_MAX.</tt></li>
+ <li><tt>03.31.04 IIS: turn off blinking cursor while changing
+colormap so we do not see a color flash due to the updating of the
+frame when the cursor form is changed.</tt></li>
+ <li><tt>04.01.04 WEB DISPLAY: add options on how to load downloaded
+fits.</tt></li>
+ <li><tt>04.01.04 WEB DISPLAY: fixed a problem when the image
+width/height contains garbage.</tt></li>
+ <li><tt>04.02.04 TCL/TK: update to 8.4.6</tt></li>
+ <li><tt>04.05.04 PAN: fixed yet another problem with -pan.
+Hopefully this time, I've got it right.</tt></li>
+ <li><tt>04.06.04 GRID: fixed a problem with psLine and gcc
+2.96.</tt></li>
+ <li><tt>04.06.04 MAKEFILE: fixed a typo with ./configure.</tt></li>
+ <li>
+ <p><tt><b>04.06.04 </b><b>RELEASE version 3.0b8</b></tt></p>
+ </li>
+ <li><tt>04.12.04 SAVEAS: add SaveAs MPEG-1 support using tkmpeg and
+exmpeg.</tt></li>
+ <li><tt>04.14.04 BINNING: 60% improvement in speed for little
+endian arch.</tt></li>
+ <li><tt>04.23.04 ZLIB: upgrade to version 1.2.1<br>
+ </tt></li>
+ <li><tt>04.26.04 ALPHA: minor changes to make.alpha and
+ds9/Makefile for alpha support.</tt></li>
+ <li><tt>04.26.04 FITS: fixed problems with trying to open regions
+extensions in cases where the mode was not mmap.<br>
+ </tt></li>
+ <li><tt>04.27.04 EXTERNAL FITS: fixed major problems with pattern
+matching.</tt></li>
+ <li><tt>04.27.04 FITSY++: skip over unknow binary column types. We
+used to force an exit.</tt></li>
+ <li><tt>04.28.04 FITSY++: fixed a problem with SocketGZ where if
+too little data had arrived, ds9 would incorrectly see this as an error.</tt></li>
+ <li><tt>04.29.04 GUI: fixed a race condition in which ds9 'thinks'
+the windows have been realized, and XPA has been init'd and the user
+starts to delete windows that don't exists. Now XPA is not realized
+until the
+canvas window has been realized.</tt></li>
+ <li><tt>04.29.04 LINUX: return to a full static link. Seems like
+the best option to support current and future versions of linux.</tt></li>
+ <li><tt>04.29.04 PRINT: add print prefs.</tt></li>
+ <li>
+ <p><tt><b>05.03.04 </b><b>RELEASE version 3.0b9</b></tt></p>
+ </li>
+ <li><tt>05.04.04 BINNING: fixed a problem with column size double
+and
+buffer overflow on little endian machines.<br>
+ </tt></li>
+ <li><tt>05.04.04 PANDA: fixed a problem with postscript and gcc
+2.95
+compilers. This problem had already been fixed for gcc 3.x compilers.</tt></li>
+ <li><tt>05.06.04 BINNING: add support for variable binning in x and
+y.</tt></li>
+ <li><tt>05.07.04 IIS: fixed a problem with buffer overflow and
+determining imtool.rc file location.</tt></li>
+ <li><tt>05.07.04 FRAMEBASE: fixed some minor memory leaks.</tt></li>
+ <li><tt>05.10.04 BINNING: for FITS REGIONS files, when loading
+against a binned image, compare X and Y bin columns to regions X and Y
+bin columns for a match. Do not load unless they match.</tt></li>
+ <li><tt>05.10.04 GUI: add 'option' command to control GUI
+appearance. Removed many -bd 2 options to clean up the interface.</tt></li>
+ <li><tt>05.12.04 BINNING: fixed a major problem with 3D binning.
+Once it was turned on and then turned off, important internal
+parameters where not being update, resulting in segvs.</tt></li>
+ <li><tt>05.15.04 RGB: fixed memory leak in loading RGB images.</tt></li>
+ <li><tt>05.17.04 LINUX: ok, back to two versions: one dynamic, one
+static. The static version is buggy under Fedora, but is required for
+old versions of RH. So the default version will be dynamic linked, with
+an static version available for older machines.</tt></li>
+ <li><tt>05.21.04 XPA: fixed a problem with WCS REPLACE FILE and WCS
+APPEND FILE.</tt></li>
+ <li><tt>05.25.04 PANDA: fixed CIAO output so that the start angle
+is always less than the end angle.</tt></li>
+ <li><tt>05.26.04 FITSY++: clean up code for strm.C, map.C, mapincr.C</tt></li>
+ <li><tt>05.31.04 FITSY++: introduce new 'internal paging' mapince.C
+for binning files larger than 1Gb. Only 1Gb segments are mmap at one
+time, to allow binning &gt;2Gb/&gt;4Gb bin tables under a 32bit OS.</tt></li>
+ <li><tt>05.31.04 FITSDATA: optimized swap(), getValueFloat(),
+getValueDouble(), and scan() in hopes of speeding up display times,
+especially for linux.</tt></li>
+ <li><tt>06.13.04 WCS: upgrade to version 3.5.3</tt></li>
+ <li><tt>06.16.04 WEB DISPLAY: increased default font by one size.</tt></li>
+ <li><tt>06.16.04 GUI: fixed a problem with display header. Under
+Fedora Core 2, the default font size was too small.</tt></li>
+ <li><tt>06.17.04 XPA: add fits header keyword support.</tt></li>
+ <li><tt>06.17.04 PLOT: add option plot names to xpa, plot name in
+window title, plot data command</tt></li>
+ <li><tt>06.17.04 PLOT: fixed a problem with closing xpa plots via
+xpa.</tt></li>
+ <li><tt>06.18.04 PLOT: remove prefs 'Unique Plot'. This never
+worked correctly and is now obsolete.</tt></li>
+ <li><tt>06.21.04 PANDA: radii now extend from inner annuli to outer
+annuli and not from the center.</tt></li>
+ <li><tt>06.21.04 RGB: fixed a problem with 'fit to zoom' for rgb
+frames.</tt></li>
+ <li><tt>06.22.04 AST: update to version 3.3-1.</tt></li>
+ <li><tt>06.23.04 GRIDS: fixed justification (yet again!)</tt></li>
+ <li><tt>06.24.04 REGIONS: the default GUI size is now constant,
+reguardless of current zoom.</tt></li>
+ <li><tt>06.24.04 REGIONS: add support for cut/copy/paste regions
+across frames.</tt></li>
+ <li><tt>06.25.04 REGIONS: add unselect, begin rotate, end rotate,
+begin move, end move, begin edit, end edit callback support.</tt></li>
+ <li><tt>06.25.04 GUI: add support for multiple FITS headers for
+multiple extension FITS files.</tt></li>
+ <li><tt>06.28.04 REGIONS: add support for listing WCS keywords and
+values as comments in region files.</tt></li>
+ <li><tt>06.28.04 REGIONS: fixed a problem with the TEXT region
+handles with zooms not equal to 1.</tt></li>
+ <li><tt>06.28.04 XPA: fixed a problem with xpaset regions color and
+xpaset regions width.</tt></li>
+ <li><tt>06.29.04 FITS: add support for reload option. if reload
+option is set, markers and aux contours are preserved across loads.</tt></li>
+ <li><tt>07.01.04 FITSY++: fixed a problem with binning if the image
+header contained more than 36 cards.</tt></li>
+ <li><tt>07.01.04 FITSY++: added TV and TS keyword support for FITS
+bin tables.</tt></li>
+ <li><tt>07.01.04 FITSY++: add TP keyword support for FITS bin
+tables.</tt></li>
+ <li><tt>07.02.04 GRID: fixed a problem with a wcs with PC keywords.</tt></li>
+ <li><tt>07.05.04 WCS: removed WCS projection option. Its no longer
+needed.</tt></li>
+ <li><tt>07.05.04 GRID: fixed several problems with converting from
+wcs to AST. AST is very very picky as to which keywords to use and in
+what order. These include CDELT's, CD's, PC's, CROTA's.</tt></li>
+ <li><tt>07.08.04 SAVEAS: reorganize save as menus.</tt></li>
+ <li><tt>07.08.04 SAVEAS: add support for saving multiple frames as
+MPEG movie.</tt></li>
+ <li><tt>07.13.04 MOSAIC: fixed a problem with mosaic image wcs with
+orientations of xx.</tt></li>
+ <li><tt>07.14.04 WCS: upgrade to version 3.5.5.</tt></li>
+ <li><tt>07.14.04 FITSY++: add support for real number format 'D'.</tt></li>
+ <li><tt>07.14.04 FITSY: add changes to support real number format
+'D'.</tt></li>
+ <li><tt>07.15.04 ANALYSIS: stderr can now be redirected to stdout
+for $text with the |&amp; macro.</tt></li>
+ <li><tt>07.15.04 ANALYSIS: shell environment vars will be expanded
+within the command with the env() macro.</tt></li>
+ <li><tt>07.15.04 ANALYSIS: add support for the WEB menu item.</tt></li>
+ <li>
+ <p><tt><b>07.26.04 </b><b>RELEASE version 3.0<br>
+ </b></tt></p>
+ </li>
+ <li><tt>07.28.04 IIS: fixed a problem with iraf iis support that
+would sometimes result in a blank screen.</tt></li>
+ <li>
+ <p><tt><b>07.28.04 </b><b>RELEASE version 3.0.1<br>
+ </b></tt></p>
+ </li>
+ <li> <tt>08.02.2004 VECTOR: fixed a problem with matrix inversion
+with numbers smaller than DBL_EPSILON.</tt></li>
+ <li><tt>08.02.2004 FRAME: check for negative zoom.</tt></li>
+ <li><tt>08.06.2004 FITSIMAGE: fixed a problem with determining the
+length of a vector in the case of a non-wcs rotated coordinate system.</tt></li>
+ <li><tt>08.09.2004 GRID: fixed a problem with a rotation in
+physical and wcs linear grids.</tt></li>
+ <li><tt>08.10.2004 MAKEFILE: add support for emacs tags in
+saods9/saotk</tt></li>
+ <li><tt>08.12.2004 PROJECTION: fixed a problem with paste
+projection and setup callback procs.</tt></li>
+ <li><tt>08.12.2004 REGIONS: fixed a problem where regions
+properties where lost if cut/paste across frames.</tt></li>
+ <li><tt>08.13.2004 DIALOGS: fixed an issues with some windows
+managers who needed a hint to bring all dialogs to the front.</tt></li>
+ <li><tt>08.13.2004 POLYGON: change default create method to be
+simular to box.</tt></li>
+ <li><tt>08.13.2004 POLYGON: add prefs default polygon size.</tt></li>
+ <li><tt>08.13.2004 POLYGON: fixed a problem with the control
+handles at high zoom.</tt></li>
+ <li><tt>08.16.2004 REGIONS: fixed a problem with updating
+coordinates/angles/distances when rebinning a FITS bin table.</tt></li>
+ <li><tt>08.16.2004 REGIONS: add default system, sky, skyformat,
+dist system, and dist format for regions dialog to preferences.</tt></li>
+ <li><tt>08.16.2004 FITSY++: fixed a problem with &lt;unsigned
+char&gt; columns. They where incorrectly cased as a &lt;char&gt;.</tt></li>
+ <li><tt>08.18.2004 SCALE: nolonger reset scale mode from USERCLIP
+on load FITS.</tt></li>
+ <li><tt>08.18.2004 AST: upgrade to version 3.4</tt></li>
+ <li><tt>08.18.2004 GRID: minor tweaks with the default axes
+numerics gaps.</tt></li>
+ <li><tt>08.18.2004 REGIONS: for RGB frames, always use the keyFits
+channel in mapping regions to/from reference coordinate system.</tt></li>
+ <li><tt>08.19.2004 LINUX64: add support for Linux 64.</tt></li>
+ <li><tt>08.24.2004 XPA: add get data support.</tt></li>
+ <li><tt>08.25.2004 AST: fixed a bug with using free'd memory in
+plot.c</tt></li>
+ <li><tt>08.25.2004 GUI: fixed two problems with the getDataValues
+routine. With non-symetric binning or equatorial sky coordinates, an
+incorrect number of values where returned.</tt></li>
+ <li>
+ <p><tt><b>08.27.2004 </b><b>RELEASE version 3.0.2<br>
+ </b></tt></p>
+ </li>
+ <li><tt>09.01.2004 FTTYS++: add a check for mmapincr and mmap to
+ensure that there is at least 2880 bytes before trying to parse a
+header.</tt></li>
+ <li><tt>09.02.2004 FITSY++: add new memory mode, SMMAP which allows
+for split fits mmap files.</tt></li>
+ <li><tt>09.02.2004 XPA: add new support for split mmap and shared
+FITS files.</tt></li>
+ <li><tt>09.03.2004 FITSY++: add new memory mode, SSHARE which
+allows for split fits shared memory files.</tt></li>
+ <li><tt>09.06.2004 COMMAND: add support for split mmap and shared
+FITS files.</tt></li>
+ <li><tt>09.07.2004 XPA: update to 2.1.6</tt></li>
+ <li>
+ <p><tt><b>09.10.2004 </b><b>RELEASE version 3.0.3<br>
+ </b></tt></p>
+ </li>
+ </ol>
+</ol>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+<br>
+</body>
+</html>
diff --git a/ds9/doc/release/r4.0.html b/ds9/doc/release/r4.0.html
new file mode 100644
index 0000000..75d424d
--- /dev/null
+++ b/ds9/doc/release/r4.0.html
@@ -0,0 +1,424 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 4 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3> <img alt="" src="../sun.gif" align="middle" height="98"
+ width="100">
+SAOImage DS9 Version 4.0 Release Notes</h3>
+<ol>
+ <h4> <b>Version 4</b></h4>
+ <ol>
+ <li><tt>09.13.2004 AST: update to version 3.4-4</tt></li>
+ <li><tt>09.13.2004 TCL/TK: update to version 8.4.7</tt></li>
+ <li><tt>09.14.2004 WCSSUBS: update to version 3.5.6</tt></li>
+ <li><tt>09.14.2004 TCLLIB: update to version 1.6.1</tt></li>
+ <li><tt>09.15.2004 TKTABLE: installed 2.9</tt></li>
+ <li><tt>09.20.2004 SAOTK: fixed a problem with calculating a
+regions rotational angle with a galactic or ecliptic wcs.</tt></li>
+ <li><tt>09.21.2004 SAVEFITS: fixed a problem with the savefits xpa
+and command line options.</tt></li>
+ <li><tt>09.21.2004 REGIONS: fixed a problem with updating region
+dialog boxes after a change in event file bin factor.</tt></li>
+ <li><tt>09.23.2004 DSS: if user selects dss2red or dss2blue survey,
+force server to eso.</tt></li>
+ <li><tt>09.23.2004 2MASS: add image server.</tt></li>
+ <li><tt>10.01.2004 DSS: fixed a problem with 'Update from current
+Frame'.</tt></li>
+ <li><tt>10.12.2004 MAKEFILE: add export-dynamic for linux so that
+external shared libs can be loaded.</tt></li>
+ <li><tt>10.21.2004 GUI: fixed a problem if while blinking the user
+changes the colorbar via mouse.</tt></li>
+ <li><tt>11.17.2004 IMAGESERVER: fixed incompatibilities between DSS
+and 2MASS.</tt></li>
+ <li><tt>11.19.2004 AST: update to version 3.5</tt></li>
+ <li><tt>11.29.2004 FUNTOOLS: update to version 1.2.4</tt></li>
+ <li><tt>11.30.2004 SAOTK: use NaN.h from Funtools. This corrects
+problems with new architectures.</tt></li>
+ <li><tt>12.03.2004 MAKEFILE: now support gcc 3.4.x</tt></li>
+ <li><tt>12.15.2004 XPA: fixed a problem with preserve regions
+command.</tt></li>
+ <li><tt>12.15.2004 HTML: fixed several problems with color matching
+within htmlwidget.</tt></li>
+ <li><tt>12.16.2004 GUI: fixed a problem with saving text from
+SimpleTextDialog.</tt></li>
+ <li><tt>12.16.2004 WCS: main wcs menu item now sets default marker
+coordinate system and skyframe.</tt></li>
+ <li><tt>12.16.2004 COMPASS: create compass now uses current marker
+dialog system and skyframe.</tt></li>
+ <li><tt>12.20.2004 POLYGON: fixed a problem with the exclude strip
+and rotation.</tt></li>
+ <li><tt>12.20.2004 COMPOSITE: add support for composite region.</tt></li>
+ <li><tt>12.22.2004 TEXT REGION: fixed a problem in which the text
+angle did not reflect the native coordinate system.</tt></li>
+ <li><tt>12.29.2004 IMAGESERVER: xpa and command line options are
+now synchronous. The GUI is still asynchronous.</tt></li>
+ <li><tt>12.30.2004 NAMESERVER: fixed a problem with sexigesmal from
+SIMBAD near the equator.</tt></li>
+ <li><tt>12.30.2004 NAMESERVER: xpa and command line options are now
+synchronous. The GUI is still asynchronous.</tt></li>
+ <li><tt>01.31.2005 VECTOR: add support for new VECTOR region.</tt></li>
+ <li><tt>02.08.2005 REGIONS: fix varies errors with definition of
+angles. Position angles are now defined as from first positive
+coordinate axis to second positive coordinate axis except in the case
+of equatorial wcs, in this case it is defined as from second positive
+coordinate axis to first positive coordinate axis.</tt></li>
+ <li><tt>02.16.2005 SCALE: added User menu options to clarify
+current scaling mode.</tt></li>
+ <li><tt>02.17.2005 LINUX64: fixed a problem with generating
+postscript.</tt></li>
+ <li><tt>02.28.2005 MOSAIC: add support for mosaic data cubes.</tt></li>
+ <li><tt>03.01.2005 STD Dialog: fixed several problems with ds9 not
+remembering the current working directory.</tt></li>
+ <li><tt>03.02.2005 WINDOWS: fixed a problem with a memory leak when
+rendering regions on the windows platform. We no longer try to clip
+against a clip region.</tt></li>
+ <li><tt>03.02.2005 WINDOWS: fixed a problem with command
+line options that require the ds9 window to be visible. We have to
+process
+all events with 'update' before the windows version of ds9 is visible.</tt></li>
+ <li><tt>03.03.2005 REGIONS: add support to all regions parsers for
+ms windows line terminators</tt></li>
+ <li><tt>03.03.2005 ANALYSIS: removed extra ';' at the end of all
+regions substitutions.</tt></li>
+ <li><tt>03.16.2005 FITS: increased fits file name size to 1024
+chars.</tt></li>
+ <li><tt>03.17.2005 CATALOGS: are finally implemented!</tt></li>
+ <li><tt>03.24.2005 WINDOWS: implemented non-windows native standard
+dialogs. This allows uses to specify a file extension.</tt></li>
+ <li><tt>03.29.2005 FITY++: fixed a problem with filtering large bin
+tables while in mmapincr mode. We now insure that enough data is mmap'd
+for filter to build its good array.</tt></li>
+ <li><tt>03.29.2005 PRESERVE: fixed syntax errors with preserve
+regions and pan.</tt></li>
+ <li><tt>03.30.2005 REGIONS: fixed regions parsers to accept a
+regions file without terminator as the last character.</tt></li>
+ <li><tt>03.30.2005 ZOOM: all zooms are now specified in terms of x
+and y internally</tt></li>
+ <li><tt>04.01.2005 GRID: fixed a problem with grid options</tt></li>
+ <li><tt>04.28.2005 REGIONS: reimplemented
+basemarker,baseellipse,basebox classes.</tt></li>
+ <li><tt>04.28.2005 ZOOM: implemented support for different x and y
+zoom.</tt></li>
+ <li><tt>04.29.2005 XPA: update to version 2.1.6</tt></li>
+ <li><tt>04.29.2005 FUNTOOLS: update to version 1.3.0b3</tt></li>
+ <li><tt>04.29.2005 TCL/TK: update to version 8.4.9</tt></li>
+ <li><tt>05.25.2005 REGIONS: update all regions code</tt></li>
+ <li><tt>05.25.2005 REGIONS: add EPANDA</tt></li>
+ <li><tt>06.07.2005 FUNTOOLS: update to version 1.3.0b6</tt></li>
+ <li><tt>06.13.2005 SCALE: new LOG algorithm
+log10(i/s*1000+1)/log10(1001)
+where 0&lt;i&lt;s</tt></li>
+ <li><tt>06.13.2005 MAKEFILE: add support for FreeBSD</tt></li>
+ <li><tt>06.19.2005 FTP: all ftp opens now are in passive mode</tt></li>
+ <li><tt>06.28.2005 BIN: fixed a problem with -bin factor</tt></li>
+ <li><tt>06.28.2005 PAGESETUP: pagesetup command line options are no
+longer case sensitive</tt></li>
+ <li><tt>07.12.2005 FUNTOOLS: update to version 1.3.0.b7</tt></li>
+ <li><tt>07.13.2005 REGIONS: new DS9 regions 4.0 format</tt></li>
+ <li><tt>07.13.2005 REGIONS: add copy,cut,paste,undo xpa and command
+line options.</tt></li>
+ <li><tt>08.01.2005 GCC: add support for gcc 4.0. Remove backward
+support for gcc 2.96 or earlier.</tt></li>
+ <li><tt>08.03.2005 REGIONS: panda,epanda,bpanda, only render
+start/stop angles in red/blue when selected.</tt></li>
+ <li><tt>08.04.2005 SMOOTH: add smoothing algorithms
+boxcar,tophat,gaussian</tt></li>
+ <li><tt>08.15.2005 COLORBAR: add support for printing the
+colorbar</tt></li>
+ <li><tt>08.15.2005 FUNTOOLS: update to version 1.3.0b9</tt></li>
+ <li><tt>08.15.2005 ZLIB: update to version 1.2.3</tt></li>
+ <li><tt>08.17.2005 GUI: add View menu and prefs.</tt></li>
+ <li><tt>08.24.2005 REGIONS: fixed a problem with ciao pie regions.</tt></li>
+ <li><tt>08.24.2005 REGIONS: add invert selection.</tt></li>
+ <li><tt>08.25.2005 GUI: add display image window size.</tt></li>
+ <li><tt><b>08.30.2005 RELEASE version 4.0b6</b></tt></li>
+ <li><tt>09.12.2005 IIS: fixed a problem with iis and cursors.</tt></li>
+ <li><tt><b>09.12.2005 RELEASE version 4.0b7</b></tt></li>
+ <li><tt>09.15.2005 ARRAY: fixed a problem with loading array cubes
+from a file and determining the correct endian.</tt></li>
+ <li><tt>10.24.2005 BIN: if unable to find suitable cols to bin,
+chose the first and second column. This way, if you have table, it will
+always load, even if you don't know the column names.</tt></li>
+ <li><tt>10.25.2005 BIN: binning dialog box. if number of columns is
+too large to display, wrap the menu.</tt></li>
+ <li><tt>10.27.2005 CONTOUR: complete support for command line/xpa
+control of contour features.</tt></li>
+ <li><tt>10.27.2005 CONTOUR: fixed a problem with convert and
+contours of zero length.</tt></li>
+ <li><tt>11.01.2005 FITS: fixed a problem loading very small arrays
+mmapincr</tt></li>
+ <li><tt>11.01.2005 VECTOR: small change to correct issue with gcc
+4.0.1</tt></li>
+ <li><tt>11.01.2005 WCS: fixed a problem with wcs append/replace.</tt></li>
+ <li><tt>11.02.2005 GRID: fixed a problem with alternative linear
+wcs.</tt></li>
+ <li><tt>11.02.2005 WCS: fixed a problem with alternative wcs names.
+All wcs names are now lower case.</tt></li>
+ <li><tt>11.03.2005 CONTOUR: fixed a problem with contour convert
+after a catalog command.</tt></li>
+ <li><tt>11.03.2005 HELP: altered tk to pass -help to us. For -help,
+we now display a brief message and exit and for --help, we display the
+reference manual command line options.</tt></li>
+ <li><tt>11.09.2005 CATALOG: fixed a problem with starbase to trim
+column names of white spaces.</tt></li>
+ <li><tt>11.09.2005 CATALOG: add user specified RA/DEC column option.</tt></li>
+ <li><tt>11.10.2005 CATALOG: speed up catreg for large dbs</tt></li>
+ <li><tt>11.14.2005 GUI: the meus Cut,Copy,Paste,Clear now works for
+all dialog boxes on all platforms.</tt></li>
+ <li><tt>11.16.2005 REGIONS: fixed a problem with rendering arrows
+for line,vector,ruler, and compass with width&gt;1.</tt></li>
+ <li><tt>11.16.2005 GUI: Modified standard dialog boxes to remember
+file types.</tt></li>
+ <li><tt>11.17.2005 GUI: remove 'Use Cursors' Misc Option.</tt></li>
+ <li><tt>11.17.2005 GUI: Modified standard dialog boxes to remember
+filters.</tt></li>
+ <li><tt>11.18.2005 COMPOSITE: fixed a problem with loading
+composite regions with properties.</tt></li>
+ <li><tt>12.05.2005 RGB: Fixed a problem with wcs matching rgb
+frames .</tt></li>
+ <li><tt>12.08.2005 REGIONS: Fixed a problem general comment such as
+## and #.</tt></li>
+ <li><tt>12.08.2005 HELP: reset previous behavior for -help. fv uses
+ds9 -help to probe for ds9. Until fv is changed, we need to support the
+prior behavior.</tt></li>
+ <li><tt>12.15.2005 X11: Insure that all X11 rendering is calculated
+in double precision until the very last, at which, the results are
+rounded to the nearest integer. This includes markers, contours, grids.</tt></li>
+ <li><tt>12.17.2005 PS: set default resolution to 150, from 72.</tt></li>
+ <li><tt>12.19.2005 GUI: add .ftz and .FTZ to default fits name
+filter.</tt></li>
+ <li><tt>12.19.2005 FREEBSD: added support for freebsd.</tt></li>
+ <li><tt>01.03.2006 FITSY++: fixed an overflow problem with mmap
+very large array files.</tt></li>
+ <li><tt>01.04.2006 GUI: reinstated DETECTOR and AMPLIFIER
+coordinate system menu items in menus and removed the preferences.</tt></li>
+ <li><tt>01.04.2006 GUI: reinstated ZMAX menu items in menus.</tt></li>
+ <li><tt>01.05.2006 CATALOGS: fixed a problem with rotated or
+flipped images and determining image size in ra and dec</tt></li>
+ <li><tt>01.05.2006 PROJECTION: fixed a problem move and moveto.</tt></li>
+ <li><tt>01.12.2006 COLORBAR: added numerics to colorbar.</tt></li>
+ <li><tt>01.18.2006 GUI: separte controls for min/max and low/high.</tt></li>
+ <li><tt>01.24.2006 HISTOGRAM EQU: is now based on low/high, not
+min/max.</tt></li>
+ <li><tt>01.27.2006 GUI: fixed a problem with updating the current
+colormap.</tt></li>
+ <li><tt>01.30.2006 PANNER: under truecolor visuals, the panner is
+now updated with the colorbar.</tt></li>
+ <li><tt>02.01.2006 TEMPLATE: tweak xmm templates for correct
+boresite.</tt></li>
+ <li><tt>02.03.2006 GUI: fixed Shift-Tab under linux.</tt></li>
+ <li><tt>02.03.2006 GUI: fixed a problem with loading multiple
+files, with -single command line option, followed by Match Frame. The
+frames where not realized so the coordinate systems where not valid.</tt></li>
+ <li><tt>02.03.2006 MARKERS: added the ability to toggle marker text.</tt></li>
+ <li><tt><b>02.08.2006 RELEASE version 4.0b8</b></tt></li>
+ <li><tt>02.07.2006 TCL/TK: update to version 8.4.12</tt></li>
+ <li><tt>02.08.2006 CROSSHAIR: fix a typo that caused the crosshair
+command-line option to fail.</tt></li>
+ <li><tt>02.27.2006 CATALOG: fixed a problem with finding which
+columns contain RA and DEC.</tt></li>
+ <li><tt>02.27.2006 XPA: fixed a problem with xpaget ds9 width.</tt></li>
+ <li><tt>03.20.2006 DSS: add new survey options for STSCI.</tt></li>
+ <li><tt>03.24.2006 i18n: finished implemenation of
+internationalization and localization code.</tt></li>
+ <li><tt>03.29.2006 SCALE: fixed a problem with RGB frames and
+log/pow scales. Incorrect low/high values were being used to calculate
+the scale.</tt></li>
+ <li><tt>03.29.2006 PREFS: the default prefs file is now ds9.prf.
+The following directories are now searched in order: ./ ~
+/usr/local/lib /opt/local/lib </tt></li>
+ <li><tt>03.29.2006 INITALIZATION: the default initalization file is
+now ds9.ini. The following directories are now searched in order: ./ ~
+/usr/local/lib /opt/local/lib </tt></li>
+ <li><tt>03.31.2006 GUI: fixed a problem with several dialog boxes
+with the Paste menu option. If the clipboard was empty, an error was
+generated.</tt></li>
+ <li><tt>04.3.2006 FITS HEADER: fixed a problem displaying datacube
+headers.</tt></li>
+ <li><tt>04.3.2006 PROJECTION REGION: Projection region plots can
+now be accessed via XPA PLOT</tt></li>
+ <li><tt>04.5.2006 MACOSX: fix a problem with the macosx startup
+scripts to allow path names with a space.</tt></li>
+ <li><tt>04.7.2006 WCS: fix a problem WCS menu and images without a
+wcs.</tt></li>
+ <li><tt>04.10.2006 GRID: fixed a problem with GLACTIC wcs, AST,
+WCSSUBS, and defined LATPOLE/LONPOLE keywords.</tt></li>
+ <li><tt><b>04.15.2006 RELEASE version 4.0b9</b></tt></li>
+ <li><tt>04.18.2006 CATALOGS: fixed a problem with filter editor
+menu.</tt></li>
+ <li><tt>04.18.2006 CATALOGS: fixed a problem with searching for
+other catalogs</tt></li>
+ <li><tt>04.24.2006 TEMP: DS9 will now look for environment vars
+TEMP and TMP first for location of temp directory.</tt></li>
+ <li><tt>04.28.2006 PREFS: Fixed a problem with writing invalid
+preferences.</tt></li>
+ <li><tt>04.28.2006 PS: Fixed a problem with printing Grayscale and
+pure white values. They were being rounded off to 254, not 255.</tt></li>
+ <li><tt>04.28.2006 PREFS: prefs are now written to a users home
+directory if available (including windows) and hidden.</tt></li>
+ <li><tt>05.02.2006 GCC: now compiles properly under gcc 4.1</tt></li>
+ <li><tt>05.08.2006 SCALE: more checks for illegal low/high values
+for log/pow scales</tt></li>
+ <li><tt>05.10.2006 BIN: fix an issue with calculated width/height.
+No matter the bin factor, or the dimensions of the data, always have at
+least an 1x1 image.</tt></li>
+ <li><tt>05.11.2006 DARWIN: compile under 10.4.x with no
+OSSPINLOCKLOCK, which is not available under 10.3.x</tt></li>
+ <li><tt>05.16.2006 CROSSHAIR: fixed a problem with xpa/cmd option
+crosshair.</tt></li>
+ <li><tt>05.16.2006 ANALYSIS: fixed a problem with loading analysis
+files with bindings at startup with one frame.</tt></li>
+ <li><tt>05.22.2006 WCSSUBS: Update to version 3.6.4</tt></li>
+ <li><tt>05.25.2006 ANALYSIS: add $xcen and $ycen macros.</tt></li>
+ <li><tt>05.25.2006 ANALYSIS: add $vo_method macro.</tt></li>
+ <li><tt>06.05.2006 FITSY++: fixed a problem with incorrectly
+detecting the beginning sequence of gz stream.</tt></li>
+ <li><tt>06.12.2006 HV/XPA: Implemented 'xpaset' mime support.</tt></li>
+ <li><tt>06.14.2006 FITS: Fixed a problem with displaying the header
+of a file in which there was an extention name in the primary header.</tt></li>
+ <li><tt>06.21.2006 GUI: Fixed a problem -single and -blink command
+line optons.</tt></li>
+ <li><tt>06.21.2006 REGIONS: Check for valid image loaded before
+processing load regions commands.</tt></li>
+ <li><tt>06.21.2006 MOSAIC: fixed a problem with mosaicimage wfpc2
+and display header.</tt></li>
+ <li><tt>06.23.2006 HV: Implemented file caching.</tt></li>
+ <li><tt>06.23.2006 HV: Implemented image caching.</tt></li>
+ <li><tt>06.26.2006 HV: Implemented multiple mime processing.</tt></li>
+ <li><tt>06.29.2006 TCLLIB: update to version 1.8</tt></li>
+ <li><tt>07.11.2006 WCSSUBS: update to version 3.6.5</tt></li>
+ <li><tt>07.11.2006 WCSSUBS: fix a problem with naxis&gt;2</tt></li>
+ <li><tt>07.12.2006 NAME SERVER: support for HTTP redirection</tt></li>
+ <li><tt>07.12.2006 IMAGE SERVER: support for HTTP redirection</tt></li>
+ <li><tt>07.13.2006 CATALOGS: support for HTTP redirection</tt></li>
+ <li><tt>07.13.2006 REGIONS: fixed a problem with cut/copy/paste
+regions dialog.</tt></li>
+ <li><tt>07.25.2006 PREFS: preferences are automatically saved.</tt></li>
+ <li><tt>07.25.2006 FITSY++: fixed a problem with large RGB arrays
+and streams.</tt></li>
+ <li><tt>07.31.2006 RGB: add support for invert RGB colormap.</tt></li>
+ <li><tt>07.31.2006 FIRST: add support for VLA FIRST image server.</tt></li>
+ <li><tt>08.01.2006 HTTP: add timeout options to all geturl calls.</tt></li>
+ <li><tt>08.02.2006 CATALOGS: add suppport for SDSS.</tt></li>
+ <li><tt>08.07.2006 ANALYSIS: fixed a problem with cancel geturl
+tasks.</tt></li>
+ <li><tt>08.14.2006 TKTABLE: fixed configure files for darwin intel.</tt></li>
+ <li><tt>08.14.2006 TKIMG: fixed configure files for darwin intel.</tt></li>
+ <li><tt>08.14.2006 AST: apply patch to plot.c at line 23207</tt></li>
+ <li><tt>08.17.2006 BIN: fixed a problem with binning 3D and
+integer cols.</tt></li>
+ <li><tt>08.17.2006 BIN: fixed a problem with binning 3D and
+updating the bin dialog box.</tt></li>
+ <li><tt>08.17.2006 SCALE: changed AUTO to sample only for mosaics. </tt></li>
+ <li><tt>08.30.2006 CATALOG: fixed a problem with filtering and
+column names to leading or trailing spaces. </tt></li>
+ <li><tt>08.31.2006 CATALOG: add support for CSV catalog files
+with/wo header. </tt></li>
+ <li><tt>09.06.2006 EPANDA: Fixed problems with rendering start and
+stop angles.</tt></li>
+ <li><tt>09.08.2006 BPANDA: Fixed problems with rendering start and
+stop angles.</tt></li>
+ <li><tt>09.11.2006 TEMPLATES: When creating templates, they were
+placed in the upper right corner of the frame. This has been changed to
+the center of the frame.</tt></li>
+ <li><tt>09.11.2006 TEMPLATES: When templates where created via the
+gui, the screen was not refreshed properly. This has been corrected.</tt></li>
+ <li><tt>09.12.2006 FITSY++: Fixed a problem with hist() and column
+values of 0, which was used as the default value.</tt></li>
+ <li><tt>09.13.2006 COMPOSITE: Add complement angle.</tt></li>
+ <li><tt>09.15.2006 CPANDA,EPANDA,BPANDA: fixed a conflict with
+funtools. Stop/start angles will alway increase in value.</tt></li>
+ <li><tt>09.18.2006 MOSAIC IMAGE NEXT: removed support.</tt></li>
+ <li><tt><b>10.01.2006 RELEASE version 4.0b10</b></tt></li>
+ <li><tt>10.01.2006 I18N: Add Portuguese support.</tt></li>
+ <li><tt><b>10.01.2006 RELEASE version 4.0b10.1</b></tt></li>
+ <li><tt>10.01.2006 FITS: external support for bzip2.</tt></li>
+ <li><tt>10.01.2006 REGIONS: fixed a problem with clipping regions
+in tile mode.</tt></li>
+ <li><tt>10.03.2006 HV: add support for HTTP-EQUIV HTML Meta keyword.</tt></li>
+ <li><tt>10.03.2006 PANDA: fixed a problem with zero length radius
+and printing.</tt></li>
+ <li><tt>10.10.2006 WCSSUBS: update to version 3.6.6</tt></li>
+ <li><tt>10.13.2006 TCL/TK: update to version 8.4.13</tt></li>
+ <li><tt>10.13.2006 FUNTOOLS: update to version 1.3.0b22</tt></li>
+ <li><tt>10.13.2006 TCLLIB: update to version 1.9</tt></li>
+ <li><tt>10.23.2006 LANGUAGE: add support for following languages
+fr,es,de,it,pt,ru,da.</tt></li>
+ <li><tt>10.23.2006 HTTP: increase timeout to 3 minutes.</tt></li>
+ <li><tt>10.24.2006 GUI: add view colorbar numerics support.<br></tt></li>
+ <li><tt>10.31.2006 CATALOGS: add full symbol support via xpa/command line.<br></tt></li>
+ <li><tt>10.31.2006 CATALOGS: fixed a problem with the optional catalog name as a parameter.<br></tt></li>
+ <li><tt>10.31.2006 GUI: multi column frame and active frame menu.<br></tt></li>
+ <li><tt>10.31.2006 GUI: multi column catalog col name menus.<br></tt></li>
+ <li><tt>11.02.2006 XPA: add xpaget ds9 fits bitpix.<br></tt></li>
+ <li><tt>11.06.2006 GUI: add confirmation option preference.<br></tt></li>
+ <li><tt>11.28.2006 REGIONS: add xpa/command line option get info.<br></tt></li>
+ <li><tt>11.28.2006 REGIONS: fits regions file: first look for extension [REGIONS], then attempt to load the first extension.<br></tt></li>
+ <li><tt>11.29.2006 FITS: fixed a overflow problem with very very large fits images > 8Gb in size.<br></tt></li>
+ <li><tt>12.06.2006 RGB: fixed a problem with aligning very large images.<br></tt></li>
+ <li><tt>12.07.2006 MOSAIC: fixed a problem with wcs mosaicsa and very large images.<br></tt></li>
+ <li><tt>12.09.2006 FITS: removed a kludge for defining the wcs tangent point that only affected AIR and AZP projections.<br></tt></li>
+ <li><tt>12.12.2006 GUI: fixed a problem with default vertical layout. The default size is now consistent with other options.<br></tt></li>
+ <li><tt>12.13.2006 SAVEAS: fixed a problem with PHYSICAL and WCS coordinates. They were 1 pixel off.<br></tt></li>
+ <li><tt>12.13.2006 CPANDA/EPANDA: fixed a problem with render and printing with an image flipped.<br></tt></li>
+ <li><tt>12.20.2006 RGB: NaN are now ignored when building an RGB image.<br></tt></li>
+ <li><tt>12.22.2006 GUI: Increased default X size so that buttons do not cause automatic resizing.<br></tt></li>
+ <li><tt>01.08.2007 PREFS: fixed a problem with frame parser and LoadPrefs so that a preferences file from version b9 will correctly parse.<br></tt></li>
+ <li><tt>01.23.2007 FITS: Added additional checks for valid format and values for DATASEC, DETSEC, and DETSIZE keywords.<br></tt></li>
+ <li><tt>01.24.2007 CATALOGS: fixed a problem with redirect.<br></tt></li>
+ <li><tt>01.24.2007 REGIONS: fixed a problem measuring WCS lengths across wcs mosacis and RGB images.<br></tt></li>
+ <li><tt>01.25.2007 REGIONS: fixed a problem with rotated text regions.<br></tt></li>
+ <li><tt>01.30.2007 DSS: Split DSS server into three servers.<br></tt></li>
+ <li><tt>01.31.2007 GUI: add binning buffersize 8192 and binfactor 256.<br></tt></li>
+ <li><tt><b>02.01.2007 RELEASE version 4.0b11</b></tt></li>
+ <li><tt>02.02.2007 CATALOGS: add cols.<br></tt></li>
+ <li><tt>02.02.2007 VO: default url is now http://cxc.harvard.edu/chandraed/list.txt.<br></tt></li>
+ <li><tt>02.07.2007 PREFERENCES: if ds9 detects a newer prefs file, it will not be processed.<br></tt></li>
+ <li><tt>02.09.2007 SKYVIEW: added support for HEASARC's skyview image cutout service.<br></tt></li>
+ <li><tt>02.09.2007 GUI: dropped the 'b' for beta, afterall, ds9 is always beta!<br></tt></li>
+ <li><tt>02.13.2007 CATALOGS: new non-modal search catalogs support.<br></tt></li>
+ <li><tt>02.13.2007 CATALOGS: add show/hide support.<br></tt></li>
+ <li><tt>02.15.2007 FIRST: fixed a problem with xpa first.<br></tt></li>
+ <li><tt>02.15.2007 2MASS: fixed a problem with xpa 2mass.<br></tt></li>
+ <li><tt>03.06.2007 MASK: add support for fits masks.<br></tt></li>
+ <li><tt>03.06.2007 MOSAIC: remove support for 'fast mosaic' mode.<br></tt></li>
+ <li><tt>03.06.2007 SCALE: added support for zscale parameter prefs.<br></tt></li>
+ <li><tt>03.20.2007 FITSY++: add support for compressed FITS.</tt></li>
+ <li><tt>03.27.2007 WCS: fixed support for alt wcs for bin tables.<br></tt></li>
+ <li><tt>03.29.2007 REGIONS: add support for user specified point sizes<br></tt></li>
+ <li><tt>04.02.2007 GRID: fixed a problem with TNX projection.<br></tt></li>
+ <li><tt>04.03.2007 FITSY++: split code supporting FITS ASCII tables and FITS Binary Tables.<br></tt></li>
+ <li><tt>04.03.2007 FITSY++: removed code supporting FITS Binary Tables substring arrays.<br></tt></li>
+ <li><tt>04.03.2007 WCSSUBS: update to version 3.6.8</tt></li>
+ <li><tt>04.03.2007 FUNTOOLS: update to version 1.3.0b30</tt></li>
+ <li><tt>04.03.2007 XPA: update to version 2.1.7b2</tt></li>
+ <li><tt>04.06.2007 FITSY++: add support for RICE compressed FITS.</tt></li>
+ <li><tt>04.06.2007 SMOOTH: now implemented on a per channel basis for RGB.</tt></li>
+ <li><tt>04.10.2007 WCSSUBS: backed out of wcscon.c to version 3.6.6 due to a bug in prec.</tt></li>
+ <li><tt>04.12.2007 WINDOWS: fixed a problem with iis and iraf.</tt></li>
+ <li><tt><b>04.15.2007 RELEASE version 4.12</b></tt></li>
+ <li><tt>04.16.2007 FITSIMAGE: fixed an bug with setting file names after a reset.</tt></li>
+ <li><tt>04.26.2007 ESO-DSS: support new survey names.</tt></li>
+ <li><tt>05.10.2007 NSVR: fixed a problem with xpa/command line name lookup.</tt></li>
+ <li><tt>05.10.2007 NSVR: fixed a problem redirection.</tt></li>
+ <li><tt>05.11.2007 TCL: realize ds9 before executing any external tcl source.</tt></li>
+ <li><tt>05.11.2007 CATALOGS: for csv files, ignore any comment lines.</tt></li>
+ <li><tt>05.21.2007 MOSAICS: fixed several problems with constructing mosaics from both IRAF and WCS keywords.</tt></li>
+ <li><tt>05.21.2007 IRAF MOSAICS: the image size is now defined by the actual data (just as with WCS) and not the DETSIZE keyword.</tt></li>
+ <li><tt>05.30.2007 GRID: fixed a problem with plain font style that resulted in always using system and not the selected font.</tt></li>
+ <li><tt>05.31.2007 ELLIPSE PANDA: fixed a problem incorrect postscript code.</tt></li>
+ <li><tt>06.08.2007 GUI: fixed a problem with the Display Fits Header button.</tt></li>
+ <li><tt>06.13.2007 FITS: add fits header command and xpa point.</tt></li>
+ <li><tt>06.30.2007 RULER: fixed a problem with displaying the length text.</tt></li>
+ <li><tt><b>07.15.2007 RELEASE version 4.13</b></tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r5.0.html b/ds9/doc/release/r5.0.html
new file mode 100644
index 0000000..7be3c36
--- /dev/null
+++ b/ds9/doc/release/r5.0.html
@@ -0,0 +1,449 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 5 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3> <img alt="" src="../sun.gif" align="middle" height="98"
+ width="100">
+SAOImage DS9 Version 5 Release Notes</h3>
+<ol>
+ <ol>
+ <li><tt>07.16.2007 FITSY++: fix a problem with rice compressed
+images and multiple tiles.</tt></li>
+ <li><tt>07.17.2007 MOSAIC: fix a problem with bin table extensions
+at the end of a mosaic image wcs.</tt></li>
+ <li><tt>07.20.2007 COLORMAP: fixed a problem with loading external
+colormaps.</tt></li>
+ <li><tt>07.20.2007 COLORMAP: fixed a problem colormap menus.</tt></li>
+ <li><tt>07.23.2007 ARCHIVES: new url for skyview.</tt></li>
+ <li><tt>07.23.2007 I18N: add language support for Japanese.
+(many thanks to Masahiro Tsujimoto!).</tt></li>
+ <li><tt>07.23.2007 PIXEL TABLE: xpaget will now return the pixel
+table values.</tt></li>
+ <li><tt>07.31.2007 SOLARISx86: now supporting solarisx86.</tt></li>
+ <li><tt>08.15.2007 PIXELTABLE: fixed a minor problem with xpaget
+pixeltable.</tt></li>
+ <li><tt>08.15.2007 FUNTOOLS: update to version 1.4.0</tt></li>
+ <li><tt>08.15.2007 IIS: fixed a problem with frame number greater
+than 10.</tt></li>
+ <li><tt>08.15.2007 EXAMINE: changed frame name to 'Frame'.</tt></li>
+ <li><tt>09.02.2007 CATALOGS: updated urls and menu titles.</tt></li>
+ <li><tt>09.20.2007 PREFS: new prefs dialog box.</tt></li>
+ <li><tt>09.24.2007 CATALOGS: fixed a problem with the CDS query.</tt></li>
+ <li><tt>09.24.2007 CATALOGS: add SDSS DR6.</tt></li>
+ <li><tt>09.24.2007 SKYVIEW: fixed default image size and updated
+url.</tt></li>
+ <li><tt>09.24.2007 PROJECTION: install callbacks only after Button
+Release.</tt></li>
+ <li><tt>09.25.2007 REGIONS: add xpa/command SHOW and SHOWTEXT
+support.</tt></li>
+ <li><tt>09.25.2007 CONTOURS: fixed a problem with load contours
+from the command line.</tt></li>
+ <li><tt>10.03.2007 MACOSX: MacOSX Aqua support is now fully
+implemented!</tt></li>
+ <li><tt>10.03.2007 COLORMAP: pass colormap names thru translation
+tables</tt></li>
+ <li><tt>10.03.2007 XPA: update to version 2.1.8</tt></li>
+ <li><tt>10.05.2007 COMPOSITE: add global properties switch.</tt></li>
+ <li><tt>10.05.2007 LINE: fixed a problem with initial displayed
+arrow checkboxes in dialog.</tt></li>
+ <li><tt>10.05.2007 FOV: moved FOV menu to more visible level</tt></li>
+ <li><tt>10.10.2007 I18N: add language support for French.</tt></li>
+ <li><tt>10.11.2007 CATALOGS: fixed a problem with the symbol editor
+dialog.</tt></li>
+ <li><tt><b>10.15.2007 RELEASE version 5.0</b></tt></li>
+ <li><tt>10.16.2007 PROJECTION: fixed a problem with the coordinates
+of the projection plot.</tt></li>
+ <li><tt>10.17.2007 RICE: fixed a problem with float and double RICE
+compression.</tt></li>
+ <li><tt>10.24.2007 RICE: fixed several problems with mosaics, cubes
+and RICE compression.</tt></li>
+ <li><tt>10.24.2007 GUI: added support for ds9 beta versions.</tt></li>
+ <li><tt>10.24.2007 PREFS: added OK and Cancel buttons to all tabs.</tt></li>
+ <li><tt>10.29.2007 CATALOGS: implemented support for new CDS
+catalogs search format.</tt></li>
+ <li><tt>10.30.2007 SAOTK: implemented reentrant parsers.</tt></li>
+ <li><tt>11.01.2007 SAOTK: now support any color for markers,
+contours, etc.</tt></li>
+ <li><tt>11.02.2007 MACOSX/WINDOWS: fixed a problem with native open
+file dialog. If bad file name had been used, (or an extention), an
+error would occur.</tt></li>
+ <li><tt>11.07.2007 TCL/TK: update to version 8.4.16.</tt></li>
+ <li><tt>11.08.2007 PLOT: fixed a problem with xpa/command line
+linear/line tokens to match documentation.</tt></li>
+ <li><tt>11.09.2007 PREFERENCES: fixed a problem with slower ppcs.
+use 'update idletasks' instead of 'update' to avoid possible race
+condition.</tt></li>
+ <li><tt>11.21.2007 XPA: update to version 2.1.9</tt></li>
+ <li><tt>11.21.2007 FUNTOOLS: update to version 1.4.1</tt></li>
+ <li><tt>11.21.2007 WCSSUBS: update to version 3.7.0</tt></li>
+ <li><tt>11.21.2007 TCLLIBS: update to version 1.10</tt></li>
+ <li><tt>11.28.2007 TCL/TK: update to version 8.4.17 beta.</tt></li>
+ <li><tt>11.28.2007 ANALYSIS: fix a problem with spaces in tmp file
+names.</tt></li>
+ <li><tt>12.05.2007 FLEXLEXER.Y: updated version.</tt></li>
+ <li><tt>12.06.2007 GUI: change key binding 'c' to 'r'. It conflicts
+with 'copy' on MacOSX and Windows platforms.</tt></li>
+ <li><tt>12.06.2007 REGIONS: fixed a problem with pasteing regions
+into an empty frame.</tt></li>
+ <li><tt>12.18.2007 ZIP: fixed a problem with the unix Makefile.</tt></li>
+ <li><tt>12.18.2007 FUNTOOLS: update to version 1.4.2.</tt></li>
+ <li><tt>12.18.2007 2MASS: limit size to 1024 arcsec.</tt></li>
+ <li><tt>12.21.2007 FITSY++: add support for HCOMPRESS compressed
+FITS.</tt></li>
+ <li><tt>12.28.2007 FITSY++: add support for GZIP compressed FITS.</tt></li>
+ <li><tt>01.03.2008 FITSY++: add support for PLIO compressed FITS.</tt></li>
+ <li><tt>01.04.2008 GUI: fixed a problem with X11 servers that
+return truecolor 32 bit when in fact the visual is truecolor 24bit.</tt></li>
+ <li><tt><b>01.15.2008 RELEASE version 5.1</b></tt></li>
+ <li><tt>01.17.2008 ANALYSIS: add the directory of any loaded
+analysis file to the PATH.</tt></li>
+ <li><tt>01.22.2008 REGIONS: fixed a problem introduced with
+reentrant parsers. Sexagesimal values between -00 and +00 were
+incorrectly parsed as +00.</tt></li>
+ <li><tt>01.23.2008 REGIONS: fixed a problem with parsing HMS/DMS
+coordinates.</tt></li>
+ <li><tt>01.24.2008 GUI: fixed a problem shift rotate mode.</tt></li>
+ <li><tt>01.24.2008 GUI: info panel 'Frame' width set to +4.</tt></li>
+ <li><tt>01.24.2008 GUI: add new goto frame menu.</tt></li>
+ <li><tt>01.24.2008 GUI: add support for move frames.</tt></li>
+ <li><tt>01.24.2008 ANALYSIS: for MacOSX tiger, wrap cmds with shell
+and PATH.</tt></li>
+ <li><tt>01.25.2008 CATALOGS: make sure xpa and command line
+retrieves are syncronous.</tt></li>
+ <li><tt>01.28.2008 CONTOUR: fixed a problem with loading contour
+levels into multiple frames.</tt></li>
+ <li><tt>01.31.2008 WINDOWS: changed how windows come into focus.</tt></li>
+ <li><tt>01.31.2008 TCL/TK: update to version 8.4.17.</tt></li>
+ <li><tt>02.07.2008 GUI: change default directory for standard
+dialog to $HOME.</tt></li>
+ <li><tt>02.07.2008 ANALYSIS: add /sw/bin to default path for MacOSX.</tt></li>
+ <li><tt>02.20.2008 CATALOGS: add support for editing a catalog
+table and regions.</tt></li>
+ <li><tt>02.20.2008 TEXT: add enable rotation switch for text
+regions.</tt></li>
+ <li><tt>02.20.2008 GUI: ds9 will now start in the users home
+directory for MacOSX Aqua users when invoked from a double click and
+the default dialog box is Motif or Windows.</tt></li>
+ <li><tt>02.20.2008 TCL/TK: update to version 8.4.18.</tt></li>
+ <li><tt>02.26.2008 IIS: disable most keystroke and mouse events for
+iis frames.</tt></li>
+ <li><tt>02.28.2008 FITSY++: fixed a problem with save fits and
+smoothed images.</tt></li>
+ <li><tt>02.29.2008 WCS: fixed a problem with calculating the size
+and center of complex fits images in WCS.</tt></li>
+ <li><tt>03.05.2008 GUI: backed out change key binding 'c' to 'r'.
+It causes untold grief with IRAF.</tt></li>
+ <li><tt>03.10.2008 MACOSX: fixed a problem with printing non
+standard colors.</tt></li>
+ <li><tt>03.10.2008 CATALOGS: catalog dialogs are now tied to the
+frame. This allows multiple copies of the same catalog, one per frame.</tt></li>
+ <li><tt>03.12.2008 GRID: added support for PC001001 formated WCS
+keywords.</tt></li>
+ <li><tt>03.13.2008 IIS: make sure socket is closed on exec.</tt></li>
+ <li><tt>03.13.2008 WINDOWS: add support for native printing.</tt></li>
+ <li><tt>03.18.2008 CROSSHAIR: fix a problem with the line width for
+postscript.</tt></li>
+ <li><tt>03.18.2008 MACOSX: restore postscript printing.</tt></li>
+ <li><tt>03.18.2008 WINDOWS: restore postscript printing.</tt></li>
+ <li><tt>03.19.2008 GUI: enhancements with Find/FindNext in text
+dialog windows.</tt></li>
+ <li><tt>03.19.2008 GUI: add console support.</tt></li>
+ <li><tt>03.24.2008 REGIONS: apply WCS to fits regions if present.</tt></li>
+ <li><tt>03.25.2008 PREFS: fixed a problem with Zoom menu
+preferences.</tt></li>
+ <li><tt>03.31.2008 GUI: add support for user configured button bar.</tt></li>
+ <li><tt>04.03.2008 CATALOGS: add support for simbad.</tt></li>
+ <li><tt>04.04.2008 MASKS: fixed a problem with mask color
+preference.</tt></li>
+ <li><tt>04.07.2008 IMEXAMINE: added support for key stroke events.</tt></li>
+ <li><tt><b>04.15.2008 RELEASE version 5.2</b></tt></li>
+ <li><tt>04.18.2008 REGIONS: added support for centroid.</tt></li>
+ <li><tt>04.21.2008 GUI: fixed a problem with 'c' and control-c.</tt></li>
+ <li><tt>04.21.2008 IIS: fixed a problem key events. Now all key
+events are active until IIS is in cursor mode. At this point all key
+events are passed to IRAF except for 'TAB'.</tt></li>
+ <li><tt>04.23.2008 MACOSX: split the binary and archive into two
+files, and codesign the binary, so that it will play well with
+leopard's new firewall.</tt></li>
+ <li><tt>04.25.2008 FITSY++: fixed a proble with mapincr. If seek_
+is at end of file, mmap will not return an error.</tt></li>
+ <li><tt>04.28.2008 GUI: delete all frames resets the frame counter
+(broken in 5.2).</tt></li>
+ <li><tt>06.02.2008 GCC: remove all references to <iostream.h> and
+use <iostream> instead.</iostream></iostream.h></tt></li>
+ <li><tt>06.02.2008 GCC: support for gcc 4.2.</tt></li>
+ <li><tt>06.02.2008 GUI: fix typo in bin.tcl menus.</tt></li>
+ <li><tt>06.03.2008 FITSY++: changes to processing the header where
+ds9 will now work with illegal fits files that contains NULLs instead
+of SPACEs.</tt></li>
+ <li><tt>06.03.2008 RICE: implemented compatibility with cfitsio
+3.08.</tt></li>
+ <li><tt>06.04.2008 GZIP: implemented compatibility with cfitsio
+3.08.</tt></li>
+ <li><tt>06.04.2008 HCOMPRESS: implemented compatibility with
+cfitsio 3.08.</tt></li>
+ <li><tt>06.05.2008 IIS: disable scale menu with iis frame (fixed
+from version 5.2).</tt></li>
+ <li><tt>06.05.2008 REGIONS: fixed FITS regions polygon support. Now
+determine how many points based on the repeat value of the column, but
+check for .</tt></li>
+ <li><tt>06.06.2008 FITS: for saveimage fits, if non-linear WCS,
+don't attempt to save WCS.</tt></li>
+ <li><tt>06.06.2008 BLINK: add xpa/command line option -blink
+interval.</tt></li>
+ <li><tt>06.06.2008 REGIONS: add for DASH property.</tt></li>
+ <li><tt>07.11.2008 REGIONS: fixed a problem with the 'delete all'
+button.</tt></li>
+ <li><tt>07.16.2008 XPA: if CHECKDNS fails, set XPA_METHOD to local
+and initialize.</tt></li>
+ <li><tt>07.21.2008 PROJECTION: minor change to ensure that we step
+over the grid in 1 pixel values.</tt></li>
+ <li><tt>07.24.2008 IIS: add support for all 16 IIS colors.</tt></li>
+ <li><tt>07.25.2008 BINNING: fixed a problem with smooth and 3d
+binning.</tt></li>
+ <li><tt>08.04.2008 FITSY++: fixed a problem with BSCALE/BZERO and
+float/double data types.</tt></li>
+ <li><tt>08.11.2008 CATALOGS: fixed a problem with catalogs retrieved
+via a cds search. The id returned would fail during evaluation in
+creating a valid header.</tt></li>
+ <li><tt>08.11.2008 CATALOGS: add CMC to catalog menu.</tt></li>
+ <li><tt>08.11.2008 GUI: fixed a problem with the initial directory
+for the standard dialog when loading from the command line.</tt></li>
+ <li><tt>08.14.2008 VECTOR: vast improvements in optimization.</tt></li>
+ <li><tt>08.19.2008 GUI: catch a failure to initialize window system
+(a problem with X11) and exit nice.</tt></li>
+ <li><tt>08.19.2008 MACOSX: fixed the window tab problem for Aqua
+port.</tt></li>
+ <li><tt>08.19.2008 MACOSX: fixed canvas background issues.</tt></li>
+ <li><tt>08.20.2008 GUI: Add buttons to vertical layout.</tt></li>
+ <li><tt>09.10.2008 XPA: fixed a problem with blink interval &lt; 1.</tt></li>
+ <li><tt>09.12.2008 PREFS: add 'Preserve During Load' for scale,
+pan, and regions.</tt></li>
+ <li><tt>09.12.2008 CONTOUR: add dash line option.</tt></li>
+ <li><tt>09.17.2008 PANNER: check to see if we are at pole.</tt></li>
+ <li><tt>09.17.2008 CATALOGS: add copy from row(s).</tt></li>
+ <li><tt>09.17.2008 REGIONS: look for new FITS POLYGON termination
+conditions</tt></li>
+ <li><tt>09.22.2008 COLORBAR: removed truecolor colorbar options.
+Always paint the entire image.</tt></li>
+ <li><tt>09.25.2008 BINNING: automatically look for x,y then ra,dec,
+before settling for columns 1 and 2.</tt></li>
+ <li><tt>09.25.2008 IMEXAM: added 'any' event (returns with a mouse
+event or key event).</tt></li>
+ <li><tt>10.02.2008 CATALOGS: fixed a problem with size format for
+SIMBAD and NED. Degrees and ArcSecs were incorrectly calculated.</tt></li>
+ <li><tt>10.03.2008 CATALOGS: Add support for CXC catalog.</tt></li>
+ <li><tt>10.08.2008 MACOSX: add MacOSX X11 10.5 firewall port.</tt></li>
+ <li><tt>10.10.2008 FOV: add sao/binospec.</tt></li>
+ <li><tt><b>10.15.2008 RELEASE version 5.3</b></tt></li>
+ <li><tt>10.17.2008 CATALOGS: removed support for Chandra Source
+Catalog at request of Ian Evans of CXC.</tt></li>
+ <li><tt>10.22.2008 MASKS: add support for mask transparency.</tt></li>
+ <li><tt>10.24.2008 MASKS: add new mask properties.</tt></li>
+ <li><tt>10.28.2008 GRID: add grid title support.</tt></li>
+ <li><tt><b>10.31.2008 RELEASE version 5.4</b></tt></li>
+ <li><tt>10.31.2008 GRID: full grid support for command line and xpa.</tt></li>
+ <li><tt>11.04.2008 FITSY: fixed a problem with header keywords that
+start with 'END'.</tt></li>
+ <li><tt>11.13.2008 FITSY: fixed a problem when there was a failure
+to correctly parse iraf or wcs keywords.</tt></li>
+ <li><tt>12.02.2008 FITS: for saveimage fits, fixed a problem with
+LTMV,DTMV, and WCS coordinates. They were off by 1 pixel in x.</tt></li>
+ <li><tt>12.02.2008 GUI: fixed a problem with panning via click and
+drag.</tt></li>
+ <li><tt>12.04.2008 MPEG: changed makefiles to compile tkmpeg code
+without optiminzation. -O created invalid code for MacOSX (and possible
+others)</tt></li>
+ <li><tt>12.04.2008 REGIONS: fixed a problem when creating a default
+panda region via a mouse click.</tt></li>
+ <li><tt>12.05.2008 POSTSCRIPT: fixed a problem with printing frames
+that have no image loaded.</tt></li>
+ <li><tt>12.05.2008 CATALOGS: fixed a problem with using the arrow
+keys in catalog dialogs.</tt></li>
+ <li><tt>12.10.2008 REGIONS: fixed a problem elongated rotated
+ellipses.</tt></li>
+ <li><tt>12.10.2008 MACOSX: fixed several problems with processing
+AppleEvents OpenDocument and PrintDocument. DS9 now supports opendoc
+and printdoc while currently running.</tt></li>
+ <li><tt>12.12.2008 IIS: re-enabled mouse events while in cursor
+mode.</tt></li>
+ <li><tt>12.12.2008 IIS: trap arrow keys while in cursor mode, do
+not pass to IRAF, instead warp cursor.</tt></li>
+ <li><tt>12.15.2008 SMOOTH: ignore NAN in smoothing convolution.</tt></li>
+ <li><tt>12.16.2008 GUI: fixed a problem with 'get fits size' to
+make it behave in the regions of poles.</tt></li>
+ <li><tt>12.29.2008 IIS: try to decode OBJECT from iisMessageCmd.</tt></li>
+ <li><tt>12.29.2008 IIS: if frame is in cursor mode (via the imexam
+task), RESET FRAME, will attempt to clean up.</tt></li>
+ <li><tt>01.05.2009 FUNTOOLS: update to version 1.4.2.2</tt></li>
+ <li><tt>01.05.2009 WCSSUBS: update to version 3.7.6</tt></li>
+ <li><tt>01.05.2009 GUI: add support for loading FITS multiple
+extension as multiple frames.</tt></li>
+ <li><tt>01.05.2009 EXAMINE: fixed many problems. Will work not work
+with data loaded via stdin or xpa fits.</tt></li>
+ <li><tt>01.15.2009 SMOOOTH: fixed a problem with BZERO and BSCALE.
+These keywords are reset to default values if present in the smoothed
+image, since the scaling has already been applied.</tt></li>
+ <li><tt>01.15.2009 FILTER: fixed an issue when unable to build a
+valid filter. Previously, it would exit() the program. Now, it will
+issue an error message and continue.</tt></li>
+ <li><tt>01.16.2009 MACOSX: if using the X11 port of MacOSX,
+increase the size of the window to make room for the size tab, similar
+for Aqua.</tt></li>
+ <li><tt>01.16.2009 SAVEAS: PNG now saves without GAMMA.</tt></li>
+ <li><tt>01.20.2009 GUI: Rearrange Frame menu and Region menu. They
+had grown too long and some window managers were having difficulties.</tt></li>
+ <li><tt>01.21.2009 REGIONS: fixed a problem rendering Bezier curves.</tt></li>
+ <li><tt><b>01.23.2009 RELEASE version 5.5</b></tt></li>
+ <li><tt><b>01.28.2009 RELEASE version 5.5.1</b></tt></li>
+ <li><tt>01.28.2009 GUI: fixed a problem in that the last file name
+loaded is incorrectly set if there are command line options that follow
+the file name.</tt></li>
+ <li><tt>02.02.2009 CATALOGS: updated urls for cds mirrors.</tt></li>
+ <li><tt>02.03.2009 CATALOGS: cleaned up tsv code. Will read comma
+and tab separted values, and will write tab separated values. Assumes
+first row is cols header unless first and second cols are numbers, then
+assumes ra, dec, in fk5 degrees.</tt></li>
+ <li><tt>02.04.2009 PSEUDOCOLOR: fixed a problem with the frame not
+remembering its current colormap bias and contrast setting when
+toggling between frames.</tt></li>
+ <li><tt>02.10.2009 BLT: fixed a problem zoombox under Aqua. XOR
+draws are now disabled.</tt></li>
+ <li><tt>02.11.2009 CIAO: The ciao regions parser will now accept
+compound region descriptions.</tt></li>
+ <li><tt>02.12.2009 CONTOURS: fixed a problem with command line/xpa
+dashed line parameter. Processing the -contour command is now a lot more robust in determining missing parameters.</tt></li>
+ <li><tt>02.16.2009 HISTOGRAM EQU: fixed a problem with clipping low = clipping high (usually as a result of ZSCALE).</tt></li>
+ <li><tt>02.19.2009 FITSY++: fixed a problem specifying an extension number of 0 with a multiple extension file with no primary image. It now properly fails to load.</tt></li>
+ <li><tt>02.19.2009 GUI: FITS multiple extension multiple frame will now load a primary image if present.</tt></li>
+ <li><tt>02.19.2009 GUI: compressed FITS multiple extension multiple frame will now load properly.</tt></li>
+ <li><tt>02.19.2009 GUI: FITS multiple extension multiple frame will ignore any bin table extensions.</tt></li>
+ <li><tt>02.19.2009 BLT: add support for MacOSX native printing.</tt></li>
+ <li><tt>02.19.2009 PLOT: native printing now fully supported for MacOSX and Windows.</tt></li>
+ <li><tt>02.24.2009 SAMP: add support for VO Simple Application Messaging Protocol (SAMP). Will process image.load.fits and table.load.votable events.</tt></li>
+ <li><tt>02.25.2009 FITSY++: fixed a problem with saving a slice of a cube. The header had invalid keywords.</tt></li>
+ <li><tt>02.27.2009 CATALOGS: support VOTable format.</tt></li>
+ <li><tt>03.02.2009 MacOSX: support for the MacOSX X11 Leopard 10.5 non-firewall version has been discontinued.</tt></li>
+ <li><tt>03.02.2009 MacOSX: fixed a problem with plot y axis titles offset.</tt></li>
+ <li><tt>03.02.2009 MacOSX: fixed a problem fork/exec and version 10.5 New version of tclMacNotify.c now used.</tt></li>
+ <li><tt>03.09.2009 FUNTOOLS: updated to version 1.4.3.</tt></li>
+ <li><tt>03.10.2009 REGIONS: fixed a problem with listing irregular panda, ellipse panda, and box panda in ds9/funtools format. The conjunction has been removed.</tt></li>
+ <li><tt>03.12.2009 GUI: If in tile mode, with only one frame, and tile mode is set to manual, tile anyway (don't drop into single mode).</tt></li>
+ <li><tt>03.12.2009 CATALOGS: speed up rendering of catalogs for simple symbol filters.</tt></li>
+ <li><tt>03.12.2009 REGIONS: support wildcards in filename.</tt></li>
+ <li><tt>03.12.2009 REGIONS: add support for load into all frames.</tt></li>
+ <li><tt>03.17.2009 GUI: Name server support now utilizies CDS Sesame.</tt></li>
+ <li><tt>03.17.2009 SKYVIEW: fixed a problem processing the survey query.</tt></li>
+ <li><tt>03.18.2009 HV: add support for cookies.</tt></li>
+ <li><tt>03.18.2009 ARCHIVES: add support for NVO Montage.</tt></li>
+ <li><tt>03.18.2009 REGIONS: fixed a problem calculating the WCS angle of a flipped WCS.</tt></li>
+ <li><tt>03.18.2009 HV: add support for mime-type text/xml for votable.</tt></li>
+ <li><tt>03.19.2009 CATALOGS: CDS now uses VOTABLE.</tt></li>
+ <li><tt>03.24.2009 CATALOGS: SIMBAD now uses VOTABLE.</tt></li>
+ <li><tt>03.24.2009 CATALOGS: NED now uses VOTABLE.</tt></li>
+ <li><tt>03.24.2009 CATALOGS: add preferences to download in VOTABLE if available.</tt></li>
+ <li><tt>04.01.2009 GUI: when you delete a frame, the current frame is reset to the previous frame, not the first frame.</tt></li>
+ <li><tt>04.06.2009 RULER: use preferences default distance system.</tt></li>
+ <li><tt>04.06.2009 GUI: fixed a problem with open other url.</tt></li>
+ <li><tt>04.09.2009 PROJECTION: properly calculate width when rebinning.</tt></li>
+ <li><tt><b>04.15.2009 RELEASE version 5.6</b></tt></li>
+ <li><tt>04.16.2009 REGIONS: fixed a rather nasty bug which caused a segv when switching between modes after copy a region from a frame.</tt></li>
+ <li><tt><b>04.16.2009 RELEASE version 5.6.1</b></tt></li>
+ <li><tt>04.17.2009 SAMP: use xmlrpc url method in POST header.</tt></li>
+ <li><tt>04.17.2009 CATALOGS: fixed a typo in the default SDSSR5 query.</tt></li>
+ <li><tt>04.20.2009 HV: fixed a problem with parsing query linked to a button.</tt></li>
+ <li><tt><b>04.20.2009 RELEASE version 5.6.2</b></tt></li>
+ <li><tt>04.22.2009 PREFS: updated the default name server menu.</tt></li>
+ <li><tt>04.24.2009 FIRST: removed a debug statement which was left in.</tt></li>
+ <li><tt>04.27.2009 REGIONS: fixed a problem loading a fits file with specified extension.</tt></li>
+ <li><tt>04.28.2009 HV: fixed again a problem with parsing url within a link with a query which contains a '?'.</tt></li>
+ <li><tt><b>04.30.2009 RELEASE version 5.6.3</b></tt></li>
+ <li><tt>05.01.2009 REGIONS: fixed a problem creating a text region with arcsec or arcmin char.</tt></li>
+ <li><tt>05.01.2009 NAMESRVR: fixed a problem with simbad cfa sexagesimal.</tt></li>
+ <li><tt>05.01.2009 CATALOGS: fixed a problem with quoting a VOTABLE FIELD DESCRIPTION string.</tt></li>
+ <li><tt>05.01.2009 CATALOGS: add column parameters in header output.</tt></li>
+ <li><tt>05.04.2009 SAMP: fixed a problem with select row list.</tt></li>
+ <li><tt>05.04.2009 REGIONS: add list to xpa and command line regions option.</tt></li>
+ <li><tt>05.21.2009 NVSS: add NVSS Image server back.</tt></li>
+ <li><tt>05.26.2009 NAMESRVR: set default name server to cds.</tt></li>
+ <li><tt>05.26.2009 CATALOGS: set default catalog erver to cds.</tt></li>
+ <li><tt>05.26.2009 SAMP: fixed a proble with quoting filenames and urls for xml.</tt></li>
+ <li><tt>05.26.2009 CATALOGS: will now try to determine the RA and DEC cols via the UCD if available.</tt></li>
+ <li><tt>05.26.2009 GUI: fixed a problem with standard dialog boxes and MacOSX Aqua and Windows. The dialogbox would sometimes fail to rise to top.</tt></li>
+ <li><tt>05.27.2009 GUI: WCS menu correctly updates print coordinate parameters.</tt></li>
+ <li><tt>05.27.2009 REGIONS: autocentroid now works for move, edit, and rotate.</tt></li>
+ <li><tt>05.27.2009 CATALOGS: CDS Search now retrieves search options from cds.</tt></li>
+ <li><tt>05.27.2009 CATALOGS: fixed a problem with FILTER and VOTable. The votable cols params were not being properly transfered to the new filtered table.</tt></li>
+ <li><tt>06.10.2009 REGIONS: DS9 regions syntax now supported in VOTable format.</tt></li>
+ <li><tt>06.11.2009 CATALOGS: "No Items Found" is now displayed on status line and not as a model dialog.</tt></li>
+ <li><tt>06.11.2009 REGIONS: fixed problem with dashed lines with rotated ellipses.</tt></li>
+ <li><tt>06.11.2009 GUI: fixed problem with standard file dialog boxes. Now, command line options and xpa command DOES NOT CHANGE the current directory. Only the use of the dialog box will reset the current directory.</tt></li>
+ <li><tt>06.11.2009 SAMP: don't send empty catalogs.</tt></li>
+ <li><tt>06.11.2009 CATALOGS: don't write empty catalogs.</tt></li>
+ <li><tt>06.11.2009 FILTER: fixed a problem with parsing filters on the command line that contain quotes.</tt></li>
+ <li><tt>06.16.2009 SAMP: the samp port number is now automatically determined at connection time.</tt></li>
+ <li><tt>06.17.2009 CATALOGS: for VOTables, change id to ID.</tt></li>
+ <li><tt>06.17.2009 CATALOGS: Add ID param to CXC catalog.</tt></li>
+ <li><tt>06.17.2009 SAMP: send unique catalog table-id for each catalog so tha multiple copies of ds9 with the same catalog loaded don't walk all over each other when connected to a hub.</tt></li>
+ <li><tt>06.18.2009 REGIONS: Update info box, graphs, and pixel table when draging in pointer and catalog mode.</tt></li>
+ <li><tt>06.18.2009 GUI: clean up code which enables/disables WCS menus based on current frame.</tt></li>
+ <li><tt>06.19.2009 HV: add support for arrow keys and mouse wheel.</tt></li>
+ <li><tt>06.19.2009 HV: add support for copy key shortcut.</tt></li>
+ <li><tt>06.19.2009 HV: add support for Return key shortcut for Submit.</tt></li>
+ <li><tt>06.25.2009 GUI: update crosshair, infobox, pixeltable when changing current slice in crosshair mode.</tt></li>
+ <li><tt>06.25.2009 REGIONS: fixed a problem with create/load/save regions with mosaic. The WCS of the first mosaic segment loaded is used for all regions.</tt></li>
+ <li><tt>06.30.2009 REGIONS: removed listwcs option for ds9 format.</tt></li>
+ <li><tt>06.30.2009 IIS: disabled annoying 'port/addr already in use' error message.</tt></li>
+ <li><tt>07.06.2009 BINNING: add update button to bin dialog.</tt></li>
+ <li><tt>07.06.2009 HV: add enhancements to allow complete control over a web browser window.</tt></li>
+ <li><tt>07.06.2009 VO: add enhancements to allow complete control over the vo dialog.</tt></li>
+ <li><tt>07.09.2009 XPA: 'page setup' has been renamed pagesetup.</tt></li>
+ <li><tt>07.15.2009 HV: support for sync http added.</tt></li>
+ <li><tt>07.15.2009 VO: support for sync http added.</tt></li>
+ <li><tt>07.15.2009 ANALYSIS: support for sync http added.</tt></li>
+ <li><tt>07.15.2009 ANALYSIS: analysis tasks invoked via xpa or command line are now run in blocking (sync) mode.</tt></li>
+ <li><tt>07.16.2009 XPA: added optional param to xpaget array to specify the endianness.</tt></li>
+ <li><tt>08.05.2009 XPA: add sleep command.</tt></li>
+ <li><tt>08.05.2009 GUI: add sleep command line option.</tt></li>
+ <li><tt>08.10.2009 GUI: fixed command line option commands.</tt></li>
+ <li><tt>08.10.2009 CATALOGS: for CDS catalogs, ignore the UCD at first and look for _RAJ2000 and _DEJ2000, then the UCD, then a list of common names.</tt></li>
+ <li><tt>08.11.2009 GUI: update Magnifier in Pan mode and key arrows.</tt></li>
+ <li><tt>08.12.2009 WINDOWS: Add support for wildcard filename expansion if invoked from DOS shell.</tt></li>
+ <li><tt>08.12.2009 REGIONS: Add support for load template at ra dec skyframe.</tt></li>
+ <li><tt>08.20.2009 MOSAIC: default for loading mosaics is now WCS not IRAF.</tt></li>
+ <li><tt>08.25.2009 SAMP: implemented full XPA capabilities via SAMP.</tt></li>
+ <li><tt>08.25.2009 I18N: make changes to fitsy++ lexer to allow non-single byte chars in filenames and paths.</tt></li>
+ <li><tt>08.26.2009 SAMP: fixed a problem with parsing the hub.xmlrup.url.</tt></li>
+ <li><tt>08.26.2009 XPA: update to version 2.1.10.</tt></li>
+ <li><tt>08.27.2009 FUNTOOLS: update to version 1.4.4.</tt></li>
+ <li><tt>09.01.2009 SAMP: fixed a problem with extra key value pairs in message.</tt></li>
+ <li><tt>09.01.2009 CATALOGS: add default samp command.</tt></li>
+ <li><tt>09.01.2009 CATALOGS: removed modal dialog info box calls. Messages are now updated in the status windows.</tt></li>
+ <li><tt>09.01.2009 GUI: added new level of menu updates that are only executed when a frame is create or deleted and not everytime there is a change of state.</tt></li>
+ <li><tt>09.03.2009 WINDOWS: disable menu updates during blinking because windows redraws the menu window each time the configuration is changed.</tt></li>
+ <li><tt>09.03.2009 SOLARIS: removed support for Solaris<9.0. DS9 now requires libxml2 be supported by the OS.</tt></li>
+ <li><tt>09.03.2009 GUI: added signal handling for non-windows. We now trap SIGINT and clean up before exiting.</tt></li>
+ <li><tt>09.08.2009 I18N: fixed a problem with spaces in filename.</tt></li>
+ <li><tt>09.08.2009 SAMP: fixed a problem using a hub that uses the Apache xmlrpc library.</tt></li>
+ <li><tt>09.10.2009 SAMP: fixed a problem with invalid ds9.get commands.</tt></li>
+ <li><tt>09.10.2009 GUI: cmap xpa, samp, and command line option is now much more tolerant to capitalization and spellings.</tt></li>
+ <li><tt>09.10.2009 WINDOWS: tcc is now used for the bin filter compiler. cygwin is no longer required.</tt></li>
+ <li><tt>09.21.2009 MACOSX: ports to Tiger (10.4), Leopard (10.5), and Snow Leopard (10.6) are now built under 10.6</tt></li>
+ <li><tt>09.22.2009 MACOSX: fixed a problem with snowleopard. For 32bit visuals, the alpha channel is set to 0xff, not 0.</tt></li>
+ <li><tt>09.28.2009 XPA: add XPA connect/disconnect menu options.</tt></li>
+ <li><tt>09.29.2009 RGB: fixed a problem with displaying images with NAN.</tt></li>
+ <li><tt>10.02.2009 MACOSX: pcc is now used for the bin filter compiler of i386 platforms if XCode is not installed./tt></li>
+ <li><tt>10.09.2009 ANALYSIS: fixed a problem with analysis plot command to maintain backward compatibility./tt></li>
+ <li><tt>10.12.2009 SMOOTH: fixed a problem that smooth is reset when no image is loaded. /tt></li>
+ <li><tt><b>10.15.2009 RELEASE version 5.7</b></tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r6.0.html b/ds9/doc/release/r6.0.html
new file mode 100644
index 0000000..3d8fe26
--- /dev/null
+++ b/ds9/doc/release/r6.0.html
@@ -0,0 +1,175 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 6 Release Notes</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+<h3> <img alt="" src="../sun.gif" align="middle" height="98"
+ width="100">
+SAOImage DS9 Version 6 Release Notes</h3>
+<ol>
+ <ol>
+ <li><tt>10.20.2009 XPA: moved processing xpa command line options to first pass, and init xpa earlier in startup, so that vo and web click can be processed along with regular command line options. </tt></li>
+ <li><tt>10.24.2009 UPDATE: fixed a problem with trying to provide support for backward compatibility.</tt></li>
+ <li><tt>10.24.2009 IMGSVR: fixed a problem with trying to provide support for backward compatibility</tt></li>
+ <li><tt>10.24.2009 GUI: sleep command arg is now optional</tt></li>
+ <li><tt>10.24.2009 MOSAIC: IRAF mosaics are now layed out based on the first segment load, like WCS mosaics</tt></li>
+ <li><tt>10.27.2009 GUI: fixed a problem if you delete all frames, some of the load commands (such as -rgbcube) are not executed until there is a new frame. Now, if there are no frames, the load command will create a new frame if needed</tt></li>
+ <li><tt>10.28.2009 REGION: Corrected a problem with creating templates from a VAR. Uncommented old syntax which has been superceeded</tt></li>
+ <li><tt>11.02.2009 GRID: fixed a problem with 'grid numlab gap2'</tt></li>
+ <li><tt>11.02.2009 AST: updated to version 5.3-1
+ <li><tt>11.05.2009 TILE: corrected documentation for '-tile grid layout', should be column #, row #</tt></li>
+ <li><tt>11.05.2009 DATACUBE: fixed a problem with '-wcs replace|reset|append'. The result WCS is now applied to all slices</tt></li>
+ <li><tt>11.05.2009 XPA: fixed a problem with 'xpaset wcs replace foo.wcs'</tt></li>
+ <li><tt>11.13.2009 RICE: updated to cfitsio 3210/tt></li>
+ <li><tt>11.16.2009 COMPRESS: fixed a problem with compression that extends over a page boundry of 1Gb</tt></li>
+ <li><tt>11.30.2009 GRID: fixed a problem with exterior numerics and zoomed images</tt></li>
+ <li><tt>11.30.2009 HELP: combine FAQ and ISSUES pages</tt></li>
+ <li><tt>12.04.2009 RGB: aux contour overlays are now displayed on a per channel basis</tt></li>
+ <li><tt>12.07.2009 RGB: rgb images with data cubes can now set the current slice on a per channel basis</tt></li>
+ <li><tt>12.07.2009 VO: fixed a problem with xpa keep-alive</tt></li>
+ <li><tt>12.10.2009 TK: fixed a problem MacOSX X11 standard file dialog boxes. Borrowed code from tk8.5 to correct the problem when events are added to X11</tt></li>
+ <li><tt>12.10.2009 GUI: fixed a problem with modal dialogs when the user closed the window via the window manager and not the OK/CANCEL button</tt></li>
+ <li><tt>12.10.2009 XPA: update to version 2.1.11</tt></li>
+ <li><tt>12.14.2009 RGB: fixed a problem with a incorrect WCS compass in the panner image</tt></li>
+ <li><tt>12.15.2009 WCS: Documented the old ALIGN command and updated for XPA and SAMP</tt></li>
+ <li><tt>12.15.2009 GUI: Values accepted for SKYFORMAT expanded to 'deg', 'degree', and 'degrees' for command line options, XPA, and SAMP</tt></li>
+ <li><tt>12.17.2009 WCS: added code to test for bad WCS alignment issues (mainly from CAR projection, or pole problems)</tt></li>
+ <li><tt>12.17.2009 WCS: added code for WCS alignment for CAR. If CAR, getWCScrpix() is taken from center of image, and not from CRPIX keywords</tt></li>
+ <li><tt>12.18.2009 CATALOG: added USNO UCAC3 to the Optical list</tt></li>
+ <li><tt>12.24.2009 DATACUBE: DS9 now supports FITS images up to 10 dimensions. Happy Holidays!</tt></li>
+ <li><tt>12.28.2009 ANALYSIS: fixed problems with $data and $url and spaces in the tmp directory path name</tt></li>
+ <li><tt>12.28.2009 COMM: fixed problems with spaces in file names received as argumetns via SAMP and http</tt></li>
+ <li><tt>12.29.2009 REGION: fixed problems with XPA/SAMP and -format/-system/-sky options</tt></li>
+ <li><tt>12.29.2009 GUI: fixed a problem with hiding the current frame</tt></li>
+ <li><tt>12.30.2009 HV: at EXIT, close all opened HV windows so that tmp files may be deleted</tt></li>
+ <li><tt>12.30.2009 HV: fixed a problem for MIME type 'multipart/mixed', a tmp file was not deleted</tt></li>
+ <li><tt>12.30.2009 HV: fixed a problem for MIME type 'text/plain', a tmp file was not deleted</tt></li>
+ <li><tt>12.30.2009 ANALYSIS: add $filedialog(open) and $filedialog(save) macros</tt></li>
+ <li><tt>12.30.2009 GUI: allow filenames starting with a '-'</tt></li>
+ <li><tt>01.07.2009 I18N: for X11 port, look for LC_MESSAGES, LC_ALL, LANG env vars to set langage in that order</tt></li>
+ <li><tt>01.07.2009 I18N: update Japanese language translation</tt></li>
+ <li><tt>01.07.2009 CONTOUR: fix muliple problems with command line contour options. Each frame will now remember contour params between frames</tt></li>
+ <li><tt>01.08.2009 ANALYSIS: minor changes in output of get analysis commands. Now include parameters for web and bind commands</tt></li>
+ <li><tt>01.11.2009 COLORBAR: fixed a problem with the orientation of the numerics for vertical colorbar. This problem was introduced with AST-5.3</tt></li>
+ <li><tt>01.11.2009 RGB: fixed a memory leak for RGB frames</tt></li>
+ <li><tt>01.11.2009 I18N: update Japanese language translation</tt></li>
+ <li><tt>01.11.2009 MACOSX: fixed a problem with non-native standard file dialog boxes and error messages</tt></li>
+ <li><tt>01.12.2009 AST: fixed a memory leak with colorbar grid.</tt></li>
+ <li><tt>01.13.2009 PLOT: fixed a rare problem when the user closes a plot while in the middle of a zoom.</tt></li>
+ <li><tt>01.13.2009 IRAF: fixed a problem for mosaic iraf images are loaded and the bounding box is incorrectly calculated.</tt></li>
+ <li><tt><b>01.15.2010 RELEASE version 6.0</b></tt></li>
+ <li><tt>01.27.2010 XPA: fixed a problem with reporting errors during an XPA operation. The correct error message is now passed to XPA.</tt></li>
+ <li><tt>01.27.2010 SAMP: fixed a problem with reporting errors during an SAMP operation. The correct error message is now passed to SAMP.</tt></li>
+ <li><tt>01.27.2010 REGION: fixed a problem with catch and XPA/SAMP. Errors are now reset when needed so as not to invoke an XPA/SAMP ERROR message.</tt></li>
+ <li><tt>01.27.2010 XPA: update to version 2.1.12</tt></li>
+ <li><tt>02.02.2010 CONTOURS: fixed a problem with manually entered contours values.</tt></li>
+ <li><tt>02.12.2010 COLORBAR: add numerics equal distance option.</tt></li>
+ <li><tt>02.12.2010 COLORBAR: add colorbar size option.</tt></li>
+ <li><tt>02.12.2010 COLORBAR: move colorbar parameters from view menu to colorbar menu.</tt></li>
+ <li><tt>02.18.2010 MACOSX: fixed a problem where pcc was always being installed. Now, first look for FILTER_CC (valid for X11 users only). Next, see if /usr/bin/gcc exists. Finally, install pcc if needed, and set to use it.</tt></li>
+ <li><tt>02.25.2010 SCALE: fixed numerous problems with LOG and POW scales. Previously, the exp value of the log ratio was based on the dynamic range of the data. It is now specified by the user. This solves a number of issues with data which contains negative values. (see new documenation on scale equations).</tt></li>
+ <li><tt>02.25.2010 CATALOG: CSC is now loaded as a VOTABLE by default.</tt></li>
+ <li><tt>03.02.2010 CATALOG: add support for SkyBot catalog server.</tt></li>
+ <li><tt>03.03.2010 MACOSX: printing, reduce image by 5% so colorbar end tick numerics are not cutoff.</tt></li>
+ <li><tt>03.03.2010 WINDOWS: printing, reduce image by 5% so colorbar end tick numerics are not cutoff.</tt></li>
+ <li><tt>03.03.2010 HV: fixed a problem with MouseWheel scrolling under X11.</tt></li>
+ <li><tt>03.04.2010 ZOOM: added support for mouse wheel zoom.</tt></li>
+ <li><tt>03.04.2010 HV: added support for Find and FindNext.</tt></li>
+ <li><tt>03.10.2010 POSTSCRIPT: if colorbar and colorbar numerics are visible, reduce image by 5% so colorbar end tick numerics are not cutoff.</tt></li>
+ <li><tt>03.10.2010 PRINT: add psprint xpa/command/samp command for postscript printing on MacOSX and Windows.</tt></li>
+ <li><tt>03.10.2010 GRID: add support for custom numeric formats.</tt></li>
+ <li><tt>03.17.2010 BIN: add support for Match Bin.</tt></li>
+ <li><tt>03.23.2010 FITS: add a check tor binary tables with no rows or cols.</tt></li>
+ <li><tt>03.24.2010 WINDOWS: fixed a problem with native printing and bitmaps that were not aligned upon a word boundary.</tt></li>
+ <li><tt>03.24.2010 WINDOWS: fixed a problem with rendering circle point and box circle point.</tt></li>
+ <li><tt>03.26.2010 HV: fixed a rather nasty bug. If a HV window is open when prefs are saved, the next time ds9 is started, upon exist it tried to close an non-existent window, and went into a loop.</tt></li>
+ <li><tt>03.29.2010 SAMP: add support for table.load.fits events.</tt></li>
+ <li><tt>04.13.2010 BACKUP: add support for backup and restore.</tt></li>
+ <li><tt>04.14.2010 GUI: ensure all temp files in /tmp have unique names which will not conflict with other programs.</tt></li>
+ <li><tt>04.14.2010 RGB: corrected inconsistant behavior. The creation of a RGB frame will not alter the single/tile setting.</tt></li>
+ <li><tt>04.16.2010 TK: fixed a problem with some tk lib scripts not sourced at startup and if -cd is executed, ds9 is unable to locate the scripts.</tt></li>
+ <li><tt>04.16.2010 CIAO: removed any conjuction operators (which are not supported).</tt></li>
+ <li><tt>04.16.2010 COLORBAR: fixed a rather nasty memory bug which was invoked when the colorbar was re-configured.</tt></li>
+ <li><tt>04.23.2010 BACKUP: backup save sets can be saved into on a repeat basis.</tt></li>
+ <li><tt>04.26.2010 SCALE: fixed a problem with segv and Scale Dialog box.</tt></li>
+ <li><tt>04.26.2010 GUI: fixed a problem matching frames while in single mode.</tt></li>
+ <li><tt>04.29.2010 GUI: add cycle windows key shortcut.</tt></li>
+ <li><tt>05.04.2010 WINDOWS: new windows installation procedure.</tt></li>
+ <li><tt>05.06.2010 CATALOG: add IAU location code in preferences (for Skybot).</tt></li>
+ <li><tt>05.10.2010 REGION: fixed a problem with projection region when one or both end points are off the image. All gaps (mosaic) or off image (non-mosaic) have a value of 0 and NaNs are ignored.</tt></li>
+ <li><tt>05.12.2010 VOTable: add support for FIEDref and PARAMref elements.</tt></li>
+ <li><tt><b>05.15.2010 RELEASE version 6.1</b></tt></li>
+ <li><tt>05.18.2010 WINDOWS: change windows installation procedure back to allow user to specify destination directory.</tt></li>
+ <li><tt>05.18.2010 SAMP: fixed an issue with DS9 being confused as to if it is currently connected and the need to shutdown SAMP at exit.</tt></li>
+ <li><tt><b>05.18.2010 RELEASE version 6.1.1</b></tt></li>
+ <li><tt>05.19.2010 BACKUP: fixed several major problems.</tt></li>
+ <li><tt>05.19.2010 PSEUDOCOLOR: fixed a typo.</tt></li>
+ <li><tt><b>05.19.2010 RELEASE version 6.1.2</b></tt></li>
+ <li><tt>05.20.2010 MACOSX: always install pcc if gcc not available. We don't want old versions of pcc around after upgrades of the OS.</tt></li>
+ <li><tt>05.28.2010 PLOT: added statistics window for plots.</tt></li>
+ <li><tt>05.28.2010 PLOT: fixed some problems with menus and clear data.</tt></li>
+ <li><tt>05.28.2010 NAMESERVER: add get option to return coords directly to calling proc.</tt></li>
+ <li><tt>06.17.2010 CHECKDNS: update chechdns to add support for actually connect.</tt></li>
+ <li><tt>06.17.2010 VO: use checkdns to look for active server. If none found, used hard coded list.</tt></li>
+ <li><tt>06.21.2010 ZOOM TO FIT: center image exactly, do not round to nearest whole pixel.</tt></li>
+ <li><tt>06.21.2010 BACKUP: don't save prefs(version) var. We want the current preference file version, not the save set version.</tt></li>
+ <li><tt>06.21.2010 GUI: ds9 will now look for its auxiliary file using the current name of the executable.</tt></li>
+ <li><tt>06.30.2010 WCS: add WCS Edit dialog.</tt></li>
+ <li><tt>07.01.2010 XPA: add frame has command.</tt></li>
+ <li><tt>07.01.2010 SAMP: add frame has command.</tt></li>
+ <li><tt>07.09.2010 SAMP: fixed a problem with updating the connect meun item after a manual disconnect.</tt></li>
+ <li><tt>07.09.2010 SAMP: added support for SAMP_HUB env var.</tt></li>
+ <li><tt>07.13.2010 COLORBAR: fixed a problem with a bad default -size param. This problem only showed up with a pseudocolor8 visual.</tt></li>
+ <li><tt>07.15.2010 GUI: implemented support for internal error message facility. Any fatal internal error event will trigger an GUI error message, hopefully leaving the user the option to save data and to exit gracefully.</tt></li>
+ <li><tt>07.15.2010 GUI: implemented support for trapping the SIGBUS signal and routing it to the internal error message facilty. This usually occurs when a data file has been overwritten or a shared memory segment is no longer available.</tt></li>
+ <li><tt>07.27.2010 PLOT: save font info when save configuration.</tt></li>
+ <li><tt>08.04.2010 REGION: fixed a problem with the close button on EPANDA and BPANDA dialog boxes.</tt></li>
+ <li><tt>08.05.2010 COLORBAR: fixed a problem when the image is all one value.</tt></li>
+ <li><tt>08.10.2010 GUI: add Frame Match Image, Physical, Detector, Amplifier buttons.</tt></li>
+ <li><tt>08.12.2010 MAGNIFIER: add magnifier prefs for XPA, SAMP, and the command line.</tt></li>
+ <li><tt>08.12.2010 MAGNIFIER: add magnifier color option.</tt></li>
+ <li><tt>08.17.2010 GRID: fixed a problem with init colors.</tt></li>
+ <li><tt>08.17.2010 GRID: now supports colors in form #ffffff.</tt></li>
+ <li><tt>08.18.2010 CONTOURS: fixed an issue when loading aux contours which do not end with a linefeed.</tt></li>
+ <li><tt>08.23.2010 COLORBAR: fixed an issue when printing colorbar from the command line. The numerics are now updated before printing.</tt></li>
+ <li><tt>08.23.2010 COLORBAR: fixed an issue when rendering numerics. Numerics are now properly positioned, regardless of colorbar orientation or font.</tt></li>
+ <li><tt>08.25.2010 GRID: fixed a number of issues when rendering grid numerics. Numerics are now properly positioned, regardless of orientation or font.</tt></li>
+ <li><tt>08.27.2010 POSTSCRIPT: fixed a rather nastsy prolblem with the level 2 postscript driver (Ascii85 filter) in which, sometimes, the last line of the image would not be written.</tt></li>
+ <li><tt>08.30.2010 POSTSCRIPT: add new postscript level 3 driver, which uses Flate and Ascii85 filters.</tt></li>
+ <li><tt>08.31.2010 COLORBAR: add support for user specified number of tickmarks to be displayed.</tt></li>
+ <li><tt>08.31.2010 CATALOG: The user can now invoke a blank catalog tool via the command line, xpa, or samp.</tt></li>
+ <li><tt>09.01.2010 TCL/TK: upate to version 8.5.8.</tt></li>
+ <li><tt>09.01.2010 CATALOG: add font properties to display symbol database.</tt></li>
+ <li><tt>09.07.2010 CATALOG: now supports image/physical coordinate systems.</tt></li>
+ <li><tt>09.21.2010 CONTOUR: copy/paste contours no longer requires equatorial sky param.</tt></li>
+ <li><tt>09.21.2010 REGION: copy/paste contours no longer requires equatorial sky param.</tt></li>
+ <li><tt>09.21.2010 SAVEAS: add optional params for jpeg, mpeg and tiff command line options.</tt></li>
+ <li><tt>09.22.2010 FOV: update Chandra Templates.</tt></li>
+ <li><tt>09.22.2010 GUI: add open and close support for XPA, SAMP, and command line, for all dialogs.</tt></li>
+ <li><tt>09.28.2010 COLORBAR: fixed a problem with generating colorbar values when no frame is available.</tt></li>
+ <li><tt>09.30.2010 HV: fixed a problem with multiple cookies, which created a bad header.</tt></li>
+ <li><tt>09.30.2010 VO: fixed a problem with 'xpaget ds9 vo connect'. Now returns only the current connections, not all possible connections.</tt></li>
+ <li><tt>09.30.2010 REGION: added check for no frame and no image loaded for xpaset regions via stdin.</tt></li>
+ <li><tt>09.30.2010 ANALYSIS: add 'task #|name' command.</tt></li>
+ <li><tt>10.01.2010 ANALYSIS: fixed a problem when an analysis file was loaded after an image had been loaded. Them menu was not properly updated to reflect the template for each menu item.</tt></li>
+ <li><tt>10.05.2010 CUBE: fixed a problem in which sometimes changing the current slice whould hang.</tt></li>
+ <li><tt>10.05.2010 CUBE: add support for WCS in cube dialog.</tt></li>
+ <li><tt>10.07.2010 CENTROID: add support centroid params xpa/command line.</tt></li>
+ <li><tt>10.07.2010 CENTROID: fix some problems with an offset of .5 pixels.</tt></li>
+ <li><tt>10.07.2010 SMOOTH: new frames inherit current smooth params.</tt></li>
+ <li><tt>10.07.2010 RGB: fixed a problem when the first image load has a flipped wcs.</tt></li>
+ <li><tt>10.08.2010 REGION: add CIRCLE3D region.</tt></li>
+ <li><tt>10.11.2010 BACKUP: fixed a problem with smoothed images and contours.</tt></li>
+ <li><tt>10.14.2010 HELP: fixed a problem with finding the help files if the CD command has changed the default directory.</tt></li>
+ <li><tt>10.14.2010 XPA: update to version 2.1.13</tt></li>
+ <li><tt><b>10.15.2010 RELEASE version 6.2</b></tt></li>
+ </ol>
+</ol>
+</body>
+</html>
diff --git a/ds9/doc/release/r7.0.html b/ds9/doc/release/r7.0.html
new file mode 100644
index 0000000..2b64ad7
--- /dev/null
+++ b/ds9/doc/release/r7.0.html
@@ -0,0 +1,739 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
+ charset=ISO-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux
+ 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Version 7 Release Notes</title>
+ </head>
+ <body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000"
+ vlink="#551a8b">
+ <h3> <img alt="" src="../sun.gif" align="middle" height="98"
+ width="100"> SAOImage DS9 Version 7 Release Notes</h3>
+ <ol>
+ <ol>
+ <li><tt>10.18.2010 SCALE: fixed a problem preserve Scale at
+ load.</tt></li>
+ <li><tt>10.18.2010 REGION: add group new, group update, and
+ select invert commands.</tt></li>
+ <li><tt>10.20.2010 TCL/TK: update to version 8.5.9.</tt></li>
+ <li><tt>12.01.2010 FOV: Add HEASARC/Suzaku templates for HXD,
+ XIS, and XRS</tt></li>
+ <li><tt>12.03.2010 CATALOG: fixed a problem when dec is
+ specified as -00:xx:xx for CXC, SIMBAD, SKYBOT, and SKYVIEW</tt></li>
+ <li><tt>12.07.2010 BINNING: update WCS keywords for FITS
+ bintables</tt></li>
+ <li><tt>12.10.2010 GUI: fixed a problem with displaying greek
+ letters under linux.</tt></li>
+ <li><tt>12.24.2010 MOSAIC: fixed a problem introduced with
+ verison 6.1 with wcs mosaics when first segment is flipped.</tt></li>
+ <li><tt>12.24.2010 MOSAIC: removed the FLT_EPSILON fudge factors
+ in calculating mosaic segment matrices.</tt></li>
+ <li><tt>01.04.2011 SOLARIS: fixed a major bug with color
+ allocation.</tt></li>
+ <li><tt>02.03.2011 POSTSCRIPT: all ports now generate identical
+ postscript output (with a minor exception with ast grid
+ numerics).</tt></li>
+ <li><tt>02.03.2011 TEXT: selecting a TEXT region now handles
+ rotated text correctly.</tt></li>
+ <li><tt>02.18.2011 GROUPS: fixed a problem with selecting
+ multiple regions.</tt></li>
+ <li><tt>02.21.2011 PIXELTABLE: fixed two problems with xpa and
+ copy commands.</tt></li>
+ <li><tt>02.28.2011 GUI: add theme options.</tt></li>
+ <li><tt>03.01.2011 TKTABLE: updated to version 2.10.</tt></li>
+ <li><tt>03.03.2011 POSTSCRIPT: add new scale factor.</tt></li>
+ <li><tt>03.02.2011 GUI: all dialogs now use the new ttk widgets
+ (with a few exceptions).</tt></li>
+ <li><tt>03.04.2011 PREFS: add -bg and -nan xpa/command line
+ options.</tt></li>
+ <li><tt>03.14.2011 MOSAIC: added patch from Frank Valdes for
+ default DETSIZE values.</tt></li>
+ <li><tt>03.14.2011 CMAP: add load/save xpa/command line options.</tt></li>
+ <li><tt>03.14.2011 BACKUP: fixed a problem with saved cmaps.
+ Pathname is now relative.</tt></li>
+ <li><tt>03.17.2011 TKIMG: updated to version 1.4.</tt></li>
+ <li><tt>03.17.2011 ZLIB: updated to version 1.2.5</tt></li>
+ <li><tt>03.18.2011 WCSSUBS: updated to version 3.8.2</tt></li>
+ <li><tt>04.05.2011 AST: updated to version 5.6-0</tt></li>
+ <li><tt>04.05.2011 WCS: fixed/improved support for TNX, ZPN,
+ ZPX, CAR.</tt></li>
+ <li><tt>04.25.2011 WCS: use AST for most WCS functions.</tt></li>
+ <li><tt>04.25.2011 SCALE: fix Scale Dialog formating issues.</tt></li>
+ <li><tt>04.26.2011 HELP: All user manual images are now local.</tt></li>
+ <li><tt>04.26.2011 CONTOUR: fixed problem with generating
+ contours with BITPIX=-64.</tt></li>
+ <li><tt>04.26.2011 SMOOTH: now generates BITPIX=-64 image.</tt></li>
+ <li><tt>04.27.2011 SCALE: fixed a problem with setting scale
+ user limits and then loading an image.</tt></li>
+ <li><tt>04.28.2011 EXTERNAL FILE: fixed a problem with macro
+ substitution $filename.</tt></li>
+ <li><tt>04.28.2011 FUNTOOLS: updated to version 1.4.5.</tt></li>
+ <li><tt>04.28.2011 XPA: reinstalled version 2.1.13.</tt></li>
+ <li><tt>05.02.2011 WCS: use AST for all FITS WCS projections and
+ DSS. Use WCSSUBS for TNX, ZPX, SIP, SCAMP, WCSDEP.</tt></li>
+ <li><tt>05.06.2011 WCS: Added additional reverse transformation
+ (thanks Ed Los) for calculation of Panner WCS compass.</tt></li>
+ <li><tt>05.09.2011 GRID: add support for non-standard WCSDEP
+ keyword.</tt></li>
+ <li><tt>05.12.2011 IMGSVR: for all image servers
+ (2mass,dss,first,nvss,skyview) if invoked with no argument,
+ yet dialog has a name or coords, automatically retreive the
+ image.</tt></li>
+ <li><tt>05.12.2011 FITS: External File support- fixed a problem
+ where the channel was not closed after the open pipe cmd was
+ invoked and ds9 would run out of resources.</tt></li>
+ <li><tt>05.13.2011 GUI: enhanced/implemented Match/Lock
+ Crosshairs.</tt></li>
+ <li><tt>05.13.2011 GUI: enhanced/implemented Match/Lock Frames.</tt></li>
+ <li><tt>05.13.2011 GUI: Moved Match Scale/Bin/Colorbar to
+ respective menus.</tt></li>
+ <li><tt>05.16.2011 CONTOUR: fixed a problem with NAN in data.</tt></li>
+ <li><tt>05.17.2011 CATALOG: NED fixed a problem with getURL and
+ added support for in/out sys/sky formats.</tt></li>
+ <li><tt>05.19.2011 CATALOG: SIMBAD added support for in/out
+ sys/sky formats.</tt></li>
+ <li><tt>05.19.2011 CATALOG: CDS added support for in/out
+ sys/sky formats.</tt></li>
+ <li><tt>05.20.2011 COMPOSITE: speed up create/delete composite
+ region with +1000 regions.</tt></li>
+ <li><tt>05.20.2011 WCS: implemented preferred WCS for each
+ frame. All WCS functions use the preferred WCS (i.e.
+ copy/paste/load/save regions, contours, align, match, lock,
+ rgb, cube).</tt></li>
+ <li><tt>05.25.2011 WCSSUBS: updated to version 3.8.3.</tt></li>
+ <li><tt>05.25.2011 AST: updated to version 5.7-0.</tt></li>
+ <li><tt>05.26.2011 WCS: use AST for TNX,ZPX,SCAMP.</tt></li>
+ <li><tt>05.27.2011 REGIONS: if unable to copy/cut/paste in WCS,
+ fall back upon PHYSICAL.</tt></li>
+ <li><tt>05.27.2011 REGIONS: if unable to map coordinates
+ correctly, do not a region.</tt></li>
+ <li><tt>06.03.2011 WCS: added support for xLON/xLAT and xyLN
+ xyLT WCS.</tt></li>
+ <li><tt>06.03.2011 REGIONS: added regions properites commands to
+ xpa,samp, and command line.</tt></li>
+ <li><tt>06.10.2011 HEALPIX: added support for generating an
+ image from a healpix table (both binary and ascii).</tt></li>
+ <li><tt>06.13.2011 WCS: use AST for all WCS including TAN-SIP
+ and WCSDEP.</tt></li>
+ <li><tt>06.16.2011 SAMP: added code to clean up better when DS9
+ is unable to parse a SAMP hub file.</tt></li>
+ <li><tt>06.16.2011 REGIONS: be sure to return template id when
+ created.</tt></li>
+ <li><tt>06.16.2011 ANALYSIS: added autoload support for analysis
+ files. DS9 will search a list of known dirs for *.ds9, at
+ which DS9 will load the analysis file, and add the path to
+ env(PATH).</tt></li>
+ <li><tt>06.20.2011 RGB: fixed a problem where the calculated wcs
+ rotation between two frames was reset.</tt></li>
+ <li><tt>06.27.2011 REGIONS: fixed a problem the ds9, ciao, and
+ pros regions parser. The parsers will now accept arcmin and
+ arcsec syntax which includes sciencetific notation.</tt></li>
+ <li><tt>07.07.2011 POSTSCRIPT: generate postscipt now uses
+ generic font names reguardless of platform and window
+ manager.</tt></li>
+ <li><tt>07.08.2011 BIN: split mousewheel preferences between
+ zoom and binning. By default, a bin file is zoom'd in/out
+ with the mouse wheel, unless the binning mouse wheel is
+ enabled via the preferences.</tt></li>
+ <li><tt>07.08.2011 GUI: add preference for standard dialog box
+ for order of file types.</tt></li>
+ <li><tt>07.21.2011 GUI: all non-modal dialogs have Edit menu.</tt></li>
+ <li><tt>07.21.2011 CUBE: add match/lock slice commands.</tt></li>
+ <li><tt>07.22.2011 AST: updated to version 5.7-2</tt></li>
+ <li><tt>07.22.2011 WCS: speedup generating sexagesimal output</tt></li>
+ <li><tt>07.25.2011 BIN: fixed a problem with the update filter
+ function.</tt></li>
+ <li><tt>07.29.2011 DIALOGS: fixed a problem with the motif
+ dialogbox and selection of the initial directory. Set the
+ code to the same as tkfmbox.tcl.</tt></li>
+ <li><tt>08.22.2011 WCS: if CTYPE is not of known type, assume
+ LINEAR.</tt></li>
+ <li><tt>08.26.2011 PANNER: simplified compass prefs.</tt></li>
+ <li><tt>09.19.2011 WCS: only use A_ and B_ keywords if CTYPE is
+ TAN-SIP. Ignore otherwise.</tt></li>
+ <li><tt>09.26.2011 REGIONS: use ::math::fuzzy for comparisons in
+ basepanda, composite, and convert.</tt></li>
+ <li><tt>09.27.2011 WCSSUBS: updated to version 3.8.4.</tt></li>
+ <li><tt>09.30.2011 REGIONS: implemented M_PI_2, M_TWOMPI
+ constants.</tt></li>
+ <li><tt>09.30.2011 REGIONS: use fuzzy math for degToRad() and
+ radToDeg()</tt></li>
+ <li><tt>10.04.2011 WCS: pass any PV and QV keywords if present,
+ regardless of projection.</tt></li>
+ <li><tt>10.05.2011 AST: updated to version 5.7-3</tt></li>
+ <li><tt>10.24.2011 REGIONS: fixed a problem with angs and PANDA,
+ EPANDA, and BPANDA and copy/paste in FK5. This is related to
+ the fuzzy math changes made earlier.</tt></li>
+ <li><tt>10.25.2011 FITSY++: fixed a problem finding cols by name
+ in bin tables. Previous 'R' would be matched by 'RA'.</tt></li>
+ <li><tt>10.28.2011 HV: remove
+ NED,SIMBAD,ADS,TDC,SKYVIEW,W3BROWSE from ANALYSIS:ARCHIVES
+ menu due to lack of support from sites.</tt></li>
+ <li><tt>10.28.2011 COLORMAP: add colormap server to colormap
+ dialog</tt></li>
+ <li><tt>11.01.2011 PRINT COORDINATES: now uses default skyframe
+ and skyformat (as defined by WCS menu).</tt></li>
+ <li><tt>11.04.2011 SCALE: add asinh() and sinh() scales.</tt></li>
+ <li><tt>11.10.2011 CROP: add new crop commands.</tt></li>
+ <li><tt>12.09.2011 AST: updated to version 6.0-1</tt></li>
+ <li><tt>12.09.2011 CROSSHAIR: fixed an issue with coordinates of
+ crosshair were .5 pixel off in Y.</tt></li>
+ <li><tt>12.09.2011 GUI: fixed an issue with centerimage() was .5
+ pixel off in Y.</tt></li>
+ <li><tt>12.15.2011 GRID: fixed an issue with text upside down.</tt></li>
+ <li><tt>01.03.2012 BIN: fixed a problem with depth of a 3d bin'd
+ table.</tt></li>
+ <li><tt>01.03.2012 GRID: DSS and Linear projections use AST.</tt></li>
+ <li><tt>01.17.2012 3D: 3D Frame is now available.</tt></li>
+ <li><tt>01.19.2012 ANALYSIS: added $z macro.</tt></li>
+ <li><tt>01.19.2012 CROP: add [xmin:xmax,ymin:ymax,zmin:zmax]
+ syntax</tt></li>
+ <li><tt>01.19.2012 CROP: check for valid crop with [] syntax.</tt></li>
+ <li><tt>01.23.2012 3D: add current slice highlite.</tt></li>
+ <li><tt>01.23.2012 SAVEIMAGE: fixed a problem with frame
+ highlite during saveimage process.</tt></li>
+ <li><tt>01.23.2012 ANALYSIS: expand $image macro to accept new
+ params: rgb and 3d.</tt></li>
+ <li><tt>01.27.2012 ANALYSIS: expand $filename(full) to return
+ full filename (without cropping or filters parameters).</tt></li>
+ <li><tt>01.27.2012 ANALYSIS: add macro $value.</tt></li>
+ <li><tt>01.27.2012 CROP: fixed a problem when using an image
+ subsection spec for a datacube.</tt></li>
+ <li><tt>01.28.2012 REGIONS: clean up rendering code for
+ X,ps,win32,macosx to reduce un-needed calls to set the
+ graphics context.</tt></li>
+ <li><tt>01.28.2012 CROP: all data cubes can be cropped in 3D.</tt></li>
+ <li><tt>01.28.2012 CROP: cropping in 3D will reset currentSlice
+ if needed.</tt></li>
+ <li><tt>01.28.2012 REGIONS: fixed a problem if the region color
+ was an X11 valid color, some names would get mapped to the
+ incorrect color when printing.</tt></li>
+ <li><tt>02.02.2012 COLORMAP: fixed a problem with SAO format
+ colormaps that have very long lines.</tt></li>
+ <li><tt>02.03.2012 PRINT COORDINATES: added filename to options.</tt></li>
+ <li><tt>02.03.2012 WCS: if wcs parameters are changed or reset,
+ all open catalogs regions are updated. Normal regions are
+ not changed.</tt></li>
+ <li><tt>02.07.2012 COLORMAP: remove support for old RTD and ITT
+ colormaps</tt></li>
+ <li><tt>02.08.2012 GUI: consolidate MATCH and LOCK items into
+ submenus.</tt></li>
+ <li><tt>02.08.2012 GUI: move match bin, match scale, and match
+ colorbar to frame match menu.</tt></li>
+ <li><tt>02.16.2012 CUBE: fixed a proble with calculating the wcs
+ to image for axis 3.</tt></li>
+ <li><tt>02.16.2012 FITSY++: changes required for gcc 4.7.</tt></li>
+ <li><tt>02.16.2012 BLT: patched graph.tcl to use legendRelief
+ instead of labelRelief.</tt></li>
+ <li><tt>02.16.2012 RGB: added lock wcs.</tt></li>
+ <li><tt>02.16.2012 FUNTOOLS: updated to version 1.4.5-2.</tt></li>
+ <li><tt>02.21.2012 3D: fixed a problem with scale clip scope.
+ Should alway be in GLOBAL.</tt></li>
+ <li><tt>02.29.2012 HEADER: add save header command.</tt></li>
+ <li><tt>03.01.2012 XPA: updated to version 2.1.14.</tt></li>
+ <li><tt>03.01.2012 SCALE: MinMax mode AUTOSCAN set to SAMPLE if
+ width*height*depth &gt; 1e8.</tt></li>
+ <li><tt>03.12.2012 IMGSVR: fixed a problem with clearing params
+ if no image was loaded previously.</tt></li>
+ <li><tt>03.22.2012 REGION: add ellipse3d, box3d, polygon3d,
+ point3d regions.</tt></li>
+ <li><tt>03.23.2012 IMGSVR: fixed a problem new frame option and
+ rgb.</tt></li>
+ <li><tt>03.23.2012 BIN: check for valid col names for -bin col
+ command.</tt></li>
+ <li><tt>03.28.2012 REGIONS: add Analysis support per region.</tt></li>
+ <li><tt>03.28.2012 REGIONS: add Analysis Plot3d support for
+ Circle,Ellipse,Box,Polygon,Point.</tt></li>
+ <li><tt>03.28.2012 REGIONS: add Analysis Plot2d support for
+ Projection,Line,Vector.</tt></li>
+ <li><tt>03.28.2012 REGIONS: Circle3d now converted to Circle.</tt></li>
+ <li><tt>03.28.2012 REGIONS: Plot3d saves native coordinate
+ values.</tt></li>
+ <li><tt>03.28.2012 SCALE: simplified scale dialog controls to
+ allow user values.</tt></li>
+ <li><tt>03.29.2012 WCS: fixed a problem with numaxes &gt; 3
+ images and editing WCS params.</tt></li>
+ <li><tt>04.09.2012 WCS: second attempt to handle non-equatorial
+ wcs. try to build a legal header from the wcssubs struct to
+ feed to ast.</tt></li>
+ <li><tt>04.10.2012 SCALE: fixed an issue with autocut, ll != hh.</tt></li>
+ <li><tt>04.10.2012 SKYVIEW: add WISE/COBE/WMAP to skyview survey
+ menu.</tt></li>
+ <li><tt>04.10.2012 WCS: if CD matrix is all zero, use cdelt/pc
+ matrix.</tt></li>
+ <li><tt>04.11.2012 SMOOTH: fixed a problem with images with
+ BSCALE/BZERO.</tt></li>
+ <li><tt>04.11.2012 CATALOG: fixed a problem with d:m:s formated
+ DEC which started with a '+'</tt></li>
+ <li><tt>04.12.2012 CATALOG: fixed a problem with d:m:s to degree
+ conversion. Try to maintain higher precision.</tt></li>
+ <li><tt>04.12.2012 CATALOG: add IAU location code to dialog.</tt></li>
+ <li><tt>04.13.2012 COLORMAP: add user contributed cmaps.</tt></li>
+ <li><tt>04.18.2012 GUI: fixed a problem with long WCSNAME
+ values.</tt></li>
+ <li><tt>04.20.2012 FITSY++: added support for GZIP compresss
+ parameter ZQUANTIZ.</tt></li>
+ <li><tt>04.23.2012 PS: fixed a bug with definiton of 32 bit
+ integers on 64 bit OS.</tt></li>
+ <li><tt>04.23.2012 PREFS: add Text Dialog Font preferences menu.</tt></li>
+ <li><tt>04.23.2012 LOCK: fixed a problem with lock frame and
+ mouse wheel events.</tt></li>
+ <li><tt>04.24.2012 SKYBOT: Look for EXPTIME and add 1/2 to
+ DATE-OBS to get middle of observation.</tt></li>
+ <li><tt>04.24.2012 LINUX64: add --hash-style=both to support old
+ and new GNU API for hash libs.</tt></li>
+ <li><tt>04.26.2012 PHOTO: add support for other image formats.</tt></li>
+ <li><tt>04.26.2012 EXPORT: add support for exporting to other
+ image formats.</tt></li>
+ <li><tt>04.30.2012 WCS: fixed a problem with TAN-SIP and wcs
+ append/replace.</tt></li>
+ <li><tt>05.01.2012 TCL: check to see if packages msgcat and http
+ have already been found before sourcing during startup.</tt></li>
+ <li><tt>05.03.2012 MPEG: fixed a problem with the bottom of an
+ image cut off.</tt></li>
+ <li><tt>05.07.2012 COLORTAG: add color tags.</tt></li>
+ <li><tt>05.10.2012 CROP: fixed a problem with backup and lock
+ crop.</tt></li>
+ <li><tt>05.10.2012 SCALE: fixed a problem lock scale and crop.</tt></li>
+ <li><tt>05.10.2012 BACKUP: fixed a problem with back and -slice,
+ -mosaic load options.</tt></li>
+ <li><tt>05.11.2012 REGIONS: add auto plot2d and plot3d prefs.</tt></li>
+ <li><tt>05.14.2012 GUI: add fits save.</tt></li>
+ <li><tt>05.17.2012 MPEG: updated to ezMPEG v0.1</tt></li>
+ <li><tt>05.17.2012 AST: updated to 7.0.3</tt></li>
+ <li><tt>05.23.2012 WCS: is always displayed</tt></li>
+ <li><tt>05.23.2012 CATALOG: fixed a problem with the sign of
+ d:m:s conversion introduced on 04.12.2012.</tt></li>
+ <li><tt>05.28.2012 MOVIE: minor tweaks on incr slice during
+ movie.</tt></li>
+ <li><tt>05.28.2012 WIN32: fixed a problem with 3d fillImageJoin.
+ Statck overflow.</tt></li>
+ <li><tt>05.29.2012 BACKUP: fixed active frames issue.</tt></li>
+ <li><tt>05.30.2012 GUI: add threads command.</tt></li>
+ <li><tt>05.30.2012 GUI: fixed a problem with PASTE for entries.
+ Will now process unicode.</tt></li>
+ <li><tt>05.31.2012 GRID: fixed a problem with parsing 6.1 and
+ 6.2 backup save sets. New grid options parser implemented.</tt></li>
+ <li><tt>05.31.2012 PLOT: fixed a problem in generating
+ postscript. Now just set plot size.</tt></li>
+ <li><tt>05.31.2012 PLOT: fixed a postscript font issue with
+ helvetica.</tt></li>
+ <li><tt>05.31.2012 PLOT: add axes format.</tt></li>
+ <li><tt><b>06.06.2012 RELEASE version 7.0</b></tt></li>
+ <li><tt>06.12.2012 BACKUP: fixed a problem with processing
+ version 6.1 and 6.2 backup save sets.</tt></li>
+ <li><tt><b>06.15.2012 RELEASE version 7.0.1</b></tt></li>
+ <li><tt>06.13.2012 3D: add border graphics.</tt></li>
+ <li><tt>06.15.2012 TCLLIB: updated to version 1.14. This fixes a
+ problem with math::fuzzy::tlt.</tt></li>
+ <li><tt>06.21.2012 REGION: fixed a problem with rotated images
+ and postscript printing of circle region.</tt></li>
+ <li><tt>06.21.2012 IMGSRV: fixed a problem loading images from
+ dss/2mass/etc from the command line. Use the first frame if
+ not already loaded.</tt></li>
+ <li><tt>06.21.2012 SLA: removed from build tree. not needed
+ since AST now has own version.</tt></li>
+ <li><tt>06.21.2012 HELP: rm link to home page. hv can't handle
+ the new web site.</tt></li>
+ <li><tt>06.22.2012 SKYBOT: added -filter=0.</tt></li>
+ <li><tt>06.22.2012 POSTSCRIPT: fixed a problem with rotated text
+ regions affecting other regions.</tt></li>
+ <li><tt>06.22.2012 REGIONS: fixed a problem selecting text
+ regions at high zoom.</tt></li>
+ <li><tt>06.22.2012 WCS: add support for SAO Polynomial Plate.</tt></li>
+ <li><tt>06.25.2012 GUI: improved error handling. Will now
+ properly handle a FATAL error msg from internal widgets.</tt></li>
+ <li><tt>06.25.2012 GUI: non FATAL msgs can be supressed via
+ preferences.</tt></li>
+ <li><tt>06.25.2012 FRAME: trap SIGBUS while scanning for
+ min/max.</tt></li>
+ <li><tt>06.25.2012 WCS: use new version of AST:fitschan.c which
+ supports SAO polynomial plate solution and checks for the
+ case of all PV keywords=0.</tt></li>
+ <li><tt>06.25.2012 GUI: enable hidden directory button for linux
+ standard dialog box (windows only).</tt></li>
+ <li><tt>06.25.2012 GUI: move About menu item to Help menu.</tt></li>
+ <li><tt>06.27.2012 LOCK: fixed a problem with LOCK FRAME and the
+ current skyframe.</tt></li>
+ <li><tt>06.27.2012 PANNER: fixed a problem where the wcs compass
+ was incorrectly set.</tt></li>
+ <li><tt>06.29.2012 AST: updated to 7.0.5</tt></li>
+ <li><tt>07.02.2012 HTTP: set default timeout to 1 minute.</tt></li>
+ <li><tt><b>07.03.2012 RELEASE version 7.0.2</b></tt></li>
+ <li><tt>07.05.2012 RGB: fixed a problem with -rgbimage and
+ extnames.</tt></li>
+ <li><tt>07.05.2012 GCC: fixed a problem gcc 4.5 and Pixmap
+ typedef.</tt></li>
+ <li><tt>07.06.2012 SCALE: fixed a problem with scale dialog and
+ very small numbers.</tt></li>
+ <li><tt>07.10.2012 BIN: fixed a problem with very large FITS Bin
+ Tables.</tt></li>
+ <li><tt>07.11.2012 FITSY++: fixed a number of problems with very
+ large (2Gb&gt;) FITS Image and Bin Tables.</tt></li>
+ <li><tt>07.13.2012 WINDOWS: fixed a problem with dashs on the
+ display. Tk does not give us much flexibilty, so pick
+ something closer to the desired length.</tt></li>
+ <li><tt>07.17.2012 CATALOG: add sdss r7 and sdss r8 to default
+ menu.</tt></li>
+ <li><tt>07.17.2012 GRIDS: fixed a problem where each frame grid
+ remembers its own configuration.</tt></li>
+ <li><tt>07.17.2012 FITSY++: fixed a number of problems with save
+ very large (2Gb&gt;) FITS Image and Bin Tables.</tt></li>
+ <li><tt>07.23.2012 REGIONS: fixed a problem with PLOT3D and BOX,
+ ELLIPSE, POLYGON. At certain angles, incorrect counts were
+ calculated.</tt></li>
+ <li><tt>07.27.2012 REGIONS: fixed a problem with rendering
+ ELLIPSE PANDA X11 at angle=0.</tt></li>
+ <li><tt>07.30.2012 PRINT: fixed a problem with printing simple
+ text and catalog dialogs.</tt></li>
+ <li><tt>07.30.2012 REGIONS: add default length format to
+ preferences.</tt></li>
+ <li><tt>07.30.2012 GUI: update infobox when moving between
+ frames.</tt></li>
+ <li><tt>07.30.2012 BACKUP: don't save compressed image files if
+ not requested.</tt></li>
+ <li><tt>08.02.2012 WCS: fixed a number of issues with the WCS
+ parameters dialog.</tt></li>
+ <li><tt>08.02.2012 WCS: added support for SIP and SCAMP keywords
+ to WCS parameters dialog.</tt></li>
+ <li><tt>08.06.2012 MAGNIFIER: be sure to update magnifier when
+ changing slice.</tt></li>
+ <li><tt>08.09.2012 PLOT: fixed a problem reading muliple
+ datasets from one source.</tt></li>
+ <li><tt>08.10.2012 AST: updated to version 7.0.6</tt></li>
+ <li><tt>08.13.2012 3D: add z axis scaling.</tt></li>
+ <li><tt>08.13.2012 FITSY++: accept double quoted (invalid)
+ strings.</tt></li>
+ <li><tt>08.21.2012 REGIONS: fixed a problem with -regions
+ centroid command.</tt></li>
+ <li><tt>09.05.2012 SMOOTH: add lock/match smooth.</tt></li>
+ <li><tt>09.14.2012 PLOT: enhanced gui.</tt></li>
+ <li><tt>09.14.2012 PLOT: add bar chart option.</tt></li>
+ <li><tt>09.14.2012 PLOT: add scatter chart option.</tt></li>
+ <li><tt>09.14.2012 REGIONS: add Analysis Statistics.</tt></li>
+ <li><tt>09.14.2012 REGIONS: add Analysis Radial Profile.</tt></li>
+ <li><tt>10.3.2012 CATALOG: add match option.</tt></li>
+ <li><tt><b>10.15.2012 RELEASE version 7.1</b></tt></li>
+ <li><tt>10.18.2012 GUI: update File menu.</tt></li>
+ <li><tt>11.02.2012 GUI: add support for NRRD file format.
+ Includes encodings: raw and gzip.</tt></li>
+ <li><tt>11.05.2012 GUI: fixed a problem with cut/paste for
+ contours and catalogs.</tt></li>
+ <li><tt>11.27.2012 PLOT: fixed typo in range dialog.</tt></li>
+ <li><tt>11.27.2012 GUI: fixed a problem with clear analysis menu
+ item and the analysis menu.</tt></li>
+ <li><tt>12.06.2012 SAMP: fixed a typo which disabled SAMP_HUB
+ functionality.</tt></li>
+ <li><tt>12.06.2012 DS9: fixed a problem on how to align an image
+ with an odd size frame. In versions &lt;7.0, the floating
+ point number was rounded down. This has been re-implemented.</tt></li>
+ <li><tt>12.11.2012 GPL: upgrade license to GPL v3.</tt></li>
+ <li><tt>12.18.2012 COLORBAR: add support for SAO format GAMMA
+ param.</tt></li>
+ <li><tt>12.18.2012 SAVEIMAGE: add support for EPS.</tt></li>
+ <li><tt>12.20.2012 REGIONS: fixed a problem with updating
+ analysis plot x/y axis titles.</tt></li>
+ <li><tt>12.21.2012 REGIONS: fixed a problem with analysis radial
+ profile and negative xaxis values.</tt></li>
+ <li><tt>12.21.2012 REGIONS: fixed a problem with writing
+ composited regions.</tt></li>
+ <li><tt>12.21.2012 REGIONS: fixed a problem with list/save data
+ radial annulus.</tt></li>
+ <li><tt>12.28.2012 RGB: add photo export.</tt></li>
+ <li><tt>01.19.2013 FITSY++: fixed a problem parsing filters</tt></li>
+ <li><tt>01.19.2013 FITSY++: fixed a problem with incomplete
+ variable array TFORM descriptions, used in fits compression.
+ If no length is specified, set default to 8.<br>
+ </tt></li>
+ <li><tt>01.29.2013 SAVE: save fits will now save an entire cube if loaded.</tt></li>
+ <li><tt>01.30.2013 SAVE: add support for save mecube.</tt></li>
+ <li><tt>01.31.2013 CONTOUR: fixed a problem with loading a set of contours with a specified color.</tt></li>
+ <li><tt>02.13.2013 FITSY++: support new fits compression float/double gzip method.</tt></li>
+ <li><tt>02.13.2013 FITSY++: ds9 now distinguishes between BLANK/NAN/INF values.</tt></li>
+ <li><tt>02.15.2013 REGIONS: no longer output filename in header.</tt></li>
+ <li><tt>02.26.2013 FITSY++: use magic bytes to check for gz compressed files before load.</tt></li>
+ <li><tt>02.28.2013 RGB: loading rgbimage, rgbcube, rgbarray into non-rgb frame will create new rgb frame for all command line, xpa, and samp commands.</tt></li>
+ <li><tt>03.01.2013 FRAME: trap SIGBUS and SIGSEGV while scanning data.</tt></li>
+ <li><tt>03.01.2013 FRAME: will only return error messages at levels info, warning, and error.</tt></li>
+ <li><tt>03.10.2013 PREFS: fixed a problem with prefs zoom align.</tt></li>
+ <li><tt>03.12.2013 BACKUP: check for sym links.</tt></li>
+ <li><tt>03.14.2013 GUI: non-modal dialogs are now created at the center of the main ds9 window.</tt></li>
+ <li><tt>03.25.2013 VO: default vo method is mime.</tt></li>
+ <li><tt>03.25.2013 VO: if xpa method fails, default to mime.</tt></li>
+ <li><tt>03.26.2013 XPA: add samp cmd to xpa.</tt></li>
+ <li><tt>03.26.2013 SAMP: add xpa cmd to samp.</tt></li>
+ <li><tt>04.01.2013 AST: updated to version 7.1.1</tt></li>
+ <li><tt>04.11.2013 CATALOG: fixed cut and paste.</tt></li>
+ <li><tt>04.11.2013 WCS: SAO_PLT is now handled directly by AST.</tt></li>
+ <li><tt>04.12.2013 PREFS: add dialog center option.</tt></li>
+ <li><tt>04.12.2013 PLOT: all plots (user, analysis and catalogs) are now available to the plot command.</tt></li>
+ <li><tt><b>04.15.2013 RELEASE version 7.2</b></tt></li>
+ <li><tt>04.16.2013 AST: updated to version 7.2</tt></li>
+ <li><tt>04.16.2013 TCLLIB: updated to version 1.15</tt></li>
+ <li><tt>04.26.2013 TCL: updated to version 8.6.0</tt></li>
+ <li><tt>04.26.2013 TK: updated to version 8.6.0</tt></li>
+ <li><tt>04.26.2013 ZVFS: updated to version 2</tt></li>
+ <li><tt>05.15.2013 CATALOGS: add AAVSO to cat list.</tt></li>
+ <li><tt>05.17.2013 HV: add DASCHE to Archives list.</tt></li>
+ <li><tt>06.03.2013 IRAF: fixed a problem with imexamine coords.</tt></li>
+ <li><tt>06.04.2013 IRAF: save/export will save wcs values, not just the color number.</tt></li>
+ <li><tt>06.05.2013 IRAF: colorbar displays wcs values.</tt></li>
+ <li><tt>06.05.2013 IRAF: fixed a number of issues with tvmark colors.</tt></li>
+ <li><tt>06.11.2013 FITSY++: implemented compressed FITS SUBTRACTIVE_DITHER_1 method.</tt></li>
+ <li><tt>06.14.2013 ENVI: add support for import/export envi format.</tt></li>
+ <li><tt>06.14.2013 AST: updated to version 7.3.1</tt></li>
+ <li><tt>06.18.2013 GUI: fixed a problem with blank headers being displayed.</tt></li>
+ <li><tt>06.18.2013 ARRAY: now accepts cropping info in filename.</tt></li>
+ <li><tt>06.18.2013 NRRD: now accepts cropping info in filename.</tt></li>
+ <li><tt>06.18.2013 ENVI: now accepts cropping info in filename.</tt></li>
+ <li><tt>06.21.2013 PHOTO: fixed a problem with rounding average.</tt></li>
+ <li><tt>06.24.2013 ZVFS: zvfs.c updated from freewrap 6.6</tt></li>
+ <li><tt>06.26.2013 SEGMENT: add new segment region.</tt></li>
+ <li><tt>07.02.2013 ENVI: fixed a problem with calculating wcs.</tt></li>
+ <li><tt>07.02.2013 FITSY++: changes to allow 1D image.</tt></li>
+ <li><tt>07.03.2013 GROUPS: fixed a problem allowing multiple selection of region groups.</tt></li>
+ <li><tt>08.14.2013 WCS: Linear WCS now goes straight to AST.</tt></li> <li><tt>09.10.2013 PSEUDOCOLOR: rm support for pseudocolor visuals.</tt></li>
+ <li><tt>09.17.2013 REGIONS: PLOT3D dramatic improvements in speed of deep images and large regions.</tt></li>
+ <li><tt>09.17.2013 GUI: set last file directory based on file type last loaded.</tt></li>
+ <li><tt>09.18.2013 ENVI: minor change to hdr parser.</tt></li>
+ <li><tt>09.18.2013 ENVI: fixed a major problem with swapbytes.</tt></li>
+ <li><tt>09.18.2013 CATALOG: fixed a problem with selecting the correct region when arrow keys are used.</tt></li>
+ <li><tt>09.19.2013 FITSY++: cleaned up code for dumping array,nrrd,envi in native endian.</tt></li>
+ <li><tt>09.25.2013 AST: updated to version 7.3.2 to fix problem with SCAMP.</tt></li>
+ <li><tt>09.25.2013 FITSY++: fixed a problem parsing filters in the command line.</tt></li>
+ <li><tt>10.05.2013 3D: implement image cache.</tt></li>
+ <li><tt>10.08.2013 3D: implement az and el background render.</tt></li>
+ <li><tt>10.10.2013 COLORBAR: fixed a minor problem with specifing 'other color'.</tt></li>
+ <li><tt>10.11.2013 REGIONS: add mouse click epsilon parameter.</tt></li>
+ <li><tt>10.16.2013 CUBE: add lock slice wcs.</tt></li>
+ <li><tt>10.17.2013 REGIONS: fixed a problem with ds9 regions parser and parsing hex color specification.</tt></li>
+ <li><tt>10.18.2013 XPA: fixed a problem with "file" and backward compatability.</tt></li>
+ <li><tt>10.18.2013 ANALYSIS: add several checks to verify analysis file before try to parse.</tt></li>
+ <li><tt>10.22.2013 GUI: fixed a problem with preserve PAN while loading.</tt></li>
+ <li><tt>10.22.2013 SCALE: removed PRESERVE SCALE. This has been redundant since 7.0. Setting the scale limits does the same thing.</tt></li>
+ <li><tt>10.22.2013 CONTOUR: fixed a problem if no system is specified and, the default is normally WCS, unless no WCS is defined, then default to PHYSICAL.</tt></li>
+ <li><tt>10.28.2013 TCL/TK: update to version 8.6.1.</tt></li>
+ <li><tt>10.31.2013 HTML: fixed issue causeing corrupt stack with new CLANG compilers.</tt></li>
+ <li><tt>11.10.2013 FITS: improved error handling for malformed FITS tables.</tt></li>
+ <li><tt>11.15.2013 CUBE: fixed a problem with lock slice wcs.</tt></li>
+ <li><tt>11.18.2013 CATALOG: add SDSS9 to optical menu.</tt></li>
+ <li><tt>12.12.2013 WCS: add support for AST WCS def.</tt></li>
+ <li><tt>01.28.2014 REGIONS: add auto statistics option.</tt></li>
+ <li><tt>03.06.2014 AST: updated to version 7.3.4.</tt></li>
+ <li><tt>03.21.2014 CATALOG: add 'Copy to Regions' from XPA/SAMP/commandline.</tt></li>
+ <li><tt>03.26.2014 WCS: fixed a problem with wcs append/replace where the line length was 81 with newline.</tt></li>
+ <li><tt>04.07.2014 FITSY++: expanded valid EXTNAME keywords to include '.', '-', and '_' chars.</tt></li>
+ <li><tt>04.07.2014 FITSY++: save fits will convert BITPIX=-16 to BITPIX=32</tt></li>
+ <li><tt>06.09.2014 CATALOG: if sort col is of type real, but contains blank values, substitue a value of 0.</tt></li>
+ <li><tt>07.01.2014 BLT: completed upgrade to TkBLT 3.0.</tt></li>
+ <li><tt>07.28.2014 CATALOG: add UCAC4 to optical menu.</tt></li>
+ <li><tt>08.01.2014 MACOSX: completed new 64bit Aqua port.</tt></li>
+ <li><tt>08.06.2014 3D: don't wipeout the cache when generating a movie.</tt></li>
+ <li><tt>09.15.2014 ENVI: try to determine data file name from header file name.</tt></li>
+ <li><tt>09.30.2014 GUI: default mouse mode is NONE (not POINTER).</tt></li>
+ <li><tt>09.30.2014 GUI: change mode POINTER to REGION.</tt></li>
+ <li><tt><b>10.01.2014 RELEASE version 7.3</b></tt></li>
+ <li><tt>10.03.2014 GUI: Fixed problems with Control-S and Control-Z accelerators.</tt></li>
+ <li><tt>10.03.2014 MACOSX: Removed accelerators for Print, PageSetup, and Find, as then invoke a known bug with Tk and dialogs.</tt></li>
+ <li><tt>10.03.2014 MACOSX: Fixed a problem with coordinate display dialog.</tt></li>
+ <li><tt>10.03.2014 MACOSX: Fixed a problem with deleting colorbar tags.</tt></li>
+ <li><tt>10.03.2014 PREFS: Beta versions are now deemed to be of the same verison as the final release.</tt></li>
+ <li><tt>10.03.2014 PREFS: Fixed a problem processing a newer prefs file. Now wait to notify the user after the init phase has been completed.</tt></li>
+ <li><tt>10.03.2014 PREFS: some combinations of old prefs files were not being updated correctly.</tt></li>
+ <li><tt>10.06.2014 FIRST: rename FIRST to VLA</tt></li>
+ <li><tt>10.06.2014 VLA: add STRIPE82 survey.</tt></li>
+ <li><tt>10.06.2014 HV: fixed a problem with scrolling.</tt></li>
+ <li><tt><b>10.07.2014 RELEASE version 7.3.1</b></tt></li>
+ <li><tt>10.08.2014 REGIONS: fixed a problem with parsing old regions file fonts.</tt></li>
+ <li><tt><b>10.08.2014 RELEASE version 7.3.2</b></tt></li>
+ <li><tt>10.10.2014 IEXAM: imexam has been renamed iexam.</tt></li>
+ <li><tt>10.15.2014 WCS: fixed a problem with imflip=1.</tt></li>
+ <li><tt>10.15.2014 AST: updated to version 8.0.0.</tt></li>
+ <li><tt>10.20.2014 AST: updated to version 8.0.2.</tt></li>
+ <li><tt>10.20.2014 HPX: updated compatiable wcslib-4.24.</tt></li>
+ <li><tt>10.21.2014 CATALOG: add width property for symbols.</tt></li>
+ <li><tt>10.22.2014 MACOSX: fixed a problem with mouse wheel zoom.</tt></li>
+ <li><tt>10.22.2014 FITSY++: add support for SUBTRACTIVE_DITHER_2 keyword.</tt></li>
+ <li><tt>10.22.2014 FITSY++: fixed a problem with native endian arrays. Unless specified, the array is assumed to be of the same endian-ness as the processor.</tt></li>
+ <li><tt>11.14.2014 CUBE: fixed a problem with lock slice with no fits loaded.</tt></li>
+ <li><tt>11.17.2014 TCL/TK: update to version 8.6.3.</tt></li>
+ <li><tt>11.18.2014 MACOSX: preferences, fixed jumpy window size problem.</tt></li>
+ <li><tt>11.19.2014 GUI: view horizontal/vertical now sets display size to default settings.</tt></li>
+ <li><tt>12.03.2014 IIS: fixed a problem with open_unix().</tt></li>
+ <li><tt>12.29.2014 BLOCK: add support for blocking.</tt></li>
+ <li><tt>02.04.2015 HPX: fixed a problem with cropping HPX images.</tt></li>
+ <li><tt>02.05.2015 FITS++: Fits Compression- fixed a problem with uncompressed blocks.</tt></li>
+ <li><tt>02.05.2015 FITS++: added support for 'Q' column arrays.</tt></li>
+ <li><tt>02.17.2015 HV: Fixed a problem when url scheme is FTP and authority included username and passwd.</tt></li>
+ <li><tt>02.18.2015 WCS: Fixed a problem when CDELTs and PCs keywords are used, but not in the orthodox way.</tt></li>
+ <li><tt>03.11.2015 NRRD: Fixed a problem exporting built data cube.</tt></li>
+ <li><tt>03.11.2015 ENVI: Fixed a problem exporting built data cube.</tt></li>
+ <li><tt>03.24.2015 MOSAIC: mecube will now skip over tables and find all images.</tt></li>
+ <li><tt>04.08.2015 FITS++: fixed a problem with compressed fits files and static memory size. now using alloc.</tt></li>
+ <li><tt>04.13.2015 CATALOGS: fixed a problem with deleting the frame first, before closing a catalog dialog.</tt></li>
+ <li><tt>04.15.2015 CUBE: added support for reorder data cube axes.</tt></li>
+ <li><tt>04.16.2015 SMOOTH: blank/NaN values are no longer replaced by 0, instead, NaN is used.</tt></li>
+ <li><tt>04.17.2015 SMOOTH: is now threaded.</tt></li>
+ <li><tt>04.21.2015 GUI: add UNITS keyword to infobox.</tt></li>
+ <li><tt>04.23.2015 CUBE: reorder is now threaded.</tt></li>
+ <li><tt>04.24.2015 IEXAM: add macro expansion string.</tt></li>
+ <li><tt>04.27.2015 CHECKDNS: fixed a problem so that delay will activate on time (and will return promptly).</tt></li>
+ <li><tt>04.29.2015 TCL/TK: update to version 8.6.4.</tt></li>
+ <li><tt>04.30.2015 LAYOUT: add tile grid direction.</tt></li>
+ <li><tt>04.30.2015 GUI: add user selected keyword to infobox.</tt></li>
+ <li><tt>05.21.2015 SCALE: add lock/match scalelimits.</tt></li>
+ <li><tt><b>05.29.2015 RELEASE version 7.4b1</b></tt></li>
+ <li><tt>06.09.2015 CATALOG: fixed a problem finding correct cols to parse. Original bug introduced after 7.3.2.</tt></li>
+ <li><tt><b>06.09.2015 RELEASE version 7.4b2</b></tt></li>
+ <li><tt>06.15.2015 SCALE: scaling for data cubes now use clip scope (LOCAL/GLOBAL).</tt></li>
+ <li><tt>06.18.2015 SCALE: Default scope is now GLOBAL.</tt></li>
+ <li><tt>06.18.2015 SCALE: MinMax mode AUTOSCAN has been deprecated.</tt></li>
+ <li><tt>06.22.2015 GUI: fixed a font problem displaying greek symbols.</tt></li>
+ <li><tt><b>06.22.2015 RELEASE version 7.4b3</b></tt></li>
+ <li><tt>06.29.2015 SKYVIEW: add survey and size options.</tt></li>
+ <li><tt><b>07.04.2015 RELEASE version 7.4b4</b></tt></li>
+ <li><tt>07.07.2015 VO: add additional code to use default url list if unable to download list.txt for any reason.</tt></li>
+ <li><tt>07.14.2015 FITSY++: fixed a problem with RICE compression and 4 byte INT to FLOAT conversions.</tt></li>
+ <li><tt>07.15.2015 FITSY++: fixed a problem with GZIP lossless compression.</tt></li>
+ <li><tt>07.15.2015 FITSY++: Add support for GZIP_2 FITS compression.</tt></li>
+ <li><tt><b>07.20.2015 RELEASE version 7.4b5</b></tt></li>
+ <li><tt>07.23.2015 FITSY++: fixed a problem with SAVE FITS and writing NAXIS3=1 into the header.</tt></li>
+ <li><tt>07.23.2015 FITSY++: added check for fits table in SAVE FITS TABLE.</tt></li>
+ <li><tt><b>07.24.2015 RELEASE version 7.4b6</b></tt></li>
+ <li><tt>08.13.2015 REGIONS: fixed a problem with FITS CIAO PIE region.</tt></li>
+ <li><tt>08.13.2015 REGIONS: fixed a problem with FITS CIAO ANNULUS region.</tt></li>
+ <li><tt>08.13.2015 REGIONS: added support for FITS CIAO SECTOR and ELLIPTANNULS regions.</tt></li>
+ <li><tt>08.16.2015 WCS: fixed a problem with reorder 3D cubes.</tt></li>
+ <li><tt>08.25.2015 COLORBAR: added MathLab colormaps.</tt></li>
+ <li><tt>08.25.2015 COLORBAR: added MatPlotLib colormaps.</tt></li>
+ <li><tt>08.26.2015 COLORBAR: added H5utils colormaps.</tt></li>
+ <li><tt>08.26.2015 COLORBAR: added GIST colormaps.</tt></li>
+ <li><tt>08.26.2015 COLORBAR: added Topographic colormaps.</tt></li>
+ <li><tt>08.28.2015 MOSAIC: fixed a problem introduced in 7.4b1 which failed to ignore generic tables in extensions when loading multiple extension fits.</tt></li>
+ <li><tt>09.03.2015 PAN: fixed a problem with pan then zoom mode.</tt></li>
+ <li><tt>09.17.2015 IIS: fixed a problem with imexam introduced in an earlier beta version.</tt></li>
+ <li><tt>09.17.2015 IIS: fixed a problem with imexam when a former imexam frame has been delete.</tt></li>
+ <li><tt>09.17.2015 MOSAIC: add IRAF DETSEC Align option.</tt></li>
+ <li><tt><b>09.18.2015 RELEASE version 7.4b7</b></tt></li>
+ <li><tt>09.21.2015 WCS: Look for old RADECSYS keyword if present.</tt></li>
+ <li><tt>09.22.2015 CROSSHAIR: add crosshair parameters dialog.</tt></li>
+ <li><tt>09.30.2015 TEMPLATES: fixed a problem with WCS introduced in an earlier beta version.</tt></li>
+ <li><tt>10.02.2015 SMOOTH: smooth on load now threaded.</tt></li>
+ <li><tt>10.02.2015 REGIONS: PLOT3D is disabled by default.</tt></li>
+ <li><tt>10.13.2015 SAMP: fixed a issue with case of meta-data in xmlrpc.</tt></li>
+ <li><tt>10.14.2015 GUI : fixed an issue where not all header options were offered in the case of compressed fits images.</tt></li>
+ <li><tt>10.14.2015 BACKUP : fixed a problem when creating a backup with a file that has been compressed.</tt></li>
+ <li><tt>10.15.2015 SAMP: fixed a issue with results with empty elements.</tt></li>
+ <li><tt>10.16.2015 LINUX: For all key press events, calculate the current cursor position, as Ubuntu and MacOSX Aqua returns bad x,y values. </tt></li>
+ <li><tt>10.21.2015 CATALOG: fixed a problem where a catalog had a column of the same name as a variable. </tt></li>
+ <li><tt>10.26.2015 GUI: fixed a problem remembering the previous filename loaded for standard dialogs. </tt></li>
+ <li><tt>10.30.2015 SAMP: fixed a issue with incorrect body length in xmlrpc messages.</tt></li>
+ <li><tt>11.03.2015 3D: fixed a major issue introduced in the beta 7.4 series which caused a redraw everytime the current slice was changed.</tt></li>
+ <li><tt>11.03.2015 SCALE: Default scope is back to LOCAL.</tt></li>
+ <li><tt>11.04.2015 CONTOUR: Fixed lots of issues with interaction with contours and bin/block/smooth.</tt></li>
+ <li><tt>11.04.2015 SCALE: remove old AUTOSCAN and SAMPLE code.</tt></li>
+ <li><tt>11.09.2015 FITS: fixed issues with data all NAN or INF.</tt></li>
+ <li><tt>11.09.2015 CUBE: fixed issues with selecting current slice and updating other dialog boxes while in local mode.</tt></li>
+ <li><tt><b>11.11.2015 RELEASE version 7.4b8</b></tt></li>
+ <li><tt>11.11.2015 FITS: fixed another issue when calculating MIN and MAX and one pixel images.</tt></li>
+ <li><tt>11.17.2015 WCS: fixed problem with infobox/grid with xLN/xLT WCS.</tt></li>
+ <li><tt><b>11.18.2015 RELEASE version 7.4b9</b></tt></li>
+ <li><tt>11.30.2015 CATALOG: update CDS catalog search parameters.</tt></li>
+ <li><tt>12.02.2015 BACKUP: fixed a problem with backup save sets generated with beta versions.</tt></li>
+ <li><tt>12.03.2015 PREFS: fixed a problem with prefs generated with beta versions.</tt></li>
+ <li><tt>12.07.2015 WCS: fixed a problem with replacement WCS.</tt></li>
+ <li><tt>12.08.2015 WCS: cubes now share WCS structures (very fast).</tt></li>
+ <li><tt>12.08.2015 ANALYSIS: fixed a problem with $z macro.</tt></li>
+ <li><tt><b>12.10.2015 RELEASE version 7.4b10</b></tt></li>
+ <li><tt>12.11.2015 SAVEIMAGE: fixed a problem with the colorbar not updating when used with -exit.</tt></li>
+ <li><tt>12.17.2015 FITS: 3D displayed z coord off by .5.</tt></li>
+ <li><tt><b>12.21.2015 RELEASE version 7.4</b></tt></li>
+ <li><tt>01.05.2016 XPA: update to version 2.1.17.</tt></li>
+ <li><tt>01.05.2016 FUNTOOLS: update to version 2.1.6.</tt></li>
+ <li><tt>01.21.2016 WCS: fixed a problem with PC3_3 being ignored.</tt></li>
+ <li><tt>01.21.2016 WCS: add 3d axis params to WCS dialog.</tt></li>
+ <li><tt>01.25.2016 MACOSX: fixed a problem init Tkblt.</tt></li>
+ <li><tt>02.10.2016 MACOSX: fixed again the problem with font sizes and screen dpi.</tt></li>
+ <li><tt>02.11.2016 WCS: fixed a problem with WCS replace and files without linefeed termination.</tt></li>
+ <li><tt>03.07.2016 XPA: "tcl","source","print" commands only enabled for local.</tt></li>
+ <li><tt>03.07.2016 XPA: new xpa command.</tt></li>
+ <li><tt>03.07.2016 GUI: "tcl" command enabled from commandline.</tt></li>
+ <li><tt>03.07.2016 PREFS: for security reasons, will only look for the prefs file in the $HOME directory, and must be group/world readonly.</tt></li>
+ <li><tt>03.07.2016 INIT FILE: will only look for any init file(s) in the $HOME, /usr/local/lib, /opt/local/lib directories.</tt></li>
+ <li><tt>03.07.2016 INIT FILE: only read-only files will be sourced.</tt></li>
+ <li><tt>03.08.2016 SAMP: new samp command.</tt></li>
+ <li><tt>03.08.2016 SAMP: new ds9.restricted-get command.</tt></li>
+ <li><tt>03.08.2016 SAMP: new ds9.restricted-set command.</tt></li>
+ <li><tt>03.08.2016 HV: xpa-set is now in safe mode.</tt></li>
+ <li><tt>03.18.2016 GUI: Hard code font size. Give up on trying to correct for screen resolution.</tt></li>
+ <li><tt>03.18.2016 REGION: fixed title issue with radial plot.</tt></li>
+ <li><tt>03.18.2016 REGION: fixed title issue with 2d plot.</tt></li>
+ <li><tt>03.28.2016 FITSY++: cube update clip is now threaded.</tt></li>
+ <li><tt>03.30.2016 GUI: cleaned up initialization and event loop code.</tt></li>
+ <li><tt>03.30.2016 WCSSUBS: updated to version 3.9.0.</tt></li>
+ <li><tt>04.01.2016 GUI: default number of threads is now detected based on OS.</tt></li>
+ <li><tt>04.01.2016 WCS: fixed a problem with region templates, lengths were incorrect.</tt></li>
+ <li><tt>04.05.2016 GUI: added coordinates of min/max to infobox.</tt></li>
+ <li><tt>04.05.2016 GUI: limit dialog status lines to 80 chars, so the window will not expand off the screen.</tt></li>
+ <li><tt>04.06.2016 WCS: use getWCSOrientation() instead of wcs->imflip for calcAlign and mapAngleTo/FromRef.</tt></li>
+ <li><tt>04.14.2016 SCALE: fixed minmax mode SAMPLE.</tt></li>
+ <li><tt>04.14.2016 CUBE: update histogram and histequ when changing current slice.</tt></li>
+ <li><tt>04.20.2016 MINMAX: reimplemented "-minmax sample" commandline option for loading very large images..</tt></li>
+ <li><tt>04.21.2016 3D: fixed a problem with rendering the bbox when endpoints are way off screen. Now clip against frame.</tt></li>
+ <li><tt>04.22.2016 3D: rendering speed improvements.</tt></li>
+ <li><tt>04.26.2016 3D: panner images are now cached.</tt></li>
+ <li><tt>04.27.2016 GUI: fixed a minor problem with header choice box and no filename given for xpaset stdin commands.</tt></li>
+ <li><tt>04.27.2016 3D: dramatic improvements in render speed for certain data sets.</tt></li>
+ <li><tt>04.27.2016 3D: fixed a problem with backup and 3D pan.</tt></li>
+ <li><tt>05.04.2016 BIN: added keywords EQUINOX, MJD-OBS, and RADESYS if present.</tt></li>
+ <li><tt><b>05.06.2016 RELEASE version 7.5b1</b></tt></li>
+ <li><tt>05.11.2016 SCALE: fixed a problem where histequ colorbar numerics displayed were incorrect.</tt></li>
+ <li><tt>05.18.2016 GUI: fixed a very minor problem where catalog tools is invoked back to back via command line.</tt></li>
+ <li><tt>05.19.2016 REGIONS: many important changes to Ciao Region parser to support current syntax. In particular, changes to BOX, ROTBOX, RECTANGLE. SECTOR, FIELD, and REGION are now no-ops.</tt></li>
+ <li><tt>05.23.2016 TKCON: updated to version 2.7 proper.</tt></li>
+ <li><tt>05.24.2016 PREFS: check file permissions and set accordingly.</tt></li>
+ <li><tt>05.24.2016 PREFS: new prefs file directory implemented.</tt></li>
+ <li><tt>05.07.2016 STARTUP: for security reasons, will only look for the startup file in the $HOME directory, and must be group/world readonly.</tt></li>
+ <li><tt>05.31.2016 TKBLT: updated to version 3.1.</tt></li>
+ <li><tt>06.01.2016 TKBLT: updated to version 3.1.1.</tt></li>
+ <li><tt>06.20.2016 TKBLT: updated to version 3.1.2.</tt></li>
+ <li><tt>06.20.2016 FITSY++: fixed a problem where BZERO/BSCALE was not applied to MIN/MAX for BITPIX=-32,-64.</tt></li>
+ <li><tt>06.27.2016 REGIONS: default regions coordinate system is set to PHYSICAL if no WCS present.</tt></li>
+ <li><tt>06.28.2016 3D: fixed yet another problem with rendering speed.</tt></li>
+ <li><tt>07.01.2016 FITSY++: look for MJD_OBS if MJD-OBS is not present.</tt></li>
+ <li><tt>07.05.2016 IMGSRV: simplify code.</tt></li>
+ <li><tt>07.11.2016 IMGSRV: add support for VLSS.</tt></li>
+ <li><tt>07.12.2016 SIA: simple image access protocal implemented.</tt></li>
+ <li><tt><b>07.13.2016 RELEASE version 7.5b2</b></tt></li>
+ <li><tt>07.13.2016 SKYVIEW: updated survey options.</tt></li>
+ <li><tt>07.14.2016 IIS: fixed segv issue.</tt></li>
+ <li><tt><b>07.15.2016 RELEASE version 7.5b3</b></tt></li>
+ <li><tt>07.15.2016 TKBLT: upgrade to version 3.2.2.</tt></li>
+ <li><tt>07.15.2016 GUI: fixed an issue with sourcing init files and 'global ds9'.</tt></li>
+ <li><tt><b>07.15.2016 RELEASE version 7.5b4</b></tt></li>
+ <li><tt>07.21.2016 PRINT: scaling now implement without mods to Tk source code.</tt></li>
+ <li><tt>07.21.2016 PRINT: give up on postscript scaling to screen resolution. Print resolution of 72 equals screen resolution.</tt></li>
+ <li><tt>07.25.2016 TKHTML: updated to version 1.0.3, fixed an issues with corrupted screens under MacOSX.</tt></li>
+ <li><tt>07.26.2016 TCL/TK: update to version 8.6.5.</tt></li>
+ <li><tt>07.26.2016 BACKUP: fixed an issue with missing RGB channels.</tt></li>
+ <li><tt>07.27.2016 TCLLIB: update to version 1.15.</tt></li>
+ <li><tt>07.29.2016 PREFS: fixed a problem with name server.</tt></li>
+ <li><tt>08.12.2016 REGIONS: Sky Coordinates are now formated for precision of 1/1000 of arcsec.</tt></li>
+ <li><tt>08.16.2016 PLOT: fixed an issue with incorrect color for bar chart.</tt></li>
+ <li><tt>08.18.2016 BIN: pass all keywords except manitory and reserved.</tt></li>
+ <li><tt>09.02.2016 CONTOUR: new contour file format. DS9 can read/write the new contour file format while continue support for read the old contour file format.</tt></li>
+ <li><tt>09.06.2016 CONTOUR: can read contour levels from new format while continue support for read and write old contour levels format.</tt></li>
+ <li><tt>09.09.2016 REGION: fixed a problem where RULER was not using the default length format.</tt></li>
+ <li><tt>09.14.2016 POSTSCRIPT: fixed a problem with PS level 3 images.</tt></li>
+ <li><tt><b>09.16.2016 RELEASE version 7.5rc</b></tt></li>
+ <li><tt>09.16.2016 MACOSX: add NSHighResolutionCapable attribute to info.plist to support Retina displays.</tt></li>
+ <li><tt>10.05.2016 REGION: fixed a problem when contour "Convert to Polygons" created polygon regions. Saving or listing the regions caused a Segv.</tt></li>
+ <li><tt>10.05.2016 REGION: fixed a problem saving or listing regions in WCS when no WCS is defined for the FITS image. The regions file was corrupted.</tt></li>
+ <li><tt>10.05.2016 REGION: fixed a problem with Composite Regions not properly updating when created. The region was not displayed properly.</tt></li>
+ <li><tt><b>10.06.2016 RELEASE version 7.5rc2</b></tt></li>
+ </ol>
+ </ol>
+ </body>
+</html>
diff --git a/ds9/doc/story.html b/ds9/doc/story.html
new file mode 100644
index 0000000..86e60ab
--- /dev/null
+++ b/ds9/doc/story.html
@@ -0,0 +1,59 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=ISO-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>Story of SAOImage DS9</title>
+</head>
+<body link="#0000ee" text="#000000" vlink="#551a8b" alink="#ff0000"
+ bgcolor="#ffffff">
+<h3> <img alt="" src="sun.gif" height="98" width="100" align="middle">
+The Story of SAOImage DS9: How DS9 got its name<br>
+</h3>
+<blockquote>
+ <p>In 1990, Mike Van Hilst, at the Smithsonian Astrophysical
+Observatory, Center for Astrophysics, Harvard University, developed
+SAOImage. SAOImage was first implemented in X10, then reimplemented in
+X11. In fact, it was one of the first X11 based applications publicly
+made available. SAOImage was a brilliant program, implementing
+techniques in scientific visualization 20 years ago that are still
+being used by today's applications. Since Mike's departure from SAO,
+SAOImage has been maintained by Doug Mink.</p>
+ <p>In the mid 1990's, with the administrative support of Steve
+Murray, Eric Mandel developed SAOtng, or
+(SAOImage, The Next Generation), named after the Star Trek series. TNG
+was based on IRAF's XIMTOOL graphics libraries and Tcl. It explored new
+GUI interfaces and supported a new external analysis interface. In
+particular, it utilized XPA, (X11 Public Access, also written by Eric)
+which allowed TNG to be scripted via a shell, or from other application.</p>
+ <p>In 1998, while working with Eric, William Joye began a complete
+rewrite of TNG, based on the experience developed while supporting TNG.
+This project was funded by the NASA Applied Information Systems
+Research Program, under the title "Future Directions for Astronomical
+Image Display". For lack of a name, the new project was referred to as
+DS9, the logical extension of the Star Trek series. The name continues
+to be in use. Current funding is provided by the NASA High Energy
+Astrophysics Science Archive Center and the Chandra X-ray Science
+Center.<br>
+ </p>
+ <p>DS9 is a Tcl/Tk application. The GUI is implemented as a very thin
+layer of Tk. A number of Tk Canvas widgets in C++ were created to
+support all the functionality needed. Basically, all the real work is
+done in C++. DS9 inherited TNG's support of regions, XPA, external
+analysis support, and the general GUI. However, all the visualization
+techniques come directly from SAOImage.</p>
+ <p>The current version of DS9 is composed of the Tk widgets created
+along with support from about 20 other open source products (including
+Tcl/Tk, AST, BLT, HCompress, HTMLWidget, plio, rics, tcllib, tclxml,
+tkcon, tkimg, tktable, wcssubs, xmlrpc, XPA, zip, zlib, and zvfs). The
+distributed binaries consist of a self-contained self-extracting
+archive and application, which provides an independent Tcl/Tk
+environment without installation.</p>
+ <p>The first versions of SAOImage DS9 were made available in 1999.
+Since then, the popularity of DS9 has grown far beyond expectations.<br>
+ </p>
+</blockquote>
+</body>
+</html>
diff --git a/ds9/doc/sun.gif b/ds9/doc/sun.gif
new file mode 100644
index 0000000..e4f82ff
--- /dev/null
+++ b/ds9/doc/sun.gif
Binary files differ
diff --git a/ds9/doc/tutorial.html b/ds9/doc/tutorial.html
new file mode 100644
index 0000000..2af5a37
--- /dev/null
+++ b/ds9/doc/tutorial.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.76 [en] (X11; U; SunOS 5.8 sun4u) [Netscape]">
+ <title>SAOImage: Tutorials</title>
+</head>
+<body style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"
+ alink="#ff0000" link="#0000ee" vlink="#551a8b">
+<h2> <img src="sun.gif" alt="" align="middle" height="98" width="100">
+SAOImage DS9: Tutorials<br>
+</h2>
+<blockquote>Below is a list of instructional tutorials which
+are currently available. This list is updated regularly as new material
+becomes
+available.<br>
+ <br>
+ <a href="http://www.cfa.harvard.edu/dvlwrap/special/ds9/May52009.ram"><b>Exploring
+Advanced Features of
+SAOImage DS9</b></a><br>
+ <i>CFA Head Lunch Talk: May 5, 2009</i><br>
+ <br>
+</blockquote>
+<br>
+</body>
+</html>
diff --git a/ds9/doc/user/binning/binmenu.png b/ds9/doc/user/binning/binmenu.png
new file mode 100644
index 0000000..34a399e
--- /dev/null
+++ b/ds9/doc/user/binning/binmenu.png
Binary files differ
diff --git a/ds9/doc/user/binning/binpar.png b/ds9/doc/user/binning/binpar.png
new file mode 100644
index 0000000..3bc5973
--- /dev/null
+++ b/ds9/doc/user/binning/binpar.png
Binary files differ
diff --git a/ds9/doc/user/binning/binpar2.png b/ds9/doc/user/binning/binpar2.png
new file mode 100644
index 0000000..182edb9
--- /dev/null
+++ b/ds9/doc/user/binning/binpar2.png
Binary files differ
diff --git a/ds9/doc/user/binning/block4.png b/ds9/doc/user/binning/block4.png
new file mode 100644
index 0000000..07b7745
--- /dev/null
+++ b/ds9/doc/user/binning/block4.png
Binary files differ
diff --git a/ds9/doc/user/binning/cubebox.png b/ds9/doc/user/binning/cubebox.png
new file mode 100644
index 0000000..3c9b17e
--- /dev/null
+++ b/ds9/doc/user/binning/cubebox.png
Binary files differ
diff --git a/ds9/doc/user/binning/cubeimg.png b/ds9/doc/user/binning/cubeimg.png
new file mode 100644
index 0000000..8c72995
--- /dev/null
+++ b/ds9/doc/user/binning/cubeimg.png
Binary files differ
diff --git a/ds9/doc/user/binning/defaults.png b/ds9/doc/user/binning/defaults.png
new file mode 100644
index 0000000..b9bd8fc
--- /dev/null
+++ b/ds9/doc/user/binning/defaults.png
Binary files differ
diff --git a/ds9/doc/user/binning/detimage.png b/ds9/doc/user/binning/detimage.png
new file mode 100644
index 0000000..f89bc43
--- /dev/null
+++ b/ds9/doc/user/binning/detimage.png
Binary files differ
diff --git a/ds9/doc/user/binning/filterimg.png b/ds9/doc/user/binning/filterimg.png
new file mode 100644
index 0000000..58cee6d
--- /dev/null
+++ b/ds9/doc/user/binning/filterimg.png
Binary files differ
diff --git a/ds9/doc/user/binning/index.html b/ds9/doc/user/binning/index.html
new file mode 100644
index 0000000..281df7f
--- /dev/null
+++ b/ds9/doc/user/binning/index.html
@@ -0,0 +1,367 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Binning and Filtering FITS Event Files - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Binning and Filtering FITS Event Files</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ When an x-ray event file is loaded, ds9 makes a virtual
+ image for display by binning on one or more axes.
+ This threads describes how to adjust the binning and buffer
+ sizes. Interactive data filtering is described, as well
+ as binning in three dimensions.
+ </p>
+
+ <p>
+ Note that the terms "binning" and "blocking" are used
+ interchangeably in this thread. They both refer to
+ combining pixels in an image.
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li><strong><a href="index.html#start">Getting Started</a></strong></li>
+<li><strong><a href="index.html#buffer">Buffer Size</a></strong></li>
+<li>
+<strong><a href="index.html#basics">Binning Basics</a></strong><ul>
+<li><a href="index.html#basics.block">Changing the binning factor</a></li>
+<li><a href="index.html#basics.cols">Binning different columns</a></li>
+</ul>
+</li>
+<li><strong><a href="index.html#cube">Data Cubes: Binning in three dimensions</a></strong></li>
+<li><strong><a href="index.html#filtering">Filtering Data</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#defaults">Figure 1: Data loaded with default buffer and bin size</a></li>
+<li><a href="#binmenu">Figure 2: The Bin menu</a></li>
+<li><a href="#smallbuffer">Figure 3: Buffer size set to 128x128</a></li>
+<li><a href="#largebuffer">Figure 4: Buffer size set to 4096x4096</a></li>
+<li><a href="#block4">Figure 5: Data binned by a factor of 4</a></li>
+<li><a href="#binpar">Figure 6: The Binning Parameter dialog</a></li>
+<li><a href="#detimage">Figure 7: Image binned in detector coordinates</a></li>
+<li><a href="#binpar2">Figure 8: Binning Parameter dialog for a data cube</a></li>
+<li><a href="#cubebox">Figure 9: Data Cube dialog box</a></li>
+<li><a href="#cubeimg">Figure 10: Viewing a data cube</a></li>
+<li><a href="#filterimg">Figure 11: Filtering data</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="start">Getting Started</a></h2>
+
+
+ <p>
+ This thread begins with Chandra data from an observation of
+ the Antennae Galaxies (NGC 4038/NGC 4039, ObsID 315). Open
+ the file in ds9:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 acisf00315N002_evt2.fits &amp;
+</pre></div>
+
+ <p>
+ A small section of the data is visible when the file is
+ loaded, as shown in <a href="#defaults">Figure 1</a>. The target of
+ the observation is partially visible in the display frame.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="defaults">Figure 1: Data loaded with default buffer and bin size</a></h3></div>
+<div><img alt="[The target sources of the observation are partially visible at the bottom of the frame.]" src="defaults.png"></div>
+</div>
+
+ <p>
+ By default, the buffer size is set to 1024x1024 and the
+ binning factor is set to 1. These values will be adjusted
+ in the following sections to illustrate how to make more of
+ the data visible.
+ </p>
+
+ <p>
+ The "Bin" menu, shown in <a href="#binmenu">Figure 2</a>, will be used to
+ change the setting in the following examples. From top to
+ bottom, this menu contains the bin function setting,
+ blocking factor, buffer size options, and access to the
+ binning parameters dialog box.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="binmenu">Figure 2: The Bin menu</a></h3></div>
+<div><img alt="[The blocking factor is set to 1, the buffer size is 1024x1024, and the function is sum.]" src="binmenu.png"></div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="buffer">Buffer Size</a></h2>
+
+
+ <p>
+ The buffer size determines the size of the image generated
+ by ds9. By default, a full-resolution 1024x1024 image of
+ the data is created. If your input data file has larger
+ dimensions, it is clipped to 1024x1024 in ds9. The buffer
+ settings range from 128x128 to 8192x1892.
+ </p>
+
+ <p>
+ Setting the buffer to the smallest size, 128x128,
+ illustrates how it works. The data was centered on the
+ sources in ds9 before the buffer size was changed, creating
+ <a href="#smallbuffer">Figure 3</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="smallbuffer">Figure 3: Buffer size set to 128x128</a></h3></div>
+<div><img alt="[A small central portion of the data is visible.]" src="smallbuffer.png"></div>
+</div>
+
+ <p>
+ Setting the buffer to a large size, e.g. 4096x4096, produces
+ <a href="#largebuffer">Figure 4</a>. The display frame is filled by
+ the data, and the panner in the upper right indicates
+ that more of the image is available. Clicking and dragging
+ the viewing bounding box in the panner will display a
+ different portion of the image.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="largebuffer">Figure 4: Buffer size set to 4096x4096</a></h3></div>
+<div><img alt="[The frame is filled by the data, and the panner indicates more of the image is outside the field of view.]" src="largebuffer.png"></div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="basics">Binning Basics</a></h2>
+
+
+ <div class="subsectionlist">
+<div class="subsection">
+<h3><a name="basics.block">Changing the binning factor</a></h3>
+
+
+ <p>
+ While increasing the buffer size loads more of the file
+ into ds9, binning the data makes more of it visible in
+ the frame. Binning combines the specified number of
+ pixels into one new pixel; the new pixel has a value
+ equal to the sum of the original pixels. (Note that if
+ the bin method is changed to "average", the pixel values
+ are averaged instead of summed.)
+ </p>
+
+ <p>
+ The binning can changed from the "Bin" menu or from the
+ "Bin" item in the button bar. It's also possible to
+ step through different binning values with the -/+
+ buttons or the "Block In"/"Block Out" menu items.
+ </p>
+
+ <p>
+ In <a href="#block4">Figure 5</a>, the buffer size is set to
+ 1024x1024, but the block factor has been set to 4. A
+ larger section of the data is visible in the frame.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="block4">Figure 5: Data binned by a factor of 4</a></h3></div>
+<div><img alt="[Five of the CCDs are visible in the binned data.]" src="block4.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="basics.cols">Binning different columns</a></h3>
+
+
+ <p>
+ ds9 has the ability to display any of the other columns
+ stored in the event file, although it is generally only
+ meaningful to use the spatial vector columns. Begin by
+ opening the "Bin → Binning Parameters" dialog box,
+ shown in <a href="#binpar">Figure 6</a>.
+ </p>
+
+ <p>
+ The "Bin Columns" menus are used to select the columns
+ to be binned. To create an image in detector
+ coordinates, set the first to "detx" and the second to
+ "dety"; the block is set to "2" for both.
+ The "or center of data" box is checked so that the
+ center of the data is recalculated for the new columns.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="binpar">Figure 6: The Binning Parameter dialog</a></h3></div>
+<div><img alt="[The parameters are set to bin in detector coordinates about the center of the data.]" src="binpar.png"></div>
+</div>
+
+ <p>
+ Click "Apply" and the ds9 frame is updated, as shown in
+ <a href="#detimage">Figure 7</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="detimage">Figure 7: Image binned in detector coordinates</a></h3></div>
+<div><img alt="[Some bad columns are visible in black in the detector image.]" src="detimage.png"></div>
+</div>
+
+ <p>
+ Alternatively, one can display an event file in specific
+ coordinates when starting ds9 from the command line:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 "acisf00315N002_evt2.fits[bin=detx,dety]" &amp;
+</pre></div>
+
+ </div>
+</div>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="cube">Data Cubes: Binning in three dimensions</a></h2>
+
+
+ <p>
+ It is possible to add a third column to the binning,
+ creating a 3-dimensional image also known as a "data cube".
+ In this example, an (x,y,time) data cube is created of a
+ Chandra observation of Jupiter (ObsID 1463). A cube may be
+ created from any three columns that make sense in the
+ analysis. For instance, you may want to create a PHA or
+ energy axis to see how the spectral characteristics of a
+ source change over time.
+ </p>
+
+ <p>
+ The data file is loaded into a new frame in ds9 and the "Bin →
+ Binning Parameters" dialog box is opened again. The "time"
+ column of the file is selected from the "Bin 3rd Column"
+ menu. The limits of the data in that column are filled in
+ automatically. The "depth" field determines how many
+ intervals the column is divided into; a depth of 25 is used.
+ The completed parameter box is shown in
+ <a href="#binpar2">Figure 8</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="binpar2">Figure 8: Binning Parameter dialog for a data cube</a></h3></div>
+<div><img alt='[The third binning column is set to "time" with a depth of "25".]' src="binpar2.png"></div>
+</div>
+
+ <p>
+ After clicking "Apply", two things
+ happen: <a href="#cubebox">the "Data Cube" dialog
+ box (Figure 9)</a> is launched and <a href="#cubeimg">the
+ frame is updated to show only the (x,y) image of the first
+ time slice (Figure 10)</a>. (If the data cube dialog box doesn't
+ launch, open it from the "Frame" menu.)
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="cubebox">Figure 9: Data Cube dialog box</a></h3></div>
+<div><img alt="[The dialog box has controls to step through each slice of the data cube.]" src="cubebox.png"></div>
+</div>
+
+ <p>
+ When "Play" is chosen, ds9 cycles through the bins of the
+ time axis, essentially creating a movie of the (x,y)
+ position of the object over time. The speed of the frame
+ changes is controlled from the "Interval" menu of the dialog
+ box. Any of the 25 intervals may be selected with the
+ slider bar.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="cubeimg">Figure 10: Viewing a data cube</a></h3></div>
+<div><img alt="[One interval of the data cube is visible at a time when displayed in ds9.]" src="cubeimg.png"></div>
+</div>
+
+ <p>
+ The data cube can be saved as an MPEG movie from the "File →
+ Save Image..." menu. Select "MPEG-1 (Movie)" and click
+ "OK"; after setting the filename, choose an MPEG Quality
+ Factor. The Jupiter data was saved at a quality factor of
+ 15: <a href="jupiter.mpg">jupiter.mpg</a>.
+ </p>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="filtering">Filtering Data</a></h2>
+
+
+ <p>
+ The "Bin Filter" field in the "Binning Parameters" dialog
+ box is used to apply filters to the data. A filter can be
+ applied to any of the columns present in the input file. A
+ colon is used to indicate a range of values. Filters can
+ also use &lt; (less than) or &gt; (greater than).
+ </p>
+
+ <p>
+ For instance, to include only the hard-band photons
+ (2500-8000 eV):
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">energy=2500:8000</pre></div>
+
+ <p>
+ Clicking "Apply" updates the ds9 display and keeps the
+ dialog open for adjusting the filters.
+ </p>
+
+ <p>
+ Multiple filters may be specified, separated by commas:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">energy=2500:8000, ccd_id=7</pre></div>
+
+ <p>
+ The resulting image is shown in <a href="#filterimg">Figure 11</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="filterimg">Figure 11: Filtering data</a></h3></div>
+<div><img alt="[Only the hard-band photos on CCD 7 are displayed.]" src="filterimg.png"></div>
+</div>
+
+ <p>
+ The filtered dataset can be saved as a FITS file for use in
+ data analysis from the "File → Save Frame as Fits..."
+ menu.
+ </p>
+
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">26 Jun 2009</td>
+<td>
+ Original version
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/binning/jupiter.mpg b/ds9/doc/user/binning/jupiter.mpg
new file mode 100644
index 0000000..668d338
--- /dev/null
+++ b/ds9/doc/user/binning/jupiter.mpg
Binary files differ
diff --git a/ds9/doc/user/binning/largebuffer.png b/ds9/doc/user/binning/largebuffer.png
new file mode 100644
index 0000000..764c1b7
--- /dev/null
+++ b/ds9/doc/user/binning/largebuffer.png
Binary files differ
diff --git a/ds9/doc/user/binning/smallbuffer.png b/ds9/doc/user/binning/smallbuffer.png
new file mode 100644
index 0000000..7553884
--- /dev/null
+++ b/ds9/doc/user/binning/smallbuffer.png
Binary files differ
diff --git a/ds9/doc/user/binning/thread.xml b/ds9/doc/user/binning/thread.xml
new file mode 100644
index 0000000..1a8cffc
--- /dev/null
+++ b/ds9/doc/user/binning/thread.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="us-ascii" ?>
+<!DOCTYPE thread>
+
+<thread>
+
+ <info>
+
+ <name>binning</name>
+ <version>June 2009</version>
+ <title>
+ <long>Binning and Filtering FITS Event Files</long>
+ </title>
+ <history>
+ <entry day="26" month="June" year="9" who="liz">
+ Original version
+ </entry>
+ </history>
+ </info>
+
+ <text>
+ <overview>
+
+ <synopsis>
+ <p>
+ When an x-ray event file is loaded, ds9 makes a virtual
+ image for display by binning on one or more axes.
+ This threads describes how to adjust the binning and buffer
+ sizes. Interactive data filtering is described, as well
+ as binning in three dimensions.
+ </p>
+
+ <p>
+ Note that the terms "binning" and "blocking" are used
+ interchangeably in this thread. They both refer to
+ combining pixels in an image.
+ </p>
+ </synopsis>
+ </overview>
+
+ <sectionlist>
+ <section id="start">
+ <title>Getting Started</title>
+
+ <p>
+ This thread begins with Chandra data from an observation of
+ the Antennae Galaxies (NGC 4038/NGC 4039, ObsID 315). Open
+ the file in ds9:
+ </p>
+
+<screen>
+unix% ds9 acisf00315N002_evt2.fits &amp;
+</screen>
+
+ <p>
+ A small section of the data is visible when the file is
+ loaded, as shown in <figlink id="defaults"/>. The target of
+ the observation is partially visible in the display frame.
+ </p>
+
+ <figure id="defaults">
+ <title>Data loaded with default buffer and bin size</title>
+ <description>The target sources of the observation are
+ partially visible at the bottom of the frame.</description>
+ <bitmap format="png">defaults.png</bitmap>
+ </figure>
+
+ <p>
+ By default, the buffer size is set to 1024x1024 and the
+ binning factor is set to 1. These values will be adjusted
+ in the following sections to illustrate how to make more of
+ the data visible.
+ </p>
+
+ <p>
+ The "Bin" menu, shown in <figlink id="binmenu"/>, will be used to
+ change the setting in the following examples. From top to
+ bottom, this menu contains the bin function setting,
+ blocking factor, buffer size options, and access to the
+ binning parameters dialog box.
+ </p>
+
+ <figure id="binmenu">
+ <title>The Bin menu</title>
+ <description>The blocking factor is set to 1, the buffer
+ size is 1024x1024, and the function is sum.</description>
+ <bitmap format="png">binmenu.png</bitmap>
+ </figure>
+
+ </section>
+
+
+ <section id="buffer">
+ <title>Buffer Size</title>
+
+ <p>
+ The buffer size determines the size of the image generated
+ by ds9. By default, a full-resolution 1024x1024 image of
+ the data is created. If your input data file has larger
+ dimensions, it is clipped to 1024x1024 in ds9. The buffer
+ settings range from 128x128 to 8192x1892.
+ </p>
+
+ <p>
+ Setting the buffer to the smallest size, 128x128,
+ illustrates how it works. The data was centered on the
+ sources in ds9 before the buffer size was changed, creating
+ <figlink id="smallbuffer"/>.
+ </p>
+
+ <figure id="smallbuffer">
+ <title>Buffer size set to 128x128</title>
+ <description>A small central portion of the data is visible.</description>
+ <bitmap format="png">smallbuffer.png</bitmap>
+ </figure>
+
+ <p>
+ Setting the buffer to a large size, e.g. 4096x4096, produces
+ <figlink id="largebuffer"/>. The display frame is filled by
+ the data, and the panner in the upper right indicates
+ that more of the image is available. Clicking and dragging
+ the viewing bounding box in the panner will display a
+ different portion of the image.
+ </p>
+
+ <figure id="largebuffer">
+ <title>Buffer size set to 4096x4096</title>
+ <description>The frame is filled by the data, and
+ the panner indicates more of the image is outside the field
+ of view.</description>
+ <bitmap format="png">largebuffer.png</bitmap>
+ </figure>
+
+ </section>
+
+ <section id="basics">
+ <title>Binning Basics</title>
+
+ <subsectionlist>
+ <subsection id="basics.block">
+ <title>Changing the binning factor</title>
+
+ <p>
+ While increasing the buffer size loads more of the file
+ into ds9, binning the data makes more of it visible in
+ the frame. Binning combines the specified number of
+ pixels into one new pixel; the new pixel has a value
+ equal to the sum of the original pixels. (Note that if
+ the bin method is changed to "average", the pixel values
+ are averaged instead of summed.)
+ </p>
+
+ <p>
+ The binning can changed from the "Bin" menu or from the
+ "Bin" item in the button bar. It's also possible to
+ step through different binning values with the -/+
+ buttons or the "Block In"/"Block Out" menu items.
+ </p>
+
+ <p>
+ In <figlink id="block4"/>, the buffer size is set to
+ 1024x1024, but the block factor has been set to 4. A
+ larger section of the data is visible in the frame.
+ </p>
+
+ <figure id="block4">
+ <title>Data binned by a factor of 4</title>
+ <description>Five of the CCDs are visible in the binned data.</description>
+ <bitmap format="png">block4.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="basics.cols">
+ <title>Binning different columns</title>
+
+ <p>
+ ds9 has the ability to display any of the other columns
+ stored in the event file, although it is generally only
+ meaningful to use the spatial vector columns. Begin by
+ opening the "Bin &#8594; Binning Parameters" dialog box,
+ shown in <figlink id="binpar"/>.
+ </p>
+
+ <p>
+ The "Bin Columns" menus are used to select the columns
+ to be binned. To create an image in detector
+ coordinates, set the first to "detx" and the second to
+ "dety"; the block is set to "2" for both.
+ The "or center of data" box is checked so that the
+ center of the data is recalculated for the new columns.
+ </p>
+
+ <figure id="binpar">
+ <title>The Binning Parameter dialog</title>
+ <description>The parameters are set to bin in detector
+ coordinates about the center of the data.</description>
+ <bitmap format="png">binpar.png</bitmap>
+ </figure>
+
+ <p>
+ Click "Apply" and the ds9 frame is updated, as shown in
+ <figlink id="detimage"/>.
+ </p>
+
+ <figure id="detimage">
+ <title>Image binned in detector coordinates</title>
+ <description>Some bad columns are visible in black in the
+ detector image.</description>
+ <bitmap format="png">detimage.png</bitmap>
+ </figure>
+
+ <p>
+ Alternatively, one can display an event file in specific
+ coordinates when starting ds9 from the command line:
+ </p>
+
+<screen>
+unix% ds9 "acisf00315N002_evt2.fits[bin=detx,dety]" &amp;
+</screen>
+
+ </subsection>
+ </subsectionlist>
+ </section>
+
+
+ <section id="cube">
+ <title>Data Cubes: Binning in three dimensions</title>
+
+ <p>
+ It is possible to add a third column to the binning,
+ creating a 3-dimensional image also known as a "data cube".
+ In this example, an (x,y,time) data cube is created of a
+ Chandra observation of Jupiter (ObsID 1463). A cube may be
+ created from any three columns that make sense in the
+ analysis. For instance, you may want to create a PHA or
+ energy axis to see how the spectral characteristics of a
+ source change over time.
+ </p>
+
+ <p>
+ The data file is loaded into a new frame in ds9 and the "Bin &#8594;
+ Binning Parameters" dialog box is opened again. The "time"
+ column of the file is selected from the "Bin 3rd Column"
+ menu. The limits of the data in that column are filled in
+ automatically. The "depth" field determines how many
+ intervals the column is divided into; a depth of 25 is used.
+ The completed parameter box is shown in
+ <figlink id="binpar2"/>.
+ </p>
+
+ <figure id="binpar2">
+ <title>Binning Parameter dialog for a data cube</title>
+ <description>The third binning column is set to "time" with a depth of "25".</description>
+ <bitmap format="png">binpar2.png</bitmap>
+ </figure>
+
+ <p>
+ After clicking "Apply", two things
+ happen: <figlink id="cubebox">the "Data Cube" dialog
+ box</figlink> is launched and <figlink id="cubeimg">the
+ frame is updated to show only the (x,y) image of the first
+ time slice</figlink>. (If the data cube dialog box doesn't
+ launch, open it from the "Frame" menu.)
+ </p>
+
+ <figure id="cubebox">
+ <title>Data Cube dialog box</title>
+ <description>The dialog box has controls to step through each
+ slice of the data cube.</description>
+ <bitmap format="png">cubebox.png</bitmap>
+ </figure>
+
+ <p>
+ When "Play" is chosen, ds9 cycles through the bins of the
+ time axis, essentially creating a movie of the (x,y)
+ position of the object over time. The speed of the frame
+ changes is controlled from the "Interval" menu of the dialog
+ box. Any of the 25 intervals may be selected with the
+ slider bar.
+ </p>
+
+ <figure id="cubeimg">
+ <title>Viewing a data cube</title>
+ <description>One interval of the data cube is visible at a
+ time when displayed in ds9.</description>
+ <bitmap format="png">cubeimg.png</bitmap>
+ </figure>
+
+ <p>
+ The data cube can be saved as an MPEG movie from the "File &#8594;
+ Save Image..." menu. Select "MPEG-1 (Movie)" and click
+ "OK"; after setting the filename, choose an MPEG Quality
+ Factor. The Jupiter data was saved at a quality factor of
+ 15: <a href="jupiter.mpg">jupiter.mpg</a>.
+ </p>
+ </section>
+
+
+ <section id="filtering">
+ <title>Filtering Data</title>
+
+ <p>
+ The "Bin Filter" field in the "Binning Parameters" dialog
+ box is used to apply filters to the data. A filter can be
+ applied to any of the columns present in the input file. A
+ colon is used to indicate a range of values. Filters can
+ also use &lt; (less than) or &gt; (greater than).
+ </p>
+
+ <p>
+ For instance, to include only the hard-band photons
+ (2500-8000 eV):
+ </p>
+
+<screen>energy=2500:8000</screen>
+
+ <p>
+ Clicking "Apply" updates the ds9 display and keeps the
+ dialog open for adjusting the filters.
+ </p>
+
+ <p>
+ Multiple filters may be specified, separated by commas:
+ </p>
+
+<screen>energy=2500:8000, ccd_id=7</screen>
+
+ <p>
+ The resulting image is shown in <figlink id="filterimg"/>.
+ </p>
+
+ <figure id="filterimg">
+ <title>Filtering data</title>
+ <description>Only the hard-band photos on CCD 7 are displayed.</description>
+ <bitmap format="png">filterimg.png</bitmap>
+ </figure>
+
+ <p>
+ The filtered dataset can be saved as a FITS file for use in
+ data analysis from the "File &#8594; Save Frame as Fits..."
+ menu.
+ </p>
+
+ </section>
+
+ </sectionlist>
+ </text>
+<!--
+ <figure id="">
+ <title></title>
+ <description></description>
+ <bitmap format="png">.png</bitmap>
+ </figure>
+-->
+
+</thread>
+
+
+
diff --git a/ds9/doc/user/catalogs/2masscat.png b/ds9/doc/user/catalogs/2masscat.png
new file mode 100644
index 0000000..c1a75c1
--- /dev/null
+++ b/ds9/doc/user/catalogs/2masscat.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/2masssort.png b/ds9/doc/user/catalogs/2masssort.png
new file mode 100644
index 0000000..dd5c7b8
--- /dev/null
+++ b/ds9/doc/user/catalogs/2masssort.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/2masssrc.png b/ds9/doc/user/catalogs/2masssrc.png
new file mode 100644
index 0000000..450ecb4
--- /dev/null
+++ b/ds9/doc/user/catalogs/2masssrc.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/addlabels.png b/ds9/doc/user/catalogs/addlabels.png
new file mode 100644
index 0000000..ad2cd96
--- /dev/null
+++ b/ds9/doc/user/catalogs/addlabels.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/addlabelsds9.png b/ds9/doc/user/catalogs/addlabelsds9.png
new file mode 100644
index 0000000..9f4eee4
--- /dev/null
+++ b/ds9/doc/user/catalogs/addlabelsds9.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/cscsrc.png b/ds9/doc/user/catalogs/cscsrc.png
new file mode 100644
index 0000000..591a91b
--- /dev/null
+++ b/ds9/doc/user/catalogs/cscsrc.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/editjmag14.png b/ds9/doc/user/catalogs/editjmag14.png
new file mode 100644
index 0000000..835d380
--- /dev/null
+++ b/ds9/doc/user/catalogs/editjmag14.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/editjmag14ds9.png b/ds9/doc/user/catalogs/editjmag14ds9.png
new file mode 100644
index 0000000..2252318
--- /dev/null
+++ b/ds9/doc/user/catalogs/editjmag14ds9.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/editjmagrange.png b/ds9/doc/user/catalogs/editjmagrange.png
new file mode 100644
index 0000000..6a4e7ac
--- /dev/null
+++ b/ds9/doc/user/catalogs/editjmagrange.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/index.html b/ds9/doc/user/catalogs/index.html
new file mode 100644
index 0000000..5526580
--- /dev/null
+++ b/ds9/doc/user/catalogs/index.html
@@ -0,0 +1,414 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Catalogs - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Catalogs</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ DS9 provides full support for loading, displaying,
+ filtering, and saving catalogs. DS9 allows you to overlay
+ symbols from multiple catalogs on the current image and to
+ create expressions to style the source symbols based on
+ catalog properties.
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li><strong><a href="index.html#display">Displaying a Catalog</a></strong></li>
+<li><strong><a href="index.html#select">Selecting Sources with the Cursor</a></strong></li>
+<li><strong><a href="index.html#display2">Displaying Multiple Catalogs</a></strong></li>
+<li><strong><a href="index.html#clear">Clearing Catalog Sources</a></strong></li>
+<li><strong><a href="index.html#filter">Sorting and Filtering</a></strong></li>
+<li><strong><a href="index.html#symbol">Specifying Symbols with Conditional Expressions</a></strong></li>
+<li><strong><a href="index.html#save">Saving the Sources: Catalog Files and Region Files</a></strong></li>
+<li><strong><a href="index.html#cite">Citing a Catalog in Publication</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#2masssrc">Figure 1: 2MASS Sources for the Antennae Galaxies</a></li>
+<li><a href="#2masscat">Figure 2: Catalog Tool of 2MASS Sources</a></li>
+<li><a href="#cscsrc">Figure 3: CSC and 2MASS Sources for the Antennae Galaxies</a></li>
+<li><a href="#2masssort">Figure 4: 2MASS Sources Sorted by Decreasing Jmag</a></li>
+<li><a href="#jmag14">Figure 5: Filtering 2MASS Sources: Jmag&lt;14</a></li>
+<li><a href="#jmagrange">Figure 6: Filtering 2MASS Sources: Jmag&lt;14 or Jmag&gt;16.5</a></li>
+<li><a href="#editjmag14">Figure 7: Symbol Editing: Jmag&lt;14 Rule</a></li>
+<li><a href="#editjmag14ds9">Figure 8: Symbol Editing: Jmag&lt;14 Sources Displayed</a></li>
+<li><a href="#editjmagrange">Figure 9: Symbol Editing: Jmag&gt;16.5 Sources Added</a></li>
+<li><a href="#addlabels">Figure 10: Symbol Editing: Rule to Add a Label</a></li>
+<li><a href="#addlabelsds9">Figure 11: Symbol Editing: Jmag Labels Displayed</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="display">Displaying a Catalog</a></h2>
+
+
+ <p>
+ This thread uses an optical image of the Antennae Galaxies
+ (NGC 4038/NGC 4039) from the Digital Sky Survey (DSS). It
+ was retrieved via the "Analysis → Image Servers" menu
+ in ds9.
+ </p>
+
+ <p>
+ A number of the most popular catalogs are listed by
+ wavelength in the "Analysis → Catalogs" menu. More
+ options can be accessed via the "Search for Catalogs" option
+ in that menu.
+ </p>
+
+ <p>
+ First we overlay sources from 2MASS by choosing
+ "Analysis → Catalogs → Infrared → 2MASS
+ point sources". The source matches are displayed on the
+ ds9 display (<a href="#2masssrc">Figure 1</a>) and listed in a
+ "Catalog Tool" window (<a href="#2masscat">Figure 2</a>).
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="2masssrc">Figure 1: 2MASS Sources for the Antennae Galaxies</a></h3></div>
+<div><img alt="[The sources are displayed in green on the optical image.]" src="2masssrc.png"></div>
+</div>
+
+ <p>
+ A set area centered on the field of view is used for the
+ first catalog search. The center and size of the search
+ area may be adjusted in the Catalog Tool by setting the
+ RA, Dec, height, and width fields. The "Coordinate" and
+ "Size" menus may be used to set the units for those values
+ (degrees/sexagesimal and degrees/arcmin/arcsec,
+ respectively). After changing the values, click the
+ "Retrieve" button to update the Catalog Tool.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="2masscat">Figure 2: Catalog Tool of 2MASS Sources</a></h3></div>
+<div><img alt="[199 sources were returned for this field.]" src="2masscat.png"></div>
+</div>
+
+ <p>
+ Note that ds9 attempts to select the correct (RA,Dec)
+ columns from the catalog data file in order to display the
+ sources. In some cases, the user will have to explicitly
+ set the column names by using the drop-down menus in the
+ Catalog Tool. In this example, ds9 correctly chose "_RAJ2000" and
+ "_DEJ2000".
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="select">Selecting Sources with the Cursor</a></h2>
+
+
+ <p>
+ From the "Edit" menu in ds9, choose the "Catalog" cursor
+ type. Clicking on a source in the ds9 display highlights
+ the corresponding row in the Catalog Tool. Multiple sources may be
+ selected by holding down the SHIFT key while clicking them.
+ </p>
+
+ <p>
+ Similarly, highlighting a row in the Catalog Tool will blink the
+ source region in ds9. If the "Pan to" option in the Catalog Tool
+ "Preferences" menu is checked, the ds9 display also centers
+ on the chosen source. Mutiple rows may be selected by
+ holding down the SHIFT or CTRL key while selecting them.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="display2">Displaying Multiple Catalogs</a></h2>
+
+
+ <p>
+ More than one catalog can be displayed in the same frame.
+ By default, the sources are displayed as green circle
+ points. The color and shape can be changed in the "Symbol"
+ menu of the Catalog Tool to distinguish between the different catalogs.
+ </p>
+
+ <p>
+ In <a href="#cscsrc">Figure 3</a>, the Chandra Source Catalog has been
+ added to the display (Analysis → Catalogs → High
+ Energy → Chandra Source). The symbols for the CSC
+ sources are set to red diamonds.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="cscsrc">Figure 3: CSC and 2MASS Sources for the Antennae Galaxies</a></h3></div>
+<div><img alt="[The 2MASS sources are displayed as green circles and the CSC sources are displayed as red diamonds on the optical image.]" src="cscsrc.png"></div>
+</div>
+
+ <p>
+ To toggle the display of each catalog, use the "Show
+ Regions" option in the Catalog Tool "Preferences" menu.
+ </p>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="clear">Clearing Catalog Sources</a></h2>
+
+
+ <p>
+ Simply closing the Catalog Tool will not remove the sources from the
+ display. It is necessary to choose "Clear" from the
+ corresponding Catalog Tool.
+ </p>
+
+ <p>
+ To remove <em>all</em> the sources from the display, use
+ "Analysis → Catalogs → Clear All".
+ </p>
+
+ <p>
+ For the rest of this thread, only the 2MASS sources will be
+ used.
+ </p>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="filter">Sorting and Filtering</a></h2>
+
+
+ <p>
+ The source listing is sorted on position by default. A
+ different column for sorting may be selected from the "Sort"
+ menu in the Catalog Tool. Related checkboxes determine whether the
+ results are listed in increasing or decreasing order.
+ The Catalog Tool in <a href="#2masssort">Figure 4</a> is sorted on the
+ "Jmag" column in decreasing order.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="2masssort">Figure 4: 2MASS Sources Sorted by Decreasing Jmag</a></h3></div>
+<div><img alt="[The sources are sorted on the Jmag column in decreasing order.]" src="2masssort.png"></div>
+</div>
+
+ <p>
+ The "Filter" field in the Catalog Tool is used to filter out
+ specific rows from the source matches. A filter is
+ conditional expression that is evaluated for each row of the
+ catalog. The column name must be referenced with a dollar
+ sign in the expression, e.g. "$_RAJ2000".
+ </p>
+
+ <p>
+ To select the sources with low Jmag values, the filter
+ "$Jmag&lt;14" is used. Click the "Filter" button to update
+ the Catalog Tool and the ds9 display. The results are shown in
+ <a href="#jmag14">Figure 5</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="jmag14">Figure 5: Filtering 2MASS Sources: Jmag&lt;14</a></h3></div>
+<div><img alt="[33 sources are included in the filter.]" src="jmag14.png"></div>
+</div>
+
+ <p>
+ TCL expression syntax can be used to construct more complex
+ filters. The filter "$Jmag&lt;14 || $Jmag&gt;16.5" uses the
+ logical "OR" syntax ("||") to select any source with Jmag
+ less than 14 or greater than 16.5, as shown in
+ <a href="#jmagrange">Figure 6</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="jmagrange">Figure 6: Filtering 2MASS Sources: Jmag&lt;14 or Jmag&gt;16.5</a></h3></div>
+<div><img alt="[70 sources are included in the filter.]" src="jmagrange.png"></div>
+</div>
+
+ <p>
+ The uniformity of the symbols doesn't distinguish between
+ the low-Jmag sources and the high-Jmag sources. The
+ advanced symbol editing in the next section improves on this
+ display.
+ </p>
+
+ <p>
+ Before continuing the thread, clear the filter in the
+ Catalog Tool so that all the sources are displayed.
+ </p>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="symbol">Specifying Symbols with Conditional Expressions</a></h2>
+
+
+ <p>
+ The advanced symbol editing in the Catalog Tool allows you to
+ specify the shape, size, color, and text of each symbol
+ based on catalog column values.
+ </p>
+
+ <p>
+ Open the "Symbol Editor" from the "Symbol →
+ Advanced..." menu in the Catalog Tool. A conditional statement,
+ written in the TCL expression syntax, is entered in the "If"
+ field. The styles that should be applied are set by the
+ other fields (shape, color, text, etc.).
+ </p>
+
+ <p>
+ First, define a rule that sets the sources with
+ Jmag&lt;14 to be red boxcircle points. The completed form
+ is shown in <a href="#editjmag14">Figure 7</a>. After clicking the
+ "Apply" button, the ds9 display is updated (<a href="#editjmag14ds9">Figure 8</a>).
+ </p>
+
+
+ <div class="figure">
+<div class="caption"><h3><a name="editjmag14">Figure 7: Symbol Editing: Jmag&lt;14 Rule</a></h3></div>
+<div><img alt="[The fields are set to display sources with Jmag&lt;14 as red boxpoints.]" src="editjmag14.png"></div>
+</div>
+
+ <div class="figure">
+<div class="caption"><h3><a name="editjmag14ds9">Figure 8: Symbol Editing: Jmag&lt;14 Sources Displayed</a></h3></div>
+<div><img alt="[The sources with Jmag&lt;14 are displayed as red boxpoints.]" src="editjmag14ds9.png"></div>
+</div>
+
+ <p>
+ The "Add" button in the Symbol Editor is used to create a
+ new, empty form. The second rule is defined such that
+ sources with Jmag&gt;16.5 will be cyan diamonds.
+ After clicking the "Apply" button again, the ds9 display is
+ as shown in <a href="#editjmagrange">Figure 9</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="editjmagrange">Figure 9: Symbol Editing: Jmag&gt;16.5 Sources Added</a></h3></div>
+<div><img alt="[The sources with Jmag&gt;16.5 are displayed as cyan diamonds.]" src="editjmagrange.png"></div>
+</div>
+
+ <p>
+ To edit an existing rule, highlight the rule in the Symbol
+ Editor and adjust the parameters. In
+ <a href="#addlabels">Figure 10</a>, both rules have been updated
+ so that the Text field is set to "$Jmag". This
+ <a href="#addlabelsds9">displays the Jmag column value
+ next to the symbol (Figure 11)</a>.
+ </p>
+
+
+ <div class="figure">
+<div class="caption"><h3><a name="addlabels">Figure 10: Symbol Editing: Rule to Add a Label</a></h3></div>
+<div><img alt="[The fields are set to label each source with its Jmag column value.]" src="addlabels.png"></div>
+</div>
+
+ <div class="figure">
+<div class="caption"><h3><a name="addlabelsds9">Figure 11: Symbol Editing: Jmag Labels Displayed</a></h3></div>
+<div><img alt="[Each source is labeled with its Jmag column value.]" src="addlabelsds9.png"></div>
+</div>
+
+ <p>
+ The ds9 Reference Manual
+ has <a href="../../ref/catalog.html">further examples of
+ symbol expressions</a>.
+ </p>
+
+ <p>
+ The set of rules may be saved from the "File" menu in the
+ Symbol Editor. The output for these rules looks like:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+condition shape color text size size2 units angle
+--------- ----- ----- ---- ---- ----- ----- -----
+$Jmag&lt;14 boxcircle point red $Jmag physical
+$Jmag&gt;16.5 diamond point cyan $Jmag physical
+</pre></div>
+
+ <p>
+ The file can be loaded into a later ds9 session by opening
+ the Symbol Editor and using the "File → Load" menu
+ item. Note that the column names in the symbol rules may
+ have to be updated in order to use them with a different
+ catalog.
+ </p>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="save">Saving the Sources: Catalog Files and Region Files</a></h2>
+
+
+
+ <p><strong>Saving a Catalog File</strong></p>
+ <p>
+ The contents of the Catalog Tool may be saved from the "File →
+ Save" menu. If any filters are applied, the filtered output
+ is saved in the catalog file.
+ </p>
+
+ <p>
+ ds9 supports three catalog formats: VOTable, Starbase, and
+ tab-separated file. If the catalog file will be loaded
+ back into ds9 in the future, any of the three formats may be
+ chosen.
+ </p>
+
+ <p><strong>Saving the Sources in a Region File</strong></p>
+ <p>
+ The sources may also be converted to a ds9 region file for
+ use in data analysis, e.g. spectra extraction or calculating
+ sources counts.
+ </p>
+
+ <p>
+ Select "Copy to Regions" from the Catalog Tool "File" menu. Once
+ the sources are converted to regions, individual ones may be
+ selected and edited or deleted, if desired. Save the
+ regions from the "Region → Save Regions..." menu.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="cite">Citing a Catalog in Publication</a></h2>
+
+
+ <p>
+ If you wish to use the source information in a publication,
+ refer to the "Acknowledgment" item under the "File" menu in
+ the Catalog Tool. For instance, the 2MASS acknowledgment reads:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+Acknowledgments for CDS
+
+This research has made use of the VizieR catalogue access tool, CDS,
+Strasbourg, France. VizieR is a joint effort of CDS (Centre de Données
+astronomiques de Strasbourg) and ESA-ESRIN (Information Systems Division).
+</pre></div>
+
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">08 Jan 2010</td>
+<td>
+ Original version
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/catalogs/jmag14.png b/ds9/doc/user/catalogs/jmag14.png
new file mode 100644
index 0000000..b521b93
--- /dev/null
+++ b/ds9/doc/user/catalogs/jmag14.png
Binary files differ
diff --git a/ds9/doc/user/catalogs/jmagrange.png b/ds9/doc/user/catalogs/jmagrange.png
new file mode 100644
index 0000000..a063a13
--- /dev/null
+++ b/ds9/doc/user/catalogs/jmagrange.png
Binary files differ
diff --git a/ds9/doc/user/contour/a2142.reg b/ds9/doc/user/contour/a2142.reg
new file mode 100644
index 0000000..7b279a7
--- /dev/null
+++ b/ds9/doc/user/contour/a2142.reg
@@ -0,0 +1,544 @@
+# Region file format: DS9 version 4.1
+# Filename: acisf05005N002_evt2.fits[EVENTS]
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+physical
+polygon(3535.2112,4184.5,3540.5,4179.1154,3548.5,4176.8219,3555.9012,4184.5,3548.5,4191.9558,3540.5,4190.3926)
+polygon(3545.7583,4176.5,3548.5,4174.0347,3551.0962,4176.5,3556.3318,4184.5,3548.5,4192.3896,3540.5,4192.2562,3533.5386,4184.5,3540.5,4177.4125)
+polygon(3541.8511,4176.5,3548.5,4170.5214,3554.796,4176.5,3556.5,4184.1775,3556.7483,4184.5,3556.5,4184.7649,3551.6193,4192.5,3548.5,4195.5255,3540.5,4196.6771,3536.2539,4192.5,3532.8727,4184.5,3540.5,4176.7345)
+polygon(3952.2509,4072.5,3956.5,4068.3292,3960.6285,4072.5,3956.5,4076.6793)
+polygon(3784.3016,3768.5,3788.5,3764.6165,3792.2888,3768.5,3789.9877,3776.5,3788.5,3776.9498,3787.4255,3776.5)
+polygon(3771.6665,3752.5,3772.5,3750.0922,3778.6915,3752.5,3772.5,3754.2336)
+polygon(3538.3898,4176.5,3540.5,4174.7377,3548.5,4169.1227,3556.2689,4176.5,3556.5,4177.5414,3561.8572,4184.5,3556.5,4190.2159,3555.0588,4192.5,3548.5,4198.8617,3540.5,4199.1539,3533.7363,4192.5,3532.6076,4184.5)
+polygon(3949.7017,4072.5,3956.5,4065.8271,3963.1052,4072.5,3956.5,4079.1866)
+polygon(3875.6625,3904.5,3876.5,3904.2537,3876.835,3904.5,3876.5,3905.2614)
+polygon(3868.1012,3896.5,3868.5,3895.7386,3868.7463,3896.5,3868.5,3897.3375)
+polygon(3819.1354,3888.5,3820.5,3883.0416,3828.5,3886.0489,3830.444,3888.5,3828.5,3891.632,3823.0234,3896.5,3820.5,3897.8024,3818.7446,3896.5)
+polygon(3897.7083,3880.5,3900.5,3879.5695,3902.5938,3880.5,3900.5,3880.9927)
+polygon(3769.1562,3880.5,3772.5,3875.0284,3778.8355,3880.5,3772.5,3887.5809)
+polygon(3890.1607,3872.5,3892.5,3871.2404,3894.1375,3872.5,3892.5,3876.5938)
+polygon(3907.5625,3848.5,3908.5,3847.1458,3909.8542,3848.5,3911.5156,3856.5,3911.725,3864.5,3914.2277,3872.5,3908.5,3879.4728,3902.7723,3872.5,3906.3967,3864.5,3903.675,3856.5)
+polygon(3780.9485,3848.5,3780.5,3848.2176,3779.9917,3848.5,3780.5,3850.4062)
+polygon(3725.1932,3848.5,3732.5,3844.6726,3735.9946,3848.5,3735.8646,3856.5,3732.5,3859.0234,3731.1077,3856.5)
+polygon(3921.5568,3840.5,3924.5,3839.3009,3925.5444,3840.5,3924.5,3841.375)
+polygon(3876.9766,3840.5,3876.5,3840.1369,3876.2458,3840.5,3876.5,3841.1354)
+polygon(3723.5367,3840.5,3724.5,3839.5367,3725.7596,3840.5,3724.5,3845.9584)
+polygon(3914.0096,3832.5,3916.5,3831.205,3917.6991,3832.5,3916.5,3835.4432)
+polygon(3904.3125,3824.5,3908.5,3822.4062,3908.8807,3824.5,3908.5,3825.3375)
+polygon(3706.4813,3808.5,3708.5,3805.8083,3712.5375,3808.5,3708.5,3812.9861)
+polygon(3908.4837,3792.5,3908.5,3792.4062,3908.525,3792.5,3908.5,3792.5156)
+polygon(3882.2841,3744.5,3884.5,3743.6875,3885.0945,3744.5,3884.5,3746.375)
+polygon(3700.483,3736.5,3700.5,3736.4766,3700.5187,3736.5,3700.5,3736.5536)
+polygon(3713.0054,3720.5,3716.5,3718.2673,3719.9946,3720.5,3716.5,3723.5914)
+polygon(3785.564,3696.5,3788.5,3693.564,3795.5809,3696.5,3796.5,3700.4062,3798.8393,3704.5,3804.5,3705.5161,3812.5,3709.9766,3815.6058,3712.5,3820.5,3715.1511,3827.2566,3720.5,3828.5,3721.0027,3830.4688,3720.5,3836.5,3719.0229,3843.7375,3720.5,3844.5,3720.7933,3850.7617,3728.5,3852.5,3731.772,3860.5,3731.9005,3868.5,3734.3797,3870.9429,3736.5,3871.1979,3744.5,3876.5,3751.5695,3877.2614,3752.5,3876.5,3753.1979,3872.6902,3760.5,3876.5,3766.7589,3878.125,3768.5,3884.5,3773.8125,3886.6989,3776.5,3892.0987,3784.5,3892.5,3788.3125,3892.8489,3792.5,3900.5,3799.845,3901.1298,3800.5,3900.5,3801.9886,3898.7946,3808.5,3900.5,3814.0096,3905.125,3816.5,3900.5,3822.975,3899.8068,3824.5,3900.5,3824.9236,3905.7452,3832.5,3900.525,3840.5,3900.5,3840.5163,3893.4375,3848.5,3894.5469,3856.5,3892.5,3857.7596,3888.8489,3864.5,3884.5,3870.2986,3882.2986,3872.5,3880.9861,3880.5,3876.5,3882.875,3874.7446,3880.5,3868.5,3876.8173,3860.5,3877.0982,3857.4345,3872.5,3860.5,3867.1354,3861.5541,3864.5,3860.5,3863.1823,3858.3917,3864.5,3852.5,3868.1823,3847.7898,3872.5,3844.5,3876.1188,3841.7164,3872.5,3841.7083,3864.5,3836.5,3863.7188,3835.0795,3864.5,3829.7188,3872.5,3828.5,3873.7829,3825.0178,3872.5,3823.3303,3864.5,3820.5,3862.5187,3817.1979,3864.5,3818.743,3872.5,3819.9554,3880.5,3812.5,3885.038,3808.3092,3888.5,3804.5,3893.0234,3801.3533,3888.5,3797.4531,3880.5,3796.5,3877.9584,3788.8751,3880.5,3788.5,3880.5268,3788.4062,3880.5,3780.5,3878.743,3775.1488,3872.5,3772.5,3865.5469,3767.4432,3872.5,3764.5,3873.795,3763.0924,3872.5,3756.5,3865.9076,3751.875,3864.5,3748.5,3863.0234,3743.2812,3856.5,3748.5,3851.0066,3752.1635,3848.5,3748.5,3846.4293,3740.5,3843.0461,3737.6544,3840.5,3732.5,3833.7596,3731.5367,3832.5,3732.5,3827.0416,3732.7824,3824.5,3740.5,3817.058,3741.4191,3816.5,3740.5,3815.875,3738.5469,3816.5,3732.5,3823.4107,3728.6875,3824.5,3724.5,3825.0234,3716.5,3828.517,3711.3015,3824.5,3716.5,3821.101,3721.101,3816.5,3718.2228,3808.5,3716.9595,3800.5,3716.5,3799.5234,3708.5,3796.0764,3704.9236,3792.5,3701.8021,3784.5,3707.8558,3776.5,3701.5417,3768.5,3700.9485,3760.5,3700.5,3757.9584,3699.7202,3752.5,3700.5,3750.6805,3702.2944,3744.5,3708.5,3740.1279,3716.195,3744.5,3716.5,3744.8631,3716.8812,3744.5,3717.946,3736.5,3720.7542,3728.5,3724.5,3724.338,3730.257,3720.5,3732.5,3718.125,3737.5329,3712.5,3740.5,3707.375,3748.4062,3704.5,3748.5,3704.4625,3756.5,3700.4732,3764.5,3703.7202,3772.5,3701.975,3780.5,3700.6525)
+polygon(4026.365,4536.5,4028.5,4534.4086,4030.4707,4536.5,4028.5,4538.5914)
+polygon(3527.5103,4392.5,3532.5,4388.3955,3536.415,4392.5,3532.5,4396.2423)
+polygon(4328.1093,4280.5,4332.5,4276.2719,4337.3236,4280.5,4332.5,4284.7281)
+polygon(3531.0749,4176.5,3532.5,4174.4749,3540.5,4169.3959,3548.5,4168.5659,3556.5,4172.0382,3561.1012,4176.5,3563.8911,4184.5,3556.5,4192.3861,3556.4281,4192.5,3548.5,4200.1898,3540.5,4200.1399,3532.7341,4192.5,3532.5021,4184.5,3532.5,4182.913)
+polygon(4410.0983,4144.5,4412.5,4139.4783,4414.9017,4144.5,4412.5,4146.8016)
+polygon(3948.6869,4072.5,3956.5,4064.8309,3964.0912,4072.5,3956.5,4080.1848)
+polygon(3843.8419,4048.5,3844.5,4047.0522,3845.5342,4048.5,3844.5,4049.5342)
+polygon(3874.8068,4040.5,3876.5,4039.0487,3878.677,4040.5,3876.5,4042.2928)
+polygon(3819.0015,4040.5,3820.5,4039.3761,3821.5217,4040.5,3820.5,4041.6831)
+polygon(3891.6902,4032.5,3892.5,4026.022,3893.1478,4032.5,3892.5,4033.0398)
+polygon(3945.2935,4024.5,3948.5,4022.4749,3951.998,4024.5,3948.5,4027.4598)
+polygon(3919.8522,4024.5,3924.5,4017.8602,3929.1478,4024.5,3924.5,4026.8239)
+polygon(3883.7802,4024.5,3884.5,4022.8805,3890.9781,4024.5,3884.5,4025.3098)
+polygon(3905.9601,4016.5,3908.5,4008.8805,3916.5,4013.7292,3922.5956,4016.5,3916.5,4020.3098,3909.7956,4024.5,3908.5,4025.4254,3906.3406,4024.5)
+polygon(3870.0219,4016.5,3876.5,4013.261,3878.1195,4016.5,3876.5,4017.2197)
+polygon(3819.5951,4016.5,3820.5,4011.674,3822.913,4016.5,3820.5,4018.3098)
+polygon(4058.8944,4008.5,4060.5,4006.8944,4061.8223,4008.5,4060.5,4009.7488)
+polygon(3962.323,4008.5,3964.5,4005.7292,3966.1932,4008.5,3964.5,4012.3098)
+polygon(3920.9247,4008.5,3924.5,4004.2747,3927.4049,4008.5,3924.5,4015.1398)
+polygon(3829.261,4008.5,3836.5,4007.2935,3841.326,4008.5,3841.3043,4016.5,3836.5,4020.618,3830.7348,4016.5)
+polygon(3802.1761,4008.5,3804.5,4004.2747,3807.4049,4008.5,3804.5,4012.7253)
+polygon(3779.0015,4008.5,3780.5,4004.0044,3781.683,4008.5,3780.5,4010.3732)
+polygon(4043.3864,4000.5,4044.5,3999.1838,4046.3098,4000.5,4044.5,4001.4049)
+polygon(4027.5746,4000.5,4028.5,3999.2043,4029.0398,4000.5,4028.9319,4008.5,4028.5,4008.9628,4027.4203,4008.5)
+polygon(3877.8433,4000.5,3884.5,3994.751,3891.9399,4000.5,3891.4693,4008.5,3884.5,4015.0822,3877.0951,4008.5)
+polygon(3810.4317,4000.5,3812.5,3999.0522,3814.913,4000.5,3812.5,4001.7065)
+polygon(4031.8522,3992.5,4036.5,3986.6902,4039.5985,3992.5,4036.5,3995.234)
+polygon(4018.4681,3992.5,4020.5,3990.4681,4024.3098,3992.5,4020.5,3995.5479)
+polygon(3863.9601,3992.5,3860.5,3986.5684,3857.5342,3992.5,3860.5,3994.2301)
+polygon(3765.261,3984.5,3772.5,3982.087,3780.5,3982.087,3783.3956,3984.5,3780.5,3986.3098,3772.5,3986.3098)
+polygon(4057.9602,3976.5,4060.5,3974.9761,4062.4049,3976.5,4060.5,3978.8445)
+polygon(3916.6268,3976.5,3916.5,3976.1195,3908.5,3973.3645,3901.0889,3976.5,3908.5,3980.382,3916.5,3977.0073)
+polygon(3830.4469,3976.5,3828.5,3975.9159,3827.1522,3976.5,3828.5,3977.4734)
+polygon(4018.3406,3968.5,4012.5,3967.3319,4009.5797,3968.5,4012.5,3972.0044)
+polygon(3978.8805,3960.5,3972.5,3958.3732,3971.0821,3960.5,3972.5,3962.0951)
+polygon(4015.6902,3936.5,4012.5,3934.677,4009.3098,3936.5,4012.5,3938.323)
+polygon(4015.3761,3920.5,4012.5,3917.1163,4009.6239,3920.5,4012.5,3923.6957)
+polygon(3732.5895,3920.5,3732.5,3920.4338,3732.3309,3920.5,3732.5,3920.8805)
+polygon(3659.3863,3912.5,3660.5,3905.261,3661.4652,3912.5,3660.5,3914.913)
+polygon(4020.0373,3896.5,4020.5,3894.3406,4026.978,3896.5,4020.5,3896.9319)
+polygon(3653.8603,3896.5,3660.5,3893.1801,3668.5,3889.3656,3675.0399,3896.5,3670.1056,3904.5,3668.5,3905.9049,3661.0073,3904.5,3660.5,3904.2463)
+polygon(4023.0032,3888.5,4028.5,3884.6522,4036.1956,3888.5,4028.5,3896.1956)
+polygon(3982.2643,3888.5,3980.5,3887.4186,3978.7357,3888.5,3980.5,3894.087)
+polygon(3650.1555,3888.5,3652.5,3880.8805,3655.0399,3888.5,3652.5,3894.5956)
+polygon(4005.6902,3880.5,4004.5,3879.7065,4003.8199,3880.5,4004.5,3882.8805)
+polygon(4050.8944,3872.5,4052.5,3870.4565,4054.1056,3872.5,4052.5,3874.3732)
+polygon(3625.766,3848.5,3628.5,3842.6902,3635.1397,3848.5,3636.5,3853.261,3642.9781,3856.5,3636.5,3859.739,3628.5,3857.2198,3627.9601,3856.5)
+polygon(4019.7802,3840.5,4020.5,3838.8805,4021.4254,3840.5,4020.5,3840.9983)
+polygon(3652.7174,3824.5,3652.5,3824.2463,3652.4105,3824.5,3652.5,3824.6902)
+polygon(3611.8522,3824.5,3612.5,3822.3406,3613.2198,3824.5,3613.5342,3832.5,3612.5,3833.5342,3611.6484,3832.5)
+polygon(4026.4565,3808.5,4028.5,3807.0015,4034.1195,3808.5,4028.5,3810.2291)
+polygon(3956.6522,3792.5,3964.5,3787.2681,3972.3478,3792.5,3964.5,3798.1056)
+polygon(3584.7537,3792.5,3588.5,3790.4565,3592.9956,3792.5,3588.5,3794.5435)
+polygon(3978.7709,3784.5,3980.5,3780.7537,3981.9049,3784.5,3980.5,3786.5435)
+polygon(3538.0538,3784.5,3540.5,3782.5634,3544.7253,3784.5,3540.5,3787.234)
+polygon(4003.6484,3776.5,4004.5,3775.0522,4005.4049,3776.5,4007.5643,3784.5,4004.5,3787.5643,3996.5,3786.5319,3994.7072,3784.5,3996.5,3782.8959)
+polygon(3986.4317,3768.5,3988.5,3767.7761,3989.4652,3768.5,3988.5,3769.2239)
+polygon(3969.2888,3760.5,3972.5,3754.8805,3974.1056,3760.5,3972.5,3762.5435)
+polygon(3952.6902,3760.5,3956.5,3758.8959,3960.3098,3760.5,3956.5,3762.677)
+polygon(3596.0373,3760.5,3596.5,3759.2044,3597.2198,3760.5,3596.5,3761.7956)
+polygon(3600.6902,3752.5,3604.5,3749.7292,3609.5797,3752.5,3604.5,3755.0399)
+polygon(3985.6902,3744.5,3988.5,3743.2512,3990.3732,3744.5,3988.5,3746.1056)
+polygon(3968.8681,3744.5,3972.5,3737.6902,3977.0399,3744.5,3972.5,3751.3098)
+polygon(3580.0681,3744.5,3580.5,3741.261,3581.3098,3744.5,3580.5,3745.4254)
+polygon(3936.8805,3736.5,3940.5,3732.8805,3942.1087,3736.5,3940.5,3739.3956)
+polygon(3598.1761,3736.5,3604.5,3729.8433,3609.999,3736.5,3604.5,3741.999)
+polygon(3938.3406,3720.5,3940.5,3719.8522,3941.3098,3720.5,3940.5,3722.6594)
+polygon(3899.3863,3712.5,3892.5,3708.7699,3889.6122,3712.5,3892.5,3716.0809)
+polygon(3874.8805,3712.5,3868.5,3710.3732,3866.5368,3712.5,3868.5,3713.7761,3876.4105,3720.5,3876.5,3720.5585,3876.6171,3720.5,3876.5,3718.9781)
+polygon(3576.7537,3712.5,3580.5,3709.6902,3584.2463,3712.5,3580.5,3713.9049)
+polygon(3930.8913,3704.5,3932.5,3703.2935,3936.1195,3704.5,3935.9049,3712.5,3932.5,3718.5531,3924.5,3718.1195,3916.5,3719.3098,3908.7174,3712.5,3916.5,3708.6087,3924.5,3710.2522)
+polygon(3836.6268,3704.5,3836.5,3704.4338,3836.4565,3704.5,3836.5,3704.5724)
+polygon(3585.6902,3704.5,3588.5,3698.8805,3594.1195,3704.5,3588.5,3708.2463)
+polygon(3946.8913,3696.5,3948.5,3695.3863,3949.7065,3696.5,3948.5,3700.1195)
+polygon(3617.1135,3696.5,3620.5,3694.5951,3628.1195,3696.5,3620.5,3699.8865)
+polygon(3590.8805,3696.5,3596.5,3695.0015,3598.5435,3696.5,3596.5,3702.1195)
+polygon(3921.1135,3688.5,3924.5,3687.0486,3926.0239,3688.5,3927.971,3696.5,3924.5,3700.6652,3921.3761,3696.5)
+polygon(3585.2888,3680.5,3588.5,3677.6902,3596.5,3679.8522,3598.1195,3680.5,3596.5,3680.9983,3588.5,3683.3098)
+polygon(3923.1146,3672.5,3924.5,3670.4681,3925.8251,3672.5,3924.5,3673.9514)
+polygon(3710.2975,3672.5,3708.5,3669.8854,3705.6239,3672.5,3708.5,3674.5544)
+polygon(3603.8522,3672.5,3604.5,3671.7802,3610.9781,3672.5,3604.5,3674.1195)
+polygon(3819.0522,3664.5,3812.5,3659.0399,3808.8599,3664.5,3812.5,3669.9601)
+polygon(3575.8837,3664.5,3580.5,3658.4632,3587.6344,3664.5,3580.5,3668.2371)
+polygon(3839.0522,3656.5,3844.5,3653.4734,3852.5,3652.5951,3856.9627,3656.5,3852.5,3662.1798,3848.2463,3664.5,3844.5,3666.7478,3840.0044,3664.5)
+polygon(3685.3344,3656.5,3684.5,3653.5797,3683.1522,3656.5,3682.9781,3664.5,3684.5,3664.6384,3692.3616,3672.5,3691.4049,3680.5,3692.5,3681.5951,3698.6377,3688.5,3692.5,3694.3146,3687.3098,3696.5,3692.5,3697.884,3694.1609,3696.5,3700.5,3689.8967,3706.087,3688.5,3700.5,3687.2107,3693.2301,3680.5,3692.6171,3672.5,3692.5,3672.2826,3684.7174,3664.5)
+polygon(3553.6601,3656.5,3556.5,3654.097,3558.9991,3656.5,3556.5,3659.3399)
+polygon(3875.9601,3648.5,3876.5,3645.261,3877.2198,3648.5,3877.1581,3656.5,3876.5,3658.913,3869.261,3656.5)
+polygon(3729.6902,3648.5,3724.5,3642.5683,3717.5797,3648.5,3724.5,3650.2301)
+polygon(3571.4658,3648.5,3572.5,3646.8913,3573.4652,3648.5,3572.5,3650.913)
+polygon(3816.2747,3640.5,3820.5,3637.766,3828.5,3640.0017,3829.2198,3640.5,3828.5,3646.9781,3820.5,3646.3098)
+polygon(3654.2643,3640.5,3660.5,3636.1119,3666.1418,3640.5,3664.7699,3648.5,3665.326,3656.5,3660.5,3660.1195,3656.9956,3664.5,3652.5,3666.2291,3649.8702,3672.5,3644.5,3680.4276,3636.5,3674.1195,3630.1195,3680.5,3636.5,3681.8433,3641.999,3688.5,3636.5,3692.4525,3628.5,3696.2826,3625.6328,3688.5,3620.5,3682.4049,3613.9985,3688.5,3612.5,3691.3098,3604.5,3689.2198,3604.0017,3688.5,3604.5,3686.8805,3607.0522,3680.5,3612.5,3672.7174,3612.8805,3672.5,3620.5,3666.4044,3628.5,3669.6044,3632.146,3664.5,3628.5,3662.3732,3623.8015,3656.5,3627.7761,3648.5,3628.5,3647.0522,3630.3098,3648.5,3636.5,3654.0024,3640.2463,3656.5,3644.5,3659.0522,3648.146,3656.5,3652.5,3650.4044,3653.1801,3648.5)
+polygon(3611.4203,3640.5,3612.5,3639.9111,3620.5,3636.382,3625.0515,3640.5,3620.5,3643.482,3613.8854,3648.5,3615.5478,3656.5,3619.9049,3664.5,3612.5,3672.3986,3607.3488,3664.5,3609.4522,3656.5,3608.6902,3648.5)
+polygon(3833.9179,3632.5,3836.5,3629.766,3840.0753,3632.5,3836.5,3635.8199)
+polygon(3595.3863,3632.5,3596.5,3631.4658,3603.739,3632.5,3599.3098,3640.5,3596.5,3643.3098,3594.8944,3640.5)
+polygon(3810.087,3624.5,3812.5,3623.2935,3813.9478,3624.5,3812.5,3631.739)
+polygon(3787.5746,3624.5,3788.5,3624.0373,3789.2198,3624.5,3789.2198,3632.5,3788.5,3633.0399,3788.0017,3632.5)
+polygon(3686.087,3624.5,3692.5,3620.6522,3697.9969,3624.5,3692.5,3627.4598)
+polygon(3655.0786,3624.5,3660.5,3619.4658,3664.2094,3624.5,3660.5,3627.8561)
+polygon(3761.9601,3616.5,3764.5,3613.7292,3768.3098,3616.5,3764.5,3618.8445)
+polygon(3682.3406,3616.5,3684.5,3614.8805,3685.5797,3616.5,3684.5,3619.739)
+polygon(3594.0951,3616.5,3596.5,3610.087,3599.2484,3616.5,3596.5,3618.7634)
+polygon(3795.2512,3608.5,3796.5,3605.6902,3798.1056,3608.5,3796.5,3611.3098)
+polygon(3699.2044,3608.5,3700.5,3605.261,3702.1195,3608.5,3708.5,3610.8202,3716.5,3611.3358,3724.5,3608.6902,3725.0073,3608.5,3732.5,3605.2888,3734.7478,3608.5,3740.5,3612.0951,3748.5,3616.0373,3749.2198,3616.5,3751.5985,3624.5,3756.5,3628.001,3764.5,3628.5845,3769.9214,3632.5,3772.5,3636.6902,3777.5797,3640.5,3778.677,3648.5,3780.5,3650.6268,3783.3358,3648.5,3788.5,3645.766,3794.4681,3640.5,3796.5,3637.9601,3799.0399,3640.5,3804.5,3646.4565,3808.9956,3648.5,3812.5,3651.4203,3820.5,3652.8805,3822.913,3656.5,3824.1195,3664.5,3828.5,3668.8805,3835.739,3672.5,3836.5,3672.6087,3840.0638,3680.5,3844.5,3687.3761,3849.5934,3680.5,3849.2935,3672.5,3852.5,3667.6902,3857.6044,3664.5,3860.5,3662.6902,3861.9478,3664.5,3868.5,3671.0522,3875.739,3672.5,3868.5,3676.1195,3862.6594,3680.5,3860.5,3681.4254,3855.5478,3688.5,3860.5,3693.002,3866.0024,3688.5,3868.5,3684.0044,3872.8805,3680.5,3876.5,3673.261,3876.8805,3672.5,3884.5,3669.4522,3886.2928,3672.5,3892.5,3679.5348,3893.7065,3680.5,3893.1478,3688.5,3892.5,3689.7956,3887.7112,3696.5,3892.5,3698.4719,3900.5,3701.1801,3902.9462,3704.5,3907.739,3712.5,3906.8239,3720.5,3900.5,3727.9399,3899.7675,3728.5,3900.5,3729.8603,3901.6902,3728.5,3908.5,3723.5474,3911.7046,3728.5,3916.5,3735.2935,3923.2935,3728.5,3924.5,3723.674,3925.8162,3728.5,3930.3098,3736.5,3932.5,3739.0031,3937.3098,3744.5,3932.5,3747.998,3924.5,3751.1397,3923.6344,3752.5,3924.5,3753.1801,3932.5,3755.5951,3937.4522,3752.5,3940.5,3748.146,3948.5,3750.0024,3949.7488,3752.5,3948.5,3755.7112,3943.7112,3760.5,3948.5,3766.087,3949.7065,3768.5,3948.5,3773.326,3948.1033,3776.5,3948.5,3777.0601,3951.674,3776.5,3956.5,3775.2935,3964.5,3773.2888,3972.5,3771.9485,3978.677,3776.5,3972.5,3780.618,3964.5,3779.3098,3961.0399,3784.5,3956.5,3792.2826,3956.4308,3792.5,3956.5,3792.5761,3963.1033,3800.5,3964.1956,3808.5,3964.5,3808.5895,3972.4105,3816.5,3972.5,3816.5662,3974.0219,3816.5,3972.5,3816.1195,3964.8805,3808.5,3971.2044,3800.5,3972.5,3794.0219,3980.5,3799.0522,3981.9478,3800.5,3987.2484,3808.5,3983.739,3816.5,3982.1195,3824.5,3988.5,3826.0951,3990.8202,3824.5,3996.5,3821.3761,4004.3098,3824.5,3998.8445,3832.5,4001.9478,3840.5,3998.5683,3848.5,3996.5,3853.326,3989.261,3848.5,3988.5,3848.2463,3988.2826,3848.5,3988.5,3848.8805,3994.5956,3856.5,3996.5,3857.8603,3998.4044,3856.5,4004.5,3853.1135,4012.5,3856.0017,4020.5,3855.4658,4021.9478,3856.5,4025.306,3864.5,4020.5,3869.7065,4016.0373,3864.5,4012.5,3857.4254,4007.998,3864.5,4012.5,3869.002,4016.7753,3872.5,4020.5,3879.2044,4021.5797,3880.5,4020.5,3882.6594,4017.5797,3888.5,4012.5,3890.2928,4004.5,3895.9927,4003.9927,3896.5,3996.5,3902.1195,3996.1338,3904.5,3996.5,3906.4044,3996.914,3904.5,4004.5,3896.5692,4011.7699,3904.5,4012.5,3905.9601,4020.5,3909.9058,4024.1318,3912.5,4024.9556,3920.5,4028.5,3927.2935,4029.9478,3928.5,4028.5,3935.739,4028.1956,3936.5,4028.5,3937.261,4030.5684,3944.5,4028.5,3951.739,4020.5,3947.3098,4012.5,3948.8239,4004.5,3951.1397,4001.326,3952.5,4004.5,3953.3656,4012.5,3955.8419,4020.5,3959.4203,4028.5,3952.7537,4031.234,3960.5,4028.5,3964.3732,4021.4254,3968.5,4027.1521,3976.5,4020.5,3980.4308,4012.5,3978.7478,4004.5,3980.0239,4000.7906,3976.5,3996.5,3972.2094,3990.0929,3968.5,3988.5,3966.9071,3987.5266,3968.5,3988.5,3970.0929,3992.2094,3976.5,3996.5,3982.323,3998.5319,3984.5,3999.2239,3992.5,4004.5,4000.0372,4004.881,4000.5,4004.5,4006.978,3996.5,4006.1195,3995.8199,4008.5,3988.5,4012.2955,3980.5,4011.0822,3978.1761,4008.5,3980.5,4002.6902,3984.0044,4000.5,3980.5,3996.9956,3977.6902,3992.5,3972.5,3989.306,3964.5,3989.7065,3957.558,3984.5,3956.5,3983.1398,3948.5,3984.3098,3947.739,3984.5,3940.5,3986.1086,3936.3913,3992.5,3940.5,3996.0951,3944.9049,4000.5,3940.5,4004.2094,3932.5,4003.0652,3928.6522,4000.5,3927.9601,3992.5,3924.5,3990.424,3919.3098,3992.5,3918.5683,4000.5,3916.5,4002.1086,3908.5,4008.3617,3908.3098,4008.5,3900.5,4012.4049,3894.2522,4008.5,3895.674,4000.5,3900.5,3996.8805,3902.2522,3992.5,3900.5,3991.7035,3898.9071,3992.5,3892.5,3999.5479,3887.8015,3992.5,3884.5,3989.4049,3882.249,3992.5,3876.5,3999.1567,3871.3956,4000.5,3868.5,4001.5342,3862.7634,4008.5,3860.5,4016.1956,3860.3098,4016.5,3852.5,4023.442,3848.3348,4016.5,3845.558,4008.5,3844.5,4007.1398,3841.5951,4000.5,3844.5,3995.3358,3846.6268,3992.5,3848.6522,3984.5,3844.5,3982.903,3842.3146,3984.5,3836.5,3990.6377,3832.3098,3992.5,3828.5,3995.5479,3820.5,3998.1056,3816.1401,3992.5,3812.5,3989.6512,3805.2198,3992.5,3804.5,3993.5797,3803.4203,3992.5,3796.5,3989.5342,3790.6268,3984.5,3788.5,3982.9049,3782.4719,3976.5,3783.1208,3968.5,3780.5,3962.5435,3774.8805,3960.5,3772.5,3959.8199,3771.8199,3960.5,3772.5,3961.6902,3776.1319,3968.5,3772.5,3973.4525,3764.5,3975.2239,3756.5,3969.7065,3748.5,3969.4049,3747.2935,3968.5,3748.5,3966.087,3753.2888,3960.5,3751.413,3952.5,3755.4203,3944.5,3748.6087,3936.5,3748.5,3936.2463,3748.4105,3936.5,3743.3098,3944.5,3743.998,3952.5,3740.5,3956.3478,3732.8044,3952.5,3732.5,3950.9781,3724.5,3948.0239,3720.3542,3944.5,3716.5,3940.8599,3709.9478,3944.5,3712.7753,3952.5,3708.5,3954.9049,3706.4749,3952.5,3706.8913,3944.5,3700.5,3938.1087,3698.4317,3936.5,3700.5,3929.261,3701.0073,3928.5,3700.6171,3920.5,3708.5,3913.1801,3709.0601,3912.5,3708.5,3911.442,3700.5,3909.7488,3696.7209,3904.5,3700.5,3899.7761,3703.1208,3896.5,3700.5,3892.4049,3695.8199,3896.5,3692.5,3898.9462,3687.2239,3904.5,3690.1195,3912.5,3684.5,3919.9927,3683.0015,3912.5,3681.4734,3904.5,3677.7516,3896.5,3677.1801,3888.5,3677.5307,3880.5,3679.3683,3872.5,3676.5,3867.6239,3669.5342,3872.5,3672.1195,3880.5,3668.5,3885.326,3661.261,3880.5,3660.5,3880.3829,3652.5,3879.9927,3644.5,3876.1195,3643.4658,3872.5,3644.5,3868.8805,3652.5,3869.2888,3658.087,3864.5,3660.5,3860.8805,3663.0031,3856.5,3660.5,3855.1522,3654.6594,3856.5,3652.5,3857.7956,3646.0219,3856.5,3644.5,3856.2463,3637.8603,3848.5,3640.0373,3840.5,3636.5,3835.5478,3628.8805,3832.5,3632.6268,3824.5,3636.5,3819.8522,3638.5951,3816.5,3636.5,3814.9037,3632.3098,3816.5,3628.5,3819.5478,3620.5,3820.1319,3614.4469,3816.5,3620.5,3812.6087,3626.2522,3808.5,3620.5,3805.1163,3612.5,3804.3478,3610.0951,3800.5,3612.5,3797.002,3619.5746,3792.5,3620.5,3786.0219,3620.6014,3784.5,3620.5,3784.2826,3612.5,3780.3732,3604.5,3778.3098,3603.6484,3776.5,3604.5,3771.674,3612.5,3772.9247,3617.2935,3768.5,3615.8015,3760.5,3614.6902,3752.5,3614.4047,3744.5,3617.7292,3736.5,3620.5,3732.6902,3628.5,3728.7174,3628.6522,3728.5,3628.5,3728.3829,3620.5,3726.9037,3616.7753,3728.5,3612.5,3731.7065,3607.6902,3728.5,3608.0044,3720.5,3604.5,3718.3098,3602.9071,3720.5,3596.5,3726.9071,3593.1439,3720.5,3590.8202,3712.5,3596.5,3705.558,3604.5,3705.8603,3609.261,3704.5,3612.5,3703.4203,3613.5797,3704.5,3620.5,3707.9601,3625.6902,3704.5,3628.5,3697.0073,3636.5,3701.1258,3640.6781,3696.5,3644.5,3691.1146,3648.9247,3688.5,3644.6902,3680.5,3652.5,3677.029,3658.7709,3672.5,3660.5,3668.0044,3664.9956,3672.5,3668.5,3676.0044,3675.9927,3680.5,3676.5,3682.0219,3676.6087,3680.5,3676.5,3680.3478,3669.9601,3672.5,3668.5,3669.9969,3663.0031,3664.5,3668.5,3658.087,3669.2935,3656.5,3675.9601,3648.5,3672.6268,3640.5,3671.413,3632.5,3676.5,3626.7348,3679.826,3632.5,3684.5,3635.538,3692.5,3635.7761,3697.1801,3632.5,3700.5,3626.6902,3708.5,3626.2522,3716.5,3627.3761,3722.9049,3632.5,3724.5,3637.6044,3732.5,3634.4632,3740.5,3638.4565,3745.9601,3632.5,3744.2747,3624.5,3740.5,3621.5342,3732.5,3618.5683,3724.5,3621.7065,3716.5,3620.0753,3708.5,3622.7478,3700.5,3622.7478,3695.694,3616.5)
+polygon(3611.0951,3608.5,3612.5,3607.0951,3614.9976,3608.5,3615.3098,3616.5,3612.5,3618.2291,3610.6268,3616.5)
+polygon(3736.2247,3600.5,3740.5,3599.0201,3744.7753,3600.5,3740.5,3603.7065)
+polygon(3702.8805,3600.5,3708.5,3598.2522,3714.1195,3600.5,3708.5,3604.2463)
+polygon(3666.4317,3600.5,3668.5,3598.8913,3676.5,3598.323,3684.1195,3600.5,3676.5,3602.677,3672.2094,3608.5,3668.5,3612.4155,3660.5,3611.3098,3658.2522,3608.5,3660.5,3605.6902)
+polygon(3683.2935,3592.5,3684.5,3588.8805,3692.5,3590.8913,3694.3098,3592.5,3692.5,3595.3956,3684.5,3599.739)
+polygon(3689.6808,3568.5,3692.5,3565.7893,3695.2107,3568.5,3692.5,3572.0239)
+polygon(3640.6522,3568.5,3644.5,3566.4749,3646.249,3568.5,3644.5,3571.2484)
+polygon(3666.6902,3560.5,3668.5,3558.087,3669.6137,3560.5,3668.5,3562.1087)
+polygon(3816.9362,3536.5,3820.5,3533.8696,3828.5,3533.6672,3831.7493,3536.5,3828.5,3540.0638,3820.5,3540.1826)
+polygon(3635.317,3536.5,3636.5,3534.4565,3638.9976,3536.5,3636.5,3539.7112)
+polygon(4139.0883,4648.5,4140.5,4647.0883,4141.9117,4648.5,4140.5,4654.5)
+polygon(4007.9783,4608.5,4012.5,4603.9783,4016.5,4608.5,4012.5,4612.66)
+polygon(4176.5,4552.5,4180.5,4548.6482,4184.3518,4552.5,4184.5,4560.5,4180.5,4564.674,4175.7,4560.5)
+polygon(3511.6111,4544.5,3516.5,4540.3096,3520.5,4544.5,3516.5,4548.5)
+polygon(4022.3334,4536.5,4028.5,4530.4592,4034.1923,4536.5,4028.5,4542.5408)
+polygon(3522.2778,4392.5,3524.5,4390.1471,3532.5,4385.2742,3539.3923,4392.5,3532.5,4399.0883,3524.5,4395.1666)
+polygon(3171.3571,4392.5,3172.5,4391.3572,3173.9545,4392.5,3172.5,4394.5)
+polygon(3706.9,4376.5,3708.5,4375.4333,3709.5,4376.5,3708.5,4378.1)
+polygon(4325.6282,4280.5,4332.5,4273.8827,4340.0493,4280.5,4332.5,4287.1173)
+polygon(3569.8333,4200.5,3572.5,4199.8334,3573.3,4200.5,3572.5,4201.6428)
+polygon(3684.5,4184.5,3684.5,4184.5,3684.5,4184.5,3684.5,4184.5)
+polygon(3527.7941,4168.5,3532.5,4163.5,3540.5,4163.6305,3548.5,4162.3182,3554.6818,4168.5,3556.5,4169.1061,3564.125,4176.5,3564.5,4179.1666,3567.3235,4184.5,3565.7308,4192.5,3564.5,4196.5,3563.0455,4200.5,3556.5,4206.5,3548.5,4206.2142,3540.5,4202.5,3537.3,4200.5,3532.5,4198.6538,3524.5,4193.3,3523.1667,4192.5,3524.5,4190.9,3525.6852,4184.5,3524.5,4179.1666,3521.3,4176.5,3524.5,4174.7222)
+polygon(3778.7222,4152.5,3780.5,4150.2142,3781.9545,4152.5,3780.5,4154.1)
+polygon(3937.8333,4144.5,3940.5,4143,3942.5,4144.5,3940.5,4147.5)
+polygon(3657.8333,4144.5,3660.5,4143.3572,3668.5,4144.5,3668.5,4144.5,3668.5,4144.5,3660.5,4146.5)
+polygon(4408.0862,4136.5,4412.5,4131.38,4417.62,4136.5,4419.1086,4144.5,4412.5,4150.8334,4405.8914,4144.5)
+polygon(3996.5,4128.5,3996.5,4128.5,3996.5,4128.5,3996.5,4128.5)
+polygon(3972.5,4128.5,3972.5,4128.5,3972.5,4128.5,3972.5,4128.5)
+polygon(3931.7,4128.5,3932.5,4126.9,3933.5,4128.5,3932.5,4129.8334)
+polygon(3963.3571,4120.5,3964.5,4119.6111,3966.5,4120.5,3964.5,4121.5)
+polygon(3923.7727,4120.5,3924.5,4119.7727,3926.1,4120.5,3924.5,4121.3)
+polygon(3883.0455,4120.5,3884.5,4118.9,3887.1667,4120.5,3892.5,4128.5,3892.5,4128.5,3892.5,4128.5,3884.5,4128.5,3884.5,4128.5)
+polygon(4068.5,4112.5,4068.5,4112.5,4068.5,4112.5,4068.5,4112.5)
+polygon(4051.5,4104.5,4052.5,4102.9,4054.1,4104.5,4052.5,4105.5)
+polygon(3914.5,4104.5,3916.5,4103.6111,3919.1667,4104.5,3916.5,4105.5)
+polygon(4100.5,4096.5,4100.5,4096.5,4100.5,4096.5,4100.5,4096.5)
+polygon(4026.6538,4096.5,4028.5,4093.5,4030.6818,4096.5,4028.5,4099.1666)
+polygon(3884.5,4096.5,3884.5,4096.5,3884.5,4096.5,3884.5,4096.5)
+polygon(3850.9,4096.5,3852.5,4094.9,3853.5,4096.5,3852.5,4097.1666)
+polygon(3787.7,4096.5,3788.5,4095.7,3789.3889,4096.5,3788.5,4097.1666)
+polygon(3772.5,4096.5,3772.5,4096.5,3772.5,4096.5,3772.5,4096.5)
+polygon(4058.9,4088.5,4060.5,4085.3,4063.1666,4088.5,4060.5,4091.1666)
+polygon(3820.5,4088.5,3820.5,4088.5,3820.5,4088.5,3820.5,4088.5)
+polygon(3747.9286,4088.5,3748.5,4084.5,3749.3889,4088.5,3748.5,4090.1)
+polygon(3795.5,4080.5,3796.5,4079.3572,3799.1667,4080.5,3796.5,4081.8334)
+polygon(3778.7857,4080.5,3780.5,4077.0714,3782.9,4080.5,3780.5,4083.9286)
+polygon(3737.8333,4080.5,3740.5,4079.3572,3744.5,4080.5,3740.5,4081.0714)
+polygon(4099.3572,4072.5,4100.5,4071.3572,4101.6428,4072.5,4100.5,4074.1)
+polygon(3886.5,4072.5,3884.5,4069.8334,3881.5,4072.5,3884.5,4075.9286)
+polygon(4071.4091,4064.5,4076.5,4060.1923,4080.8077,4064.5,4080.5,4072.5,4076.5,4073.2273,4075.5,4072.5)
+polygon(3901.9545,4064.5,3900.5,4063.2693,3898.5,4064.5,3900.5,4065.4412)
+polygon(3847.4091,4064.5,3844.5,4062.5,3839.1667,4064.5,3844.5,4072.5)
+polygon(3796.5,4064.5,3796.5,4064.5,3796.5,4064.5,3796.5,4064.5)
+polygon(3698.2143,4056.5,3700.5,4054.7222,3702.2778,4056.5,3700.5,4058.2778)
+polygon(3602.1,4056.5,3604.5,4054.6538,3607.5,4056.5,3604.5,4058.5)
+polygon(4087.5,4048.5,4092.5,4042.7858,4096.9445,4048.5,4096.5,4056.5,4092.5,4058.5,4091.7727,4056.5)
+polygon(3998.7857,4048.5,3996.5,4046.5,3995.3571,4048.5,3996.5,4052.5)
+polygon(3667.7,4048.5,3668.5,4047.1666,3669.5,4048.5,3668.5,4050.1)
+polygon(3644.5,4048.5,3644.5,4048.5,3652.5,4048.5,3652.5,4048.5,3652.5,4048.5,3644.5,4048.5)
+polygon(3733.6429,4040.5,3740.5,4035.1666,3745.8333,4040.5,3740.5,4047.3572)
+polygon(3724.5,4040.5,3724.5,4040.5,3724.5,4040.5,3724.5,4040.5)
+polygon(3612.5,4040.5,3612.5,4040.5,3612.5,4040.5,3612.5,4040.5)
+polygon(3580.5,4040.5,3580.5,4040.5,3580.5,4040.5,3580.5,4040.5)
+polygon(3679.1667,4032.5,3684.5,4030.2142,3686.5,4032.5,3684.5,4035.7)
+polygon(3596.5,4032.5,3596.5,4032.5,3596.5,4032.5,3596.5,4032.5)
+polygon(3707.3571,4024.5,3708.5,4020.5,3710.1,4024.5,3708.5,4025.3889)
+polygon(4103.4091,4016.5,4108.5,4009.5,4114.7222,4016.5,4108.5,4020)
+polygon(4084.5,4016.5,4076.5,4015.8846,4075.7727,4016.5,4076.5,4017.1666)
+polygon(3668.5,4016.5,3668.5,4016.5,3668.5,4016.5,3674.2143,4024.5,3668.5,4028.1364,3665.1667,4024.5)
+polygon(3646.5,4016.5,3652.5,4014.7858,3657.3,4016.5,3652.5,4018.3462)
+polygon(3672.5,4008.5,3676.5,4004.5,3682.9,4008.5,3676.5,4011.1666)
+polygon(3642.1,4008.5,3644.5,4004.5,3646.2143,4008.5,3644.5,4014.5)
+polygon(3515.6111,4008.5,3516.5,4007.3572,3517.2273,4008.5,3516.5,4010.1)
+polygon(4098.5,4000.5,4092.5,3997.0714,4088.5,4000.5,4092.5,4002.9)
+polygon(3660.5,4000.5,3660.5,4000.5,3660.5,4000.5,3660.5,4000.5)
+polygon(3596.5,4000.5,3596.5,4000.5,3596.5,4000.5,3596.5,4000.5)
+polygon(3588.5,3992.5,3588.5,3992.5,3588.5,3992.5,3588.5,3992.5)
+polygon(3387.0454,3992.5,3388.5,3991.2693,3389.5,3992.5,3388.5,3994.5)
+polygon(4228.5,3984.5,4228.5,3984.5,4228.5,3984.5,4228.5,3984.5)
+polygon(4156.5,3984.5,4156.5,3984.5,4156.5,3984.5,4156.5,3984.5)
+polygon(3537.8333,3984.5,3540.5,3982.2142,3541.7308,3984.5,3540.5,3988.5)
+polygon(4172.5,3976.5,4172.5,3976.5,4172.5,3976.5,4172.5,3976.5)
+polygon(4135.5,3976.5,4140.5,3970.7858,4143.1666,3976.5,4140.5,3979.3572)
+polygon(3616.8077,3976.5,3620.5,3970.5,3625.3,3976.5,3620.5,3982.5)
+polygon(3595.6111,3976.5,3596.5,3975.5,3604.5,3975.1666,3605.5,3976.5,3604.5,3977.5,3596.5,3979.1666)
+polygon(4093.6428,3968.5,4092.5,3965.8334,4091.8846,3968.5,4092.5,3976.5)
+polygon(3624.5,3968.5,3628.5,3966.5,3633.8333,3968.5,3628.5,3971.1666)
+polygon(3570.9,3968.5,3572.5,3967.3572,3573.1667,3968.5,3572.5,3969.6428)
+polygon(3535.1667,3968.5,3540.5,3966.7222,3542.2778,3968.5,3540.5,3970.7858)
+polygon(3524.5,3968.5,3524.5,3968.5,3524.5,3968.5,3524.5,3968.5)
+polygon(4118.5,3960.5,4124.5,3955.7,4129.3,3960.5,4124.5,3964.5)
+polygon(3631.1667,3960.5,3636.5,3954.1,3643.8846,3960.5,3636.5,3967.8846)
+polygon(3615.8333,3960.5,3620.5,3953.5,3624.8077,3960.5,3620.5,3966.7222)
+polygon(3588.5,3960.5,3588.5,3960.5,3596.5,3955.7,3599.5,3960.5,3596.5,3962.9,3588.5,3968.5,3588.5,3968.5,3588.5,3968.5)
+polygon(3546.1,3960.5,3548.5,3957.8333,3550.5,3960.5,3548.5,3962.9)
+polygon(3508.5,3960.5,3508.5,3960.5,3508.5,3960.5,3508.5,3960.5)
+polygon(3572.5,3952.5,3572.5,3952.5,3580.5,3952.5,3580.5,3952.5,3580.5,3952.5,3572.5,3952.5)
+polygon(3353.8333,3952.5,3356.5,3950.5,3358.2778,3952.5,3356.5,3954.2778)
+polygon(4156.5,3936.5,4156.5,3936.5,4156.5,3936.5,4156.5,3936.5)
+polygon(3570.7222,3936.5,3572.5,3934.2143,3575.7,3936.5,3572.5,3941.8333)
+polygon(3547.8333,3936.5,3548.5,3933.8333,3556.5,3934.9,3558.2778,3936.5,3556.5,3939.1667,3548.5,3937.6429)
+polygon(3523.7727,3928.5,3524.5,3924.5,3525.3,3928.5,3524.5,3930.1)
+polygon(3631.4091,3920.5,3628.5,3915.1667,3624.9445,3920.5,3623.9286,3928.5,3620.5,3931.5,3612.5,3932.5,3604.5,3928.5,3596.5,3936.5,3604.5,3937.8333,3612.5,3938.5,3620.5,3939.8333,3624.5,3936.5,3628.5,3932.0555,3631.4091,3928.5)
+polygon(4154.2142,3912.5,4156.5,3909.3,4157.9546,3912.5,4156.5,3913.8333)
+polygon(3554.2143,3912.5,3556.5,3910.5,3559.7,3912.5,3556.5,3915.7)
+polygon(3536.5,3912.5,3540.5,3908.5,3542.7857,3912.5,3540.5,3913.9545)
+polygon(3476.5,3912.5,3476.5,3912.5,3476.5,3912.5,3476.5,3912.5)
+polygon(3598.7857,3904.5,3596.5,3903.0455,3592.5,3904.5,3596.5,3906.7857)
+polygon(3562.5,3904.5,3564.5,3900.5,3569.8333,3904.5,3564.5,3907.7)
+polygon(3468.5,3904.5,3468.5,3904.5,3468.5,3904.5,3468.5,3904.5)
+polygon(3566.7857,3896.5,3572.5,3890.7857,3579.1667,3896.5,3572.5,3903.1667)
+polygon(3525.8333,3896.5,3532.5,3889.8333,3540.5,3896.5,3540.5,3896.5,3540.5,3896.5,3539.1667,3904.5,3532.5,3911.1667,3526.7857,3904.5)
+polygon(3500.5,3896.5,3500.5,3896.5,3500.5,3896.5,3500.5,3896.5)
+polygon(3452.5,3896.5,3452.5,3896.5,3452.5,3896.5,3452.5,3896.5)
+polygon(4212.5,3880.5,4212.5,3880.5,4212.5,3880.5,4212.5,3880.5)
+polygon(3508.5,3880.5,3508.5,3880.5,3516.5,3880.5,3516.5,3880.5,3516.5,3880.5,3508.5,3880.5)
+polygon(4125.5,3872.5,4124.5,3871.7727,4123.7727,3872.5,4124.5,3874.1)
+polygon(3492.5,3872.5,3492.5,3872.5,3492.5,3872.5,3492.5,3872.5)
+polygon(3457.1667,3872.5,3460.5,3869.4231,3464.1364,3872.5,3460.5,3876.9445)
+polygon(4117.8334,3856.5,4116.5,3854.5,4114.5,3856.5,4116.5,3858.7857)
+polygon(3428.5,3856.5,3428.5,3856.5,3428.5,3856.5,3428.5,3856.5)
+polygon(3489.3,3848.5,3492.5,3843.9286,3497.0714,3848.5,3492.5,3852.5)
+polygon(3474.3667,3848.5,3476.5,3843.9286,3479.7,3848.5,3476.5,3850.9615)
+polygon(4162.5,3840.5,4164.5,3838.5,4167.1666,3840.5,4164.5,3842.5)
+polygon(4116.5,3840.5,4108.5,3839.0455,4107.5,3840.5,4108.5,3842.2778)
+polygon(3457.8333,3840.5,3460.5,3838.7222,3461.8333,3840.5,3460.5,3848.5,3460.5,3848.5,3460.5,3848.5)
+polygon(4093.5,3832.5,4092.5,3830.5,4092.1,3832.5,4092.5,3833.2273)
+polygon(3500.5,3832.5,3500.5,3832.5,3500.5,3832.5,3500.5,3832.5)
+polygon(3451.6111,3832.5,3452.5,3829.8333,3453.5,3832.5,3452.5,3834.1)
+polygon(3404.5,3832.5,3404.5,3832.5,3404.5,3832.5,3404.5,3832.5)
+polygon(4160.5,3824.5,4164.5,3823.5,4166.1,3824.5,4164.5,3825.6429)
+polygon(3483.5,3824.5,3484.5,3820.5,3485.5,3824.5,3484.5,3827.1667)
+polygon(3252.5,3824.5,3252.5,3824.5,3252.5,3824.5,3252.5,3824.5)
+polygon(3387.0454,3816.5,3388.5,3814.7222,3390.5,3816.5,3388.5,3820.5)
+polygon(4163.3572,3808.5,4164.5,3807.7,4165.5,3808.5,4164.5,3809.5)
+polygon(3457.8333,3808.5,3460.5,3806.9,3468.5,3805.0714,3471.5,3808.5,3476.5,3815.1667,3480.5,3816.5,3476.5,3817.5,3472.5,3824.5,3468.5,3828,3460.5,3826.9,3455.7,3824.5,3460.5,3816.5)
+polygon(3440.5,3808.5,3444.5,3805.3,3448.5,3808.5,3444.5,3810.5)
+polygon(3380.5,3808.5,3380.5,3808.5,3380.5,3808.5,3380.5,3808.5)
+polygon(3526.1,3800.5,3524.5,3798.2143,3522.2143,3800.5,3524.5,3802.5,3531.3571,3808.5,3532.5,3809.6429,3533.1667,3808.5,3532.5,3807.6111)
+polygon(3488.0555,3800.5,3492.5,3796.5,3499.1667,3800.5,3500.5,3808.5,3500.5,3808.5,3508.5,3816.5,3508.5,3816.5,3508.5,3816.5,3500.5,3821.8333,3494.1,3816.5,3492.5,3815.8333,3487,3808.5)
+polygon(3393.0714,3800.5,3396.5,3797.8333,3399.9286,3800.5,3396.5,3805.3)
+polygon(4140.5,3792.5,4140.5,3792.5,4140.5,3792.5,4140.5,3800.5,4140.5,3800.5,4136.5,3808.5,4132.5,3812.5,4129.3,3808.5,4126.2778,3800.5,4132.5,3795.8333)
+polygon(4124.5,3792.5,4124.5,3792.5,4124.5,3792.5,4124.5,3792.5)
+polygon(4086.1,3792.5,4084.5,3788.5,4082.5,3792.5,4076.5,3798.5,4074.7222,3800.5,4076.5,3801.7308,4077.4412,3800.5,4084.5,3793.4412,4092,3800.5,4092.5,3802.5,4093.6428,3800.5,4092.5,3799.6111)
+polygon(3466.7222,3792.5,3468.5,3789.3,3471.7,3792.5,3468.5,3795.1667)
+polygon(3442.0385,3792.5,3444.5,3789.5909,3448.5,3792.5,3444.5,3797.0714)
+polygon(3422.5,3792.5,3428.5,3789.8333,3430.5,3792.5,3428.5,3800.5,3428.5,3800.5,3428.5,3800.5)
+polygon(3510.1,3784.5,3508.5,3783.7,3507.5,3784.5,3508.5,3788.5)
+polygon(3304.0555,3784.5,3308.5,3781.8333,3311.1667,3784.5,3308.5,3787.8333)
+polygon(4124.5,3776.5,4124.5,3776.5,4132.5,3775.1667,4140.5,3776.5,4140.5,3776.5,4140.5,3776.5,4132.5,3779.1667,4124.5,3776.5)
+polygon(3443.1667,3776.5,3444.5,3775.5,3445.5,3776.5,3444.5,3777.5)
+polygon(3404.5,3776.5,3404.5,3776.5,3404.5,3776.5,3404.5,3776.5)
+polygon(3436.5,3768.5,3436.5,3768.5,3436.5,3768.5,3436.5,3768.5)
+polygon(3409.3,3768.5,3412.5,3766.7222,3415.7,3768.5,3412.5,3772.5)
+polygon(4108.5,3760.5,4108.5,3760.5,4116.5,3756.1923,4122.1,3760.5,4116.5,3766.1,4108.5,3760.5)
+polygon(4064.5,3760.5,4060.5,3758.5,4059.7,3760.5,4060.5,3761.6429)
+polygon(3556.8636,3760.5,3556.5,3760.0294,3555.8846,3760.5,3556.5,3761.5)
+polygon(3428.5,3760.5,3428.5,3760.5,3428.5,3760.5,3428.5,3760.5)
+polygon(3511.5,3752.5,3508.5,3749.5,3506.7857,3752.5,3508.5,3755.1667,3513.8333,3760.5,3516.5,3763.9286,3519.5,3760.5,3516.5,3757.5)
+polygon(3459.3571,3752.5,3460.5,3750.9,3468.5,3747.9286,3472.0555,3752.5,3476.5,3756.5,3481.5,3760.5,3476.5,3767.1667,3472.5,3768.5,3468.5,3776.5,3468.5,3776.5,3466.1,3784.5,3460.5,3788.5,3452.5,3788.9445,3449.1667,3784.5,3452.5,3781.1667,3457.5909,3776.5,3460.5,3770.1,3464.5,3768.5,3463.7,3760.5,3460.5,3754.1)
+polygon(4132.5,3744.5,4132.5,3744.5,4132.5,3744.5,4132.5,3752.5,4132.5,3752.5,4132.5,3752.5)
+polygon(4140.5,3736.5,4140.5,3736.5,4140.5,3736.5,4140.5,3736.5)
+polygon(4047.9286,3736.5,4044.5,3734.1,4043,3736.5,4044.5,3738.1)
+polygon(3372.5,3736.5,3372.5,3736.5,3380.5,3736.5,3380.5,3736.5,3380.5,3736.5,3372.5,3736.5)
+polygon(4093.3889,3728.5,4100.5,3724.5,4108.5,3728.5,4108.5,3728.5,4116.5,3736.5,4116.5,3736.5,4116.5,3736.5,4108.5,3740.5,4100.5,3738.5,4096.5,3736.5)
+polygon(3423.7,3728.5,3428.5,3721.6429,3434.5,3728.5,3428.5,3735.3571)
+polygon(3412.5,3728.5,3412.5,3728.5,3412.5,3728.5,3412.5,3728.5)
+polygon(4073.3,3720.5,4068.5,3715.7,4066.7858,3720.5,4060.5,3727.8333,4058.9,3728.5,4060.5,3730.1,4068.5,3735.1667,4071.1666,3728.5)
+polygon(3486.5,3720.5,3484.5,3719.3571,3476.5,3720.5,3481.3,3728.5,3484.5,3730.2778,3490.1,3736.5,3492.5,3739.9286,3500.5,3738.1,3502.1,3736.5,3500.5,3732.5,3496.5,3728.5,3492.5,3727.3571)
+polygon(3476.5,3720.5,3468.5,3716.5,3460.5,3716.5,3452.5,3719.1667,3449.8333,3720.5,3449.3,3728.5,3452.5,3730.5,3455.1667,3728.5,3460.5,3724.5,3468.5,3726.5)
+polygon(3415.5,3720.5,3420.5,3716.8636,3427.1667,3720.5,3420.5,3724.9445)
+polygon(3396.5,3720.5,3396.5,3720.5,3404.5,3720.5,3404.5,3720.5,3404.5,3720.5,3396.5,3720.5)
+polygon(4132.5,3704.5,4132.5,3704.5,4132.5,3704.5,4132.5,3704.5)
+polygon(4100.5,3704.5,4100.5,3704.5,4100.5,3704.5,4102.7858,3712.5,4100.5,3714.1,4097.8334,3712.5)
+polygon(4046.5,3704.5,4044.5,3702.9,4041.8334,3704.5,4036.5,3707.7,4034.5,3712.5,4036.5,3713.9117,4043.0883,3720.5,4044.5,3722.9,4046.3462,3720.5,4044.5,3717.0714,4039.9286,3712.5,4044.5,3706.1)
+polygon(3501.8333,3704.5,3500.5,3699.1667,3498.9,3704.5,3500.5,3706.5)
+polygon(3478.5,3704.5,3476.5,3703.4333,3468.5,3704.5,3476.5,3707.1667)
+polygon(3403.3571,3704.5,3404.5,3703.7,3412.5,3701.8333,3417.3,3704.5,3412.5,3712.5,3412.5,3712.5,3412.5,3712.5,3404.5,3708.5)
+polygon(3480.1364,3688.5,3476.5,3681.8333,3472.8636,3688.5,3476.5,3690.7222)
+polygon(3364.5,3688.5,3364.5,3688.5,3364.5,3688.5,3364.5,3688.5)
+polygon(4076.5,3680.5,4076.5,3680.5,4084.5,3679.3571,4086.1,3680.5,4088.5,3688.5,4084.5,3690.3461,4081.5,3688.5,4076.5,3680.5)
+polygon(3997.6429,3680.5,3996.5,3672.5,3995.3571,3680.5,3996.5,3681.3)
+polygon(3354.9,3680.5,3356.5,3678.9,3360.5,3680.5,3356.5,3682.7857)
+polygon(3308.5,3680.5,3308.5,3680.5,3308.5,3680.5,3308.5,3680.5)
+polygon(3415.5,3672.5,3420.5,3669.1667,3428.5,3671.5,3429.5,3672.5,3433.3,3680.5,3429.6429,3688.5,3428.5,3692.5,3420.5,3693.5909,3415.8333,3688.5,3412.5,3685.6429,3406.9615,3680.5,3412.5,3674.5)
+polygon(3404.5,3672.5,3404.5,3672.5,3404.5,3672.5,3404.5,3672.5)
+polygon(3347.6111,3672.5,3348.5,3671.6111,3349.3889,3672.5,3348.5,3673.3889)
+polygon(4077.5,3664.5,4084.5,3661.2059,4087.6111,3664.5,4084.5,3668.8077)
+polygon(4068.5,3664.5,4068.5,3664.5,4068.5,3664.5,4068.5,3664.5)
+polygon(3409.5,3656.5,3412.5,3653.0714,3415.1667,3656.5,3414.2778,3664.5,3412.5,3667.7,3409.8333,3664.5)
+polygon(3370.6538,3656.5,3372.5,3650.5,3380.5,3655.1667,3382.5,3656.5,3382.1,3664.5,3383.7,3672.5,3380.5,3676.5,3379.0454,3672.5,3379.3571,3664.5,3372.5,3659.1667)
+polygon(3331.5,3656.5,3332.5,3655.8846,3334.5,3656.5,3332.5,3657.3)
+polygon(4056.5,3648.5,4060.5,3647.5,4064.5,3648.5,4060.5,3649.8333)
+polygon(3989.0333,3648.5,3988.5,3640.5,3986.9,3648.5,3981.8333,3656.5,3988.5,3660.9445,3991.5769,3656.5)
+polygon(3977.3,3648.5,3972.5,3643.7,3966.5,3648.5,3964.5,3652.5,3962.2143,3656.5,3964.5,3658.2778,3965.6429,3656.5,3972.5,3651.1667)
+polygon(3949.2273,3648.5,3948.5,3647.8333,3947.3571,3648.5,3948.5,3649.0333)
+polygon(3511.4091,3648.5,3508.5,3646.3666,3504.9445,3648.5,3500.5,3653.5,3492.5,3654.6177,3489.3,3656.5,3492.5,3661.8333,3496.5,3664.5,3500.5,3672.5,3508.5,3667.7,3509.7308,3664.5,3508.5,3662.5,3503.1667,3656.5,3508.5,3651.7)
+polygon(3442.7222,3648.5,3444.5,3643.1667,3446.5,3648.5,3444.5,3651.1667)
+polygon(3340.5,3648.5,3340.5,3648.5,3348.5,3646.2143,3350.2778,3648.5,3348.5,3650.5,3340.5,3648.5)
+polygon(3324.5,3648.5,3324.5,3648.5,3324.5,3648.5,3324.5,3648.5)
+polygon(3267.2692,3648.5,3268.5,3646.9,3269.9546,3648.5,3268.5,3650.5)
+polygon(4092.5,3640.5,4092.5,3640.5,4092.5,3640.5,4092.5,3640.5)
+polygon(4067.5,3640.5,4068.5,3636.5,4069.6428,3640.5,4068.5,3644.5)
+polygon(4047.7,3640.5,4052.5,3637.8333,4054.9,3640.5,4052.5,3646.5)
+polygon(3933.3,3640.5,3932.5,3638.9,3931.7727,3640.5,3932.5,3641.3)
+polygon(3426.5,3640.5,3428.5,3636.5,3436.5,3637.8333,3440.5,3640.5,3436.5,3641.5,3428.5,3641.3889)
+polygon(3409.3,3640.5,3412.5,3635.1667,3415.7,3640.5,3412.5,3643.1667)
+polygon(3331.5,3640.5,3332.5,3638.5,3334.1,3640.5,3332.5,3641.1154)
+polygon(4032.5,3632.5,4036.5,3628.9445,4039.7,3632.5,4036.5,3635.7)
+polygon(3502.6818,3632.5,3500.5,3630.1,3499.0882,3632.5,3500.5,3635.1667)
+polygon(3452.5,3632.5,3452.5,3632.5,3452.5,3632.5,3460.5,3636.7667,3466.7222,3640.5,3460.5,3646.1,3452.5,3640.5,3452.5,3640.5)
+polygon(3420.5,3632.5,3420.5,3632.5,3420.5,3632.5,3420.5,3632.5)
+polygon(3391.7,3632.5,3396.5,3628.1364,3401.3,3632.5,3396.5,3637.8333)
+polygon(3362.3182,3632.5,3364.5,3627.7,3369.3,3632.5,3364.5,3634.6818)
+polygon(4013.5,3624.5,4020.5,3617.5,4028.5,3620.5,4032.5,3624.5,4028.5,3628.9445,4020.5,3631.5)
+polygon(3438.9,3624.5,3444.5,3618.9,3451.5,3624.5,3444.5,3629.5909)
+polygon(3386.9,3624.5,3388.5,3623.3571,3389.8333,3624.5,3388.5,3626.1)
+polygon(3372.5,3624.5,3372.5,3624.5,3372.5,3624.5,3372.5,3624.5)
+polygon(3348.5,3624.5,3348.5,3624.5,3356.5,3623.8333,3359.1667,3624.5,3356.5,3625.3889,3348.5,3624.5)
+polygon(3324.5,3624.5,3324.5,3624.5,3324.5,3624.5,3324.5,3624.5)
+polygon(4050.1471,3616.5,4052.5,3610.7857,4055.3572,3616.5,4052.5,3620.1364)
+polygon(4032.5,3616.5,4036.5,3610.7857,4038.8529,3616.5,4036.5,3620.5)
+polygon(3422.9,3616.5,3428.5,3610.2778,3436.5,3611.1667,3439.7,3616.5,3436.5,3619.7,3428.5,3621.5909)
+polygon(4019.6111,3608.5,4020.5,3605.8333,4021.6428,3608.5,4020.5,3612.5)
+polygon(3396.5,3608.5,3396.5,3608.5,3404.5,3603.1667,3412.5,3603.7,3416.5,3608.5,3412.5,3616.5,3412.5,3616.5,3412.5,3616.5,3404.5,3612.5,3400.5,3616.5,3396.5,3618.7857,3394.5,3616.5)
+polygon(3363.1667,3608.5,3364.5,3607.6111,3372.5,3605.5,3375.5,3608.5,3372.5,3612.5,3364.5,3609.6429)
+polygon(3950.1,3600.5,3956.5,3595.9286,3961.8333,3600.5,3956.5,3606.9)
+polygon(3511.1667,3600.5,3508.5,3595.1667,3502.1,3600.5,3508.5,3603.1667)
+polygon(3498.5,3600.5,3492.5,3595.7,3490.3182,3600.5,3484.5,3605.0714,3480.5,3608.5,3476.5,3612.8636,3470.7857,3616.5,3476.5,3621.5,3479.8333,3616.5,3484.5,3612.1923,3492.5,3611.4091,3494.9615,3608.5)
+polygon(3999.9286,3592.5,4004.5,3588.5,4009.8333,3592.5,4006.1,3600.5,4006.1,3608.5,4007.7,3616.5,4004.5,3619.7,4001.8333,3616.5,3996.5,3608.5,3996.5,3608.5,3996.5,3608.5,4001.8333,3600.5)
+polygon(3909.3889,3592.5,3908.5,3584.5,3907.1667,3592.5,3908.5,3593.6429)
+polygon(3415.1667,3592.5,3420.5,3586.1,3426.3182,3592.5,3425.8333,3600.5,3420.5,3603.7,3416.5,3600.5)
+polygon(3372.5,3592.5,3372.5,3592.5,3380.5,3592.5,3380.5,3592.5,3380.5,3600.5,3380.5,3600.5,3380.5,3600.5,3372.5,3592.5)
+polygon(3944.5,3584.5,3940.5,3582.1,3937.0714,3584.5,3932.5,3589.0714,3929.5,3592.5,3932.5,3597.3,3940.5,3596.5,3946.9,3600.5,3948.5,3601.2273,3955.7727,3608.5,3956.5,3610.5,3958.6818,3616.5,3956.5,3621.3,3948.5,3618.5,3947.2368,3624.5,3948.5,3627.5,3956.5,3625.8333,3958.5,3624.5,3964.5,3621.0714,3967.5476,3616.5,3965.1667,3608.5,3969.8333,3600.5,3964.5,3592.5,3964.5,3592.5,3956.5,3589.5,3953.5,3592.5,3948.5,3599.1667,3944.0555,3592.5)
+polygon(3500.5,3584.5,3492.5,3582.9,3491.3571,3584.5,3492.5,3587.1667)
+polygon(3398.1,3584.5,3404.5,3581.5909,3409.0714,3584.5,3404.5,3587.7)
+polygon(4004.5,3576.5,4004.5,3576.5,4004.5,3576.5,4004.5,3576.5)
+polygon(3660.9445,3576.5,3660.5,3575.9667,3660.1,3576.5,3660.5,3576.881)
+polygon(3364.5,3576.5,3364.5,3576.5,3364.5,3576.5,3364.5,3576.5)
+polygon(3472.5,3568.5,3468.5,3565.8333,3465.5,3568.5,3468.5,3576.5)
+polygon(3380.5,3568.5,3380.5,3568.5,3380.5,3568.5,3380.5,3568.5)
+polygon(3315.3571,3568.5,3316.5,3567.7727,3319.1667,3568.5,3316.5,3570.5)
+polygon(4027.5,3560.5,4028.5,3559.3571,4036.5,3558.5,4038.1,3560.5,4036.5,3564.5,4028.5,3561.5)
+polygon(3556.9211,3560.5,3556.5,3559.8846,3555.1667,3560.5,3556.5,3561.3889)
+polygon(3495.7,3560.5,3492.5,3555.1667,3490.7222,3560.5,3484.5,3565.1667,3479.5,3568.5,3484.5,3574.2143,3487.8333,3568.5,3492.5,3562.2778)
+polygon(3425.5,3560.5,3428.5,3557.5,3431.5,3560.5,3436.5,3563.8333,3442.1,3568.5,3436.5,3575.5,3434.9,3576.5,3433.8333,3584.5,3428.5,3589.8333,3422.5,3584.5,3420.5,3581.3,3417.8333,3576.5,3418.9,3568.5,3420.5,3567.1667)
+polygon(3388.5,3560.5,3388.5,3560.5,3388.5,3560.5,3388.5,3560.5)
+polygon(3306.9,3560.5,3308.5,3558.9,3309.2273,3560.5,3308.5,3561.6429)
+polygon(4007.7,3552.5,4012.5,3550.1,4018.5,3552.5,4012.5,3555.9286)
+polygon(3989.8333,3552.5,3996.5,3546.7857,4002.2143,3552.5,3996.5,3555.8333)
+polygon(3970.5,3552.5,3972.5,3548.5,3976.5,3552.5,3972.5,3554.5)
+polygon(3869.3,3552.5,3868.5,3550.9,3860.5,3544.5,3857.0714,3552.5,3860.5,3556.5,3868.5,3560.5)
+polygon(3814.6334,3552.5,3812.5,3550.6177,3809.3,3552.5,3812.5,3555.7)
+polygon(3473.0714,3552.5,3468.5,3550.2143,3460.5,3552.5,3468.5,3555.7)
+polygon(3401.3,3552.5,3404.5,3549.3,3407.7,3552.5,3412.5,3558.5,3413.8333,3560.5,3412.5,3562.1,3408.5,3568.5,3404.5,3571.4091,3401.3,3568.5,3400.8636,3560.5)
+polygon(3345.8333,3552.5,3348.5,3549.0714,3351.5,3552.5,3348.5,3554.6818)
+polygon(3959.1667,3544.5,3964.5,3542.7222,3969.8333,3544.5,3964.5,3547.7)
+polygon(3944.5,3544.5,3948.5,3542.9,3952.5,3544.5,3948.5,3547.1667)
+polygon(3574.853,3544.5,3572.5,3541.1667,3564.5,3544.5,3572.5,3547)
+polygon(3431.1667,3544.5,3436.5,3542.5,3441.8333,3544.5,3436.5,3546.7857)
+polygon(3413.6429,3544.5,3420.5,3540.1364,3427.3571,3544.5,3424.0555,3552.5,3420.5,3556.0555,3415.9286,3552.5)
+polygon(3252.5,3544.5,3252.5,3544.5,3252.5,3544.5,3252.5,3544.5)
+polygon(3921.5,3536.5,3916.5,3529.8333,3908.5,3536.5,3908.5,3536.5,3903.1667,3544.5,3903.7,3552.5,3908.5,3554.6818,3911.5,3552.5,3916.5,3546.7857,3919.8333,3552.5,3921.5,3560.5,3916.5,3564.9445,3914.0385,3568.5,3916.5,3574.9,3920.0555,3568.5,3924.5,3563.5,3930.5,3560.5,3930.1,3552.5,3924.5,3545.5,3921.8333,3544.5)
+polygon(3854.5,3536.5,3852.5,3533.3,3851.0455,3536.5,3844.5,3543.7,3843.6111,3544.5,3844.5,3545.6429,3845.3889,3544.5,3852.5,3538.1)
+polygon(3799.9286,3536.5,3796.5,3533.5,3794.1,3536.5,3796.5,3544.5)
+polygon(3548.5,3536.5,3540.5,3531.9286,3537.5909,3536.5,3540.5,3538.6334)
+polygon(3400.5,3536.5,3404.5,3535.3571,3405.8333,3536.5,3404.5,3538.5)
+polygon(3761.8333,3528.5,3756.5,3526.3666,3754.3666,3528.5,3756.5,3532.0555)
+polygon(3566.6818,3528.5,3564.5,3527,3562.5,3528.5,3564.5,3532.5)
+polygon(3396.5,3528.5,3396.5,3528.5,3396.5,3528.5,3396.5,3528.5)
+polygon(3356.5,3528.5,3356.5,3528.5,3364.5,3522.6818,3368.7667,3528.5,3364.5,3532.2647,3356.5,3528.5)
+polygon(3328.5,3528.5,3332.5,3526.1,3340.5,3525.8333,3343.5,3528.5,3340.5,3536.5,3340.5,3536.5,3332.5,3536.5,3332.5,3536.5)
+polygon(4036.5,3520.5,4036.5,3520.5,4036.5,3520.5,4036.5,3520.5)
+polygon(3972.5,3520.5,3972.5,3520.5,3972.5,3520.5,3972.5,3520.5)
+polygon(3837.6429,3520.5,3836.5,3516.5,3834.9,3520.5,3828.5,3526.9,3820.5,3524.9445,3817.5909,3528.5,3820.5,3529.2619,3828.5,3528.7051,3830.1,3528.5,3836.5,3522.1)
+polygon(3710.1,3520.5,3708.5,3518.9,3707.5,3520.5,3708.5,3521.6429)
+polygon(3514.5,3520.5,3508.5,3517.5,3504.5,3520.5,3508.5,3522.3461,3515.7727,3528.5,3516.5,3529.8333,3517.8333,3528.5,3516.5,3524.5)
+polygon(3823.4091,3512.5,3820.5,3507.1667,3817.5909,3512.5,3820.5,3516.0555)
+polygon(3807.4091,3512.5,3804.5,3509.8333,3801.3,3512.5,3804.5,3514.1842)
+polygon(3788.5,3512.5,3780.5,3504.5,3776.5,3512.5,3780.5,3514.1)
+polygon(3727.4091,3512.5,3724.5,3510.8158,3721.8333,3512.5,3724.5,3517.8333)
+polygon(3686.1,3512.5,3684.5,3504.5,3682.9,3512.5,3684.5,3515.1667)
+polygon(3645.9545,3512.5,3644.5,3511.0455,3640.5,3512.5,3644.5,3515.1667)
+polygon(3529.8333,3512.5,3524.5,3510.7222,3519.1667,3512.5,3524.5,3513.9545)
+polygon(3463.1667,3512.5,3468.5,3507.1667,3473.8333,3512.5,3468.5,3517.8333)
+polygon(3422.1,3512.5,3428.5,3507.1667,3433.0714,3512.5,3428.5,3515.1667)
+polygon(3372.5,3512.5,3372.5,3512.5,3372.5,3512.5,3372.5,3512.5)
+polygon(3339.1667,3512.5,3340.5,3511.3571,3348.5,3512.5,3356.5,3512.5,3356.5,3512.5,3356.5,3512.5,3348.5,3512.5,3340.5,3513.6429)
+polygon(3297.1667,3512.5,3300.5,3508.8636,3303.5769,3512.5,3300.5,3515.5769)
+polygon(3932.5,3504.5,3932.5,3504.5,3940.5,3502.7222,3942.7857,3504.5,3940.5,3506.7857,3932.5,3512.5,3932.5,3512.5,3932.5,3512.5)
+polygon(3565.8333,3504.5,3564.5,3502.9,3563.8846,3504.5,3564.5,3504.9211,3572.0789,3512.5,3572.5,3513.3,3573.3,3512.5,3572.5,3511.1667)
+polygon(3510.5,3504.5,3508.5,3501.8333,3506.5,3504.5,3508.5,3505.8333)
+polygon(3453.3889,3504.5,3460.5,3499.5769,3466.9,3504.5,3460.5,3510.9)
+polygon(3433.8333,3504.5,3436.5,3503.3571,3437.8333,3504.5,3436.5,3506.5)
+polygon(3409.3,3504.5,3412.5,3499.9286,3420.5,3504.5,3420.5,3504.5,3420.5,3504.5,3412.5,3507.7)
+polygon(3329.8333,3504.5,3332.5,3502.1,3335.1667,3504.5,3332.5,3507.5)
+polygon(4016.0555,3496.5,4020.5,3494,4024.9445,3496.5,4020.5,3503.1667)
+polygon(3968.0555,3496.5,3972.5,3492.5,3976.1364,3496.5,3972.5,3500.9445)
+polygon(3789.6429,3496.5,3788.5,3491.1667,3786.7222,3496.5,3788.5,3498.1)
+polygon(3494.7857,3496.5,3492.5,3493.3,3489.8333,3496.5,3485.5,3504.5,3492.5,3508.8077,3498.1,3504.5)
+polygon(3379.5,3496.5,3380.5,3495.6111,3384.5,3496.5,3380.5,3498.5)
+polygon(4002.3182,3488.5,4004.5,3485.8333,4007.5,3488.5,4004.5,3490.1)
+polygon(3733.6429,3488.5,3732.5,3484.5,3731.7,3488.5,3732.5,3489.3)
+polygon(3662.9,3488.5,3660.5,3486.7857,3657.8333,3488.5,3660.5,3491.9286)
+polygon(3530.2143,3488.5,3524.5,3482.7857,3520.8636,3488.5,3524.5,3493.5,3528.5,3496.5,3532.5,3499.1667,3540.5,3499.1667,3545.8333,3504.5,3540.5,3512.5,3548.5,3516.9445,3551,3512.5,3549.1154,3504.5,3548.5,3503.9667,3541.0333,3496.5,3548.5,3489.5,3551.1667,3488.5,3548.5,3480.5,3546.2143,3488.5,3540.5,3495.1667,3532.5,3491.7)
+polygon(3355.3571,3488.5,3356.5,3487.7727,3360.5,3488.5,3356.5,3489.8333)
+polygon(3921.3,3480.5,3924.5,3478.7222,3927.7,3480.5,3924.5,3482.5)
+polygon(3905.8333,3480.5,3908.5,3479.1667,3910.5,3480.5,3908.5,3482.5)
+polygon(3714.9,3480.5,3708.5,3474.1,3700.5,3472.5,3695.7,3480.5,3700.5,3485.8333,3705.3,3488.5,3700.5,3493.3,3692.5,3494.9,3690.5,3496.5,3692.5,3504.5,3700.5,3498.7857,3703.7,3496.5,3708.5,3491.7,3712.5,3496.5,3716.5,3499.1667,3720.5,3496.5,3716.5,3491.7,3712.5,3488.5)
+polygon(3408.5,3480.5,3412.5,3476.5,3415.1667,3480.5,3412.5,3484.5)
+polygon(3389.6429,3480.5,3396.5,3477.0714,3403.3571,3480.5,3396.5,3485.8333)
+polygon(3332.5,3480.5,3332.5,3480.5,3332.5,3480.5,3332.5,3488.5,3332.5,3488.5,3332.5,3488.5)
+polygon(3976.5,3472.5,3980.5,3470.1,3983.9286,3472.5,3980.5,3478.5)
+polygon(3932.5,3472.5,3932.5,3472.5,3932.5,3472.5,3932.5,3472.5)
+polygon(3916.5,3472.5,3916.5,3472.5,3916.5,3472.5,3916.5,3472.5)
+polygon(3900.5,3472.5,3900.5,3472.5,3900.5,3472.5,3900.5,3472.5)
+polygon(3873.8333,3472.5,3876.5,3470.9,3877.8333,3472.5,3884.5,3478.2143,3892.5,3475.1667,3898.5,3480.5,3892.5,3488.5,3892.5,3488.5,3886.5,3496.5,3892.5,3501.3,3895.1667,3496.5,3900.5,3491.7,3908.5,3492.5,3916.5,3495.3571,3917.6429,3496.5,3916.5,3498.1,3911.9286,3504.5,3908.5,3510.5,3900.5,3504.5,3894.7857,3512.5,3898.5,3520.5,3892.5,3523.7,3886.9615,3528.5,3884.5,3532.5,3879.9286,3528.5,3881.8333,3520.5,3884.5,3517.3,3889.3,3512.5,3884.5,3504.5,3884.5,3504.5,3876.5,3501.3,3873.5,3496.5,3876.5,3491.7,3884.5,3488.5,3876.5,3485.3,3873.5,3480.5)
+polygon(3598.1,3472.5,3596.5,3464.5,3592.5,3472.5,3596.5,3475.9286)
+polygon(3559.1667,3472.5,3556.5,3471.7727,3554.9,3472.5,3556.5,3480.5,3556.5,3480.5,3564.5,3483.1667,3565.2273,3480.5,3572.5,3473.2273,3572.8636,3472.5,3572.5,3471.9286,3569.8333,3472.5,3564.5,3477.8333)
+polygon(3425.8333,3472.5,3428.5,3470.2143,3436.5,3468.9445,3440.5,3472.5,3436.5,3477.0714,3431.7,3480.5,3436.5,3483.5,3441.5,3488.5,3436.5,3492.1364,3428.5,3496.5,3428.5,3496.5,3428.5,3496.5,3426.5,3488.5,3424.5,3480.5)
+polygon(3355.3571,3472.5,3356.5,3471.6111,3357.6429,3472.5,3356.5,3473.2273)
+polygon(3836.5,3464.5,3836.5,3464.5,3844.5,3464.5,3844.5,3464.5,3850.5,3472.5,3844.5,3477.3,3841.0714,3472.5,3836.5,3464.5)
+polygon(3500.5,3464.5,3500.5,3464.5,3500.5,3464.5,3500.5,3464.5)
+polygon(3388.5,3464.5,3388.5,3464.5,3388.5,3464.5,3388.5,3464.5)
+polygon(3932.5,3456.5,3932.5,3456.5,3932.5,3456.5,3932.5,3456.5)
+polygon(3722.9,3456.5,3724.5,3455.6111,3727.1667,3456.5,3724.5,3460.5)
+polygon(3372.5,3456.5,3372.5,3456.5,3380.5,3454.7222,3381.7308,3456.5,3380.5,3458.1,3372.5,3456.5)
+polygon(4019.7,3448.5,4020.5,3447.1667,4022.5,3448.5,4020.5,3449.5)
+polygon(3899.7,3448.5,3900.5,3446.9,3908.5,3448.5,3908.5,3448.5,3908.5,3448.5,3900.5,3449.6429)
+polygon(3867.3571,3448.5,3868.5,3445.8333,3870.1,3448.5,3868.5,3456.5,3868.5,3456.5,3868.5,3456.5)
+polygon(3416.5,3448.5,3420.5,3445.8333,3423.7,3448.5,3420.5,3453.8333)
+polygon(3398.6818,3448.5,3404.5,3443.1667,3410.9,3448.5,3404.5,3453.0714)
+polygon(3956.5,3440.5,3956.5,3440.5,3956.5,3440.5,3956.5,3440.5)
+polygon(3883.7,3440.5,3884.5,3436.5,3885.0714,3440.5,3884.5,3444.5)
+polygon(3839.7,3440.5,3844.5,3438.1,3848.5,3440.5,3844.5,3444.5)
+polygon(3711.7,3440.5,3716.5,3437.0714,3722.5,3440.5,3720.2333,3448.5,3716.5,3453.5909,3711.8333,3448.5)
+polygon(3664.5,3440.5,3668.5,3438.5,3671.1667,3440.5,3669.6429,3448.5,3668.5,3451.1667,3664.5,3448.5)
+polygon(3639.8333,3440.5,3644.5,3434.9,3651.5,3440.5,3644.5,3446.7222)
+polygon(3426.9,3440.5,3428.5,3439.1667,3430.1,3440.5,3428.5,3442.5)
+polygon(3384.5,3440.5,3388.5,3436.5,3392.5,3440.5,3388.5,3442.9615)
+polygon(3897.8333,3432.5,3900.5,3431.5,3901.5,3432.5,3900.5,3434.1)
+polygon(3803.5,3432.5,3804.5,3431.3571,3812.5,3428.0555,3820.5,3428.8636,3824.9445,3432.5,3820.5,3436.1364,3812.5,3438.2143,3804.5,3435.1667)
+polygon(3708.5,3432.5,3708.5,3432.5,3708.5,3432.5,3708.5,3432.5)
+polygon(3409.8333,3432.5,3412.5,3429.3,3414.1,3432.5,3412.5,3434.7857)
+polygon(3842.9,3424.5,3844.5,3422.9,3846.1,3424.5,3844.5,3425.5)
+polygon(3756.5,3424.5,3756.5,3424.5,3764.5,3420.5,3771.1667,3424.5,3764.5,3430.2143,3756.5,3424.5)
+polygon(3734.1,3424.5,3740.5,3418.1,3745.8333,3424.5,3740.5,3428.0555)
+polygon(3696.5,3424.5,3700.5,3421.8333,3705.8333,3424.5,3700.5,3426.7857)
+polygon(3849.0714,3416.5,3852.5,3413.8333,3857.3,3416.5,3852.5,3419.9286)
+polygon(3817.3,3416.5,3820.5,3414.2143,3821.9545,3416.5,3820.5,3418.5)
+polygon(3803.6111,3416.5,3804.5,3414.9,3806.5,3416.5,3804.5,3417.6429)
+polygon(3729.6429,3416.5,3732.5,3410.7857,3739.1667,3416.5,3732.5,3423.1667)
+polygon(3684.5,3416.5,3684.5,3416.5,3684.5,3416.5,3689.8333,3424.5,3690.9,3432.5,3684.5,3436.0555,3682.2143,3432.5,3676.5,3425.2273,3675.5,3424.5,3676.5,3420.5)
+polygon(3436.5,3416.5,3436.5,3416.5,3436.5,3416.5,3442.5,3424.5,3436.5,3426.5,3428.5,3426.7857,3425.3,3424.5,3428.5,3419.1667)
+polygon(3380.5,3416.5,3380.5,3416.5,3380.5,3416.5,3380.5,3416.5)
+polygon(3866.6539,3408.5,3868.5,3405.8333,3872.5,3408.5,3873.8333,3416.5,3868.5,3421.8333,3864.5,3416.5)
+polygon(3671.1667,3408.5,3676.5,3403.1667,3679.7,3408.5,3676.5,3413.8333)
+polygon(3650.5,3408.5,3652.5,3407.6111,3660.5,3406.7222,3665.8333,3408.5,3660.5,3412.5,3652.5,3416.5,3652.5,3416.5,3652.5,3416.5)
+polygon(3441.8333,3408.5,3444.5,3404.5,3449.8333,3408.5,3444.5,3412.5)
+polygon(3874.5,3400.5,3876.5,3399.0454,3878.7857,3400.5,3876.5,3403.7)
+polygon(3860.5,3400.5,3860.5,3400.5,3860.5,3400.5,3860.5,3400.5)
+polygon(3802.9,3400.5,3804.5,3396.5,3812.5,3398.9,3815.1667,3400.5,3813.8333,3408.5,3812.5,3410.5,3810.9,3408.5,3804.5,3402.1)
+polygon(3737.8333,3400.5,3740.5,3398.7222,3743.7,3400.5,3740.5,3404.5)
+polygon(3634.5,3400.5,3636.5,3399.8333,3638.1,3400.5,3636.5,3401.8333)
+polygon(3460.5,3400.5,3460.5,3400.5,3460.5,3400.5,3468.5,3403.7,3473.3,3408.5,3468.5,3416.5,3471.1667,3424.5,3476.5,3426.5,3484.5,3432.5,3484.5,3432.5,3488.5,3440.5,3491.7,3448.5,3490.5,3456.5,3486.5,3464.5,3484.5,3472.5,3492.5,3477.8333,3500.5,3473.8333,3507.1667,3480.5,3506.5,3488.5,3508.5,3491.1667,3509.6429,3488.5,3511.1667,3480.5,3508.5,3478.5,3502.5,3472.5,3508.5,3467.7,3512.5,3464.5,3508.5,3463.1667,3501.8333,3456.5,3500.5,3451.1667,3496.5,3448.5,3496.5,3440.5,3500.5,3432.5,3500.5,3432.5,3500.5,3432.5,3508.5,3436.1364,3512.9445,3432.5,3511.1667,3424.5,3516.5,3418.1,3519.1667,3416.5,3524.5,3413.8333,3532.5,3408.5,3532.5,3408.5,3540.5,3408.5,3540.5,3408.5,3547.0455,3416.5,3540.5,3421.6429,3538,3424.5,3532.5,3430.7857,3527.7,3432.5,3532.5,3435.9286,3537.8333,3440.5,3536.5,3448.5,3538.5,3456.5,3532.5,3459.1667,3524.5,3463.9667,3521.8333,3464.5,3522.5,3472.5,3524.5,3476.5,3532.5,3473.3889,3540.5,3480.5,3543.1667,3472.5,3540.5,3467.1667,3539.3571,3464.5,3540.5,3460.5,3543.1667,3456.5,3548.5,3451.1667,3553.8333,3456.5,3556.5,3457.2273,3558.1,3456.5,3564.5,3451.9286,3569.0714,3456.5,3572.5,3458,3580.5,3456.5,3572.5,3454.5,3566.5,3448.5,3564.5,3445.0714,3562.1,3448.5,3556.5,3455.5,3549.5,3448.5,3548.5,3447.7727,3541.8333,3440.5,3540.5,3438.2143,3535.5,3432.5,3540.5,3428.5,3548.5,3426.5,3552.5,3424.5,3556.5,3419.1667,3558.1,3416.5,3564.5,3411.9286,3568.5,3416.5,3572.5,3419.7,3579.3571,3424.5,3572.5,3431.3571,3570.9,3432.5,3572.5,3433.3,3577,3440.5,3580.5,3445.5909,3587.5,3440.5,3580.5,3432.5,3580.5,3432.5,3580.5,3432.5,3582.5,3424.5,3580.5,3422.9,3576.5,3416.5,3580.5,3410.1,3588.5,3414.2143,3593.5,3408.5,3596.5,3406.5,3604.5,3406.9,3609.8333,3400.5,3612.5,3398.7222,3614.2778,3400.5,3616.1364,3408.5,3612.5,3414.2143,3604.5,3411.1667,3599.1667,3416.5,3596.5,3417.6429,3591.1667,3424.5,3596.5,3430.5,3604.5,3426.1,3612.5,3424.5,3612.5,3424.5,3614.7857,3416.5,3620.5,3412.8636,3628.5,3411.7,3636.5,3413.5,3638.6818,3416.5,3636.5,3418.5,3628.5,3424.5,3632.5,3432.5,3629.8333,3440.5,3628.5,3441.6429,3626.5,3440.5,3620.5,3432.5,3615.7,3440.5,3620.5,3444.5,3623.1667,3448.5,3620.5,3451.1667,3613.6429,3456.5,3620.5,3460.8636,3623.8333,3464.5,3628.5,3470.1,3634.5,3472.5,3628.5,3475.9286,3622.1,3480.5,3628.5,3482.7857,3631.7,3480.5,3636.5,3473.6429,3642.5,3480.5,3644.5,3483.1667,3645.9545,3480.5,3645.1667,3472.5,3644.5,3471.7,3636.5,3469.8333,3634.7222,3464.5,3631.1667,3456.5,3636.5,3452.5,3644.5,3456.5,3652.5,3448.5,3652.5,3448.5,3652.5,3448.5,3660.5,3449.5,3666.7222,3456.5,3662.5,3464.5,3668.5,3467.9286,3672.0555,3472.5,3676.5,3480.5,3679.3571,3472.5,3676.5,3469.6429,3670.5,3464.5,3670.7857,3456.5,3676.5,3452.8636,3683.1667,3456.5,3684.5,3457.3,3688.5,3456.5,3692.5,3454.9,3700.5,3453.8333,3708.5,3455.1667,3710.1,3456.5,3712.5,3464.5,3716.5,3467.1667,3724.5,3468.5,3726.5,3464.5,3732.5,3459.7,3740.5,3458.7857,3743.5769,3464.5,3748.5,3469.8333,3754.9,3464.5,3748.5,3459.1667,3743.1667,3456.5,3748.5,3450.1,3756.5,3448.5,3748.5,3447.1667,3745.8333,3448.5,3740.5,3452.5,3732.5,3448.5,3732.5,3448.5,3726.5,3440.5,3729.8333,3432.5,3732.5,3427.1667,3734.7857,3432.5,3740.5,3440.5,3745.5,3432.5,3748.5,3427.7,3750.9,3432.5,3756.5,3438.1,3764.5,3437.8333,3772.5,3433.8333,3775.1667,3432.5,3780.5,3430.2143,3788.5,3424.5,3788.5,3424.5,3788.5,3424.5,3792.5,3432.5,3788.5,3436.5,3782.2778,3440.5,3788.5,3448.5,3788.5,3448.5,3790.9,3456.5,3788.5,3461.3,3780.5,3463.7727,3774.3461,3456.5,3772.5,3452.5,3768.5,3456.5,3772.5,3464.5,3772.5,3464.5,3772.5,3472.5,3772.5,3472.5,3769.3,3480.5,3764.5,3483.5,3757.8333,3488.5,3756.5,3491.1667,3753.8333,3488.5,3748.5,3483.1667,3746.5,3488.5,3748.5,3493.8333,3751.1667,3496.5,3755.1667,3504.5,3756.5,3507.1667,3764.5,3506.5,3765.5,3504.5,3767.1667,3496.5,3766.853,3488.5,3772.5,3481.6429,3775.1667,3480.5,3780.5,3474.1,3788.5,3472.5,3788.5,3472.5,3788.5,3472.5,3796.5,3480.5,3804.5,3472.5,3796.5,3468.5,3792.5,3464.5,3796.5,3462.7222,3804.5,3458.7857,3812.5,3458.1,3814.1,3456.5,3820.5,3453.5909,3825.5909,3448.5,3828.5,3445.5909,3833.0714,3448.5,3828.5,3456.5,3828.5,3456.5,3824.5,3464.5,3820.5,3470.9,3812.5,3468.0555,3804.5,3472.5,3810.5,3480.5,3812.5,3481.9545,3819.7,3488.5,3820.5,3496.5,3828.5,3491.9286,3831.7,3496.5,3836.5,3502.5,3841.8333,3504.5,3844.5,3512.5,3846.5,3504.5,3844.5,3502.5,3841.8333,3496.5,3844.5,3493.8333,3852.5,3489.3889,3853.6429,3488.5,3856.5,3480.5,3860.5,3476.5,3861.8333,3480.5,3868.5,3488.5,3868.5,3488.5,3868.5,3488.5,3863.5,3496.5,3868.5,3500.1364,3874.5,3504.5,3876.5,3507.1667,3881.0714,3512.5,3876.5,3516.5,3871.1667,3520.5,3868.5,3522.7857,3864.5,3520.5,3864.1364,3512.5,3860.5,3504.5,3856.0555,3512.5,3855.1667,3520.5,3860.5,3522.5,3864.8636,3528.5,3867.3571,3536.5,3868.5,3538.1,3876.5,3540.1364,3884.5,3541.8333,3888.5,3536.5,3892.5,3534.0385,3897.6429,3528.5,3900.5,3522.7857,3908.5,3520.5,3908.5,3520.5,3908.5,3520.5,3916.5,3524.5,3924.5,3525.8333,3932.5,3522.1,3940.5,3527.5,3948.5,3525.1667,3951.8333,3528.5,3948.5,3532.9445,3940.5,3530.1,3936.5,3536.5,3932.5,3544.5,3940.5,3546.1,3945.8333,3552.5,3940.5,3557.8333,3935.1667,3560.5,3940.5,3562.2778,3948.5,3566.9,3956.5,3565.5,3959.9286,3568.5,3964.5,3573.0714,3970.9,3568.5,3972.5,3566.5,3975.9286,3560.5,3980.5,3554.1,3983.7,3560.5,3986.2143,3568.5,3980.5,3572.9445,3975.1667,3576.5,3972.5,3579.7,3967.7,3584.5,3972.5,3589.3,3977.3,3584.5,3980.5,3581.8333,3982.7857,3584.5,3988.5,3587.3571,3994.5,3592.5,3992.5,3600.5,3988.5,3603.7,3986.9,3600.5,3980.5,3595.9286,3973.3889,3600.5,3980.5,3605.8333,3985.0714,3608.5,3984.5,3616.5,3988.5,3620.1364,3996.5,3618.9615,4002.5,3624.5,4002.1,3632.5,4004.5,3636.5,4007.9286,3640.5,4012.5,3644.0555,4020.5,3645.8333,4028.5,3640.5,4028.5,3640.5,4028.5,3640.5,4036.5,3645.3,4038.9615,3648.5,4042.2142,3656.5,4036.5,3662.2143,4028.5,3664.5,4036.5,3669.8333,4038.1,3664.5,4044.5,3658.1,4048.2646,3664.5,4048.5,3672.5,4044.5,3675.5,4038.7858,3680.5,4044.5,3686.2143,4051.1666,3680.5,4052.5,3678.5,4056.5,3680.5,4055.7,3688.5,4055.4091,3696.5,4058.5,3704.5,4060.5,3705.6429,4068.5,3708.5,4071.1666,3704.5,4068.5,3696.5,4068.5,3696.5,4065.3,3688.5,4068.5,3686.9,4070.7858,3688.5,4076.5,3695.1667,4077.2273,3696.5,4079.4091,3704.5,4078.9,3712.5,4078.7858,3720.5,4081.2059,3728.5,4084.5,3733.5909,4090.9,3736.5,4084.5,3741.0714,4078.5,3744.5,4084.5,3746.6818,4092.5,3752.5,4092.5,3752.5,4098.9,3760.5,4095.1666,3768.5,4100.5,3773.0714,4106.5,3776.5,4108.5,3779.1667,4116.5,3777.3,4123.7,3784.5,4116.5,3791.0455,4108.5,3788.0555,4103.5,3792.5,4108.5,3796.9445,4113.0714,3800.5,4113.0714,3808.5,4116.5,3813.3,4118.2778,3816.5,4120.5,3824.5,4124.5,3828.8077,4130.5,3832.5,4132.5,3840.5,4136.5,3832.5,4139.3572,3824.5,4140.5,3816.5,4140.5,3816.5,4140.5,3816.5,4148.5,3821.5,4154.5,3824.5,4148.5,3829.3,4144.5,3832.5,4148.5,3837.8333,4149.6428,3840.5,4156.5,3848.5,4156.5,3848.5,4156.5,3848.5,4148.5,3851.1667,4146.5,3848.5,4140.5,3844.5,4132.5,3848.5,4132.5,3848.5,4130.2142,3856.5,4132.5,3861.8333,4136.5,3856.5,4140.5,3851.9286,4145.8334,3856.5,4143.1666,3864.5,4148.5,3870.2143,4152.5,3872.5,4148.5,3876.0555,4140.5,3876.9445,4136.5,3880.5,4134.7858,3888.5,4132.5,3891.1667,4124.5,3888.5,4122.5,3896.5,4124.5,3898.1,4132.5,3902.9,4140.5,3902.9,4144.5,3896.5,4148.5,3888.5,4148.5,3888.5,4148.5,3888.5,4153.0714,3896.5,4153.5,3904.5,4148.5,3908.5,4140.5,3912.5,4144.5,3920.5,4140.5,3925.3,4134.5,3920.5,4132.5,3919.8333,4131.1666,3920.5,4132.5,3921.3,4139.0454,3928.5,4132.5,3935.7,4131.7,3936.5,4132.5,3938.5,4140.5,3940.5,4142.5,3944.5,4141.6428,3952.5,4140.5,3953.2273,4132.5,3957.8333,4127.1666,3952.5,4124.5,3951.3571,4121.8334,3952.5,4116.5,3958.9,4112.5,3960.5,4116.5,3961.8334,4121.5,3968.5,4117.8334,3976.5,4124.5,3984.5,4124.5,3984.5,4127.7,3992.5,4124.5,3995.1666,4122.2142,3992.5,4116.5,3988.0555,4109.8334,3992.5,4114.2142,4000.5,4108.5,4007.1666,4107.1666,4008.5,4100.5,4012.9445,4097.8334,4016.5,4100.5,4022.9,4101.3,4024.5,4108.5,4031.0454,4116.5,4028.5,4122.9,4032.5,4116.5,4037.0714,4108.5,4034.2778,4100.5,4034.1,4092.5,4038.7222,4089.3,4040.5,4084.5,4044.5,4080.5,4040.5,4076.5,4036.5,4074.5,4040.5,4076.5,4042.9,4082.1,4048.5,4076.5,4052.8077,4068.5,4051.1666,4063.9286,4056.5,4060.5,4060.5,4052.5,4064.5,4060.5,4066.9,4064.5,4072.5,4060.5,4078.1,4052.5,4074.9,4044.5,4075.5,4039.7,4072.5,4036.5,4068.5,4028.5,4070.9,4020.5,4064.5,4012.5,4072.5,4012.5,4080.5,4012.5,4080.5,4012.5,4080.5,4004.5,4077.0714,3996.5,4078.1,3988.5,4077.6765,3984.1364,4080.5,3988.5,4088.5,3988.5,4088.5,3988.5,4088.5,3984.5,4096.5,3980.5,4097.2273,3976.5,4096.5,3972.5,4095.7727,3965.2273,4088.5,3972.5,4083.5,3976.8636,4080.5,3972.5,4077.0714,3965.3889,4072.5,3972.5,4066.1,3974.1,4064.5,3972.5,4063.6578,3971.8333,4064.5,3964.5,4072.1522,3964.4838,4072.5,3964.5,4074.1,3967.7,4080.5,3964.5,4086.9,3963.7727,4088.5,3964.5,4096.5,3964.5,4096.5,3964.5,4096.5,3959.9286,4104.5,3956.5,4106.9,3952.5,4104.5,3951.7,4096.5,3952.2895,4088.5,3948.5,4083.3572,3940.5,4087.1666,3936.5,4088.5,3940.5,4093.3,3943.1667,4096.5,3940.5,4098.7858,3932.5,4100.5,3926.7857,4096.5,3926.5,4088.5,3924.5,4080.5,3924.5,4080.5,3916.5,4078.5,3913.0714,4080.5,3916.5,4085.3,3921.8333,4088.5,3916.5,4090.1,3909.3889,4096.5,3908.5,4098.5,3900.5,4096.5,3900.5,4096.5,3900.5,4096.5,3902.1,4088.5,3900.5,4086.5,3896.5,4088.5,3892.5,4089.3,3891.5,4088.5,3884.5,4083.4091,3876.5,4084.1364,3868.5,4083.1666,3865.5,4080.5,3860.5,4076.0555,3852.5,4077.8334,3849.5,4080.5,3844.5,4083.8334,3840.5,4080.5,3836.5,4075.5,3828.5,4075.9286,3825.8333,4072.5,3822.2143,4064.5,3820.5,4061.0714,3816.5,4064.5,3814.5,4072.5,3812.5,4074.1,3811.1667,4072.5,3808.5,4064.5,3804.5,4061.8334,3798.5,4056.5,3796.5,4053.3,3788.5,4053.6765,3780.5,4053.8334,3772.5,4052.5,3767.1667,4048.5,3764.5,4047.5,3756.5,4046.5,3751.1667,4040.5,3748.5,4034.5,3746.5,4032.5,3740.5,4029.8334,3732.5,4026.7858,3724.5,4031.3572,3719.7,4024.5,3716.5,4019.1666,3711.1667,4016.5,3708.5,4015.3572,3701.6429,4008.5,3700.5,4007.5,3692.5,4000.5,3684.5,4005.8334,3681.8333,4000.5,3676.5,3992.5,3676.5,3992.5,3670.5,3984.5,3676.5,3978.5,3680.5,3984.5,3684.5,3992.5,3692.5,3985.5667,3700.5,3987.5,3703.5,3984.5,3700.5,3982.6538,3692.5,3983.1666,3684.5,3981.5,3677.8333,3976.5,3676.5,3974.9,3668.5,3975.5,3666.9,3976.5,3666.9,3984.5,3660.5,3988.5,3658.2143,3992.5,3652.5,3998.6538,3645.8333,3992.5,3644.5,3988.5,3642.7222,3984.5,3639.7,3976.5,3640.5,3968.5,3644.5,3964.5,3646.1,3960.5,3644.5,3952.5,3644.5,3952.5,3636.5,3948.5,3632.5,3952.5,3628.5,3955.1667,3622.5,3952.5,3620.5,3951.5,3612.5,3952.5,3612.5,3952.5,3604.5,3954.7857,3600.5,3952.5,3596.5,3949.8333,3593.5909,3944.5,3588.5,3938.2778,3585.3,3936.5,3588.5,3934.7222,3593.1667,3928.5,3596.5,3920.5,3588.5,3917.5,3587,3920.5,3582.2778,3928.5,3580.5,3931.7,3578.2143,3928.5,3572.5,3922.7857,3565.8333,3928.5,3564.5,3929.5,3563.6111,3928.5,3560.5,3920.5,3564.5,3916.5,3572.5,3912.5,3572.5,3912.5,3574.1,3904.5,3580.5,3898.1,3581.3889,3896.5,3580.5,3895.3571,3574.5,3888.5,3572.5,3887.1667,3567.1667,3888.5,3564.5,3891.1667,3560.5,3888.5,3556.5,3887.9286,3550.3823,3880.5,3549.8333,3872.5,3556.5,3865.2273,3564.119,3872.5,3564.5,3876.5,3565.3,3872.5,3564.5,3868.5,3561.8333,3864.5,3556.5,3859.1667,3551.1667,3864.5,3548.5,3866.1,3544.5,3872.5,3542.1,3880.5,3540.5,3883.1667,3532.5,3887.3571,3525.6429,3880.5,3524.5,3872.5,3524.5,3872.5,3524.5,3864.5,3524.5,3864.5,3532.5,3859.9286,3540.5,3856.5,3532.5,3852.5,3524.5,3848.5,3524.5,3848.5,3516.5,3845.8333,3508.5,3840.5,3508.5,3840.5,3508.5,3840.5,3511.7,3832.5,3516.5,3827.7,3521.8333,3832.5,3524.5,3835.9286,3529.0714,3840.5,3532.5,3844.5,3540.5,3848.5,3540.5,3848.5,3548.5,3849.8333,3549.2273,3848.5,3548.5,3846.5,3545.0714,3840.5,3540.5,3835.9286,3532.5,3836.5,3528.5,3832.5,3524.5,3829.5,3520.0555,3824.5,3524.5,3816.5,3516.5,3810.5,3514.5,3808.5,3508.5,3803.7,3503.1667,3800.5,3500.5,3797.8333,3498.2143,3792.5,3496.7667,3784.5,3492.5,3777.3889,3484.5,3780.5,3480.5,3776.5,3478.5,3768.5,3484.5,3764.5,3487.5,3760.5,3489.3,3752.5,3484.5,3745.6429,3481.8333,3744.5,3476.5,3742.5,3473.0714,3736.5,3468.5,3730.1,3460.5,3736.5,3460.5,3736.5,3454.1,3744.5,3452.5,3745.6429,3444.5,3744.5,3436.5,3750.9,3430.6818,3744.5,3436.5,3738.6818,3444.5,3736.5,3439.7,3728.5,3442.9,3720.5,3440.8636,3712.5,3436.5,3704.5,3428.5,3707.5,3423.7,3704.5,3428.5,3698.5,3436.5,3704.5,3439.4091,3696.5,3444.5,3689.5,3448.5,3696.5,3446.5,3704.5,3452.5,3707.5,3460.5,3707.1667,3468.5,3704.5,3460.5,3702.9,3456.2333,3696.5,3460.5,3690.1,3462.5,3688.5,3460.5,3685.3,3456.5,3680.5,3452.5,3675.7,3449.3,3672.5,3446.5,3664.5,3449.8333,3656.5,3452.5,3654.5,3460.5,3653.3,3463.5,3648.5,3468.5,3642.7857,3475.1667,3648.5,3476.5,3652.5,3477.6429,3648.5,3478.7857,3640.5,3476.5,3637.8333,3468.5,3637.8333,3465.8333,3632.5,3460.5,3626.6818,3454.5,3624.5,3460.5,3620.5,3465.3,3616.5,3460.5,3610.5,3457.8333,3608.5,3455.1667,3600.5,3460.5,3596.5,3464.5,3600.5,3468.5,3605.8333,3473.8333,3600.5,3473.3,3592.5,3470.3462,3584.5,3468.5,3576.5,3462.5,3584.5,3460.5,3586.1,3452.5,3584.5,3447.8333,3592.5,3449.8333,3600.5,3449.3,3608.5,3444.5,3612.5,3438.5,3608.5,3439.9286,3600.5,3438.7857,3592.5,3440.5,3584.5,3444.5,3579.7,3452.5,3584.5,3457.0714,3576.5,3452.5,3572.9445,3447.5,3568.5,3444.5,3563.7,3442.2143,3560.5,3443.1667,3552.5,3444.5,3548.5,3446.1,3544.5,3444.5,3540.5,3443.3571,3536.5,3444.5,3533.8333,3452.5,3530.7857,3456.5,3528.5,3452.5,3526.5,3444.5,3524.5,3436.5,3520.5,3436.5,3520.5,3436.5,3520.5,3444.5,3518.5,3449.8333,3512.5,3452.5,3506.5,3457.3,3512.5,3460.5,3515.1667,3465.8333,3520.5,3468.5,3528.5,3468.5,3528.5,3473.3,3536.5,3476.5,3539.7,3484.5,3541.8333,3491.6111,3536.5,3484.5,3532.7353,3479.3571,3528.5,3476.5,3522.7857,3472.5,3520.5,3476.5,3516.5,3479.7,3512.5,3476.5,3509.8333,3471.1667,3504.5,3469.2273,3496.5,3468.5,3492.5,3460.5,3488.5,3460.5,3488.5,3459.6111,3480.5,3460.5,3477.8333,3468.5,3479.5,3472.5,3480.5,3476.5,3483.1667,3477.3,3480.5,3476.5,3478.5,3474.1,3472.5,3468.5,3465.5,3460.5,3469.8333,3457.8333,3472.5,3452.5,3475.1667,3448.5,3472.5,3452.5,3464.5,3447.1667,3456.5,3444.5,3455.3571,3439.1667,3448.5,3444.5,3444.1364,3448.5,3440.5,3452.5,3432.5,3445.8333,3424.5,3446.7857,3416.5,3452.5,3409.8333,3459.1667,3416.5,3456.9445,3424.5,3452.5,3432.5,3460.5,3437.3,3462.2778,3440.5,3464.5,3448.5,3460.5,3453.8333,3457.8333,3456.5,3460.5,3458.1,3468.5,3456.5,3468.5,3456.5,3476.5,3450.5,3477.3,3448.5,3476.5,3444.5,3475.5,3440.5,3468.5,3432.5,3468.5,3432.5,3466.9,3424.5,3468.5,3416.5,3460.5,3412.5,3456.5,3408.5)
+polygon(3828.5,3392.5,3828.5,3392.5,3828.5,3392.5,3832.1364,3400.5,3828.5,3404.5,3822.7857,3400.5)
+polygon(3583.1667,3392.5,3588.5,3388.2333,3593.8333,3392.5,3588.5,3399.6111)
+polygon(3556.5,3392.5,3556.5,3392.5,3556.5,3392.5,3564.5,3395.7,3572.5,3395.1667,3576.5,3400.5,3572.5,3406.5,3564.5,3404.5,3560.5,3408.5,3556.5,3414.5,3553.0714,3408.5,3556.5,3400.5)
+polygon(3812.5,3384.5,3812.5,3384.5,3812.5,3384.5,3812.5,3384.5)
+polygon(3732.5,3384.5,3732.5,3384.5,3732.5,3384.5,3732.5,3384.5)
+polygon(3643.6111,3384.5,3644.5,3381.8333,3646.1,3384.5,3644.5,3392.5,3644.5,3392.5,3644.5,3392.5)
+polygon(3779.3571,3376.5,3780.5,3373.8333,3784.5,3376.5,3780.5,3377.2273)
+polygon(3745.8333,3376.5,3748.5,3373.3,3750.7857,3376.5,3748.5,3378.5)
+polygon(3668.5,3376.5,3668.5,3376.5,3668.5,3376.5,3668.5,3376.5)
+polygon(3521.8333,3376.5,3524.5,3374.5,3529.8333,3376.5,3524.5,3380.5)
+polygon(3474.7222,3376.5,3476.5,3374.2143,3481.8333,3376.5,3478.5,3384.5,3484.5,3389.3,3486.7857,3392.5,3492.5,3397.5,3496.5,3400.5,3500.5,3406.5,3506.5,3400.5,3508.5,3399.7727,3516.5,3397.8333,3524.5,3395.1667,3529.8333,3400.5,3524.5,3404.5,3520.5,3408.5,3516.5,3414.9,3514.9,3416.5,3508.5,3421.8333,3500.5,3420.2333,3495.1667,3424.5,3492.5,3430.9,3489.3,3424.5,3485.9546,3416.5,3489.8333,3408.5,3484.5,3406.7222,3478.2778,3400.5,3476.5,3398.5,3472.1364,3392.5,3468.5,3384.5,3468.5,3384.5,3468.5,3384.5)
+polygon(3419.7727,3376.5,3420.5,3374.5,3421.3889,3376.5,3420.5,3380.5)
+polygon(3836.5,3368.5,3836.5,3368.5,3836.5,3368.5,3836.5,3368.5)
+polygon(3732.5,3368.5,3732.5,3368.5,3740.5,3366.7222,3743.7,3368.5,3740.5,3371.1667,3732.5,3368.5)
+polygon(3698.2143,3368.5,3700.5,3365.3,3702.1,3368.5,3708.5,3374.9,3710.5,3376.5,3708.5,3379.1667,3702.1,3384.5,3708.5,3389.8333,3710.2778,3392.5,3716.5,3397.5909,3722.9,3400.5,3716.5,3406.9,3708.5,3408.5,3708.5,3408.5,3700.5,3411.1667,3697.3,3408.5,3694.5,3400.5,3700.5,3392.5,3698.9,3384.5,3692.5,3379.1667,3690.2143,3376.5,3692.5,3374.2143)
+polygon(3683.8846,3368.5,3684.5,3367.3571,3685.8333,3368.5,3684.5,3369.8333)
+polygon(3612.5,3368.5,3612.5,3368.5,3612.5,3368.5,3612.5,3368.5)
+polygon(3576.9445,3368.5,3580.5,3365.8333,3582.6334,3368.5,3580.5,3376.5,3580.5,3376.5,3572.5,3378.6818,3569.0714,3376.5,3572.5,3373.5)
+polygon(3642.5,3360.5,3644.5,3358.5,3646.1,3360.5,3644.5,3364.5)
+polygon(3596.5,3360.5,3596.5,3360.5,3596.5,3360.5,3596.5,3360.5)
+polygon(3536.0555,3360.5,3540.5,3355.5,3548.5,3358.5,3549.3889,3360.5,3549.3,3368.5,3548.5,3370.1,3546.9762,3376.5,3540.5,3381.3571,3532.9445,3376.5,3535.5,3368.5)
+polygon(3467.3571,3360.5,3468.5,3356.5,3476.5,3357.8333,3479.7,3360.5,3476.5,3362.7857,3469.8333,3368.5,3468.5,3369.5,3467.3571,3368.5)
+polygon(3443.9286,3360.5,3444.5,3359.9286,3446.1,3360.5,3444.5,3368.5,3444.5,3368.5,3444.5,3368.5)
+polygon(3705.3,3352.5,3708.5,3349.3,3711.7,3352.5,3708.5,3356.5)
+polygon(3579.5,3352.5,3580.5,3351.5,3581.8333,3352.5,3580.5,3353.3889)
+polygon(3516.5,3352.5,3516.5,3352.5,3524.5,3350.7222,3527.1667,3352.5,3524.5,3355.7,3516.5,3352.5)
+polygon(3498.9,3352.5,3500.5,3351.5,3501.6429,3352.5,3502.2778,3360.5,3508.5,3367.5,3509.5,3368.5,3508.5,3369.5,3500.5,3371.1667,3499.1667,3368.5,3498.9,3360.5)
+polygon(3751.7,3344.5,3756.5,3340.1364,3760.1923,3344.5,3756.5,3349.8333)
+polygon(3481.4231,3344.5,3484.5,3341.4231,3488.5,3344.5,3484.5,3348.1364)
+polygon(3732.5,3336.5,3732.5,3336.5,3732.5,3336.5,3732.5,3336.5)
+polygon(3664.5,3336.5,3668.5,3334.6538,3672.5,3336.5,3668.5,3338.5)
+polygon(3820.5,3328.5,3820.5,3328.5,3820.5,3328.5,3820.5,3328.5)
+polygon(3524.5,3328.5,3524.5,3328.5,3524.5,3328.5,3524.5,3328.5)
+polygon(3554.7222,3320.5,3556.5,3318.5,3558.5,3320.5,3556.5,3322.2778)
+polygon(3948.5,3312.5,3948.5,3312.5,3948.5,3312.5,3948.5,3312.5)
+polygon(3684.5,3312.5,3684.5,3312.5,3684.5,3312.5,3684.5,3312.5)
+polygon(3587.8846,3312.5,3588.5,3311.8333,3589.3889,3312.5,3588.5,3314.5)
+polygon(3884.5,3304.5,3884.5,3304.5,3884.5,3304.5,3884.5,3304.5)
+polygon(3663.1667,3296.5,3668.5,3294.7222,3669.8333,3296.5,3668.5,3298.2778)
+polygon(3528.5,3296.5,3532.5,3295.1667,3533.1154,3296.5,3532.5,3297.1667)
+polygon(3700.5,3288.5,3700.5,3288.5,3700.5,3288.5,3700.5,3288.5)
+polygon(3609.4231,3280.5,3612.5,3277.1667,3615.5769,3280.5,3612.5,3283.3571)
+polygon(3577.8333,3280.5,3580.5,3278.1,3583.9286,3280.5,3580.5,3283.9286)
+polygon(3982.1,3128.5,3988.5,3126.2143,3992.0555,3128.5,3988.5,3132.0556)
diff --git a/ds9/doc/user/contour/dialog.png b/ds9/doc/user/contour/dialog.png
new file mode 100644
index 0000000..b38db02
--- /dev/null
+++ b/ds9/doc/user/contour/dialog.png
Binary files differ
diff --git a/ds9/doc/user/contour/ds9.con b/ds9/doc/user/contour/ds9.con
new file mode 100644
index 0000000..74dd88b
--- /dev/null
+++ b/ds9/doc/user/contour/ds9.con
@@ -0,0 +1,2682 @@
+ 2.39617839e+02 2.71644106e+01
+ 2.39617474e+02 2.71647525e+01
+ 2.39616775e+02 2.71644112e+01
+ 2.39617473e+02 2.71637275e+01
+ 2.39617839e+02 2.71644106e+01
+
+ 2.39625462e+02 2.71657727e+01
+ 2.39625155e+02 2.71659682e+01
+ 2.39624814e+02 2.71657731e+01
+ 2.39625155e+02 2.71656428e+01
+ 2.39625462e+02 2.71657727e+01
+
+ 2.39589828e+02 2.71726237e+01
+ 2.39589828e+02 2.71726237e+01
+ 2.39589828e+02 2.71726237e+01
+ 2.39589828e+02 2.71726237e+01
+ 2.39589828e+02 2.71726237e+01
+
+ 2.39634708e+02 2.71739667e+01
+ 2.39634380e+02 2.71747869e+01
+ 2.39633960e+02 2.71739672e+01
+ 2.39634379e+02 2.71737391e+01
+ 2.39634708e+02 2.71739667e+01
+
+ 2.39626954e+02 2.71739718e+01
+ 2.39626698e+02 2.71742453e+01
+ 2.39626506e+02 2.71739721e+01
+ 2.39626697e+02 2.71732886e+01
+ 2.39626954e+02 2.71739718e+01
+
+ 2.39597628e+02 2.71739873e+01
+ 2.39597510e+02 2.71742151e+01
+ 2.39597339e+02 2.71739874e+01
+ 2.39597509e+02 2.71738631e+01
+ 2.39597628e+02 2.71739873e+01
+
+ 2.39637672e+02 2.71753312e+01
+ 2.39637453e+02 2.71755799e+01
+ 2.39637111e+02 2.71753316e+01
+ 2.39637452e+02 2.71751706e+01
+ 2.39637672e+02 2.71753312e+01
+
+ 2.39629771e+02 2.71753366e+01
+ 2.39629771e+02 2.71753366e+01
+ 2.39629771e+02 2.71753366e+01
+ 2.39629771e+02 2.71753366e+01
+ 2.39629771e+02 2.71753366e+01
+
+ 2.39624522e+02 2.71753399e+01
+ 2.39624588e+02 2.71767066e+01
+ 2.39623628e+02 2.71778460e+01
+ 2.39622603e+02 2.71767078e+01
+ 2.39622091e+02 2.71760869e+01
+ 2.39621605e+02 2.71753417e+01
+ 2.39622090e+02 2.71746581e+01
+ 2.39623626e+02 2.71745433e+01
+ 2.39624522e+02 2.71753399e+01
+
+ 2.39628543e+02 2.71767041e+01
+ 2.39628236e+02 2.71769145e+01
+ 2.39628000e+02 2.71767044e+01
+ 2.39628236e+02 2.71763138e+01
+ 2.39628543e+02 2.71767041e+01
+
+ 2.39599326e+02 2.71767199e+01
+ 2.39599048e+02 2.71780866e+01
+ 2.39599048e+02 2.71780866e+01
+ 2.39599048e+02 2.71780866e+01
+ 2.39597511e+02 2.71767206e+01
+ 2.39597511e+02 2.71767206e+01
+ 2.39597511e+02 2.71767206e+01
+ 2.39599047e+02 2.71764163e+01
+ 2.39599326e+02 2.71767199e+01
+
+ 2.39592075e+02 2.71767228e+01
+ 2.39591366e+02 2.71772356e+01
+ 2.39590927e+02 2.71767233e+01
+ 2.39591366e+02 2.71762408e+01
+ 2.39592075e+02 2.71767228e+01
+
+ 2.39633358e+02 2.71780676e+01
+ 2.39633506e+02 2.71794341e+01
+ 2.39632848e+02 2.71804596e+01
+ 2.39632678e+02 2.71808013e+01
+ 2.39631655e+02 2.71821687e+01
+ 2.39631622e+02 2.71835354e+01
+ 2.39632851e+02 2.71843155e+01
+ 2.39634169e+02 2.71849003e+01
+ 2.39633237e+02 2.71862676e+01
+ 2.39632854e+02 2.71872929e+01
+ 2.39632662e+02 2.71876347e+01
+ 2.39631319e+02 2.71886985e+01
+ 2.39629783e+02 2.71890032e+01
+ 2.39629783e+02 2.71890032e+01
+ 2.39629783e+02 2.71890032e+01
+ 2.39628246e+02 2.71886626e+01
+ 2.39626710e+02 2.71890052e+01
+ 2.39628247e+02 2.71896876e+01
+ 2.39629169e+02 2.71903703e+01
+ 2.39628248e+02 2.71909566e+01
+ 2.39627634e+02 2.71917379e+01
+ 2.39628079e+02 2.71931043e+01
+ 2.39628250e+02 2.71934459e+01
+ 2.39628763e+02 2.71944705e+01
+ 2.39629788e+02 2.71949824e+01
+ 2.39630940e+02 2.71944691e+01
+ 2.39629787e+02 2.71941545e+01
+ 2.39628323e+02 2.71931042e+01
+ 2.39628863e+02 2.71917372e+01
+ 2.39629784e+02 2.71907116e+01
+ 2.39631320e+02 2.71905967e+01
+ 2.39631935e+02 2.71903685e+01
+ 2.39631758e+02 2.71890019e+01
+ 2.39632854e+02 2.71878623e+01
+ 2.39634391e+02 2.71876335e+01
+ 2.39634391e+02 2.71876335e+01
+ 2.39635772e+02 2.71862659e+01
+ 2.39635926e+02 2.71858102e+01
+ 2.39637461e+02 2.71853536e+01
+ 2.39638077e+02 2.71862642e+01
+ 2.39637944e+02 2.71876310e+01
+ 2.39637464e+02 2.71883147e+01
+ 2.39635928e+02 2.71885435e+01
+ 2.39635416e+02 2.71889994e+01
+ 2.39634392e+02 2.71894825e+01
+ 2.39633186e+02 2.71903676e+01
+ 2.39634394e+02 2.71914406e+01
+ 2.39634813e+02 2.71917332e+01
+ 2.39635010e+02 2.71930997e+01
+ 2.39634396e+02 2.71937835e+01
+ 2.39633958e+02 2.71944671e+01
+ 2.39634397e+02 2.71949224e+01
+ 2.39634704e+02 2.71944666e+01
+ 2.39635932e+02 2.71934718e+01
+ 2.39636879e+02 2.71944651e+01
+ 2.39636593e+02 2.71958319e+01
+ 2.39637472e+02 2.71966123e+01
+ 2.39638131e+02 2.71971975e+01
+ 2.39637473e+02 2.71985646e+01
+ 2.39637473e+02 2.71985646e+01
+ 2.39637014e+02 2.71999316e+01
+ 2.39637475e+02 2.72004438e+01
+ 2.39638174e+02 2.72012975e+01
+ 2.39637784e+02 2.72026644e+01
+ 2.39639014e+02 2.72032102e+01
+ 2.39639892e+02 2.72026629e+01
+ 2.39640549e+02 2.72012958e+01
+ 2.39640549e+02 2.72012958e+01
+ 2.39640549e+02 2.72012958e+01
+ 2.39642086e+02 2.72017502e+01
+ 2.39642598e+02 2.72012942e+01
+ 2.39642084e+02 2.71999280e+01
+ 2.39642084e+02 2.71999280e+01
+ 2.39642084e+02 2.71999280e+01
+ 2.39643621e+02 2.71996990e+01
+ 2.39644005e+02 2.71999265e+01
+ 2.39644006e+02 2.72012932e+01
+ 2.39643931e+02 2.72026599e+01
+ 2.39643624e+02 2.72028554e+01
+ 2.39642088e+02 2.72040280e+01
+ 2.39642088e+02 2.72040280e+01
+ 2.39641513e+02 2.72053950e+01
+ 2.39640554e+02 2.72065346e+01
+ 2.39639371e+02 2.72053966e+01
+ 2.39639016e+02 2.72049413e+01
+ 2.39638358e+02 2.72053973e+01
+ 2.39639017e+02 2.72067635e+01
+ 2.39639017e+02 2.72067635e+01
+ 2.39639787e+02 2.72081296e+01
+ 2.39640555e+02 2.72082809e+01
+ 2.39642093e+02 2.72090390e+01
+ 2.39643629e+02 2.72085824e+01
+ 2.39645166e+02 2.72089798e+01
+ 2.39645743e+02 2.72094919e+01
+ 2.39645167e+02 2.72101756e+01
+ 2.39643630e+02 2.72096373e+01
+ 2.39642180e+02 2.72108612e+01
+ 2.39642315e+02 2.72122278e+01
+ 2.39642096e+02 2.72123798e+01
+ 2.39641788e+02 2.72122282e+01
+ 2.39641955e+02 2.72108614e+01
+ 2.39640557e+02 2.72101031e+01
+ 2.39639021e+02 2.72104079e+01
+ 2.39637995e+02 2.72094976e+01
+ 2.39638711e+02 2.72081304e+01
+ 2.39637481e+02 2.72072202e+01
+ 2.39637097e+02 2.72067649e+01
+ 2.39635943e+02 2.72057407e+01
+ 2.39635431e+02 2.72053994e+01
+ 2.39635942e+02 2.72050574e+01
+ 2.39636966e+02 2.72040317e+01
+ 2.39635941e+02 2.72035500e+01
+ 2.39634405e+02 2.72040334e+01
+ 2.39634405e+02 2.72040334e+01
+ 2.39634022e+02 2.72054004e+01
+ 2.39634407e+02 2.72067668e+01
+ 2.39634407e+02 2.72067668e+01
+ 2.39634407e+02 2.72067668e+01
+ 2.39633091e+02 2.72081343e+01
+ 2.39632872e+02 2.72088178e+01
+ 2.39632745e+02 2.72095012e+01
+ 2.39632874e+02 2.72101845e+01
+ 2.39633385e+02 2.72095008e+01
+ 2.39634409e+02 2.72091584e+01
+ 2.39635946e+02 2.72094990e+01
+ 2.39635946e+02 2.72094990e+01
+ 2.39635946e+02 2.72094990e+01
+ 2.39635676e+02 2.72108659e+01
+ 2.39634412e+02 2.72122334e+01
+ 2.39635950e+02 2.72133712e+01
+ 2.39636206e+02 2.72135988e+01
+ 2.39637334e+02 2.72149647e+01
+ 2.39636875e+02 2.72163317e+01
+ 2.39636914e+02 2.72176983e+01
+ 2.39635954e+02 2.72183823e+01
+ 2.39635315e+02 2.72190661e+01
+ 2.39635601e+02 2.72204326e+01
+ 2.39634420e+02 2.72214096e+01
+ 2.39633908e+02 2.72218004e+01
+ 2.39634421e+02 2.72224075e+01
+ 2.39635650e+02 2.72217992e+01
+ 2.39635957e+02 2.72214573e+01
+ 2.39637109e+02 2.72204315e+01
+ 2.39637493e+02 2.72200896e+01
+ 2.39639030e+02 2.72204301e+01
+ 2.39639030e+02 2.72204301e+01
+ 2.39639030e+02 2.72204301e+01
+ 2.39638006e+02 2.72217975e+01
+ 2.39638520e+02 2.72231638e+01
+ 2.39638137e+02 2.72245308e+01
+ 2.39637497e+02 2.72251007e+01
+ 2.39636728e+02 2.72245318e+01
+ 2.39635959e+02 2.72235561e+01
+ 2.39634422e+02 2.72236223e+01
+ 2.39633142e+02 2.72245343e+01
+ 2.39634253e+02 2.72259002e+01
+ 2.39632888e+02 2.72268122e+01
+ 2.39632010e+02 2.72272683e+01
+ 2.39631523e+02 2.72286353e+01
+ 2.39631353e+02 2.72290910e+01
+ 2.39630914e+02 2.72300024e+01
+ 2.39631354e+02 2.72302506e+01
+ 2.39631968e+02 2.72300017e+01
+ 2.39632890e+02 2.72296284e+01
+ 2.39633835e+02 2.72286338e+01
+ 2.39634426e+02 2.72282063e+01
+ 2.39635524e+02 2.72286326e+01
+ 2.39635068e+02 2.72299996e+01
+ 2.39635965e+02 2.72308687e+01
+ 2.39636478e+02 2.72313653e+01
+ 2.39637504e+02 2.72327312e+01
+ 2.39637504e+02 2.72327312e+01
+ 2.39637645e+02 2.72340978e+01
+ 2.39637505e+02 2.72342687e+01
+ 2.39637365e+02 2.72340980e+01
+ 2.39635967e+02 2.72327323e+01
+ 2.39634430e+02 2.72327334e+01
+ 2.39634430e+02 2.72327334e+01
+ 2.39632892e+02 2.72315196e+01
+ 2.39631355e+02 2.72322473e+01
+ 2.39629819e+02 2.72327365e+01
+ 2.39629819e+02 2.72327365e+01
+ 2.39629478e+02 2.72341033e+01
+ 2.39628284e+02 2.72350608e+01
+ 2.39627823e+02 2.72354711e+01
+ 2.39626747e+02 2.72360697e+01
+ 2.39625979e+02 2.72368389e+01
+ 2.39626493e+02 2.72382052e+01
+ 2.39625213e+02 2.72391822e+01
+ 2.39624598e+02 2.72395731e+01
+ 2.39623676e+02 2.72400862e+01
+ 2.39622140e+02 2.72408046e+01
+ 2.39622037e+02 2.72409413e+01
+ 2.39622140e+02 2.72413968e+01
+ 2.39622909e+02 2.72423075e+01
+ 2.39623678e+02 2.72425172e+01
+ 2.39625216e+02 2.72433994e+01
+ 2.39625370e+02 2.72436726e+01
+ 2.39625901e+02 2.72450389e+01
+ 2.39625603e+02 2.72464058e+01
+ 2.39625219e+02 2.72469527e+01
+ 2.39624561e+02 2.72477731e+01
+ 2.39625220e+02 2.72482852e+01
+ 2.39625701e+02 2.72491391e+01
+ 2.39625221e+02 2.72496275e+01
+ 2.39623684e+02 2.72501165e+01
+ 2.39622829e+02 2.72491408e+01
+ 2.39623272e+02 2.72477739e+01
+ 2.39623066e+02 2.72464074e+01
+ 2.39622143e+02 2.72450412e+01
+ 2.39621683e+02 2.72464082e+01
+ 2.39620607e+02 2.72472061e+01
+ 2.39619070e+02 2.72474835e+01
+ 2.39617918e+02 2.72477770e+01
+ 2.39619071e+02 2.72488014e+01
+ 2.39619264e+02 2.72491429e+01
+ 2.39619072e+02 2.72495986e+01
+ 2.39618836e+02 2.72505099e+01
+ 2.39619073e+02 2.72510564e+01
+ 2.39619535e+02 2.72518761e+01
+ 2.39619074e+02 2.72529014e+01
+ 2.39617537e+02 2.72527884e+01
+ 2.39616511e+02 2.72518778e+01
+ 2.39615999e+02 2.72516048e+01
+ 2.39615719e+02 2.72518783e+01
+ 2.39615341e+02 2.72532452e+01
+ 2.39614976e+02 2.72546120e+01
+ 2.39614464e+02 2.72559790e+01
+ 2.39614464e+02 2.72559790e+01
+ 2.39614464e+02 2.72559790e+01
+ 2.39612927e+02 2.72554673e+01
+ 2.39611390e+02 2.72558098e+01
+ 2.39611082e+02 2.72559808e+01
+ 2.39611390e+02 2.72566639e+01
+ 2.39612928e+02 2.72573465e+01
+ 2.39612928e+02 2.72573465e+01
+ 2.39612928e+02 2.72573465e+01
+ 2.39611391e+02 2.72575425e+01
+ 2.39609853e+02 2.72573481e+01
+ 2.39608317e+02 2.72583511e+01
+ 2.39607087e+02 2.72587161e+01
+ 2.39607219e+02 2.72600827e+01
+ 2.39607165e+02 2.72614494e+01
+ 2.39606781e+02 2.72619963e+01
+ 2.39605244e+02 2.72619629e+01
+ 2.39604405e+02 2.72614508e+01
+ 2.39604218e+02 2.72600842e+01
+ 2.39603705e+02 2.72597690e+01
+ 2.39602552e+02 2.72600850e+01
+ 2.39602425e+02 2.72614517e+01
+ 2.39602169e+02 2.72616037e+01
+ 2.39601145e+02 2.72628189e+01
+ 2.39600632e+02 2.72633658e+01
+ 2.39599607e+02 2.72628196e+01
+ 2.39599095e+02 2.72626832e+01
+ 2.39598875e+02 2.72628199e+01
+ 2.39597942e+02 2.72641870e+01
+ 2.39597649e+02 2.72655538e+01
+ 2.39597559e+02 2.72656514e+01
+ 2.39596790e+02 2.72655542e+01
+ 2.39596021e+02 2.72652811e+01
+ 2.39595509e+02 2.72655547e+01
+ 2.39594484e+02 2.72662384e+01
+ 2.39592946e+02 2.72661536e+01
+ 2.39591409e+02 2.72669230e+01
+ 2.39592947e+02 2.72680406e+01
+ 2.39593387e+02 2.72682889e+01
+ 2.39592948e+02 2.72684993e+01
+ 2.39591410e+02 2.72684849e+01
+ 2.39589873e+02 2.72693836e+01
+ 2.39588335e+02 2.72688033e+01
+ 2.39586798e+02 2.72694168e+01
+ 2.39585260e+02 2.72694877e+01
+ 2.39584821e+02 2.72696587e+01
+ 2.39583723e+02 2.72705132e+01
+ 2.39582186e+02 2.72703429e+01
+ 2.39581609e+02 2.72710264e+01
+ 2.39580649e+02 2.72715961e+01
+ 2.39579111e+02 2.72722571e+01
+ 2.39578958e+02 2.72723938e+01
+ 2.39577574e+02 2.72730092e+01
+ 2.39576036e+02 2.72727591e+01
+ 2.39574499e+02 2.72727856e+01
+ 2.39572961e+02 2.72733894e+01
+ 2.39571424e+02 2.72733898e+01
+ 2.39570057e+02 2.72723962e+01
+ 2.39569886e+02 2.72723158e+01
+ 2.39569827e+02 2.72723962e+01
+ 2.39569886e+02 2.72726695e+01
+ 2.39570765e+02 2.72737627e+01
+ 2.39569887e+02 2.72751295e+01
+ 2.39569887e+02 2.72751295e+01
+ 2.39569887e+02 2.72751295e+01
+ 2.39568349e+02 2.72737632e+01
+ 2.39566811e+02 2.72746747e+01
+ 2.39566372e+02 2.72737636e+01
+ 2.39565273e+02 2.72733842e+01
+ 2.39564312e+02 2.72737640e+01
+ 2.39564078e+02 2.72751307e+01
+ 2.39564351e+02 2.72764974e+01
+ 2.39563736e+02 2.72767253e+01
+ 2.39563224e+02 2.72764976e+01
+ 2.39563121e+02 2.72751309e+01
+ 2.39562198e+02 2.72748157e+01
+ 2.39560661e+02 2.72746758e+01
+ 2.39560543e+02 2.72751314e+01
+ 2.39559833e+02 2.72764981e+01
+ 2.39559124e+02 2.72770449e+01
+ 2.39558285e+02 2.72764984e+01
+ 2.39557805e+02 2.72751318e+01
+ 2.39557586e+02 2.72747901e+01
+ 2.39556560e+02 2.72737653e+01
+ 2.39556048e+02 2.72733926e+01
+ 2.39554510e+02 2.72735244e+01
+ 2.39552973e+02 2.72737657e+01
+ 2.39552973e+02 2.72737657e+01
+ 2.39552973e+02 2.72737657e+01
+ 2.39551435e+02 2.72730825e+01
+ 2.39550512e+02 2.72723993e+01
+ 2.39549897e+02 2.72716184e+01
+ 2.39548359e+02 2.72714233e+01
+ 2.39546822e+02 2.72721263e+01
+ 2.39545284e+02 2.72721719e+01
+ 2.39545114e+02 2.72723997e+01
+ 2.39543747e+02 2.72733937e+01
+ 2.39542868e+02 2.72723998e+01
+ 2.39543593e+02 2.72710331e+01
+ 2.39542722e+02 2.72696665e+01
+ 2.39542209e+02 2.72692109e+01
+ 2.39540672e+02 2.72689832e+01
+ 2.39539441e+02 2.72682999e+01
+ 2.39539134e+02 2.72681480e+01
+ 2.39537596e+02 2.72678443e+01
+ 2.39536059e+02 2.72672065e+01
+ 2.39534521e+02 2.72669332e+01
+ 2.39534521e+02 2.72669332e+01
+ 2.39534521e+02 2.72669332e+01
+ 2.39536059e+02 2.72666178e+01
+ 2.39536963e+02 2.72655665e+01
+ 2.39536059e+02 2.72645903e+01
+ 2.39534522e+02 2.72641998e+01
+ 2.39534522e+02 2.72641998e+01
+ 2.39534522e+02 2.72641998e+01
+ 2.39535290e+02 2.72628332e+01
+ 2.39536059e+02 2.72618870e+01
+ 2.39536618e+02 2.72614665e+01
+ 2.39536059e+02 2.72609696e+01
+ 2.39534522e+02 2.72605554e+01
+ 2.39532984e+02 2.72614665e+01
+ 2.39532984e+02 2.72614665e+01
+ 2.39532984e+02 2.72614665e+01
+ 2.39532765e+02 2.72600998e+01
+ 2.39532984e+02 2.72599631e+01
+ 2.39534137e+02 2.72587332e+01
+ 2.39534522e+02 2.72580498e+01
+ 2.39534983e+02 2.72573665e+01
+ 2.39534522e+02 2.72568540e+01
+ 2.39533561e+02 2.72559998e+01
+ 2.39532984e+02 2.72557435e+01
+ 2.39532472e+02 2.72559998e+01
+ 2.39531447e+02 2.72565855e+01
+ 2.39530737e+02 2.72559997e+01
+ 2.39531191e+02 2.72546331e+01
+ 2.39530974e+02 2.72532664e+01
+ 2.39530525e+02 2.72518997e+01
+ 2.39531447e+02 2.72505331e+01
+ 2.39530218e+02 2.72491663e+01
+ 2.39529910e+02 2.72488247e+01
+ 2.39529526e+02 2.72477996e+01
+ 2.39529910e+02 2.72474269e+01
+ 2.39531447e+02 2.72477997e+01
+ 2.39532985e+02 2.72464331e+01
+ 2.39531448e+02 2.72460060e+01
+ 2.39529910e+02 2.72452182e+01
+ 2.39529718e+02 2.72450663e+01
+ 2.39529910e+02 2.72446108e+01
+ 2.39530935e+02 2.72436997e+01
+ 2.39531448e+02 2.72430164e+01
+ 2.39531667e+02 2.72423331e+01
+ 2.39531789e+02 2.72409664e+01
+ 2.39531448e+02 2.72402831e+01
+ 2.39529911e+02 2.72402830e+01
+ 2.39529398e+02 2.72395996e+01
+ 2.39529399e+02 2.72382330e+01
+ 2.39529911e+02 2.72380052e+01
+ 2.39530526e+02 2.72382330e+01
+ 2.39531448e+02 2.72390531e+01
+ 2.39532985e+02 2.72392782e+01
+ 2.39533818e+02 2.72382332e+01
+ 2.39534522e+02 2.72374419e+01
+ 2.39535823e+02 2.72382332e+01
+ 2.39536059e+02 2.72385065e+01
+ 2.39536401e+02 2.72382332e+01
+ 2.39536059e+02 2.72379847e+01
+ 2.39535246e+02 2.72368665e+01
+ 2.39534932e+02 2.72354999e+01
+ 2.39536059e+02 2.72345603e+01
+ 2.39536700e+02 2.72341332e+01
+ 2.39536059e+02 2.72332790e+01
+ 2.39534522e+02 2.72337232e+01
+ 2.39533544e+02 2.72327665e+01
+ 2.39534522e+02 2.72321287e+01
+ 2.39536059e+02 2.72320832e+01
+ 2.39536521e+02 2.72313999e+01
+ 2.39537596e+02 2.72302041e+01
+ 2.39537750e+02 2.72300332e+01
+ 2.39537904e+02 2.72286666e+01
+ 2.39539133e+02 2.72272999e+01
+ 2.39539133e+02 2.72272999e+01
+ 2.39539646e+02 2.72259332e+01
+ 2.39540158e+02 2.72245665e+01
+ 2.39540670e+02 2.72235415e+01
+ 2.39541988e+02 2.72245665e+01
+ 2.39542207e+02 2.72259332e+01
+ 2.39542976e+02 2.72245665e+01
+ 2.39542207e+02 2.72243712e+01
+ 2.39541055e+02 2.72231999e+01
+ 2.39542207e+02 2.72224544e+01
+ 2.39542756e+02 2.72218331e+01
+ 2.39543744e+02 2.72211498e+01
+ 2.39545002e+02 2.72218330e+01
+ 2.39545281e+02 2.72221064e+01
+ 2.39545665e+02 2.72218330e+01
+ 2.39545281e+02 2.72214914e+01
+ 2.39544666e+02 2.72204664e+01
+ 2.39545281e+02 2.72194414e+01
+ 2.39546818e+02 2.72195552e+01
+ 2.39546946e+02 2.72190996e+01
+ 2.39546818e+02 2.72187959e+01
+ 2.39545622e+02 2.72177330e+01
+ 2.39546510e+02 2.72163663e+01
+ 2.39546220e+02 2.72149996e+01
+ 2.39546817e+02 2.72136329e+01
+ 2.39546817e+02 2.72122663e+01
+ 2.39546817e+02 2.72122663e+01
+ 2.39546817e+02 2.72122663e+01
+ 2.39548354e+02 2.72133595e+01
+ 2.39548661e+02 2.72136328e+01
+ 2.39549891e+02 2.72139972e+01
+ 2.39551120e+02 2.72136326e+01
+ 2.39551427e+02 2.72133592e+01
+ 2.39551940e+02 2.72122659e+01
+ 2.39551427e+02 2.72108992e+01
+ 2.39549890e+02 2.72114688e+01
+ 2.39548354e+02 2.72117195e+01
+ 2.39547695e+02 2.72108996e+01
+ 2.39548354e+02 2.72101540e+01
+ 2.39549890e+02 2.72099232e+01
+ 2.39551427e+02 2.72108992e+01
+ 2.39552964e+02 2.72101019e+01
+ 2.39554500e+02 2.72095322e+01
+ 2.39554500e+02 2.72095322e+01
+ 2.39556037e+02 2.72086027e+01
+ 2.39557574e+02 2.72083170e+01
+ 2.39559110e+02 2.72083927e+01
+ 2.39559494e+02 2.72081649e+01
+ 2.39559669e+02 2.72067982e+01
+ 2.39559110e+02 2.72063013e+01
+ 2.39557881e+02 2.72067985e+01
+ 2.39557574e+02 2.72074818e+01
+ 2.39556037e+02 2.72072543e+01
+ 2.39554500e+02 2.72080517e+01
+ 2.39552963e+02 2.72077102e+01
+ 2.39551427e+02 2.72081659e+01
+ 2.39551427e+02 2.72081659e+01
+ 2.39551427e+02 2.72081659e+01
+ 2.39551287e+02 2.72067993e+01
+ 2.39551427e+02 2.72065715e+01
+ 2.39552963e+02 2.72058880e+01
+ 2.39554500e+02 2.72057251e+01
+ 2.39556036e+02 2.72054321e+01
+ 2.39556036e+02 2.72040654e+01
+ 2.39554499e+02 2.72026989e+01
+ 2.39554499e+02 2.72026989e+01
+ 2.39554499e+02 2.72026989e+01
+ 2.39556036e+02 2.72026987e+01
+ 2.39556036e+02 2.72026987e+01
+ 2.39557573e+02 2.72040652e+01
+ 2.39559109e+02 2.72026983e+01
+ 2.39559109e+02 2.72026983e+01
+ 2.39559109e+02 2.72026983e+01
+ 2.39560646e+02 2.72031081e+01
+ 2.39562183e+02 2.72026978e+01
+ 2.39561118e+02 2.72013313e+01
+ 2.39561414e+02 2.71999646e+01
+ 2.39562182e+02 2.71997692e+01
+ 2.39562840e+02 2.71985977e+01
+ 2.39562181e+02 2.71972311e+01
+ 2.39562181e+02 2.71972311e+01
+ 2.39562181e+02 2.71972311e+01
+ 2.39563266e+02 2.71958643e+01
+ 2.39563717e+02 2.71952430e+01
+ 2.39564678e+02 2.71958640e+01
+ 2.39564486e+02 2.71972307e+01
+ 2.39565084e+02 2.71985973e+01
+ 2.39563719e+02 2.71999642e+01
+ 2.39563719e+02 2.71999642e+01
+ 2.39563104e+02 2.72013310e+01
+ 2.39563719e+02 2.72020763e+01
+ 2.39564817e+02 2.72026973e+01
+ 2.39565256e+02 2.72033806e+01
+ 2.39565695e+02 2.72026971e+01
+ 2.39565256e+02 2.72023556e+01
+ 2.39564487e+02 2.72013307e+01
+ 2.39565255e+02 2.72001591e+01
+ 2.39566792e+02 2.72008422e+01
+ 2.39567560e+02 2.71999634e+01
+ 2.39566791e+02 2.71991436e+01
+ 2.39565474e+02 2.71985972e+01
+ 2.39566791e+02 2.71977769e+01
+ 2.39567350e+02 2.71972301e+01
+ 2.39567943e+02 2.71958634e+01
+ 2.39567098e+02 2.71944969e+01
+ 2.39566790e+02 2.71931303e+01
+ 2.39566790e+02 2.71931303e+01
+ 2.39566448e+02 2.71917637e+01
+ 2.39566789e+02 2.71913731e+01
+ 2.39568326e+02 2.71913428e+01
+ 2.39569862e+02 2.71908933e+01
+ 2.39571207e+02 2.71917626e+01
+ 2.39571399e+02 2.71931292e+01
+ 2.39572936e+02 2.71931289e+01
+ 2.39574472e+02 2.71930042e+01
+ 2.39575496e+02 2.71917615e+01
+ 2.39576008e+02 2.71907852e+01
+ 2.39576599e+02 2.71917612e+01
+ 2.39576667e+02 2.71931279e+01
+ 2.39577546e+02 2.71944943e+01
+ 2.39578911e+02 2.71931273e+01
+ 2.39579082e+02 2.71929905e+01
+ 2.39580618e+02 2.71923068e+01
+ 2.39581130e+02 2.71917599e+01
+ 2.39582154e+02 2.71903929e+01
+ 2.39580617e+02 2.71898468e+01
+ 2.39579849e+02 2.71890270e+01
+ 2.39579080e+02 2.71882818e+01
+ 2.39577982e+02 2.71876609e+01
+ 2.39579080e+02 2.71871349e+01
+ 2.39580616e+02 2.71872045e+01
+ 2.39581128e+02 2.71876599e+01
+ 2.39582153e+02 2.71890263e+01
+ 2.39583689e+02 2.71885475e+01
+ 2.39584640e+02 2.71876588e+01
+ 2.39585225e+02 2.71868176e+01
+ 2.39586761e+02 2.71865192e+01
+ 2.39587041e+02 2.71862913e+01
+ 2.39588297e+02 2.71851727e+01
+ 2.39589834e+02 2.71859487e+01
+ 2.39590858e+02 2.71849233e+01
+ 2.39591369e+02 2.71835564e+01
+ 2.39591369e+02 2.71835564e+01
+ 2.39592905e+02 2.71830302e+01
+ 2.39593674e+02 2.71835555e+01
+ 2.39592906e+02 2.71844100e+01
+ 2.39592138e+02 2.71849228e+01
+ 2.39592907e+02 2.71857425e+01
+ 2.39594443e+02 2.71862885e+01
+ 2.39595979e+02 2.71856046e+01
+ 2.39596620e+02 2.71862877e+01
+ 2.39595980e+02 2.71869713e+01
+ 2.39594443e+02 2.71862885e+01
+ 2.39592907e+02 2.71867447e+01
+ 2.39591371e+02 2.71876564e+01
+ 2.39591371e+02 2.71876564e+01
+ 2.39589835e+02 2.71890237e+01
+ 2.39591372e+02 2.71896443e+01
+ 2.39592225e+02 2.71890227e+01
+ 2.39592908e+02 2.71883392e+01
+ 2.39594444e+02 2.71883911e+01
+ 2.39595981e+02 2.71890212e+01
+ 2.39597517e+02 2.71878817e+01
+ 2.39598798e+02 2.71890201e+01
+ 2.39597518e+02 2.71898748e+01
+ 2.39596750e+02 2.71903876e+01
+ 2.39596665e+02 2.71917543e+01
+ 2.39595983e+02 2.71922515e+01
+ 2.39595445e+02 2.71931215e+01
+ 2.39595984e+02 2.71936527e+01
+ 2.39597328e+02 2.71931207e+01
+ 2.39597520e+02 2.71928928e+01
+ 2.39598032e+02 2.71931204e+01
+ 2.39599057e+02 2.71940310e+01
+ 2.39599671e+02 2.71931197e+01
+ 2.39599056e+02 2.71925733e+01
+ 2.39598479e+02 2.71917535e+01
+ 2.39598286e+02 2.71903869e+01
+ 2.39599054e+02 2.71893616e+01
+ 2.39599182e+02 2.71890199e+01
+ 2.39600590e+02 2.71880797e+01
+ 2.39602126e+02 2.71879252e+01
+ 2.39603279e+02 2.71890180e+01
+ 2.39603664e+02 2.71895645e+01
+ 2.39604222e+02 2.71890176e+01
+ 2.39603663e+02 2.71884105e+01
+ 2.39602702e+02 2.71876516e+01
+ 2.39603662e+02 2.71866750e+01
+ 2.39605198e+02 2.71869671e+01
+ 2.39605813e+02 2.71876502e+01
+ 2.39606736e+02 2.71883331e+01
+ 2.39607394e+02 2.71876494e+01
+ 2.39608271e+02 2.71871023e+01
+ 2.39608830e+02 2.71876487e+01
+ 2.39609297e+02 2.71890151e+01
+ 2.39608273e+02 2.71897966e+01
+ 2.39607659e+02 2.71903826e+01
+ 2.39608274e+02 2.71908139e+01
+ 2.39609426e+02 2.71903817e+01
+ 2.39609810e+02 2.71899260e+01
+ 2.39611345e+02 2.71890141e+01
+ 2.39611345e+02 2.71890141e+01
+ 2.39611612e+02 2.71876473e+01
+ 2.39611344e+02 2.71865541e+01
+ 2.39609807e+02 2.71862815e+01
+ 2.39609807e+02 2.71862815e+01
+ 2.39609166e+02 2.71849152e+01
+ 2.39609806e+02 2.71837760e+01
+ 2.39611342e+02 2.71841331e+01
+ 2.39612110e+02 2.71835470e+01
+ 2.39612878e+02 2.71828633e+01
+ 2.39613646e+02 2.71835462e+01
+ 2.39614415e+02 2.71843658e+01
+ 2.39614769e+02 2.71835456e+01
+ 2.39615182e+02 2.71821787e+01
+ 2.39615950e+02 2.71820264e+01
+ 2.39616257e+02 2.71821781e+01
+ 2.39617231e+02 2.71835442e+01
+ 2.39617487e+02 2.71838857e+01
+ 2.39617668e+02 2.71835440e+01
+ 2.39619023e+02 2.71822620e+01
+ 2.39620236e+02 2.71835425e+01
+ 2.39620561e+02 2.71844534e+01
+ 2.39622097e+02 2.71839730e+01
+ 2.39622755e+02 2.71835410e+01
+ 2.39622095e+02 2.71821747e+01
+ 2.39620559e+02 2.71829349e+01
+ 2.39619279e+02 2.71821764e+01
+ 2.39619022e+02 2.71819488e+01
+ 2.39618473e+02 2.71808102e+01
+ 2.39618252e+02 2.71794437e+01
+ 2.39619020e+02 2.71789877e+01
+ 2.39619789e+02 2.71794428e+01
+ 2.39620558e+02 2.71803534e+01
+ 2.39621172e+02 2.71808086e+01
+ 2.39622095e+02 2.71821747e+01
+ 2.39623631e+02 2.71809780e+01
+ 2.39625167e+02 2.71808062e+01
+ 2.39625167e+02 2.71808062e+01
+ 2.39626703e+02 2.71799852e+01
+ 2.39628239e+02 2.71808043e+01
+ 2.39628239e+02 2.71808043e+01
+ 2.39629776e+02 2.71814245e+01
+ 2.39630367e+02 2.71808029e+01
+ 2.39630543e+02 2.71794361e+01
+ 2.39631311e+02 2.71792404e+01
+ 2.39632462e+02 2.71780682e+01
+ 2.39632846e+02 2.71776124e+01
+ 2.39633358e+02 2.71780676e+01
+
+ 2.39629993e+02 2.71780698e+01
+ 2.39629774e+02 2.71787533e+01
+ 2.39629646e+02 2.71780700e+01
+ 2.39629773e+02 2.71779181e+01
+ 2.39629993e+02 2.71780698e+01
+
+ 2.39617902e+02 2.71780772e+01
+ 2.39617484e+02 2.71786631e+01
+ 2.39617064e+02 2.71780777e+01
+ 2.39617483e+02 2.71775649e+01
+ 2.39617902e+02 2.71780772e+01
+
+ 2.39592903e+02 2.71780892e+01
+ 2.39592903e+02 2.71780892e+01
+ 2.39592903e+02 2.71780892e+01
+ 2.39592903e+02 2.71780892e+01
+ 2.39592903e+02 2.71780892e+01
+
+ 2.39616926e+02 2.71794444e+01
+ 2.39615948e+02 2.71800827e+01
+ 2.39615315e+02 2.71794453e+01
+ 2.39615948e+02 2.71788072e+01
+ 2.39616926e+02 2.71794444e+01
+
+ 2.39598281e+02 2.71794536e+01
+ 2.39599049e+02 2.71805922e+01
+ 2.39599562e+02 2.71808197e+01
+ 2.39599562e+02 2.71821864e+01
+ 2.39600587e+02 2.71835526e+01
+ 2.39602123e+02 2.71830964e+01
+ 2.39602252e+02 2.71835519e+01
+ 2.39602124e+02 2.71836495e+01
+ 2.39600876e+02 2.71849192e+01
+ 2.39600588e+02 2.71854318e+01
+ 2.39600012e+02 2.71849195e+01
+ 2.39599051e+02 2.71842366e+01
+ 2.39597954e+02 2.71835538e+01
+ 2.39598932e+02 2.71821867e+01
+ 2.39597513e+02 2.71812226e+01
+ 2.39596233e+02 2.71808212e+01
+ 2.39596814e+02 2.71794543e+01
+ 2.39597512e+02 2.71788845e+01
+ 2.39598281e+02 2.71794536e+01
+
+ 2.39579635e+02 2.71794604e+01
+ 2.39579077e+02 2.71800680e+01
+ 2.39578638e+02 2.71794607e+01
+ 2.39579077e+02 2.71791569e+01
+ 2.39579635e+02 2.71794604e+01
+
+ 2.39611647e+02 2.71808139e+01
+ 2.39612109e+02 2.71821803e+01
+ 2.39611341e+02 2.71828641e+01
+ 2.39609805e+02 2.71830927e+01
+ 2.39608268e+02 2.71823066e+01
+ 2.39608098e+02 2.71821824e+01
+ 2.39608267e+02 2.71808157e+01
+ 2.39608267e+02 2.71808157e+01
+ 2.39608267e+02 2.71808157e+01
+ 2.39609804e+02 2.71817911e+01
+ 2.39611084e+02 2.71808142e+01
+ 2.39611340e+02 2.71806433e+01
+ 2.39611647e+02 2.71808139e+01
+
+ 2.39593377e+02 2.71808223e+01
+ 2.39592904e+02 2.71812781e+01
+ 2.39591675e+02 2.71808230e+01
+ 2.39592904e+02 2.71804020e+01
+ 2.39593377e+02 2.71808223e+01
+
+ 2.39582699e+02 2.71808261e+01
+ 2.39582150e+02 2.71816805e+01
+ 2.39581296e+02 2.71808266e+01
+ 2.39582150e+02 2.71799721e+01
+ 2.39582699e+02 2.71808261e+01
+
+ 2.39639434e+02 2.71821633e+01
+ 2.39640532e+02 2.71833014e+01
+ 2.39640686e+02 2.71835290e+01
+ 2.39640533e+02 2.71837569e+01
+ 2.39638997e+02 2.71840428e+01
+ 2.39637844e+02 2.71835311e+01
+ 2.39637459e+02 2.71826203e+01
+ 2.39636947e+02 2.71821651e+01
+ 2.39637458e+02 2.71818914e+01
+ 2.39638995e+02 2.71818903e+01
+ 2.39639434e+02 2.71821633e+01
+
+ 2.39625680e+02 2.71821725e+01
+ 2.39626705e+02 2.71827186e+01
+ 2.39628022e+02 2.71835377e+01
+ 2.39628051e+02 2.71849044e+01
+ 2.39628243e+02 2.71851776e+01
+ 2.39629779e+02 2.71852069e+01
+ 2.39630394e+02 2.71849028e+01
+ 2.39630700e+02 2.71835360e+01
+ 2.39629778e+02 2.71830810e+01
+ 2.39628241e+02 2.71832642e+01
+ 2.39627472e+02 2.71821714e+01
+ 2.39626704e+02 2.71813909e+01
+ 2.39625680e+02 2.71821725e+01
+
+ 2.39605786e+02 2.71821835e+01
+ 2.39605196e+02 2.71830380e+01
+ 2.39603659e+02 2.71823948e+01
+ 2.39602891e+02 2.71821849e+01
+ 2.39603659e+02 2.71817941e+01
+ 2.39605195e+02 2.71817283e+01
+ 2.39605786e+02 2.71821835e+01
+
+ 2.39580614e+02 2.71821934e+01
+ 2.39580614e+02 2.71821934e+01
+ 2.39580614e+02 2.71821934e+01
+ 2.39580614e+02 2.71821934e+01
+ 2.39580614e+02 2.71821934e+01
+
+ 2.39573701e+02 2.71821954e+01
+ 2.39572933e+02 2.71829548e+01
+ 2.39572079e+02 2.71821958e+01
+ 2.39572932e+02 2.71814363e+01
+ 2.39573701e+02 2.71821954e+01
+
+ 2.39636436e+02 2.71835321e+01
+ 2.39635924e+02 2.71839880e+01
+ 2.39634388e+02 2.71844446e+01
+ 2.39634080e+02 2.71835337e+01
+ 2.39634387e+02 2.71829868e+01
+ 2.39635923e+02 2.71830769e+01
+ 2.39636436e+02 2.71835321e+01
+
+ 2.39589449e+02 2.71835571e+01
+ 2.39588297e+02 2.71843776e+01
+ 2.39587877e+02 2.71835577e+01
+ 2.39588296e+02 2.71832647e+01
+ 2.39589449e+02 2.71835571e+01
+
+ 2.39607598e+02 2.71849160e+01
+ 2.39606734e+02 2.71859414e+01
+ 2.39606105e+02 2.71849167e+01
+ 2.39606733e+02 2.71842331e+01
+ 2.39607598e+02 2.71849160e+01
+
+ 2.39587273e+02 2.71849246e+01
+ 2.39586761e+02 2.71853803e+01
+ 2.39585225e+02 2.71856086e+01
+ 2.39584526e+02 2.71849255e+01
+ 2.39585224e+02 2.71837864e+01
+ 2.39586761e+02 2.71847729e+01
+ 2.39587273e+02 2.71849246e+01
+
+ 2.39582664e+02 2.71849261e+01
+ 2.39582152e+02 2.71853363e+01
+ 2.39580615e+02 2.71856627e+01
+ 2.39579983e+02 2.71849270e+01
+ 2.39580615e+02 2.71842890e+01
+ 2.39582151e+02 2.71844138e+01
+ 2.39582664e+02 2.71849261e+01
+
+ 2.39643992e+02 2.71862599e+01
+ 2.39643608e+02 2.71868069e+01
+ 2.39642840e+02 2.71862608e+01
+ 2.39643608e+02 2.71859185e+01
+ 2.39643992e+02 2.71862599e+01
+
+ 2.39623464e+02 2.71862739e+01
+ 2.39622099e+02 2.71871858e+01
+ 2.39620870e+02 2.71876421e+01
+ 2.39622100e+02 2.71879291e+01
+ 2.39623102e+02 2.71890074e+01
+ 2.39623126e+02 2.71903741e+01
+ 2.39623638e+02 2.71910571e+01
+ 2.39625175e+02 2.71908698e+01
+ 2.39625789e+02 2.71903724e+01
+ 2.39625174e+02 2.71892795e+01
+ 2.39625003e+02 2.71890063e+01
+ 2.39623636e+02 2.71880960e+01
+ 2.39622868e+02 2.71876409e+01
+ 2.39623635e+02 2.71865471e+01
+ 2.39624147e+02 2.71862735e+01
+ 2.39623634e+02 2.71855905e+01
+ 2.39623464e+02 2.71862739e+01
+
+ 2.39576775e+02 2.71862945e+01
+ 2.39576007e+02 2.71872709e+01
+ 2.39575308e+02 2.71862949e+01
+ 2.39576006e+02 2.71856735e+01
+ 2.39576775e+02 2.71862945e+01
+
+ 2.39573446e+02 2.71862954e+01
+ 2.39572934e+02 2.71867056e+01
+ 2.39572579e+02 2.71862956e+01
+ 2.39572934e+02 2.71857831e+01
+ 2.39573446e+02 2.71862954e+01
+
+ 2.39648603e+02 2.71876230e+01
+ 2.39648219e+02 2.71884043e+01
+ 2.39647877e+02 2.71876236e+01
+ 2.39648218e+02 2.71873196e+01
+ 2.39648603e+02 2.71876230e+01
+
+ 2.39642073e+02 2.71876280e+01
+ 2.39642073e+02 2.71876280e+01
+ 2.39642073e+02 2.71876280e+01
+ 2.39642073e+02 2.71876280e+01
+ 2.39642073e+02 2.71876280e+01
+
+ 2.39599821e+02 2.71876529e+01
+ 2.39599054e+02 2.71887922e+01
+ 2.39597773e+02 2.71876538e+01
+ 2.39599053e+02 2.71870838e+01
+ 2.39599821e+02 2.71876529e+01
+
+ 2.39652947e+02 2.71889862e+01
+ 2.39652829e+02 2.71890839e+01
+ 2.39652727e+02 2.71889864e+01
+ 2.39652829e+02 2.71889009e+01
+ 2.39652947e+02 2.71889862e+01
+
+ 2.39614248e+02 2.71890125e+01
+ 2.39614419e+02 2.71903791e+01
+ 2.39614572e+02 2.71890123e+01
+ 2.39614418e+02 2.71886708e+01
+ 2.39614248e+02 2.71890125e+01
+
+ 2.39585885e+02 2.71890251e+01
+ 2.39586763e+02 2.71903914e+01
+ 2.39587377e+02 2.71890245e+01
+ 2.39586762e+02 2.71886343e+01
+ 2.39585885e+02 2.71890251e+01
+
+ 2.39577544e+02 2.71890277e+01
+ 2.39577544e+02 2.71890277e+01
+ 2.39577544e+02 2.71890277e+01
+ 2.39577544e+02 2.71890277e+01
+ 2.39577544e+02 2.71890277e+01
+
+ 2.39641307e+02 2.71903619e+01
+ 2.39640540e+02 2.71913875e+01
+ 2.39639004e+02 2.71917302e+01
+ 2.39639004e+02 2.71917302e+01
+ 2.39639004e+02 2.71917302e+01
+ 2.39638234e+02 2.71903641e+01
+ 2.39639002e+02 2.71896802e+01
+ 2.39640538e+02 2.71899525e+01
+ 2.39641307e+02 2.71903619e+01
+
+ 2.39620181e+02 2.71903758e+01
+ 2.39620566e+02 2.71910589e+01
+ 2.39621077e+02 2.71903753e+01
+ 2.39620565e+02 2.71902902e+01
+ 2.39620181e+02 2.71903758e+01
+
+ 2.39582154e+02 2.71903929e+01
+ 2.39583691e+02 2.71913036e+01
+ 2.39584458e+02 2.71903922e+01
+ 2.39583690e+02 2.71900888e+01
+ 2.39582154e+02 2.71903929e+01
+
+ 2.39574471e+02 2.71903952e+01
+ 2.39574471e+02 2.71903952e+01
+ 2.39572935e+02 2.71903955e+01
+ 2.39571399e+02 2.71913070e+01
+ 2.39570886e+02 2.71903960e+01
+ 2.39571398e+02 2.71898493e+01
+ 2.39572935e+02 2.71903955e+01
+ 2.39574471e+02 2.71903952e+01
+ 2.39574471e+02 2.71903952e+01
+
+ 2.39556034e+02 2.71903988e+01
+ 2.39556034e+02 2.71903988e+01
+ 2.39556034e+02 2.71903988e+01
+ 2.39556034e+02 2.71903988e+01
+ 2.39556034e+02 2.71903988e+01
+
+ 2.39645867e+02 2.71917251e+01
+ 2.39645150e+02 2.71924090e+01
+ 2.39644253e+02 2.71917264e+01
+ 2.39645149e+02 2.71911629e+01
+ 2.39645867e+02 2.71917251e+01
+
+ 2.39589222e+02 2.71917572e+01
+ 2.39589398e+02 2.71931238e+01
+ 2.39588814e+02 2.71944907e+01
+ 2.39589838e+02 2.71948320e+01
+ 2.39590145e+02 2.71944902e+01
+ 2.39590221e+02 2.71931235e+01
+ 2.39591373e+02 2.71923776e+01
+ 2.39592910e+02 2.71917558e+01
+ 2.39591373e+02 2.71911352e+01
+ 2.39589836e+02 2.71914153e+01
+ 2.39589222e+02 2.71917572e+01
+
+ 2.39564058e+02 2.71917641e+01
+ 2.39563717e+02 2.71919464e+01
+ 2.39563278e+02 2.71917643e+01
+ 2.39563717e+02 2.71914909e+01
+ 2.39564058e+02 2.71917641e+01
+
+ 2.39651856e+02 2.71930871e+01
+ 2.39651297e+02 2.71935431e+01
+ 2.39650272e+02 2.71930884e+01
+ 2.39651296e+02 2.71927838e+01
+ 2.39651856e+02 2.71930871e+01
+
+ 2.39624562e+02 2.71931065e+01
+ 2.39625177e+02 2.71934966e+01
+ 2.39625484e+02 2.71931060e+01
+ 2.39625176e+02 2.71928025e+01
+ 2.39624562e+02 2.71931065e+01
+
+ 2.39570785e+02 2.71944961e+01
+ 2.39569863e+02 2.71951270e+01
+ 2.39568519e+02 2.71958632e+01
+ 2.39569305e+02 2.71972297e+01
+ 2.39569864e+02 2.71985963e+01
+ 2.39569864e+02 2.71985963e+01
+ 2.39571401e+02 2.71991653e+01
+ 2.39572499e+02 2.71985956e+01
+ 2.39572937e+02 2.71980489e+01
+ 2.39573859e+02 2.71972286e+01
+ 2.39572937e+02 2.71967164e+01
+ 2.39571401e+02 2.71968876e+01
+ 2.39570691e+02 2.71958627e+01
+ 2.39571400e+02 2.71950426e+01
+ 2.39572083e+02 2.71944957e+01
+ 2.39571399e+02 2.71931292e+01
+ 2.39570785e+02 2.71944961e+01
+
+ 2.39562693e+02 2.71944977e+01
+ 2.39562181e+02 2.71947711e+01
+ 2.39561412e+02 2.71944979e+01
+ 2.39562181e+02 2.71942566e+01
+ 2.39562693e+02 2.71944977e+01
+
+ 2.39640763e+02 2.71958289e+01
+ 2.39640544e+02 2.71961708e+01
+ 2.39639776e+02 2.71958297e+01
+ 2.39640544e+02 2.71955558e+01
+ 2.39640763e+02 2.71958289e+01
+
+ 2.39625947e+02 2.71958390e+01
+ 2.39626715e+02 2.71960338e+01
+ 2.39627099e+02 2.71958383e+01
+ 2.39626715e+02 2.71955652e+01
+ 2.39625947e+02 2.71958390e+01
+
+ 2.39621751e+02 2.71958416e+01
+ 2.39622106e+02 2.71966613e+01
+ 2.39623028e+02 2.71958408e+01
+ 2.39622105e+02 2.71953289e+01
+ 2.39621751e+02 2.71958416e+01
+
+ 2.39584888e+02 2.71958587e+01
+ 2.39585229e+02 2.71965419e+01
+ 2.39585844e+02 2.71958584e+01
+ 2.39585229e+02 2.71954681e+01
+ 2.39584888e+02 2.71958587e+01
+
+ 2.39575498e+02 2.71972282e+01
+ 2.39576010e+02 2.71973523e+01
+ 2.39576779e+02 2.71972279e+01
+ 2.39576010e+02 2.71970003e+01
+ 2.39575498e+02 2.71972282e+01
+
+ 2.39659190e+02 2.71985476e+01
+ 2.39658985e+02 2.71987186e+01
+ 2.39658601e+02 2.71985481e+01
+ 2.39658985e+02 2.71983656e+01
+ 2.39659190e+02 2.71985476e+01
+
+ 2.39655912e+02 2.71985504e+01
+ 2.39655912e+02 2.71985504e+01
+ 2.39654376e+02 2.71990072e+01
+ 2.39653863e+02 2.71985521e+01
+ 2.39654375e+02 2.71977317e+01
+ 2.39655912e+02 2.71985504e+01
+ 2.39655912e+02 2.71985504e+01
+
+ 2.39631903e+02 2.71985685e+01
+ 2.39632864e+02 2.71994220e+01
+ 2.39634400e+02 2.71986387e+01
+ 2.39634912e+02 2.71985664e+01
+ 2.39634400e+02 2.71982251e+01
+ 2.39632863e+02 2.71974289e+01
+ 2.39631903e+02 2.71985685e+01
+
+ 2.39626599e+02 2.71985719e+01
+ 2.39626717e+02 2.71986961e+01
+ 2.39626808e+02 2.71985718e+01
+ 2.39626717e+02 2.71983766e+01
+ 2.39626599e+02 2.71985719e+01
+
+ 2.39560865e+02 2.71985980e+01
+ 2.39560645e+02 2.71992814e+01
+ 2.39560474e+02 2.71985981e+01
+ 2.39560645e+02 2.71983247e+01
+ 2.39560865e+02 2.71985980e+01
+
+ 2.39639011e+02 2.71999302e+01
+ 2.39639011e+02 2.71999302e+01
+ 2.39639011e+02 2.71999302e+01
+ 2.39639011e+02 2.71999302e+01
+ 2.39639011e+02 2.71999302e+01
+
+ 2.39589750e+02 2.71999570e+01
+ 2.39589840e+02 2.72000329e+01
+ 2.39589943e+02 2.71999569e+01
+ 2.39589840e+02 2.71995014e+01
+ 2.39589750e+02 2.71999570e+01
+
+ 2.39557914e+02 2.71999651e+01
+ 2.39557572e+02 2.72002385e+01
+ 2.39557188e+02 2.71999652e+01
+ 2.39557572e+02 2.71996919e+01
+ 2.39557914e+02 2.71999651e+01
+
+ 2.39652842e+02 2.72012863e+01
+ 2.39652842e+02 2.72012863e+01
+ 2.39652842e+02 2.72012863e+01
+ 2.39652842e+02 2.72012863e+01
+ 2.39652842e+02 2.72012863e+01
+
+ 2.39633964e+02 2.72013004e+01
+ 2.39632867e+02 2.72022773e+01
+ 2.39632252e+02 2.72026682e+01
+ 2.39631331e+02 2.72034888e+01
+ 2.39630819e+02 2.72040358e+01
+ 2.39631332e+02 2.72044911e+01
+ 2.39631890e+02 2.72040351e+01
+ 2.39632868e+02 2.72031648e+01
+ 2.39633635e+02 2.72026673e+01
+ 2.39634403e+02 2.72019834e+01
+ 2.39635171e+02 2.72012996e+01
+ 2.39634402e+02 2.72010516e+01
+ 2.39633964e+02 2.72013004e+01
+
+ 2.39629665e+02 2.72013033e+01
+ 2.39629793e+02 2.72014740e+01
+ 2.39630177e+02 2.72013029e+01
+ 2.39629793e+02 2.72011513e+01
+ 2.39629665e+02 2.72013033e+01
+
+ 2.39572554e+02 2.72013290e+01
+ 2.39572939e+02 2.72017389e+01
+ 2.39574091e+02 2.72013286e+01
+ 2.39572938e+02 2.72007431e+01
+ 2.39572554e+02 2.72013290e+01
+
+ 2.39569646e+02 2.72013296e+01
+ 2.39569865e+02 2.72020129e+01
+ 2.39570145e+02 2.72013295e+01
+ 2.39569865e+02 2.72004185e+01
+ 2.39569646e+02 2.72013296e+01
+
+ 2.39554115e+02 2.72013323e+01
+ 2.39552963e+02 2.72017424e+01
+ 2.39552578e+02 2.72013325e+01
+ 2.39552962e+02 2.72005124e+01
+ 2.39554115e+02 2.72013323e+01
+
+ 2.39646697e+02 2.72026578e+01
+ 2.39646697e+02 2.72026578e+01
+ 2.39646697e+02 2.72026578e+01
+ 2.39646697e+02 2.72026578e+01
+ 2.39646697e+02 2.72026578e+01
+
+ 2.39620501e+02 2.72026756e+01
+ 2.39620574e+02 2.72027377e+01
+ 2.39620766e+02 2.72026755e+01
+ 2.39620574e+02 2.72026162e+01
+ 2.39620501e+02 2.72026756e+01
+
+ 2.39662406e+02 2.72040114e+01
+ 2.39662065e+02 2.72043154e+01
+ 2.39661625e+02 2.72040121e+01
+ 2.39662064e+02 2.72035562e+01
+ 2.39662406e+02 2.72040114e+01
+
+ 2.39656175e+02 2.72053835e+01
+ 2.39655920e+02 2.72064087e+01
+ 2.39655631e+02 2.72053839e+01
+ 2.39655919e+02 2.72051679e+01
+ 2.39656175e+02 2.72053835e+01
+
+ 2.39647469e+02 2.72067572e+01
+ 2.39646701e+02 2.72068629e+01
+ 2.39646530e+02 2.72067579e+01
+ 2.39646701e+02 2.72066335e+01
+ 2.39647469e+02 2.72067572e+01
+
+ 2.39642571e+02 2.72067609e+01
+ 2.39642092e+02 2.72077375e+01
+ 2.39640993e+02 2.72067621e+01
+ 2.39642090e+02 2.72061401e+01
+ 2.39642571e+02 2.72067609e+01
+
+ 2.39628920e+02 2.72081371e+01
+ 2.39629799e+02 2.72086335e+01
+ 2.39630237e+02 2.72081362e+01
+ 2.39629798e+02 2.72073556e+01
+ 2.39628920e+02 2.72081371e+01
+
+ 2.39665298e+02 2.72094755e+01
+ 2.39665144e+02 2.72095999e+01
+ 2.39665004e+02 2.72094758e+01
+ 2.39665144e+02 2.72093390e+01
+ 2.39665298e+02 2.72094755e+01
+
+ 2.39648411e+02 2.72094898e+01
+ 2.39648240e+02 2.72096418e+01
+ 2.39647984e+02 2.72094901e+01
+ 2.39648240e+02 2.72091483e+01
+ 2.39648411e+02 2.72094898e+01
+
+ 2.39547256e+02 2.72095329e+01
+ 2.39546817e+02 2.72098063e+01
+ 2.39546510e+02 2.72095330e+01
+ 2.39546817e+02 2.72089863e+01
+ 2.39547256e+02 2.72095329e+01
+
+ 2.39650461e+02 2.72108548e+01
+ 2.39649780e+02 2.72122220e+01
+ 2.39649780e+02 2.72122220e+01
+ 2.39649780e+02 2.72122220e+01
+ 2.39649266e+02 2.72108558e+01
+ 2.39649778e+02 2.72103998e+01
+ 2.39650461e+02 2.72108548e+01
+
+ 2.39638509e+02 2.72108639e+01
+ 2.39637656e+02 2.72122311e+01
+ 2.39637486e+02 2.72124590e+01
+ 2.39637229e+02 2.72122314e+01
+ 2.39636870e+02 2.72108650e+01
+ 2.39637484e+02 2.72099535e+01
+ 2.39638509e+02 2.72108639e+01
+
+ 2.39563625e+02 2.72108975e+01
+ 2.39563721e+02 2.72110683e+01
+ 2.39563839e+02 2.72108975e+01
+ 2.39563721e+02 2.72105558e+01
+ 2.39563625e+02 2.72108975e+01
+
+ 2.39558855e+02 2.72108983e+01
+ 2.39559111e+02 2.72112020e+01
+ 2.39560648e+02 2.72108980e+01
+ 2.39559111e+02 2.72105078e+01
+ 2.39558855e+02 2.72108983e+01
+
+ 2.39645938e+02 2.72122250e+01
+ 2.39645390e+02 2.72135921e+01
+ 2.39645171e+02 2.72137289e+01
+ 2.39643634e+02 2.72136846e+01
+ 2.39643463e+02 2.72135936e+01
+ 2.39643634e+02 2.72133982e+01
+ 2.39644401e+02 2.72122262e+01
+ 2.39645168e+02 2.72113145e+01
+ 2.39645938e+02 2.72122250e+01
+
+ 2.39640048e+02 2.72135961e+01
+ 2.39639024e+02 2.72138702e+01
+ 2.39638585e+02 2.72135971e+01
+ 2.39639023e+02 2.72133235e+01
+ 2.39640048e+02 2.72135961e+01
+
+ 2.39554117e+02 2.72136323e+01
+ 2.39553989e+02 2.72149990e+01
+ 2.39552965e+02 2.72161380e+01
+ 2.39552728e+02 2.72163658e+01
+ 2.39552965e+02 2.72169124e+01
+ 2.39554117e+02 2.72177323e+01
+ 2.39554502e+02 2.72178042e+01
+ 2.39554611e+02 2.72177322e+01
+ 2.39554502e+02 2.72174589e+01
+ 2.39553477e+02 2.72163657e+01
+ 2.39554501e+02 2.72157582e+01
+ 2.39555599e+02 2.72149988e+01
+ 2.39554843e+02 2.72136322e+01
+ 2.39554501e+02 2.72133589e+01
+ 2.39554117e+02 2.72136323e+01
+
+ 2.39542890e+02 2.72136331e+01
+ 2.39542207e+02 2.72149998e+01
+ 2.39542207e+02 2.72149998e+01
+ 2.39542207e+02 2.72149998e+01
+ 2.39541695e+02 2.72136332e+01
+ 2.39542207e+02 2.72129498e+01
+ 2.39542890e+02 2.72136331e+01
+
+ 2.39633390e+02 2.72149674e+01
+ 2.39634415e+02 2.72154637e+01
+ 2.39634887e+02 2.72149664e+01
+ 2.39634414e+02 2.72144201e+01
+ 2.39633390e+02 2.72149674e+01
+
+ 2.39627691e+02 2.72149712e+01
+ 2.39628268e+02 2.72154264e+01
+ 2.39629190e+02 2.72163369e+01
+ 2.39629636e+02 2.72177033e+01
+ 2.39629806e+02 2.72178274e+01
+ 2.39629897e+02 2.72177031e+01
+ 2.39630364e+02 2.72163361e+01
+ 2.39629804e+02 2.72152432e+01
+ 2.39629420e+02 2.72149701e+01
+ 2.39628267e+02 2.72145153e+01
+ 2.39627691e+02 2.72149712e+01
+
+ 2.39648247e+02 2.72163232e+01
+ 2.39648247e+02 2.72163232e+01
+ 2.39648247e+02 2.72163232e+01
+ 2.39648247e+02 2.72163232e+01
+ 2.39648247e+02 2.72163232e+01
+
+ 2.39547202e+02 2.72163662e+01
+ 2.39548354e+02 2.72169519e+01
+ 2.39548662e+02 2.72163661e+01
+ 2.39548354e+02 2.72160245e+01
+ 2.39547202e+02 2.72163662e+01
+
+ 2.39539646e+02 2.72163666e+01
+ 2.39539133e+02 2.72165488e+01
+ 2.39538941e+02 2.72163666e+01
+ 2.39539133e+02 2.72161388e+01
+ 2.39539646e+02 2.72163666e+01
+
+ 2.39643638e+02 2.72176934e+01
+ 2.39643639e+02 2.72190601e+01
+ 2.39643639e+02 2.72190601e+01
+ 2.39642103e+02 2.72198300e+01
+ 2.39640567e+02 2.72202924e+01
+ 2.39639643e+02 2.72190630e+01
+ 2.39640125e+02 2.72176960e+01
+ 2.39640564e+02 2.72173741e+01
+ 2.39642100e+02 2.72165557e+01
+ 2.39643638e+02 2.72176934e+01
+ 2.39643638e+02 2.72176934e+01
+
+ 2.39650006e+02 2.72190552e+01
+ 2.39649787e+02 2.72192262e+01
+ 2.39649647e+02 2.72190555e+01
+ 2.39649786e+02 2.72189414e+01
+ 2.39650006e+02 2.72190552e+01
+
+ 2.39551300e+02 2.72190992e+01
+ 2.39551209e+02 2.72204659e+01
+ 2.39551428e+02 2.72206367e+01
+ 2.39551514e+02 2.72204659e+01
+ 2.39551582e+02 2.72190992e+01
+ 2.39551428e+02 2.72190138e+01
+ 2.39551300e+02 2.72190992e+01
+
+ 2.39540670e+02 2.72190999e+01
+ 2.39540670e+02 2.72190999e+01
+ 2.39539133e+02 2.72195099e+01
+ 2.39538749e+02 2.72190999e+01
+ 2.39539133e+02 2.72188436e+01
+ 2.39540670e+02 2.72190999e+01
+ 2.39540670e+02 2.72190999e+01
+
+ 2.39641336e+02 2.72217951e+01
+ 2.39640569e+02 2.72231624e+01
+ 2.39642107e+02 2.72236168e+01
+ 2.39642415e+02 2.72245277e+01
+ 2.39642109e+02 2.72258946e+01
+ 2.39642109e+02 2.72258946e+01
+ 2.39642109e+02 2.72258946e+01
+ 2.39640570e+02 2.72245290e+01
+ 2.39640570e+02 2.72245290e+01
+ 2.39640569e+02 2.72231624e+01
+ 2.39639953e+02 2.72217961e+01
+ 2.39640567e+02 2.72207024e+01
+ 2.39641336e+02 2.72217951e+01
+
+ 2.39626618e+02 2.72218052e+01
+ 2.39626736e+02 2.72218810e+01
+ 2.39626890e+02 2.72218050e+01
+ 2.39626736e+02 2.72217140e+01
+ 2.39626618e+02 2.72218052e+01
+
+ 2.39540926e+02 2.72218332e+01
+ 2.39540670e+02 2.72222888e+01
+ 2.39540552e+02 2.72218332e+01
+ 2.39540670e+02 2.72216054e+01
+ 2.39540926e+02 2.72218332e+01
+
+ 2.39536060e+02 2.72231999e+01
+ 2.39536060e+02 2.72231999e+01
+ 2.39536060e+02 2.72231999e+01
+ 2.39536060e+02 2.72231999e+01
+ 2.39536060e+02 2.72231999e+01
+
+ 2.39537715e+02 2.72245666e+01
+ 2.39537597e+02 2.72252499e+01
+ 2.39537212e+02 2.72245666e+01
+ 2.39537597e+02 2.72244147e+01
+ 2.39537715e+02 2.72245666e+01
+
+ 2.39639035e+02 2.72258968e+01
+ 2.39640294e+02 2.72272626e+01
+ 2.39639037e+02 2.72282096e+01
+ 2.39637500e+02 2.72279479e+01
+ 2.39635963e+02 2.72282906e+01
+ 2.39635420e+02 2.72272660e+01
+ 2.39634616e+02 2.72258999e+01
+ 2.39635960e+02 2.72251018e+01
+ 2.39636729e+02 2.72258984e+01
+ 2.39637499e+02 2.72270937e+01
+ 2.39639035e+02 2.72258968e+01
+ 2.39639035e+02 2.72258968e+01
+ 2.39639035e+02 2.72258968e+01
+
+ 2.39628158e+02 2.72259042e+01
+ 2.39628276e+02 2.72260017e+01
+ 2.39629814e+02 2.72266841e+01
+ 2.39630428e+02 2.72259027e+01
+ 2.39629813e+02 2.72254826e+01
+ 2.39628276e+02 2.72258237e+01
+ 2.39628158e+02 2.72259042e+01
+
+ 2.39540670e+02 2.72272999e+01
+ 2.39542207e+02 2.72274241e+01
+ 2.39542347e+02 2.72272998e+01
+ 2.39542207e+02 2.72259332e+01
+ 2.39540670e+02 2.72272999e+01
+
+ 2.39535291e+02 2.72300332e+01
+ 2.39534522e+02 2.72306189e+01
+ 2.39533600e+02 2.72300332e+01
+ 2.39534523e+02 2.72294475e+01
+ 2.39535291e+02 2.72300332e+01
+
+ 2.39533644e+02 2.72313998e+01
+ 2.39532985e+02 2.72322198e+01
+ 2.39532063e+02 2.72313998e+01
+ 2.39532985e+02 2.72305798e+01
+ 2.39533644e+02 2.72313998e+01
+
+ 2.39530219e+02 2.72313997e+01
+ 2.39529911e+02 2.72316274e+01
+ 2.39529692e+02 2.72313997e+01
+ 2.39529911e+02 2.72312945e+01
+ 2.39530219e+02 2.72313997e+01
+
+ 2.39659119e+02 2.72327142e+01
+ 2.39659023e+02 2.72328054e+01
+ 2.39658937e+02 2.72327144e+01
+ 2.39659022e+02 2.72326232e+01
+ 2.39659119e+02 2.72327142e+01
+
+ 2.39641092e+02 2.72340953e+01
+ 2.39640579e+02 2.72342665e+01
+ 2.39640440e+02 2.72340958e+01
+ 2.39640579e+02 2.72339714e+01
+ 2.39641092e+02 2.72340953e+01
+
+ 2.39532985e+02 2.72341331e+01
+ 2.39532985e+02 2.72341331e+01
+ 2.39532985e+02 2.72341331e+01
+ 2.39532985e+02 2.72341331e+01
+ 2.39532985e+02 2.72341331e+01
+
+ 2.39646399e+02 2.72354580e+01
+ 2.39645192e+02 2.72361422e+01
+ 2.39644387e+02 2.72354595e+01
+ 2.39645191e+02 2.72346677e+01
+ 2.39646399e+02 2.72354580e+01
+
+ 2.39639602e+02 2.72354630e+01
+ 2.39639044e+02 2.72360101e+01
+ 2.39638485e+02 2.72354638e+01
+ 2.39639043e+02 2.72350730e+01
+ 2.39639602e+02 2.72354630e+01
+
+ 2.39630799e+02 2.72354691e+01
+ 2.39629822e+02 2.72365327e+01
+ 2.39628745e+02 2.72354705e+01
+ 2.39629820e+02 2.72344068e+01
+ 2.39630799e+02 2.72354691e+01
+
+ 2.39532217e+02 2.72354998e+01
+ 2.39532302e+02 2.72368664e+01
+ 2.39531448e+02 2.72377206e+01
+ 2.39530936e+02 2.72368664e+01
+ 2.39531256e+02 2.72354997e+01
+ 2.39531448e+02 2.72353045e+01
+ 2.39532217e+02 2.72354998e+01
+
+ 2.39637508e+02 2.72368312e+01
+ 2.39637508e+02 2.72368312e+01
+ 2.39637508e+02 2.72368312e+01
+ 2.39637508e+02 2.72368312e+01
+ 2.39637508e+02 2.72368312e+01
+
+ 2.39635202e+02 2.72368328e+01
+ 2.39635971e+02 2.72374631e+01
+ 2.39636740e+02 2.72381984e+01
+ 2.39635972e+02 2.72389962e+01
+ 2.39634435e+02 2.72387125e+01
+ 2.39633666e+02 2.72382005e+01
+ 2.39632897e+02 2.72370829e+01
+ 2.39631360e+02 2.72382021e+01
+ 2.39631362e+02 2.72395688e+01
+ 2.39631362e+02 2.72395688e+01
+ 2.39631362e+02 2.72395688e+01
+ 2.39631360e+02 2.72382021e+01
+ 2.39630437e+02 2.72368360e+01
+ 2.39631359e+02 2.72362497e+01
+ 2.39632896e+02 2.72365859e+01
+ 2.39634433e+02 2.72358084e+01
+ 2.39635202e+02 2.72368328e+01
+
+ 2.39628285e+02 2.72368374e+01
+ 2.39628285e+02 2.72368374e+01
+ 2.39628285e+02 2.72368374e+01
+ 2.39628285e+02 2.72368374e+01
+ 2.39628285e+02 2.72368374e+01
+
+ 2.39627460e+02 2.72395713e+01
+ 2.39627674e+02 2.72409378e+01
+ 2.39626752e+02 2.72413484e+01
+ 2.39625215e+02 2.72418855e+01
+ 2.39624226e+02 2.72409400e+01
+ 2.39625213e+02 2.72398212e+01
+ 2.39625597e+02 2.72395725e+01
+ 2.39626749e+02 2.72384003e+01
+ 2.39627460e+02 2.72395713e+01
+
+ 2.39643660e+02 2.72409267e+01
+ 2.39643660e+02 2.72409267e+01
+ 2.39643660e+02 2.72409267e+01
+ 2.39643660e+02 2.72409267e+01
+ 2.39643660e+02 2.72409267e+01
+
+ 2.39636358e+02 2.72409320e+01
+ 2.39635975e+02 2.72415180e+01
+ 2.39635619e+02 2.72409325e+01
+ 2.39635974e+02 2.72404198e+01
+ 2.39636358e+02 2.72409320e+01
+
+ 2.39632900e+02 2.72409344e+01
+ 2.39632900e+02 2.72409344e+01
+ 2.39632900e+02 2.72409344e+01
+ 2.39632900e+02 2.72409344e+01
+ 2.39632900e+02 2.72409344e+01
+
+ 2.39618628e+02 2.72436766e+01
+ 2.39619068e+02 2.72443597e+01
+ 2.39619836e+02 2.72436759e+01
+ 2.39619067e+02 2.72433347e+01
+ 2.39618628e+02 2.72436766e+01
+
+ 2.39636096e+02 2.72450322e+01
+ 2.39635978e+02 2.72451689e+01
+ 2.39635807e+02 2.72450324e+01
+ 2.39635978e+02 2.72449080e+01
+ 2.39636096e+02 2.72450322e+01
+
+ 2.39630025e+02 2.72491363e+01
+ 2.39629832e+02 2.72492731e+01
+ 2.39629525e+02 2.72491366e+01
+ 2.39629832e+02 2.72489412e+01
+ 2.39630025e+02 2.72491363e+01
+
+ 2.39614350e+02 2.72491457e+01
+ 2.39614460e+02 2.72494190e+01
+ 2.39614716e+02 2.72491455e+01
+ 2.39614460e+02 2.72490405e+01
+ 2.39614350e+02 2.72491457e+01
+
+ 2.39532677e+02 2.72491665e+01
+ 2.39532985e+02 2.72492641e+01
+ 2.39533087e+02 2.72491665e+01
+ 2.39532985e+02 2.72487109e+01
+ 2.39532677e+02 2.72491665e+01
+
+ 2.39620610e+02 2.72505088e+01
+ 2.39620610e+02 2.72505088e+01
+ 2.39620610e+02 2.72505088e+01
+ 2.39620610e+02 2.72505088e+01
+ 2.39620610e+02 2.72505088e+01
+
+ 2.39528373e+02 2.72505329e+01
+ 2.39528373e+02 2.72505329e+01
+ 2.39528373e+02 2.72505329e+01
+ 2.39528373e+02 2.72505329e+01
+ 2.39528373e+02 2.72505329e+01
+
+ 2.39609465e+02 2.72518816e+01
+ 2.39609543e+02 2.72532482e+01
+ 2.39609851e+02 2.72534189e+01
+ 2.39611388e+02 2.72540160e+01
+ 2.39612926e+02 2.72539298e+01
+ 2.39613517e+02 2.72532462e+01
+ 2.39612925e+02 2.72526770e+01
+ 2.39611388e+02 2.72526882e+01
+ 2.39610335e+02 2.72518812e+01
+ 2.39609849e+02 2.72512957e+01
+ 2.39609465e+02 2.72518816e+01
+
+ 2.39538804e+02 2.72518999e+01
+ 2.39539134e+02 2.72520951e+01
+ 2.39539326e+02 2.72518999e+01
+ 2.39539134e+02 2.72516070e+01
+ 2.39538804e+02 2.72518999e+01
+
+ 2.39619076e+02 2.72546097e+01
+ 2.39619076e+02 2.72546097e+01
+ 2.39619076e+02 2.72546097e+01
+ 2.39619076e+02 2.72546097e+01
+ 2.39619076e+02 2.72546097e+01
+
+ 2.39616222e+02 2.72573447e+01
+ 2.39616003e+02 2.72576865e+01
+ 2.39615490e+02 2.72573451e+01
+ 2.39616003e+02 2.72571929e+01
+ 2.39616222e+02 2.72573447e+01
+
+ 2.39533599e+02 2.72573665e+01
+ 2.39532984e+02 2.72576149e+01
+ 2.39532677e+02 2.72573665e+01
+ 2.39532984e+02 2.72568198e+01
+ 2.39533599e+02 2.72573665e+01
+
+ 2.39623998e+02 2.72587068e+01
+ 2.39623691e+02 2.72593903e+01
+ 2.39623435e+02 2.72587071e+01
+ 2.39623691e+02 2.72584792e+01
+ 2.39623998e+02 2.72587068e+01
+
+ 2.39614586e+02 2.72600789e+01
+ 2.39614467e+02 2.72602156e+01
+ 2.39614357e+02 2.72600790e+01
+ 2.39614467e+02 2.72598056e+01
+ 2.39614586e+02 2.72600789e+01
+
+ 2.39611878e+02 2.72600804e+01
+ 2.39611393e+02 2.72605931e+01
+ 2.39610973e+02 2.72600808e+01
+ 2.39611392e+02 2.72593973e+01
+ 2.39611878e+02 2.72600804e+01
+
+ 2.39600118e+02 2.72600861e+01
+ 2.39600631e+02 2.72602811e+01
+ 2.39601399e+02 2.72600855e+01
+ 2.39600630e+02 2.72598906e+01
+ 2.39600118e+02 2.72600861e+01
+
+ 2.39604093e+02 2.72655509e+01
+ 2.39603709e+02 2.72657613e+01
+ 2.39603367e+02 2.72655512e+01
+ 2.39603708e+02 2.72652094e+01
+ 2.39604093e+02 2.72655509e+01
+
+ 2.39538942e+02 2.72655665e+01
+ 2.39539134e+02 2.72657184e+01
+ 2.39539219e+02 2.72655665e+01
+ 2.39539134e+02 2.72653388e+01
+ 2.39538942e+02 2.72655665e+01
+
+ 2.39602300e+02 2.72669184e+01
+ 2.39602172e+02 2.72670551e+01
+ 2.39601659e+02 2.72669187e+01
+ 2.39602172e+02 2.72667476e+01
+ 2.39602300e+02 2.72669184e+01
+
+ 2.39606786e+02 2.72696496e+01
+ 2.39606786e+02 2.72696496e+01
+ 2.39606786e+02 2.72696496e+01
+ 2.39606786e+02 2.72696496e+01
+ 2.39606786e+02 2.72696496e+01
+
+ 2.39599406e+02 2.72696530e+01
+ 2.39599099e+02 2.72698809e+01
+ 2.39598757e+02 2.72696533e+01
+ 2.39599098e+02 2.72693798e+01
+ 2.39599406e+02 2.72696530e+01
+
+ 2.39575337e+02 2.72710282e+01
+ 2.39576036e+02 2.72717873e+01
+ 2.39576676e+02 2.72710278e+01
+ 2.39576036e+02 2.72707924e+01
+ 2.39575337e+02 2.72710282e+01
+
+ 2.39540951e+02 2.72710332e+01
+ 2.39540672e+02 2.72717165e+01
+ 2.39540287e+02 2.72710332e+01
+ 2.39540672e+02 2.72705776e+01
+ 2.39540951e+02 2.72710332e+01
+
+ 2.39557201e+02 2.72751319e+01
+ 2.39556048e+02 2.72755225e+01
+ 2.39554510e+02 2.72755422e+01
+ 2.39553588e+02 2.72751323e+01
+ 2.39554510e+02 2.72744489e+01
+ 2.39556048e+02 2.72742209e+01
+ 2.39557201e+02 2.72751319e+01
+
+ 2.39566922e+02 2.72764969e+01
+ 2.39566812e+02 2.72767702e+01
+ 2.39566427e+02 2.72764970e+01
+ 2.39566812e+02 2.72758135e+01
+ 2.39566922e+02 2.72764969e+01
+
+ 2.39556048e+02 2.72778654e+01
+ 2.39556048e+02 2.72778654e+01
+ 2.39556048e+02 2.72778654e+01
+ 2.39556048e+02 2.72778654e+01
+ 2.39556048e+02 2.72778654e+01
+
+ 2.39569888e+02 2.72792295e+01
+ 2.39569888e+02 2.72792295e+01
+ 2.39569888e+02 2.72792295e+01
+ 2.39569888e+02 2.72792295e+01
+ 2.39569888e+02 2.72792295e+01
+
+ 2.39560662e+02 2.72792313e+01
+ 2.39560662e+02 2.72792313e+01
+ 2.39560662e+02 2.72792313e+01
+ 2.39560662e+02 2.72792313e+01
+ 2.39560662e+02 2.72792313e+01
+
+ 2.39489611e+02 2.72819583e+01
+ 2.39488389e+02 2.72830148e+01
+ 2.39487260e+02 2.72819575e+01
+ 2.39488390e+02 2.72808570e+01
+ 2.39489611e+02 2.72819583e+01
+
+ 2.39626785e+02 2.72833050e+01
+ 2.39626785e+02 2.72833050e+01
+ 2.39626785e+02 2.72833050e+01
+ 2.39626785e+02 2.72833050e+01
+ 2.39626785e+02 2.72833050e+01
+
+ 2.39625922e+02 2.72860389e+01
+ 2.39625724e+02 2.72874057e+01
+ 2.39625951e+02 2.72887722e+01
+ 2.39625252e+02 2.72893939e+01
+ 2.39623715e+02 2.72901243e+01
+ 2.39623386e+02 2.72901405e+01
+ 2.39622178e+02 2.72908571e+01
+ 2.39620640e+02 2.72904350e+01
+ 2.39619486e+02 2.72901428e+01
+ 2.39619452e+02 2.72887761e+01
+ 2.39619110e+02 2.72874097e+01
+ 2.39619958e+02 2.72860425e+01
+ 2.39620636e+02 2.72853352e+01
+ 2.39622173e+02 2.72846823e+01
+ 2.39623711e+02 2.72847712e+01
+ 2.39625249e+02 2.72854016e+01
+ 2.39625922e+02 2.72860389e+01
+
+ 2.39534521e+02 2.72860665e+01
+ 2.39534521e+02 2.72860665e+01
+ 2.39534521e+02 2.72860665e+01
+ 2.39534521e+02 2.72860665e+01
+ 2.39534521e+02 2.72860665e+01
+
+ 2.39501864e+02 2.73010953e+01
+ 2.39500684e+02 2.73020982e+01
+ 2.39499519e+02 2.73010947e+01
+ 2.39500685e+02 2.73000111e+01
+ 2.39501864e+02 2.73010953e+01
+
+ 2.39626355e+02 2.73161053e+01
+ 2.39625274e+02 2.73170521e+01
+ 2.39623735e+02 2.73165274e+01
+ 2.39623262e+02 2.73161072e+01
+ 2.39623735e+02 2.73156315e+01
+ 2.39625273e+02 2.73150978e+01
+ 2.39626355e+02 2.73161053e+01
+
+ 2.39750705e+02 2.73187052e+01
+ 2.39749873e+02 2.73195525e+01
+ 2.39748335e+02 2.73194680e+01
+ 2.39747537e+02 2.73187099e+01
+ 2.39748331e+02 2.73175699e+01
+ 2.39749870e+02 2.73180231e+01
+ 2.39750705e+02 2.73187052e+01
+
+ 2.39586900e+02 2.73338913e+01
+ 2.39586826e+02 2.73339632e+01
+ 2.39586756e+02 2.73338913e+01
+ 2.39586826e+02 2.73338366e+01
+ 2.39586900e+02 2.73338913e+01
+
+ 2.39549220e+02 2.73352661e+01
+ 2.39548366e+02 2.73362152e+01
+ 2.39547581e+02 2.73352662e+01
+ 2.39548365e+02 2.73344716e+01
+ 2.39549220e+02 2.73352661e+01
+
+ 2.39627405e+02 2.73366046e+01
+ 2.39626828e+02 2.73370291e+01
+ 2.39626395e+02 2.73366052e+01
+ 2.39626828e+02 2.73361808e+01
+ 2.39627405e+02 2.73366046e+01
+
+ 2.39526093e+02 2.73379994e+01
+ 2.39525288e+02 2.73390832e+01
+ 2.39524465e+02 2.73379992e+01
+ 2.39525288e+02 2.73373008e+01
+ 2.39526093e+02 2.73379994e+01
+
+ 2.39710932e+02 2.73488264e+01
+ 2.39711135e+02 2.73501928e+01
+ 2.39709928e+02 2.73509459e+01
+ 2.39709121e+02 2.73501953e+01
+ 2.39708532e+02 2.73488293e+01
+ 2.39709923e+02 2.73479900e+01
+ 2.39710932e+02 2.73488264e+01
+
+ 2.39531515e+02 2.73516664e+01
+ 2.39531442e+02 2.73517423e+01
+ 2.39531368e+02 2.73516664e+01
+ 2.39531442e+02 2.73515809e+01
+ 2.39531515e+02 2.73516664e+01
+
+ 2.39606797e+02 2.72040497e+01
+ 2.39606745e+02 2.72040623e+01
+ 2.39606736e+02 2.72040497e+01
+ 2.39606745e+02 2.72040324e+01
+ 2.39606797e+02 2.72040497e+01
+
+ 2.39603697e+02 2.72054178e+01
+ 2.39603673e+02 2.72054409e+01
+ 2.39603647e+02 2.72054178e+01
+ 2.39603673e+02 2.72053993e+01
+ 2.39603697e+02 2.72054178e+01
+
+ 2.39600768e+02 2.72067858e+01
+ 2.39601024e+02 2.72081524e+01
+ 2.39600925e+02 2.72095191e+01
+ 2.39601306e+02 2.72108856e+01
+ 2.39600603e+02 2.72111985e+01
+ 2.39600056e+02 2.72108861e+01
+ 2.39599066e+02 2.72100943e+01
+ 2.39598076e+02 2.72108870e+01
+ 2.39599067e+02 2.72122070e+01
+ 2.39599095e+02 2.72122532e+01
+ 2.39600604e+02 2.72127991e+01
+ 2.39601477e+02 2.72122522e+01
+ 2.39602140e+02 2.72113177e+01
+ 2.39602771e+02 2.72122516e+01
+ 2.39603678e+02 2.72134914e+01
+ 2.39605214e+02 2.72133160e+01
+ 2.39605384e+02 2.72136170e+01
+ 2.39606752e+02 2.72145518e+01
+ 2.39607803e+02 2.72149825e+01
+ 2.39608290e+02 2.72158472e+01
+ 2.39608773e+02 2.72163487e+01
+ 2.39609827e+02 2.72172847e+01
+ 2.39610394e+02 2.72163478e+01
+ 2.39611363e+02 2.72154850e+01
+ 2.39612764e+02 2.72163466e+01
+ 2.39612900e+02 2.72164827e+01
+ 2.39613455e+02 2.72177129e+01
+ 2.39612902e+02 2.72189437e+01
+ 2.39612657e+02 2.72190800e+01
+ 2.39612320e+02 2.72204468e+01
+ 2.39611367e+02 2.72210994e+01
+ 2.39610307e+02 2.72204479e+01
+ 2.39609829e+02 2.72196835e+01
+ 2.39608292e+02 2.72200666e+01
+ 2.39607285e+02 2.72190827e+01
+ 2.39606754e+02 2.72177856e+01
+ 2.39606598e+02 2.72177164e+01
+ 2.39605217e+02 2.72173077e+01
+ 2.39603680e+02 2.72171037e+01
+ 2.39603468e+02 2.72177179e+01
+ 2.39603680e+02 2.72180248e+01
+ 2.39605217e+02 2.72178239e+01
+ 2.39606521e+02 2.72190831e+01
+ 2.39606755e+02 2.72192906e+01
+ 2.39608113e+02 2.72204490e+01
+ 2.39608293e+02 2.72207038e+01
+ 2.39609830e+02 2.72209942e+01
+ 2.39610417e+02 2.72218145e+01
+ 2.39611368e+02 2.72227429e+01
+ 2.39612904e+02 2.72220381e+01
+ 2.39614441e+02 2.72224316e+01
+ 2.39615588e+02 2.72231784e+01
+ 2.39615032e+02 2.72245454e+01
+ 2.39614443e+02 2.72255131e+01
+ 2.39613698e+02 2.72245461e+01
+ 2.39612905e+02 2.72239886e+01
+ 2.39612113e+02 2.72245469e+01
+ 2.39612906e+02 2.72251044e+01
+ 2.39614119e+02 2.72259125e+01
+ 2.39612907e+02 2.72269348e+01
+ 2.39612416e+02 2.72272801e+01
+ 2.39612371e+02 2.72286468e+01
+ 2.39611806e+02 2.72300137e+01
+ 2.39612520e+02 2.72313800e+01
+ 2.39611374e+02 2.72321280e+01
+ 2.39611067e+02 2.72327475e+01
+ 2.39611375e+02 2.72335214e+01
+ 2.39611723e+02 2.72341138e+01
+ 2.39611930e+02 2.72354803e+01
+ 2.39611377e+02 2.72363009e+01
+ 2.39610324e+02 2.72368478e+01
+ 2.39609840e+02 2.72373498e+01
+ 2.39609417e+02 2.72368483e+01
+ 2.39608303e+02 2.72366457e+01
+ 2.39607996e+02 2.72368490e+01
+ 2.39608303e+02 2.72373441e+01
+ 2.39609424e+02 2.72382150e+01
+ 2.39608775e+02 2.72395820e+01
+ 2.39608675e+02 2.72409487e+01
+ 2.39609690e+02 2.72423148e+01
+ 2.39608307e+02 2.72432104e+01
+ 2.39607140e+02 2.72436828e+01
+ 2.39606802e+02 2.72450496e+01
+ 2.39606771e+02 2.72451050e+01
+ 2.39605234e+02 2.72462281e+01
+ 2.39603697e+02 2.72458716e+01
+ 2.39602404e+02 2.72450517e+01
+ 2.39602159e+02 2.72449740e+01
+ 2.39602112e+02 2.72450518e+01
+ 2.39601170e+02 2.72464189e+01
+ 2.39602161e+02 2.72475503e+01
+ 2.39603697e+02 2.72467118e+01
+ 2.39605235e+02 2.72476451e+01
+ 2.39606773e+02 2.72477275e+01
+ 2.39606790e+02 2.72477829e+01
+ 2.39606773e+02 2.72477961e+01
+ 2.39605235e+02 2.72478391e+01
+ 2.39604669e+02 2.72491506e+01
+ 2.39603699e+02 2.72497116e+01
+ 2.39602298e+02 2.72491517e+01
+ 2.39602161e+02 2.72486070e+01
+ 2.39600624e+02 2.72489538e+01
+ 2.39599087e+02 2.72484118e+01
+ 2.39598809e+02 2.72491533e+01
+ 2.39597954e+02 2.72505203e+01
+ 2.39598781e+02 2.72518866e+01
+ 2.39597860e+02 2.72532537e+01
+ 2.39598050e+02 2.72546203e+01
+ 2.39597674e+02 2.72559871e+01
+ 2.39597554e+02 2.72561642e+01
+ 2.39596989e+02 2.72559874e+01
+ 2.39596261e+02 2.72546210e+01
+ 2.39596015e+02 2.72545531e+01
+ 2.39595840e+02 2.72546212e+01
+ 2.39594478e+02 2.72550071e+01
+ 2.39593130e+02 2.72559890e+01
+ 2.39592942e+02 2.72562901e+01
+ 2.39592634e+02 2.72559892e+01
+ 2.39592289e+02 2.72546226e+01
+ 2.39591403e+02 2.72532840e+01
+ 2.39590749e+02 2.72546232e+01
+ 2.39590789e+02 2.72559899e+01
+ 2.39591152e+02 2.72573564e+01
+ 2.39589868e+02 2.72583785e+01
+ 2.39588330e+02 2.72584619e+01
+ 2.39587295e+02 2.72573578e+01
+ 2.39586792e+02 2.72568001e+01
+ 2.39585907e+02 2.72573583e+01
+ 2.39586407e+02 2.72587248e+01
+ 2.39585256e+02 2.72598577e+01
+ 2.39584921e+02 2.72600920e+01
+ 2.39584291e+02 2.72614588e+01
+ 2.39583720e+02 2.72618333e+01
+ 2.39583104e+02 2.72614592e+01
+ 2.39582182e+02 2.72608675e+01
+ 2.39581326e+02 2.72614598e+01
+ 2.39580645e+02 2.72626710e+01
+ 2.39579108e+02 2.72623359e+01
+ 2.39578492e+02 2.72614606e+01
+ 2.39577570e+02 2.72610753e+01
+ 2.39576319e+02 2.72600946e+01
+ 2.39576032e+02 2.72599714e+01
+ 2.39575745e+02 2.72600947e+01
+ 2.39576032e+02 2.72604422e+01
+ 2.39577002e+02 2.72614611e+01
+ 2.39576302e+02 2.72628279e+01
+ 2.39576033e+02 2.72637853e+01
+ 2.39575757e+02 2.72641947e+01
+ 2.39574496e+02 2.72652142e+01
+ 2.39573795e+02 2.72641953e+01
+ 2.39572958e+02 2.72629782e+01
+ 2.39571421e+02 2.72640968e+01
+ 2.39569883e+02 2.72640517e+01
+ 2.39568346e+02 2.72630354e+01
+ 2.39566808e+02 2.72641242e+01
+ 2.39565443e+02 2.72628305e+01
+ 2.39565424e+02 2.72614638e+01
+ 2.39565270e+02 2.72612459e+01
+ 2.39564964e+02 2.72614639e+01
+ 2.39563733e+02 2.72620113e+01
+ 2.39562748e+02 2.72614643e+01
+ 2.39562195e+02 2.72611574e+01
+ 2.39561003e+02 2.72600980e+01
+ 2.39560658e+02 2.72598747e+01
+ 2.39560312e+02 2.72600981e+01
+ 2.39559120e+02 2.72608689e+01
+ 2.39557583e+02 2.72606590e+01
+ 2.39556629e+02 2.72614653e+01
+ 2.39556046e+02 2.72621685e+01
+ 2.39555039e+02 2.72614655e+01
+ 2.39554508e+02 2.72611196e+01
+ 2.39553183e+02 2.72600990e+01
+ 2.39553065e+02 2.72587324e+01
+ 2.39552970e+02 2.72586805e+01
+ 2.39552889e+02 2.72587324e+01
+ 2.39551433e+02 2.72593796e+01
+ 2.39549896e+02 2.72591306e+01
+ 2.39548358e+02 2.72587724e+01
+ 2.39546821e+02 2.72588973e+01
+ 2.39546705e+02 2.72587329e+01
+ 2.39546821e+02 2.72586233e+01
+ 2.39547785e+02 2.72573662e+01
+ 2.39548341e+02 2.72559995e+01
+ 2.39547811e+02 2.72546329e+01
+ 2.39548050e+02 2.72532662e+01
+ 2.39548358e+02 2.72530346e+01
+ 2.39548911e+02 2.72518994e+01
+ 2.39549484e+02 2.72505327e+01
+ 2.39549895e+02 2.72502591e+01
+ 2.39550623e+02 2.72491660e+01
+ 2.39551432e+02 2.72480875e+01
+ 2.39551797e+02 2.72477992e+01
+ 2.39551432e+02 2.72474000e+01
+ 2.39549894e+02 2.72465712e+01
+ 2.39549583e+02 2.72464327e+01
+ 2.39549221e+02 2.72450661e+01
+ 2.39549849e+02 2.72436994e+01
+ 2.39549894e+02 2.72436439e+01
+ 2.39551431e+02 2.72436684e+01
+ 2.39552558e+02 2.72423324e+01
+ 2.39552864e+02 2.72409657e+01
+ 2.39552463e+02 2.72395991e+01
+ 2.39552101e+02 2.72382325e+01
+ 2.39552968e+02 2.72378287e+01
+ 2.39553497e+02 2.72382323e+01
+ 2.39554505e+02 2.72388523e+01
+ 2.39555152e+02 2.72382321e+01
+ 2.39556042e+02 2.72370018e+01
+ 2.39556226e+02 2.72368653e+01
+ 2.39557579e+02 2.72356622e+01
+ 2.39557751e+02 2.72354985e+01
+ 2.39557753e+02 2.72341318e+01
+ 2.39558500e+02 2.72327650e+01
+ 2.39557578e+02 2.72320367e+01
+ 2.39556991e+02 2.72313986e+01
+ 2.39557578e+02 2.72310962e+01
+ 2.39559115e+02 2.72309873e+01
+ 2.39559731e+02 2.72313982e+01
+ 2.39560652e+02 2.72315097e+01
+ 2.39560726e+02 2.72313980e+01
+ 2.39561266e+02 2.72300313e+01
+ 2.39560651e+02 2.72288963e+01
+ 2.39560409e+02 2.72286647e+01
+ 2.39560651e+02 2.72284138e+01
+ 2.39562157e+02 2.72272978e+01
+ 2.39562188e+02 2.72272285e+01
+ 2.39563725e+02 2.72265449e+01
+ 2.39564031e+02 2.72259308e+01
+ 2.39565261e+02 2.72253153e+01
+ 2.39566798e+02 2.72246317e+01
+ 2.39566851e+02 2.72245635e+01
+ 2.39568335e+02 2.72234394e+01
+ 2.39568655e+02 2.72231965e+01
+ 2.39568334e+02 2.72218853e+01
+ 2.39568316e+02 2.72218299e+01
+ 2.39568334e+02 2.72218047e+01
+ 2.39569207e+02 2.72204630e+01
+ 2.39568763e+02 2.72190965e+01
+ 2.39569870e+02 2.72186275e+01
+ 2.39570792e+02 2.72177294e+01
+ 2.39571406e+02 2.72166811e+01
+ 2.39572944e+02 2.72173186e+01
+ 2.39574480e+02 2.72164707e+01
+ 2.39575364e+02 2.72177282e+01
+ 2.39574669e+02 2.72190951e+01
+ 2.39576018e+02 2.72196944e+01
+ 2.39576753e+02 2.72190945e+01
+ 2.39577323e+02 2.72177277e+01
+ 2.39577554e+02 2.72174928e+01
+ 2.39579090e+02 2.72164383e+01
+ 2.39580627e+02 2.72167471e+01
+ 2.39581373e+02 2.72163598e+01
+ 2.39580627e+02 2.72150330e+01
+ 2.39579090e+02 2.72162048e+01
+ 2.39578031e+02 2.72149941e+01
+ 2.39579090e+02 2.72142232e+01
+ 2.39580627e+02 2.72149010e+01
+ 2.39582163e+02 2.72138386e+01
+ 2.39583393e+02 2.72149925e+01
+ 2.39583700e+02 2.72153631e+01
+ 2.39584089e+02 2.72149923e+01
+ 2.39585237e+02 2.72143540e+01
+ 2.39586773e+02 2.72138001e+01
+ 2.39586857e+02 2.72136247e+01
+ 2.39588310e+02 2.72124396e+01
+ 2.39588593e+02 2.72122574e+01
+ 2.39589846e+02 2.72115502e+01
+ 2.39591016e+02 2.72108898e+01
+ 2.39591382e+02 2.72105044e+01
+ 2.39592116e+02 2.72108894e+01
+ 2.39591883e+02 2.72122562e+01
+ 2.39592920e+02 2.72130756e+01
+ 2.39594302e+02 2.72122552e+01
+ 2.39594456e+02 2.72114333e+01
+ 2.39595993e+02 2.72113512e+01
+ 2.39597082e+02 2.72108874e+01
+ 2.39595992e+02 2.72101775e+01
+ 2.39594456e+02 2.72107795e+01
+ 2.39592919e+02 2.72104668e+01
+ 2.39592165e+02 2.72095227e+01
+ 2.39592918e+02 2.72083003e+01
+ 2.39594455e+02 2.72088930e+01
+ 2.39595992e+02 2.72089743e+01
+ 2.39597499e+02 2.72081539e+01
+ 2.39597528e+02 2.72081193e+01
+ 2.39597632e+02 2.72081538e+01
+ 2.39599065e+02 2.72086994e+01
+ 2.39599924e+02 2.72081529e+01
+ 2.39600138e+02 2.72067861e+01
+ 2.39600600e+02 2.72065511e+01
+ 2.39600768e+02 2.72067858e+01
+
+ 2.39594877e+02 2.72067883e+01
+ 2.39594454e+02 2.72070201e+01
+ 2.39594337e+02 2.72067885e+01
+ 2.39594454e+02 2.72067000e+01
+ 2.39594877e+02 2.72067883e+01
+
+ 2.39584118e+02 2.72067923e+01
+ 2.39583697e+02 2.72071016e+01
+ 2.39583316e+02 2.72067925e+01
+ 2.39583697e+02 2.72065554e+01
+ 2.39584118e+02 2.72067923e+01
+
+ 2.39604221e+02 2.72081509e+01
+ 2.39603983e+02 2.72095177e+01
+ 2.39603676e+02 2.72097753e+01
+ 2.39603416e+02 2.72095179e+01
+ 2.39603128e+02 2.72081514e+01
+ 2.39603674e+02 2.72078593e+01
+ 2.39604221e+02 2.72081509e+01
+
+ 2.39611974e+02 2.72095137e+01
+ 2.39611359e+02 2.72100611e+01
+ 2.39611069e+02 2.72095142e+01
+ 2.39611359e+02 2.72091773e+01
+ 2.39611974e+02 2.72095137e+01
+
+ 2.39605787e+02 2.72108835e+01
+ 2.39605213e+02 2.72116896e+01
+ 2.39604524e+02 2.72108841e+01
+ 2.39605213e+02 2.72102458e+01
+ 2.39605787e+02 2.72108835e+01
+
+ 2.39582800e+02 2.72108927e+01
+ 2.39582162e+02 2.72116220e+01
+ 2.39581445e+02 2.72108931e+01
+ 2.39582162e+02 2.72103259e+01
+ 2.39582800e+02 2.72108927e+01
+
+ 2.39614937e+02 2.72122454e+01
+ 2.39614435e+02 2.72132301e+01
+ 2.39613783e+02 2.72122461e+01
+ 2.39614434e+02 2.72114254e+01
+ 2.39614937e+02 2.72122454e+01
+
+ 2.39613002e+02 2.72136131e+01
+ 2.39612898e+02 2.72136363e+01
+ 2.39611362e+02 2.72145436e+01
+ 2.39610578e+02 2.72136144e+01
+ 2.39611361e+02 2.72130976e+01
+ 2.39612898e+02 2.72135855e+01
+ 2.39613002e+02 2.72136131e+01
+
+ 2.39571645e+02 2.72136292e+01
+ 2.39571406e+02 2.72141079e+01
+ 2.39570818e+02 2.72136294e+01
+ 2.39571406e+02 2.72133899e+01
+ 2.39571645e+02 2.72136292e+01
+
+ 2.39610692e+02 2.72149810e+01
+ 2.39609826e+02 2.72157521e+01
+ 2.39608873e+02 2.72149819e+01
+ 2.39609825e+02 2.72144516e+01
+ 2.39610692e+02 2.72149810e+01
+
+ 2.39603504e+02 2.72149846e+01
+ 2.39603679e+02 2.72153477e+01
+ 2.39603924e+02 2.72149844e+01
+ 2.39603678e+02 2.72144397e+01
+ 2.39603504e+02 2.72149846e+01
+
+ 2.39576693e+02 2.72149945e+01
+ 2.39576744e+02 2.72163612e+01
+ 2.39576017e+02 2.72169539e+01
+ 2.39574684e+02 2.72163617e+01
+ 2.39575533e+02 2.72149948e+01
+ 2.39576016e+02 2.72148442e+01
+ 2.39576693e+02 2.72149945e+01
+
+ 2.39617388e+02 2.72163441e+01
+ 2.39615975e+02 2.72171833e+01
+ 2.39615090e+02 2.72163453e+01
+ 2.39615974e+02 2.72158611e+01
+ 2.39617388e+02 2.72163441e+01
+
+ 2.39614748e+02 2.72204455e+01
+ 2.39614440e+02 2.72206512e+01
+ 2.39614070e+02 2.72204459e+01
+ 2.39614440e+02 2.72203283e+01
+ 2.39614748e+02 2.72204455e+01
+
+ 2.39564205e+02 2.72204641e+01
+ 2.39563723e+02 2.72211673e+01
+ 2.39563354e+02 2.72204642e+01
+ 2.39563723e+02 2.72200540e+01
+ 2.39564205e+02 2.72204641e+01
+
+ 2.39616705e+02 2.72218111e+01
+ 2.39615978e+02 2.72227003e+01
+ 2.39615311e+02 2.72218119e+01
+ 2.39615977e+02 2.72211005e+01
+ 2.39616705e+02 2.72218111e+01
+
+ 2.39562774e+02 2.72218310e+01
+ 2.39562187e+02 2.72229799e+01
+ 2.39561110e+02 2.72218313e+01
+ 2.39562187e+02 2.72216184e+01
+ 2.39562774e+02 2.72218310e+01
+
+ 2.39617776e+02 2.72231772e+01
+ 2.39617516e+02 2.72233278e+01
+ 2.39616839e+02 2.72231777e+01
+ 2.39617515e+02 2.72228010e+01
+ 2.39617776e+02 2.72231772e+01
+
+ 2.39566703e+02 2.72231969e+01
+ 2.39565261e+02 2.72239914e+01
+ 2.39563724e+02 2.72238228e+01
+ 2.39562493e+02 2.72231977e+01
+ 2.39563724e+02 2.72227598e+01
+ 2.39565261e+02 2.72224392e+01
+ 2.39566703e+02 2.72231969e+01
+
+ 2.39560729e+02 2.72259313e+01
+ 2.39560651e+02 2.72259591e+01
+ 2.39560622e+02 2.72259314e+01
+ 2.39560651e+02 2.72259168e+01
+ 2.39560729e+02 2.72259313e+01
+
+ 2.39556611e+02 2.72272986e+01
+ 2.39556040e+02 2.72278912e+01
+ 2.39554503e+02 2.72275116e+01
+ 2.39554099e+02 2.72272989e+01
+ 2.39554503e+02 2.72270780e+01
+ 2.39556040e+02 2.72269245e+01
+ 2.39556611e+02 2.72272986e+01
+
+ 2.39614815e+02 2.72286455e+01
+ 2.39614446e+02 2.72289744e+01
+ 2.39613983e+02 2.72286459e+01
+ 2.39614446e+02 2.72285674e+01
+ 2.39614815e+02 2.72286455e+01
+
+ 2.39563145e+02 2.72286643e+01
+ 2.39563725e+02 2.72290357e+01
+ 2.39564062e+02 2.72286641e+01
+ 2.39563725e+02 2.72276320e+01
+ 2.39563145e+02 2.72286643e+01
+
+ 2.39558290e+02 2.72286651e+01
+ 2.39557577e+02 2.72292229e+01
+ 2.39556655e+02 2.72286653e+01
+ 2.39557577e+02 2.72279313e+01
+ 2.39558290e+02 2.72286651e+01
+
+ 2.39554735e+02 2.72341322e+01
+ 2.39554504e+02 2.72342817e+01
+ 2.39554407e+02 2.72341322e+01
+ 2.39554504e+02 2.72340226e+01
+ 2.39554735e+02 2.72341322e+01
+
+ 2.39557327e+02 2.72354985e+01
+ 2.39556042e+02 2.72366421e+01
+ 2.39555297e+02 2.72354988e+01
+ 2.39556041e+02 2.72347126e+01
+ 2.39557327e+02 2.72354985e+01
+
+ 2.39555765e+02 2.72368654e+01
+ 2.39554505e+02 2.72374261e+01
+ 2.39553956e+02 2.72368656e+01
+ 2.39554504e+02 2.72362427e+01
+ 2.39555765e+02 2.72368654e+01
+
+ 2.39605048e+02 2.72423171e+01
+ 2.39604542e+02 2.72436840e+01
+ 2.39605233e+02 2.72438726e+01
+ 2.39606154e+02 2.72436833e+01
+ 2.39605785e+02 2.72423168e+01
+ 2.39605232e+02 2.72422054e+01
+ 2.39605048e+02 2.72423171e+01
+
+ 2.39545590e+02 2.72450663e+01
+ 2.39545283e+02 2.72453399e+01
+ 2.39544975e+02 2.72450664e+01
+ 2.39545283e+02 2.72448166e+01
+ 2.39545590e+02 2.72450663e+01
+
+ 2.39600793e+02 2.72505191e+01
+ 2.39600625e+02 2.72506219e+01
+ 2.39600483e+02 2.72505192e+01
+ 2.39600625e+02 2.72502452e+01
+ 2.39600793e+02 2.72505191e+01
+
+ 2.39551537e+02 2.72559992e+01
+ 2.39552970e+02 2.72561653e+01
+ 2.39553113e+02 2.72559990e+01
+ 2.39552970e+02 2.72557260e+01
+ 2.39551537e+02 2.72559992e+01
+
+ 2.39548410e+02 2.72559995e+01
+ 2.39549199e+02 2.72573661e+01
+ 2.39549896e+02 2.72582950e+01
+ 2.39550699e+02 2.72573659e+01
+ 2.39551381e+02 2.72559992e+01
+ 2.39549895e+02 2.72555333e+01
+ 2.39548410e+02 2.72559995e+01
+
+ 2.39565188e+02 2.72587305e+01
+ 2.39565270e+02 2.72589484e+01
+ 2.39566807e+02 2.72589192e+01
+ 2.39567268e+02 2.72587301e+01
+ 2.39566807e+02 2.72586132e+01
+ 2.39565270e+02 2.72586624e+01
+ 2.39565188e+02 2.72587305e+01
+
+ 2.39544146e+02 2.72587331e+01
+ 2.39543746e+02 2.72592071e+01
+ 2.39543450e+02 2.72587331e+01
+ 2.39543746e+02 2.72584487e+01
+ 2.39544146e+02 2.72587331e+01
+
+ 2.39588566e+02 2.72600907e+01
+ 2.39588331e+02 2.72604275e+01
+ 2.39586794e+02 2.72603411e+01
+ 2.39586076e+02 2.72600916e+01
+ 2.39586794e+02 2.72596127e+01
+ 2.39588331e+02 2.72595436e+01
+ 2.39588566e+02 2.72600907e+01
+
+ 2.39554119e+02 2.72614656e+01
+ 2.39552971e+02 2.72625593e+01
+ 2.39552433e+02 2.72614658e+01
+ 2.39552971e+02 2.72602880e+01
+ 2.39554119e+02 2.72614656e+01
+
+ 2.39546883e+02 2.72614662e+01
+ 2.39546821e+02 2.72614876e+01
+ 2.39546799e+02 2.72614663e+01
+ 2.39546821e+02 2.72614355e+01
+ 2.39546883e+02 2.72614662e+01
+
+ 2.39586864e+02 2.72628246e+01
+ 2.39586795e+02 2.72629511e+01
+ 2.39586679e+02 2.72628247e+01
+ 2.39586795e+02 2.72627425e+01
+ 2.39586864e+02 2.72628246e+01
+
+ 2.39562811e+02 2.72628310e+01
+ 2.39562196e+02 2.72629932e+01
+ 2.39560965e+02 2.72628313e+01
+ 2.39562196e+02 2.72619557e+01
+ 2.39562811e+02 2.72628310e+01
+
+ 2.39555496e+02 2.72628321e+01
+ 2.39554509e+02 2.72640234e+01
+ 2.39553258e+02 2.72628324e+01
+ 2.39554508e+02 2.72617899e+01
+ 2.39555496e+02 2.72628321e+01
+
+ 2.39548623e+02 2.72628328e+01
+ 2.39548359e+02 2.72629424e+01
+ 2.39548227e+02 2.72628328e+01
+ 2.39548359e+02 2.72625589e+01
+ 2.39548623e+02 2.72628328e+01
+
+ 2.39578946e+02 2.72641938e+01
+ 2.39577571e+02 2.72650976e+01
+ 2.39576196e+02 2.72641946e+01
+ 2.39577571e+02 2.72636006e+01
+ 2.39578946e+02 2.72641938e+01
+
+ 2.39566697e+02 2.72641969e+01
+ 2.39565271e+02 2.72651268e+01
+ 2.39564781e+02 2.72641973e+01
+ 2.39565271e+02 2.72630352e+01
+ 2.39566697e+02 2.72641969e+01
+
+ 2.39557772e+02 2.72641985e+01
+ 2.39557584e+02 2.72643992e+01
+ 2.39557436e+02 2.72641985e+01
+ 2.39557584e+02 2.72640400e+01
+ 2.39557772e+02 2.72641985e+01
+
+ 2.39570346e+02 2.72655628e+01
+ 2.39569884e+02 2.72656596e+01
+ 2.39569781e+02 2.72655629e+01
+ 2.39569884e+02 2.72650150e+01
+ 2.39570346e+02 2.72655628e+01
+
+ 2.39567390e+02 2.72655634e+01
+ 2.39566809e+02 2.72662275e+01
+ 2.39565763e+02 2.72655638e+01
+ 2.39566808e+02 2.72642959e+01
+ 2.39567390e+02 2.72655634e+01
+
+ 2.39564534e+02 2.72655640e+01
+ 2.39563734e+02 2.72659027e+01
+ 2.39563263e+02 2.72655642e+01
+ 2.39563734e+02 2.72653008e+01
+ 2.39564534e+02 2.72655640e+01
+
+ 2.39561189e+02 2.72655646e+01
+ 2.39560659e+02 2.72659885e+01
+ 2.39560098e+02 2.72655648e+01
+ 2.39560659e+02 2.72652724e+01
+ 2.39561189e+02 2.72655646e+01
+
+ 2.39560593e+02 2.72723980e+01
+ 2.39559123e+02 2.72736705e+01
+ 2.39557680e+02 2.72723985e+01
+ 2.39559122e+02 2.72710885e+01
+ 2.39560593e+02 2.72723980e+01
+
+ 2.39488815e+02 2.72819580e+01
+ 2.39488389e+02 2.72823260e+01
+ 2.39487996e+02 2.72819577e+01
+ 2.39488390e+02 2.72815744e+01
+ 2.39488815e+02 2.72819580e+01
+
+ 2.39624197e+02 2.72860400e+01
+ 2.39625213e+02 2.72874060e+01
+ 2.39625049e+02 2.72887728e+01
+ 2.39623715e+02 2.72899233e+01
+ 2.39622177e+02 2.72900810e+01
+ 2.39620666e+02 2.72887754e+01
+ 2.39620638e+02 2.72887196e+01
+ 2.39619308e+02 2.72874096e+01
+ 2.39620636e+02 2.72861550e+01
+ 2.39620857e+02 2.72860420e+01
+ 2.39622173e+02 2.72849775e+01
+ 2.39623712e+02 2.72856937e+01
+ 2.39624197e+02 2.72860400e+01
+
+ 2.39501218e+02 2.73010951e+01
+ 2.39500685e+02 2.73015486e+01
+ 2.39500157e+02 2.73010948e+01
+ 2.39500685e+02 2.73006048e+01
+ 2.39501218e+02 2.73010951e+01
+
+ 2.39625446e+02 2.73161058e+01
+ 2.39625273e+02 2.73162574e+01
+ 2.39624974e+02 2.73161061e+01
+ 2.39625273e+02 2.73159446e+01
+ 2.39625446e+02 2.73161058e+01
+
+ 2.39591468e+02 2.72218230e+01
+ 2.39592925e+02 2.72230655e+01
+ 2.39593049e+02 2.72231890e+01
+ 2.39592925e+02 2.72234268e+01
+ 2.39592703e+02 2.72245558e+01
+ 2.39592926e+02 2.72247464e+01
+ 2.39593515e+02 2.72245555e+01
+ 2.39594462e+02 2.72240065e+01
+ 2.39596000e+02 2.72243954e+01
+ 2.39596156e+02 2.72245544e+01
+ 2.39596000e+02 2.72247891e+01
+ 2.39595645e+02 2.72259213e+01
+ 2.39596001e+02 2.72272656e+01
+ 2.39597538e+02 2.72265209e+01
+ 2.39598179e+02 2.72272869e+01
+ 2.39598934e+02 2.72286533e+01
+ 2.39598126e+02 2.72300203e+01
+ 2.39599077e+02 2.72307712e+01
+ 2.39599535e+02 2.72313863e+01
+ 2.39599078e+02 2.72320305e+01
+ 2.39598019e+02 2.72327537e+01
+ 2.39598006e+02 2.72341203e+01
+ 2.39597542e+02 2.72346599e+01
+ 2.39596443e+02 2.72354876e+01
+ 2.39596006e+02 2.72360583e+01
+ 2.39595653e+02 2.72368546e+01
+ 2.39596007e+02 2.72377732e+01
+ 2.39597098e+02 2.72382207e+01
+ 2.39596007e+02 2.72384985e+01
+ 2.39594470e+02 2.72384298e+01
+ 2.39592933e+02 2.72388865e+01
+ 2.39592396e+02 2.72395893e+01
+ 2.39592537e+02 2.72409559e+01
+ 2.39592103e+02 2.72423227e+01
+ 2.39591398e+02 2.72429871e+01
+ 2.39589861e+02 2.72433765e+01
+ 2.39589576e+02 2.72436903e+01
+ 2.39588324e+02 2.72448416e+01
+ 2.39587839e+02 2.72450576e+01
+ 2.39586788e+02 2.72458371e+01
+ 2.39585250e+02 2.72458202e+01
+ 2.39583800e+02 2.72450590e+01
+ 2.39583713e+02 2.72449996e+01
+ 2.39583656e+02 2.72450591e+01
+ 2.39583491e+02 2.72464258e+01
+ 2.39582176e+02 2.72470105e+01
+ 2.39580639e+02 2.72467238e+01
+ 2.39580281e+02 2.72464268e+01
+ 2.39579676e+02 2.72450603e+01
+ 2.39579101e+02 2.72446674e+01
+ 2.39577564e+02 2.72441795e+01
+ 2.39576836e+02 2.72436945e+01
+ 2.39576026e+02 2.72433708e+01
+ 2.39575116e+02 2.72436949e+01
+ 2.39574489e+02 2.72445864e+01
+ 2.39574368e+02 2.72450618e+01
+ 2.39572953e+02 2.72457061e+01
+ 2.39571704e+02 2.72464291e+01
+ 2.39571416e+02 2.72466089e+01
+ 2.39570260e+02 2.72464295e+01
+ 2.39569878e+02 2.72456372e+01
+ 2.39569729e+02 2.72450629e+01
+ 2.39569407e+02 2.72436963e+01
+ 2.39569236e+02 2.72423297e+01
+ 2.39568723e+02 2.72409631e+01
+ 2.39568339e+02 2.72404100e+01
+ 2.39567641e+02 2.72395967e+01
+ 2.39566802e+02 2.72383085e+01
+ 2.39566717e+02 2.72382302e+01
+ 2.39566802e+02 2.72377995e+01
+ 2.39567854e+02 2.72368633e+01
+ 2.39568127e+02 2.72354966e+01
+ 2.39568338e+02 2.72352434e+01
+ 2.39568795e+02 2.72341298e+01
+ 2.39568432e+02 2.72327632e+01
+ 2.39569874e+02 2.72316636e+01
+ 2.39570057e+02 2.72313962e+01
+ 2.39571411e+02 2.72303309e+01
+ 2.39571568e+02 2.72300292e+01
+ 2.39571491e+02 2.72286625e+01
+ 2.39572897e+02 2.72272955e+01
+ 2.39572947e+02 2.72272064e+01
+ 2.39573167e+02 2.72259288e+01
+ 2.39574483e+02 2.72254875e+01
+ 2.39576020e+02 2.72247396e+01
+ 2.39576174e+02 2.72245613e+01
+ 2.39577556e+02 2.72238937e+01
+ 2.39579093e+02 2.72240711e+01
+ 2.39580417e+02 2.72231934e+01
+ 2.39580630e+02 2.72229879e+01
+ 2.39582166e+02 2.72223868e+01
+ 2.39583404e+02 2.72218258e+01
+ 2.39583703e+02 2.72216079e+01
+ 2.39585240e+02 2.72206487e+01
+ 2.39586777e+02 2.72216662e+01
+ 2.39588314e+02 2.72213926e+01
+ 2.39589566e+02 2.72218237e+01
+ 2.39589851e+02 2.72219012e+01
+ 2.39591111e+02 2.72218231e+01
+ 2.39591388e+02 2.72217674e+01
+ 2.39591468e+02 2.72218230e+01
+
+ 2.39597559e+02 2.72368538e+01
+ 2.39597543e+02 2.72370320e+01
+ 2.39597499e+02 2.72368539e+01
+ 2.39597543e+02 2.72368316e+01
+ 2.39597559e+02 2.72368538e+01
+
+ 2.39595183e+02 2.72409548e+01
+ 2.39594472e+02 2.72419990e+01
+ 2.39593264e+02 2.72409556e+01
+ 2.39594471e+02 2.72402124e+01
+ 2.39595183e+02 2.72409548e+01
+
+ 2.39567188e+02 2.72423301e+01
+ 2.39567411e+02 2.72436968e+01
+ 2.39567825e+02 2.72450633e+01
+ 2.39566804e+02 2.72459985e+01
+ 2.39565910e+02 2.72450637e+01
+ 2.39566294e+02 2.72436970e+01
+ 2.39566435e+02 2.72423303e+01
+ 2.39566803e+02 2.72416766e+01
+ 2.39567188e+02 2.72423301e+01
+
+ 2.39579780e+02 2.72477936e+01
+ 2.39579102e+02 2.72481183e+01
+ 2.39578611e+02 2.72477939e+01
+ 2.39579102e+02 2.72471610e+01
+ 2.39579780e+02 2.72477936e+01
+
+ 2.39560286e+02 2.72723981e+01
+ 2.39559123e+02 2.72734051e+01
+ 2.39557981e+02 2.72723984e+01
+ 2.39559122e+02 2.72713617e+01
+ 2.39560286e+02 2.72723981e+01
+
+ 2.39622694e+02 2.72860409e+01
+ 2.39623712e+02 2.72861240e+01
+ 2.39625106e+02 2.72874061e+01
+ 2.39624463e+02 2.72887731e+01
+ 2.39623714e+02 2.72894184e+01
+ 2.39622177e+02 2.72898676e+01
+ 2.39620913e+02 2.72887753e+01
+ 2.39620638e+02 2.72882281e+01
+ 2.39619807e+02 2.72874093e+01
+ 2.39620637e+02 2.72866251e+01
+ 2.39621775e+02 2.72860414e+01
+ 2.39622174e+02 2.72857190e+01
+ 2.39622694e+02 2.72860409e+01
+
+ 2.39559516e+02 2.72723982e+01
+ 2.39559123e+02 2.72727386e+01
+ 2.39558737e+02 2.72723983e+01
+ 2.39559123e+02 2.72720479e+01
+ 2.39559516e+02 2.72723982e+01
+
+ 2.39624837e+02 2.72874062e+01
+ 2.39623714e+02 2.72886300e+01
+ 2.39623220e+02 2.72887739e+01
+ 2.39622177e+02 2.72893315e+01
+ 2.39621533e+02 2.72887749e+01
+ 2.39620643e+02 2.72874088e+01
+ 2.39622174e+02 2.72860534e+01
+ 2.39623712e+02 2.72863713e+01
+ 2.39624837e+02 2.72874062e+01
+
+ 2.39624163e+02 2.72874067e+01
+ 2.39623713e+02 2.72878965e+01
+ 2.39622176e+02 2.72887523e+01
+ 2.39620685e+02 2.72874088e+01
+ 2.39622174e+02 2.72860905e+01
+ 2.39623713e+02 2.72869924e+01
+ 2.39624163e+02 2.72874067e+01
+
+ 2.39623631e+02 2.72874070e+01
+ 2.39622176e+02 2.72886572e+01
+ 2.39620790e+02 2.72874087e+01
+ 2.39622174e+02 2.72861838e+01
+ 2.39623631e+02 2.72874070e+01
+
diff --git a/ds9/doc/user/contour/dsscontour.png b/ds9/doc/user/contour/dsscontour.png
new file mode 100644
index 0000000..c09a5fd
--- /dev/null
+++ b/ds9/doc/user/contour/dsscontour.png
Binary files differ
diff --git a/ds9/doc/user/contour/dssdialog.png b/ds9/doc/user/contour/dssdialog.png
new file mode 100644
index 0000000..88d425a
--- /dev/null
+++ b/ds9/doc/user/contour/dssdialog.png
Binary files differ
diff --git a/ds9/doc/user/contour/index.html b/ds9/doc/user/contour/index.html
new file mode 100644
index 0000000..88e9ca2
--- /dev/null
+++ b/ds9/doc/user/contour/index.html
@@ -0,0 +1,269 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Contours - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Contours</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ Contours are curves along which the pixels have a constant
+ value. ds9 can create and display contours as an overlay on
+ a data image. The contours can be copied between frames in
+ the current session or saved to file for future use with ds9.
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li><strong><a href="index.html#create">Creating Contours on a Dataset</a></strong></li>
+<li><strong><a href="index.html#copy">Copying the Contours to Another Frame</a></strong></li>
+<li><strong><a href="index.html#save">Saving the Contours</a></strong></li>
+<li><strong><a href="index.html#convert">Converting to Polygons and Saving</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#dialog">Figure 1: Contour Parameters dialog box</a></li>
+<li><a href="#xraycontour">Figure 2: X-ray data with contours</a></li>
+<li><a href="#dssdialog">Figure 3: SAO-DSS Server dialog box</a></li>
+<li><a href="#dsscontour">Figure 4: X-ray and optical data with contours</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="create">Creating Contours on a Dataset</a></h2>
+
+
+ <p>
+ This thread uses Chandra data from an observation of the
+ galaxy cluster Abell 2142 (ObsID 5005).
+ </p>
+
+ <p>
+ After loading the data into ds9 and setting the desired
+ scale, click on the "Contours" item in the "Analysis" menu
+ to turn on contour display. Open the "Contour Parameters"
+ window from "Analysis → Contours Parameters". There
+ are two sliding scales which are used to set the number and
+ smoothness of the contours and fields for setting the range
+ of values to use.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="dialog">Figure 1: Contour Parameters dialog box</a></h3></div>
+<div><img alt='[The "Contour Parameters" dialog box has sliding scales to set the number and smoothness of the contours and fields for setting the range of values.]' src="dialog.png"></div>
+</div>
+
+ <p>
+ Typically, you will want to generate between 1 and 10
+ contours; larger numbers will take longer to generate and
+ display. A smoothness level of 1 will evaluate the contour
+ at each image pixel, while a level of 2 will evaluate the
+ contour at every other pixel, and so on. A larger smoothing
+ will generate contours more quickly, but less detail will be
+ available.
+ </p>
+
+ <p>
+ By default, the range of the data scale is filled in as the
+ limits. Under the "Method" menu, there are two choices:
+ </p>
+
+ <ol type="1">
+ <li>
+ block (the default) - blocks down the image by the
+ smoothness factor before contours are calculated. The
+ larger the smoothness, the faster the result.
+ </li>
+
+ <li>
+ smooth - smooths the image before calculating contours.
+ The larger the smoothness, the slower the result.
+ </li>
+ </ol>
+
+ <p>
+ In this example, the number of levels is set to 6 and the
+ smoothing is set to 5. The contours will be generated over
+ the limit 1 to 100. The default method (block) is used.
+ </p>
+
+ <p>
+ After clicking the "Generate" button, the list of contours
+ is calculated and displayed in the "Levels" portion of the window.
+ Click "Apply" and the ds9 display is updated with the new
+ contour levels, as shown in <a href="#xraycontour">Figure 2</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="xraycontour">Figure 2: X-ray data with contours</a></h3></div>
+<div><img alt="[Diffuse emission with contours overlaid; a point source is visible in the upper left corner of the image.]" src="xraycontour.png"></div>
+</div>
+
+ <p>
+ The contour parameters can be adjusted until the desired
+ result is achieved. Be sure to click "Generate" whenever
+ an adjustment is made so that the levels are recalculated.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="copy">Copying the Contours to Another Frame</a></h2>
+
+
+ <p>
+ In this section, we take the X-ray contours just generated
+ and display them on an optional image from the Digital Sky Survey (DSS).
+ </p>
+
+ <p>
+ From the "Analysis → Image Servers" menu, select one
+ of the DSS server options (e.g. "SAO-DSS"). The server
+ dialog box allows you to retrieve an optical image of the
+ field of your observation and load it into a new frame. The
+ default retrieval image size and (RA,Dec) is equal to the
+ size and center of the field currently displayed. Here the
+ width and height have been set to 40, but the (RA,Dec)
+ determined by ds9 are used.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="dssdialog">Figure 3: SAO-DSS Server dialog box</a></h3></div>
+<div><img alt="[The fields for Ra, Dec, width, and height are populated with values determined from the x-ray data image.]" src="dssdialog.png"></div>
+</div>
+
+ <p>
+ Click on "Retrieve" and the data is loaded into a new ds9
+ frame.
+ </p>
+
+ <p>
+ To copy the x-ray contours:
+ </p>
+
+ <ol type="1">
+ <li><p>
+ Select the frame with the X-ray data in it.
+ </p></li>
+ <li><p>
+ Use "Frame → Match Frames → WCS" to align the
+ two images.
+ </p></li>
+ <li><p>
+ To copy the contours, open the "Contour Parameters"
+ dialog again and select "Copy Contours" from the
+ "File" menu. Leave the window open, as it is needed in
+ a future step.
+ </p></li>
+ <li><p>
+ Select the frame with the optical data in it.
+ </p></li>
+ <li><p>
+ Using the "File" menu of the "Contour Parameters"
+ dialog, select "Paste Contours".
+ </p></li>
+ <li><p>
+ Adjust the parameters (if desired) in the small dialog box
+ that is displayed, then click "OK".
+ </p></li>
+ </ol>
+
+ <p>
+ The optical image now has the x-ray contours overlaid.
+ Since the WCS is the same, correlation between x-ray
+ and optical features may be seen.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="dsscontour">Figure 4: X-ray and optical data with contours</a></h3></div>
+<div><img alt="[The x-ray data is in the left frame and the optical data is in the right frame; both have the x-ray contours displayed on the data.]" src="dsscontour.png"></div>
+</div>
+
+ <p>
+ To delete contours which have been pasted into a
+ frame, select "Clear" from the "File" menu of the "Contour
+ Parameters" dialog.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="save">Saving the Contours</a></h2>
+
+
+ <p>
+ To save the contours to a text file, choose "Save Contours"
+ from the "File" menu of the "Contour Parameters" dialog.
+ The contours are saved in a text file which can be loaded
+ back into ds9 with the "Load Contours" menu item.
+ </p>
+
+ <p>
+ The contours generated in this thread have been saved as <a href="ds9.con">ds9.con</a>.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="convert">Converting to Polygons and Saving</a></h2>
+
+
+ <p>
+ The contours can be converted to ds9 polygon regions for use
+ in filtering data. Converting to polygons also allows you
+ to select and/or delete specific contours.
+ </p>
+
+ <p>
+ <strong>Note that the contours cannot be <a href="index.html#save">saved
+ in ds9 format</a> after converting.</strong> If you wish to
+ save the contours, do so before continuing.
+ </p>
+
+ <p>
+ To convert the contours, select "Convert to Polygons" from
+ the "File" menu of the "Contour Parameters" dialog. The
+ contours are now defined as ds9 polygons, e.g.
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+polygon(3535.2112,4184.5,3540.5,4179.1154,3548.5,4176.8219,3555.9012,4184.5,3548.5,4191.9558,3540.5,4190.3926)
+</pre></div>
+
+
+ <p>
+ The polygon-shaped contours can be saved as a ds9 region
+ file from the "Region Save → Regions" menu. The region
+ file for these contours has been saved as <a href="a2142.reg">a2142.reg</a>.
+ </p>
+
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">24 Jun 2009</td>
+<td>
+ Original version
+
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/contour/thread.xml b/ds9/doc/user/contour/thread.xml
new file mode 100644
index 0000000..48d4d32
--- /dev/null
+++ b/ds9/doc/user/contour/thread.xml
@@ -0,0 +1,258 @@
+<?xml version="1.0" encoding="us-ascii" ?>
+<!DOCTYPE thread>
+
+<thread>
+
+ <info>
+
+ <version>June 2009</version>
+ <title>
+ <long>Contours</long>
+ </title>
+ <history>
+ <entry day="24" month="June" year="9" who="liz">
+ Original version
+ <!-- copied in part from CIAO ds9 thread //-->
+ </entry>
+ </history>
+ </info>
+
+ <text>
+ <overview>
+
+ <synopsis>
+ <p>
+ Contours are shapes which are drawn on the data at a
+ specified pixel value. ds9 can create and display contours
+ as an overlay on an image.
+ </p>
+ </synopsis>
+ </overview>
+
+ <sectionlist>
+
+ <section id="create">
+ <title>Creating Contours on a Dataset</title>
+
+ <p>
+ This thread uses Chandra data from an observation of the
+ galaxy cluster Abell 2142 (ObsID 5005).
+ </p>
+
+ <p>
+ After loading the data into ds9 and setting the desired
+ scale, click on the "Contours" item in the "Analysis" menu
+ to turn on contour display. Open the "Contour Parameters"
+ window from "Analysis &#8594; Contours Parameters". There
+ are two sliding scales which are used to set the number and
+ smoothness of the contours and fields for setting the range
+ of values to use.
+ </p>
+
+ <figure id="dialog">
+ <title>Contour Parameters dialog box</title>
+ <description>The "Contour Parameters" dialog box has sliding
+ scales to set the number and smoothness of the contours and
+ fields for setting the range of values.</description>
+ <bitmap format="png">dialog.png</bitmap>
+ </figure>
+
+ <p>
+ Typically, you will want to generate between 1 and 10
+ contours; larger numbers will take longer to generate and
+ display. A smoothness level of 1 will evaluate the contour
+ at each image pixel, while a level of 2 will evaluate the
+ contour at every other pixel, and so on. A larger smoothing
+ will generate contours more quickly, but less detail will be
+ available.
+ </p>
+
+ <p>
+ By default, the range of the data scale is filled in as the
+ limits. Under the "Method" menu, there are two choices:
+ </p>
+
+ <list type="1">
+ <li>
+ block (the default) - blocks down the image by the
+ smoothness factor before contours are calculated. The
+ larger the smoothness, the faster the result.
+ </li>
+
+ <li>
+ smooth - smooths the image before calculating contours.
+ The larger the smoothness, the slower the result.
+ </li>
+ </list>
+
+ <p>
+ In this example, the number of levels is set to 6 and the
+ smoothing is set to 5. The contours will be generated over
+ the limit 1 to 100. The default method (block) is used.
+ </p>
+
+ <p>
+ After clicking the "Generate" button, the list of contours
+ is calculated and displayed in the "Levels" portion of the window.
+ Click "Apply" and the ds9 display is updated with the new
+ contour levels, as shown in <figlink id="xraycontour"/>.
+ </p>
+
+ <figure id="xraycontour">
+ <title>X-ray data with contours</title>
+ <description>Diffuse emission with
+ contours overlaid; a point source is visible in the upper
+ left corner of the image.</description>
+ <bitmap format="png">xraycontour.png</bitmap>
+ </figure>
+
+ <p>
+ The contour parameters can be adjusted until the desired
+ result is achieved. Be sure to click "Generate" whenever
+ an adjustment is made so that the levels are recalculated.
+ </p>
+
+ </section>
+
+ <section id="copy">
+ <title>Copying the Contours to Another Frame</title>
+
+ <p>
+ In this section, we take the X-ray contours just generated
+ and display them on an optional image from the Digital Sky Survey (DSS).
+ </p>
+
+ <p>
+ From the "Analysis &#8594; Image Servers" menu, select one
+ of the DSS server options (e.g. "SAO-DSS"). The server
+ dialog box allows you to retrieve an optical image of the
+ field of your observation and load it into a new frame. The
+ default retrieval image size and (RA,Dec) is equal to the
+ size and center of the field currently displayed. Here the
+ width and height have been set to 40, but the (RA,Dec)
+ determined by ds9 are used.
+ </p>
+
+ <figure id="dssdialog">
+ <title>SAO-DSS Server dialog box</title>
+ <description>The fields for Ra, Dec, width, and height are
+ populated with values determined from the x-ray data image.</description>
+ <bitmap format="png">dssdialog.png</bitmap>
+ </figure>
+
+ <p>
+ Click on "Retrieve" and the data is loaded into a new ds9
+ frame.
+ </p>
+
+ <p>
+ To copy the x-ray contours:
+ </p>
+
+ <list type="1">
+ <li><p>
+ Select the frame with the X-ray data in it.
+ </p></li>
+ <li><p>
+ Use "Frame &#8594; Match Frames &#8594; WCS" to align the
+ two images.
+ </p></li>
+ <li><p>
+ To copy the contours, open the "Contour Parameters"
+ dialog again and select "Copy Contours" from the
+ "File" menu. Leave the window open, as it is needed in
+ a future step.
+ </p></li>
+ <li><p>
+ Select the frame with the optical data in it.
+ </p></li>
+ <li><p>
+ Using the "File" menu of the "Contour Parameters"
+ dialog, select "Paste Contours".
+ </p></li>
+ <li><p>
+ Adjust the parameters (if desired) in the small dialog box
+ that is displayed, then click "OK".
+ </p></li>
+ </list>
+
+ <p>
+ The optical image now has the x-ray contours overlaid.
+ Since the WCS is the same, correlation between x-ray
+ and optical features may be seen.
+ </p>
+
+ <figure id="dsscontour">
+ <title>X-ray and optical data with contours</title>
+ <description>The x-ray data is in the left frame and the
+ optical data is in the right frame; both have the x-ray
+ contours displayed on the data.</description>
+ <bitmap format="png">dsscontour.png</bitmap>
+ </figure>
+
+ <p>
+ To delete contours which have been pasted into a
+ frame, select "Clear" from the "File" menu of the "Contour
+ Parameters" dialog.
+ </p>
+
+ </section>
+
+ <section id="save">
+ <title>Saving the Contours</title>
+
+ <p>
+ To save the contours to a text file, choose "Save Contours"
+ from the "File" menu of the "Contour Parameters" dialog.
+ The contours are saved in a text file which can be loaded
+ back into ds9 with the "Load Contours" menu item.
+ </p>
+
+ <p>
+ The contours generated in this thread have been saved as <a href="ds9.con">ds9.con</a>.
+ </p>
+
+ </section>
+
+ <section id="convert">
+ <title>Converting to Polygons and Saving</title>
+
+ <p>
+ The contours can be converted to ds9 polygon regions for use
+ in filtering data. Converting to polygons also allows you
+ to select and/or delete specific contours.
+ </p>
+
+ <p>
+ <strong>Note that the contours cannot be <threadlink id="save">saved
+ in ds9 format</threadlink> after converting.</strong> If you wish to
+ save the contours, do so before continuing.
+ </p>
+
+ <p>
+ To convert the contours, select "Convert to Polygons" from
+ the "File" menu of the "Contour Parameters" dialog. The
+ contours are now defined as ds9 polygons, e.g.
+ </p>
+
+<screen>
+polygon(3535.2112,4184.5,3540.5,4179.1154,3548.5,4176.8219,3555.9012,4184.5,3548.5,4191.9558,3540.5,4190.3926)
+</screen>
+
+
+ <p>
+ The polygon-shaped contours can be saved as a ds9 region
+ file from the "Region Save &#8594; Regions" menu. The region
+ file for these contours has been saved as <a href="a2142.reg">a2142.reg</a>.
+ </p>
+
+ </section>
+
+
+ </sectionlist>
+ </text>
+
+</thread>
+
+
+
diff --git a/ds9/doc/user/contour/xraycontour.png b/ds9/doc/user/contour/xraycontour.png
new file mode 100644
index 0000000..c426f91
--- /dev/null
+++ b/ds9/doc/user/contour/xraycontour.png
Binary files differ
diff --git a/ds9/doc/user/gui/button.png b/ds9/doc/user/gui/button.png
new file mode 100644
index 0000000..9ebfdaf
--- /dev/null
+++ b/ds9/doc/user/gui/button.png
Binary files differ
diff --git a/ds9/doc/user/gui/color.png b/ds9/doc/user/gui/color.png
new file mode 100644
index 0000000..b59dd4b
--- /dev/null
+++ b/ds9/doc/user/gui/color.png
Binary files differ
diff --git a/ds9/doc/user/gui/components.png b/ds9/doc/user/gui/components.png
new file mode 100644
index 0000000..63bd64d
--- /dev/null
+++ b/ds9/doc/user/gui/components.png
Binary files differ
diff --git a/ds9/doc/user/gui/frame.png b/ds9/doc/user/gui/frame.png
new file mode 100644
index 0000000..b65fdba
--- /dev/null
+++ b/ds9/doc/user/gui/frame.png
Binary files differ
diff --git a/ds9/doc/user/gui/index.html b/ds9/doc/user/gui/index.html
new file mode 100644
index 0000000..45c3d63
--- /dev/null
+++ b/ds9/doc/user/gui/index.html
@@ -0,0 +1,351 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Introduction to the ds9 Interface - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Introduction to the ds9 Interface</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ This thread provides an overview of the key components of
+ the ds9 graphical user interface (GUI).
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li>
+<strong><a href="index.html#gui">The ds9 Interface</a></strong><ol type="1">
+<li><a href="index.html#gui.menu">Menu bar</a></li>
+<li><a href="index.html#gui.info">Information panel</a></li>
+<li><a href="index.html#gui.pan">Panner</a></li>
+<li><a href="index.html#gui.mag">Magnifier</a></li>
+<li><a href="index.html#gui.buttons">Buttons</a></li>
+<li><a href="index.html#gui.frame">Display frame</a></li>
+<li><a href="index.html#gui.color">Colorbar</a></li>
+</ol>
+</li>
+<li><strong><a href="index.html#preferences">Setting and Saving View Preferences</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#components">Figure 1: The ds9 GUI</a></li>
+<li><a href="#vertical">Figure 2: The ds9 GUI, vertical layout</a></li>
+<li><a href="#menu">Figure 3: Menu bar</a></li>
+<li><a href="#menutear">Figure 4: Tearing off a Menu</a></li>
+<li><a href="#info">Figure 5: Information panel</a></li>
+<li><a href="#panner">Figure 6: Panner</a></li>
+<li><a href="#mag">Figure 7: Magnifier</a></li>
+<li><a href="#button">Figure 8: Buttons</a></li>
+<li><a href="#frame">Figure 9: Tiled frame display</a></li>
+<li><a href="#color">Figure 10: Colorbar</a></li>
+<li><a href="#prefs">Figure 11: Preferences dialog box</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="gui">The ds9 Interface</a></h2>
+
+
+ <p>
+ This thread uses Chandra data from an observation of the
+ Trapezium Cluster (ObsID 1522). The default ds9 GUI is
+ shown in <a href="#components">Figure 1</a>. The main components
+ are numbered:
+ </p>
+
+ <ol type="1">
+ <li>Menu bar</li>
+ <li>Information panel</li>
+ <li>Panner</li>
+ <li>Magnifier</li>
+ <li>Buttons</li>
+ <li>Display frame</li>
+ <li>Colorbar</li>
+ </ol>
+
+ <div class="figure">
+<div class="caption"><h3><a name="components">Figure 1: The ds9 GUI</a></h3></div>
+<div><img alt="[The default ds9 display includes the information panel, panner, magnifier, and colorbar.]" src="components.png"></div>
+</div>
+
+ <p>
+ The default setup is a "horizontal layout", with the
+ information panel, panner, magnifier, and buttons displayed
+ horizontally across the window. This may be changed to
+ "vertical layout" in the View menu (<a href="#vertical">Figure 2</a>).
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="vertical">Figure 2: The ds9 GUI, vertical layout</a></h3></div>
+<div><img alt="[In the vertical layout, the information panel, panner, magnifier, and buttons are displayed vertically at the left of the data frame.]" src="vertical.png"></div>
+</div>
+
+ <p>
+ Note that the colorbar remained horizontal at the bottom of
+ the display frame. This may be changed with the "vertical
+ colorbar" option in the "View" menu.
+ </p>
+
+ <div class="subsectionlist">
+<div class="subsection">
+<h3><a name="gui.menu">1. Menu bar</a></h3>
+
+
+ <p>
+ The menu bar provides access to all of ds9's
+ capabilities. For a complete description of each menu,
+ refer to the <a href="../../ref/gui.html">Menu bar
+ section of the Reference Manual</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="menu">Figure 3: Menu bar</a></h3></div>
+<div><img alt="[The menu bar of the ds9 GUI.]" src="menu.png"></div>
+</div>
+
+ <p>
+ All ds9 menus can be "torn off" to be a separate window
+ from the main GUI. To tear off a menu, select the
+ dashed line, which is the first item of each menu (shown
+ in <a href="#menutear">Figure 4</a>). The menu will become its
+ own window.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="menutear">Figure 4: Tearing off a Menu</a></h3></div>
+<div><img alt='[The dashed line at the top of the "View" menu is highlighted.]' src="menutear.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.info">2. Information panel</a></h3>
+
+
+ <p>
+ The information panel displays information about the
+ data file and the values at the cursor position. In
+ <a href="#info">Figure 5</a>, the object name has been
+ loaded from the header of the data file. The image
+ value and position (in WCS, physical, and image
+ coordinates) are updated in real time as the cursor is
+ moved.
+ </p>
+
+ <p>
+ The fields of the information panel can be customized
+ from the "View" menu. Any of the default entries can be
+ removed, and additional fields can be added
+ (e.g. detector coordinates, min/max data values).
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="info">Figure 5: Information panel</a></h3></div>
+<div><img alt="[The information panel of the ds9 GUI.]" src="info.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.pan">3. Panner</a></h3>
+
+
+ <p>
+ The panner allows the user to view areas of the frame
+ which are outside of the current field of view.
+ Although the display frame is filled by the data, the
+ panner indicates that more of the image is
+ available. Clicking and dragging the viewing bounding
+ box in the panner - shown in blue in
+ <a href="#panner">Figure 6</a> - will display a different
+ portion of the image.
+ </p>
+
+ <p>
+ The panner also contains axes to indicate the directions
+ of North and East and the directions of the physical
+ (x,y) data axes.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="panner">Figure 6: Panner</a></h3></div>
+<div><img alt="[The panner of the ds9 GUI.]" src="panner.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.mag">4. Magnifier</a></h3>
+
+
+ <p>
+ The magnifier displays a magnified view of the current
+ cursor location. The magnifier cursor - the small square
+ in the center of <a href="#mag">Figure 7</a> - outlines
+ the size and orientation of one pixel, taking into
+ account the current frame zoom and orientation.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="mag">Figure 7: Magnifier</a></h3></div>
+<div><img alt="[The magnifier of the ds9 GUI.]" src="mag.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.buttons">5. Buttons</a></h3>
+
+
+ <p>
+ The button bar duplicates many of the options available
+ from the menu bar. The buttons provide quick access to
+ change the most frequently-used ds9 actions
+ (e.g. changing the scale and color bar, blinking and
+ tiling frames).
+ </p>
+
+ <p>
+ When a category is chosen from the top row, the options
+ within that category are displayed in the bottom row of
+ buttons. In <a href="#button">Figure 8</a>, the color category is
+ chosen and the bottom row shows the ten most-used
+ colormap options (additional colormaps are available
+ from the "Color" menu).
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="button">Figure 8: Buttons</a></h3></div>
+<div><img alt="[The buttons of the ds9 GUI.]" src="button.png"></div>
+</div>
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.frame">6. Display frame</a></h3>
+
+
+ <p>
+ The display frame is the area of ds9 where the FITS
+ image is shown. In <a href="#components">Figure 1</a>, a single
+ frame is shown.
+ </p>
+
+ <p>
+ Multiple frames can be opened in ds9 at the same time.
+ In <a href="#frame">Figure 9</a>, nine frames have been
+ opened and set to "tile" display from the "frame"
+ button. The current frame is indicated by a blue
+ outline around it (second row, center frame). How the
+ frames are tiled is set in the "Frame → Frame
+ Parameters → Tile" menu; the default is to tile
+ the frames in a grid.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="frame">Figure 9: Tiled frame display</a></h3></div>
+<div><img alt="[Nine frames in the ds9 GUI.]" src="frame.png"></div>
+</div>
+
+ <p>
+ If the display is set back to "single", then the current
+ frame fills the display area. The other frames can be
+ accessed via the "previous" and "next" options in the
+ buttons bar (or from the "Frame" menu).
+ </p>
+
+ <p>
+ The "blink" option may also be used with multiple
+ frames. When blink is turned on, ds9 cycles through all
+ the available frames. The blink interval is set in the
+ "Frame → Frame Parameters → Blink Interval" menu.
+ </p>
+
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="gui.color">7. Colorbar</a></h3>
+
+
+ <p>
+ The colorbar displays the colormap, bias, and contrast
+ settings. The colormap correlates the colors used in the
+ image with the pixel values in the data.
+ </p>
+
+ <p>
+ To change the colormap, use the "Color" menu or button.
+ The contrast and bias can be adjusted by right-clicking
+ and dragging on the ds9 display. The "Color →
+ Colormap Parameters" dialog box can also be used to
+ change contrast and bias.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="color">Figure 10: Colorbar</a></h3></div>
+<div><img alt="[The colorbar of the ds9 GUI.]" src="color.png"></div>
+</div>
+ </div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="preferences">Setting and Saving View Preferences</a></h2>
+
+
+ <p>
+ All of the view options described in this thread can be set
+ and saved as a preference. Open the "Preferences" dialog box
+ from the "Edit" menu and select the "View" tab, shown in
+ <a href="#prefs">Figure 11</a>.
+ </p>
+
+
+ <div class="figure">
+<div class="caption"><h3><a name="prefs">Figure 11: Preferences dialog box</a></h3></div>
+<div><img alt="[The view tab is selected in the preferences dialog.]" src="prefs.png"></div>
+</div>
+
+
+ <p>
+ The "Default" menus are used to set the defaults of the
+ "View" menu and buttons. For instance, uncheck the "Panner"
+ item under "Menu" and the panner won't be displayed when ds9
+ is launched. (Note that some options require ds9 to be
+ restarted before they take effect.)
+ </p>
+
+ <p>
+ After setting the desired preferences, select "Save". User
+ preferences are stored in <tt>.ds9.prf</tt>. At startup,
+ ds9 looks for the preferences file in the following
+ directory order:
+ <tt>./</tt>, <tt>$HOME</tt>, <tt>/usr/local/lib</tt>,
+ <tt>/opt/local/lib</tt>.
+ </p>
+
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">06 Jul 2009</td>
+<td>
+ Original version
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/gui/info.png b/ds9/doc/user/gui/info.png
new file mode 100644
index 0000000..59f4c7a
--- /dev/null
+++ b/ds9/doc/user/gui/info.png
Binary files differ
diff --git a/ds9/doc/user/gui/mag.png b/ds9/doc/user/gui/mag.png
new file mode 100644
index 0000000..db5d82d
--- /dev/null
+++ b/ds9/doc/user/gui/mag.png
Binary files differ
diff --git a/ds9/doc/user/gui/menu.png b/ds9/doc/user/gui/menu.png
new file mode 100644
index 0000000..457100d
--- /dev/null
+++ b/ds9/doc/user/gui/menu.png
Binary files differ
diff --git a/ds9/doc/user/gui/menutear.png b/ds9/doc/user/gui/menutear.png
new file mode 100644
index 0000000..bfb789d
--- /dev/null
+++ b/ds9/doc/user/gui/menutear.png
Binary files differ
diff --git a/ds9/doc/user/gui/panner.png b/ds9/doc/user/gui/panner.png
new file mode 100644
index 0000000..e5d5e29
--- /dev/null
+++ b/ds9/doc/user/gui/panner.png
Binary files differ
diff --git a/ds9/doc/user/gui/prefs.png b/ds9/doc/user/gui/prefs.png
new file mode 100644
index 0000000..d2a6b72
--- /dev/null
+++ b/ds9/doc/user/gui/prefs.png
Binary files differ
diff --git a/ds9/doc/user/gui/thread.xml b/ds9/doc/user/gui/thread.xml
new file mode 100644
index 0000000..6b4530e
--- /dev/null
+++ b/ds9/doc/user/gui/thread.xml
@@ -0,0 +1,325 @@
+<?xml version="1.0" encoding="us-ascii" ?>
+<!DOCTYPE thread>
+
+<thread>
+
+ <info>
+
+ <name>gui</name>
+ <version>June 2009</version>
+ <title>
+ <long>Introduction to the ds9 Interface</long>
+ </title>
+ <history>
+ <entry day="6" month="July" year="9" who="liz">
+ Original version
+ </entry>
+ </history>
+ </info>
+
+ <text>
+ <overview>
+
+ <synopsis>
+ <p>
+ This thread provides an overview of the key components of
+ the ds9 graphical user interface (GUI).
+ </p>
+ </synopsis>
+ </overview>
+
+ <sectionlist>
+
+ <section id="gui">
+ <title>The ds9 Interface</title>
+
+ <p>
+ This thread uses Chandra data from an observation of the
+ Trapezium Cluster (ObsID 1522). The default ds9 GUI is
+ shown in <figlink id="components"/>. The main components
+ are numbered:
+ </p>
+
+ <list type="1">
+ <li>Menu bar</li>
+ <li>Information panel</li>
+ <li>Panner</li>
+ <li>Magnifier</li>
+ <li>Buttons</li>
+ <li>Display frame</li>
+ <li>Colorbar</li>
+ </list>
+
+ <figure id="components">
+ <title>The ds9 GUI</title>
+ <description>The default ds9 display includes the
+ information panel, panner, magnifier, and colorbar.</description>
+ <bitmap format="png">components.png</bitmap>
+ </figure>
+
+ <p>
+ The default setup is a "horizontal layout", with the
+ information panel, panner, magnifier, and buttons displayed
+ horizontally across the window. This may be changed to
+ "vertical layout" in the View menu (<figlink id="vertical"/>).
+ </p>
+
+ <figure id="vertical">
+ <title>The ds9 GUI, vertical layout</title>
+ <description>In the vertical layout, the information panel,
+ panner, magnifier, and buttons are displayed vertically at
+ the left of the data frame.</description>
+ <bitmap format="png">vertical.png</bitmap>
+ </figure>
+
+ <p>
+ Note that the colorbar remained horizontal at the bottom of
+ the display frame. This may be changed with the "vertical
+ colorbar" option in the "View" menu.
+ </p>
+
+ <subsectionlist type="1">
+ <subsection id="gui.menu">
+ <title>Menu bar</title>
+
+ <p>
+ The menu bar provides access to all of ds9's
+ capabilities. For a complete description of each menu,
+ refer to the <a href="../../ref/gui.html">Menu bar
+ section of the Reference Manual</a>.
+ </p>
+
+ <figure id="menu">
+ <title>Menu bar</title>
+ <description>The menu bar of the ds9 GUI.</description>
+ <bitmap format="png">menu.png</bitmap>
+ </figure>
+
+ <p>
+ All ds9 menus can be "torn off" to be a separate window
+ from the main GUI. To tear off a menu, select the
+ dashed line, which is the first item of each menu (shown
+ in <figlink id="menutear"/>). The menu will become its
+ own window.
+ </p>
+
+ <figure id="menutear">
+ <title>Tearing off a Menu</title>
+ <description>The dashed line at the top of the "View"
+ menu is highlighted.</description>
+ <bitmap format="png">menutear.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="gui.info">
+ <title>Information panel</title>
+
+ <p>
+ The information panel displays information about the
+ data file and the values at the cursor position. In
+ <figlink id="info"/>, the object name has been
+ loaded from the header of the data file. The image
+ value and position (in WCS, physical, and image
+ coordinates) are updated in real time as the cursor is
+ moved.
+ </p>
+
+ <p>
+ The fields of the information panel can be customized
+ from the "View" menu. Any of the default entries can be
+ removed, and additional fields can be added
+ (e.g. detector coordinates, min/max data values).
+ </p>
+
+ <figure id="info">
+ <title>Information panel</title>
+ <description>The information panel of the ds9 GUI.</description>
+ <bitmap format="png">info.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="gui.pan">
+ <title>Panner</title>
+
+ <p>
+ The panner allows the user to view areas of the frame
+ which are outside of the current field of view.
+ Although the display frame is filled by the data, the
+ panner indicates that more of the image is
+ available. Clicking and dragging the viewing bounding
+ box in the panner - shown in blue in
+ <figlink id="panner"/> - will display a different
+ portion of the image.
+ </p>
+
+ <p>
+ The panner also contains axes to indicate the directions
+ of North and East and the directions of the physical
+ (x,y) data axes.
+ </p>
+
+ <figure id="panner">
+ <title>Panner</title>
+ <description>The panner of the ds9 GUI.</description>
+ <bitmap format="png">panner.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="gui.mag">
+ <title>Magnifier</title>
+
+ <p>
+ The magnifier displays a magnified view of the current
+ cursor location. The magnifier cursor - the small square
+ in the center of <figlink id="mag"/> - outlines
+ the size and orientation of one pixel, taking into
+ account the current frame zoom and orientation.
+ </p>
+
+ <figure id="mag">
+ <title>Magnifier</title>
+ <description>The magnifier of the ds9 GUI.</description>
+ <bitmap format="png">mag.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="gui.buttons">
+ <title>Buttons</title>
+
+ <p>
+ The button bar duplicates many of the options available
+ from the menu bar. The buttons provide quick access to
+ change the most frequently-used ds9 actions
+ (e.g. changing the scale and color bar, blinking and
+ tiling frames).
+ </p>
+
+ <p>
+ When a category is chosen from the top row, the options
+ within that category are displayed in the bottom row of
+ buttons. In <figlink id="button"/>, the color category is
+ chosen and the bottom row shows the ten most-used
+ colormap options (additional colormaps are available
+ from the "Color" menu).
+ </p>
+
+ <figure id="button">
+ <title>Buttons</title>
+ <description>The buttons of the ds9 GUI.</description>
+ <bitmap format="png">button.png</bitmap>
+ </figure>
+ </subsection>
+
+ <subsection id="gui.frame">
+ <title>Display frame</title>
+
+ <p>
+ The display frame is the area of ds9 where the FITS
+ image is shown. In <figlink id="components"/>, a single
+ frame is shown.
+ </p>
+
+ <p>
+ Multiple frames can be opened in ds9 at the same time.
+ In <figlink id="frame"/>, nine frames have been
+ opened and set to "tile" display from the "frame"
+ button. The current frame is indicated by a blue
+ outline around it (second row, center frame). How the
+ frames are tiled is set in the "Frame &#8594; Frame
+ Parameters &#8594; Tile" menu; the default is to tile
+ the frames in a grid.
+ </p>
+
+ <figure id="frame">
+ <title>Tiled frame display</title>
+ <description>Nine frames in the ds9 GUI.</description>
+ <bitmap format="png">frame.png</bitmap>
+ </figure>
+
+ <p>
+ If the display is set back to "single", then the current
+ frame fills the display area. The other frames can be
+ accessed via the "previous" and "next" options in the
+ buttons bar (or from the "Frame" menu).
+ </p>
+
+ <p>
+ The "blink" option may also be used with multiple
+ frames. When blink is turned on, ds9 cycles through all
+ the available frames. The blink interval is set in the
+ "Frame &#8594; Frame Parameters &#8594; Blink Interval" menu.
+ </p>
+
+ </subsection>
+
+ <subsection id="gui.color">
+ <title>Colorbar</title>
+
+ <p>
+ The colorbar displays the colormap, bias, and contrast
+ settings. The colormap correlates the colors used in the
+ image with the pixel values in the data.
+ </p>
+
+ <p>
+ To change the colormap, use the "Color" menu or button.
+ The contrast and bias can be adjusted by right-clicking
+ and dragging on the ds9 display. The "Color &#8594;
+ Colormap Parameters" dialog box can also be used to
+ change contrast and bias.
+ </p>
+
+ <figure id="color">
+ <title>Colorbar</title>
+ <description>The colorbar of the ds9 GUI.</description>
+ <bitmap format="png">color.png</bitmap>
+ </figure>
+ </subsection>
+ </subsectionlist>
+
+ </section>
+
+
+ <section id="preferences">
+ <title>Setting and Saving View Preferences</title>
+
+ <p>
+ All of the view options described in this thread can be set
+ and saved as a preference. Open the "Preferences" dialog box
+ from the "Edit" menu and select the "View" tab, shown in
+ <figlink id="prefs"/>.
+ </p>
+
+
+ <figure id="prefs">
+ <title>Preferences dialog box</title>
+ <description>The view tab is selected in the preferences dialog.</description>
+ <bitmap format="png">prefs.png</bitmap>
+ </figure>
+
+
+ <p>
+ The "Default" menus are used to set the defaults of the
+ "View" menu and buttons. For instance, uncheck the "Panner"
+ item under "Menu" and the panner won't be displayed when ds9
+ is launched. (Note that some options require ds9 to be
+ restarted before they take effect.)
+ </p>
+
+ <p>
+ After setting the desired preferences, select "Save". User
+ preferences are stored in <tt>.ds9.prf</tt>. At startup,
+ ds9 looks for the preferences file in the following
+ directory order:
+ <tt>./</tt>, <tt>$HOME</tt>, <tt>/usr/local/lib</tt>,
+ <tt>/opt/local/lib</tt>.
+ </p>
+
+ </section>
+ </sectionlist>
+ </text>
+
+</thread>
+
+
+
diff --git a/ds9/doc/user/gui/vertical.png b/ds9/doc/user/gui/vertical.png
new file mode 100644
index 0000000..d96ee37
--- /dev/null
+++ b/ds9/doc/user/gui/vertical.png
Binary files differ
diff --git a/ds9/doc/user/index.html b/ds9/doc/user/index.html
new file mode 100644
index 0000000..94dc602
--- /dev/null
+++ b/ds9/doc/user/index.html
@@ -0,0 +1,68 @@
+<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type"
+ content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR"
+ content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
+ <title>DS9 Users Manual</title>
+</head>
+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+
+ <h2><img alt="" src="../sun.gif" align="middle" height="98" width="100">SAOImage DS9 Users Manual</h2>
+
+ <p>
+ The DS9 Users Manual leads the user step-by-step through many
+ features of ds9, such as data binning and contours. For an
+ in-depth description of all of ds9's capabilities, refer to the
+ <a href="../ref/index.html">Reference
+ Manual</a>
+ </p>
+
+
+ <ul type="none">
+ <li>
+ <p>
+ <strong><a href="gui/index.html">Introduction to the ds9 Interface</a></strong>
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong><a href="binning/index.html">Binning and Filtering FITS Event Files</a></strong>
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong><a href="contour/index.html">Contours</a></strong>
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong><a href="rgb/index.html">Create a True Color Image in an
+ RGB frame</a></strong>
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong><a href="scripts/index.html">Scripting ds9</a></strong>
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong><a href="catalogs/index.html">Catalogs</a></strong>
+ </p>
+ </li>
+ </ul>
+
+
+ <p>
+ If there are topics that you would like to see covered in the
+ Users Manual, please email: saord @ cfa.harvard.edu.
+ </p>
+</body>
+</html>
diff --git a/ds9/doc/user/rgb/color.png b/ds9/doc/user/rgb/color.png
new file mode 100644
index 0000000..23df0bb
--- /dev/null
+++ b/ds9/doc/user/rgb/color.png
Binary files differ
diff --git a/ds9/doc/user/rgb/ds9.png b/ds9/doc/user/rgb/ds9.png
new file mode 100644
index 0000000..650334b
--- /dev/null
+++ b/ds9/doc/user/rgb/ds9.png
Binary files differ
diff --git a/ds9/doc/user/rgb/filtered.png b/ds9/doc/user/rgb/filtered.png
new file mode 100644
index 0000000..8bf7134
--- /dev/null
+++ b/ds9/doc/user/rgb/filtered.png
Binary files differ
diff --git a/ds9/doc/user/rgb/grid.png b/ds9/doc/user/rgb/grid.png
new file mode 100644
index 0000000..46a7ccc
--- /dev/null
+++ b/ds9/doc/user/rgb/grid.png
Binary files differ
diff --git a/ds9/doc/user/rgb/index.html b/ds9/doc/user/rgb/index.html
new file mode 100644
index 0000000..735386a
--- /dev/null
+++ b/ds9/doc/user/rgb/index.html
@@ -0,0 +1,431 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Create a True Color Image in an RGB frame - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Create a True Color Image in an RGB frame</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ Most astronomical images map color to intensity level,
+ e.g. lighter tones may correspond to a brighter intensity
+ level in a greyscale image. An alternative way of
+ presenting data is via an image that correllates color and
+ energy.
+ </p>
+
+ <p>
+ ds9 has the capability to create an RGB image and
+ interactively adjust many of its parameters to achieve
+ optimal display results.
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li>
+<strong><a href="index.html#frame">Creating an RGB Frame</a></strong><ol type="A">
+<li><a href="index.html#frame.cmdline">From the command line</a></li>
+<li><a href="index.html#frame.gui">From the ds9 GUI</a></li>
+</ol>
+</li>
+<li><strong><a href="index.html#energy">Apply Energy Filters</a></strong></li>
+<li><strong><a href="index.html#smooth">Smoothing the Data (optional)</a></strong></li>
+<li><strong><a href="index.html#scale">Adjusting the Scale Parameters</a></strong></li>
+<li><strong><a href="index.html#coordgrid">Adding a Coordinate Grid</a></strong></li>
+<li><strong><a href="index.html#output">Saving the Output</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#rgb">Figure 1: RGB window</a></li>
+<li><a href="#lock">Figure 2: Lock menu in the RGB window</a></li>
+<li><a href="#ds9">Figure 3: RGB frame with three files loaded</a></li>
+<li><a href="#efilt">Figure 4: Energy-filtered RGB data</a></li>
+<li><a href="#smooth">Figure 5: Data smoothed with a Gaussian of radius three</a></li>
+<li><a href="#scale">Figure 6: The adjusted pixel distribution for scaling</a></li>
+<li><a href="#grid">Figure 7: Coordinate Grid parameters dialog box</a></li>
+<li><a href="#color">Figure 8: Final three-color image with coordinate grid overlaid</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="frame">Creating an RGB Frame</a></h2>
+
+
+ <p>
+ To use the three-color capabilities of ds9, the data must be
+ loaded into a special RGB frame. This frame will contain
+ all three files, stacked together in separate layers.
+ </p>
+
+ <p>
+ This thread uses Chandra data from an observation of Cas A
+ (ObsID 198); the level=2 event file is named
+ "casa.fits". The same file is loaded into each layer of the
+ RGB frame; different energy filters will be applied to the
+ layers in a later step.
+ </p>
+
+ <p>
+ There are two options for creating the RGB frame:
+ </p>
+
+ <div class="subsectionlist">
+<div class="subsection">
+<h3><a name="frame.cmdline">A. From the command line</a></h3>
+
+
+ <p>
+ The command-line syntax can be used to create the
+ RGB frame and load the three files into the red, green,
+ and blue layers:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 -rgb -red casa.fits \
+ -green casa.fits \
+ -blue casa.fits &amp;
+</pre></div>
+
+ <p>
+ ds9 will open with the three files in one frame.
+ The <a href="#rgb">RGB window (Figure 1)</a> should open
+ as well. If it doesn't, open it from the "Frame →
+ RGB..." menu.
+ </p>
+
+ <hr width="80%" align="center">
+</div>
+<div class="subsection">
+<h3><a name="frame.gui">B. From the ds9 GUI</a></h3>
+
+
+ <p>
+ To load the files from the ds9 GUI:
+ </p>
+
+ <ol type="1">
+ <li>
+ <p>
+ Launch ds9
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Choose "New Frame RGB" from the "Frame" menu.
+ </p>
+
+ <p>
+ When the new frame is created, the
+ <a href="#rgb">RGB window (Figure 1)</a> should open as well.
+ If it doesn't, open it from the "Frame → RGB..."
+ menu.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Make sure the "Red" band is selected in the
+ "Current" column of the RGB window, then choose
+ "File → Open..." in the main ds9 window and
+ select the red file.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Change the current band to "Green" in the RGB
+ window and open the green file.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Change the current band to "Blue" in the RGB
+ window and open the blue file.
+ </p>
+ </li>
+ </ol>
+
+ </div>
+</div>
+
+ <div class="figure">
+<div class="caption"><h3><a name="rgb">Figure 1: RGB window</a></h3></div>
+<div><img alt="[The RGB window indicates that all three layers are visible and Blue is selected as the current one.]" src="rgb.png"></div>
+</div>
+
+ <p>
+ Each frame of the RGB image may have different binning,
+ scaling, smoothing, and colorbars applied to it. You
+ can "lock" the frames together, so that the setting
+ is applied to all three frames at once. This is done
+ with the <a href="#lock">Lock menu in the RGB
+ window (Figure 2)</a>; all four options are checked in this
+ thread.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="lock">Figure 2: Lock menu in the RGB window</a></h3></div>
+<div><img alt="[The lock menu is expanded and all four options are checked.]" src="lock.png"></div>
+</div>
+
+ <p>
+ Use the binning and zoom options in ds9 to adjust the
+ image so that the full region of interest is visible.
+ <a href="#ds9">Figure 3</a> uses binning=2 and zoom=1.
+ The "Scale" is set to "log: minmax"
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="ds9">Figure 3: RGB frame with three files loaded</a></h3></div>
+<div><img alt="[The data is loaded into one ds9 frame; the RGB window indicates the current layer is Blue.]" src="ds9.png"></div>
+</div>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="energy">Apply Energy Filters</a></h2>
+
+
+ <p>
+ The following energy bands are used for the RGB layers:
+ </p>
+
+ <ul>
+ <li>red (soft band): 200-1500 eV</li>
+ <li>green (medium band): 1500-2500 eV</li>
+ <li>blue (hard band): 2500-8000 eV</li>
+ </ul>
+
+ <p>
+ The values are just guidelines and may need to be adjusted for your analysis.
+ </p>
+
+ <p>
+ To filter the data, first select the Red frame from the RGB
+ window. Open the <tt>Bin → Binning Parameters</tt>
+ dialog box and type "<tt>energy=200:1500</tt>" in the Bin
+ Filter field. Choose "Apply" and the ds9 display will be
+ updated to reflect the energy filter.
+ </p>
+
+ <p>
+ Without closing the Binning Parameters box, select the Green
+ frame. Type "<tt>energy=1500:2500</tt>" in the Bin
+ Filter field and choose "Apply" again. Repeat these two
+ steps for the Blue layer, using the filter
+ "<tt>energy=2500:8000</tt>".
+ </p>
+
+ <p>
+ The colors in the image, as seen in <a href="#efilt">Figure 4</a>,
+ are correlated to the energy of the data.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="efilt">Figure 4: Energy-filtered RGB data</a></h3></div>
+<div><img alt="[Each layer of data has a different energy filtered applied, correlating color and energy in the image.]" src="filtered.png"></div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="smooth">Smoothing the Data (optional)</a></h2>
+
+
+ <p>
+ Smoothing can help bring out finer features in the data by
+ removing statistical noise. It is an optional step;
+ experiment with smoothing to see if it improves the
+ appearance of your data.
+ </p>
+
+ <p>
+ The smoothing capability in ds9 lets you interactively
+ smooth the data. Note that for quantitative data analysis,
+ smoothing should be done with the appropriate data analysis
+ software; ds9 does a nice job for publication purposes.
+ </p>
+
+ <p>
+ Choose "Smooth" from the "Analysis" menu and the ds9 display
+ is updated with the results of smoothing. The "Smooth"
+ option can be toggled on and off during your ds9 session.
+ </p>
+
+ <p>
+ Open the "Smoothing Parameters..." dialog box from the same
+ menu to adjust the function and kernel radius of the
+ smoothing. This data were smoothed with a Gaussian function
+ with radius of two. The results are shown in
+ <a href="#smooth">Figure 5</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="smooth">Figure 5: Data smoothed with a Gaussian of radius three</a></h3></div>
+<div><img alt="[The smoothed data are displayed in ds9.]" src="smooth.png"></div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="scale">Adjusting the Scale Parameters</a></h2>
+
+
+ <p>
+ This data is being displayed with a "log: minmax" scale.
+ That means that ds9 stretches the scale to encompass
+ the range of pixel values in the file. Adjusting the
+ minimum and maximum scale values sets a threshold for the
+ background data and brings out features.
+ </p>
+
+ <p>
+ To change the minimum and maximum values, open the "Scale
+ → Scale Parameters" dialog box. The pixel distribution
+ shown is for the band selected as "Current" in the RGB
+ window; when the a different band is selected, the histogram
+ of pixel values is updated to match.
+ </p>
+
+ <p>
+ To adjust the values, use the cursor to grab the red
+ (minimum) or green (maximum) vertical lines on the plot and
+ drag them to the desired location. You can type a value in
+ to the "Low" or "High" field and hit "Apply" to set the
+ limits.
+ </p>
+
+ <p>
+ A basic guideline for setting the low value is to minimize
+ the contribution of the background. That is, adjust the
+ minimum of each band until the background of the image is
+ flat (i.e. solid black). For the maximum value, bringing it
+ in to the last data point in the pixel distribution is
+ usually sufficient.
+ </p>
+
+ <p>
+ For ObsID 198 with the smoothing applied, the following
+ limits were chosen (listed as "low:high" pairs):
+ </p>
+
+ <ul>
+ <li>Red - 0.4 : 20</li>
+ <li>Green - 0.3 : 35</li>
+ <li>Blue - 0.1 : 10</li>
+ </ul>
+
+ <p>
+ <a href="#scale">Figure 6</a> shows the image with
+ the new pixel value limits set.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="scale">Figure 6: The adjusted pixel distribution for scaling</a></h3></div>
+<div><img alt="[The background of the image is almost completely flat (black) after changing the scaling values.]" src="scale.png"></div>
+</div>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="coordgrid">Adding a Coordinate Grid</a></h2>
+
+
+ <p>
+ To add a coordinate grid to the image, choose the
+ "Coordinate Grid" option from the "Analysis"
+ menu. Then choose "Coordinate Grid Parameters" from the
+ same menu to open <a href="#grid">the preferences
+ dialog (Figure 7)</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="grid">Figure 7: Coordinate Grid parameters dialog box</a></h3></div>
+<div><img alt="[The parameter box contains fields to set the plot title and axis labels and to change the axis spacing and numbering.]" src="grid.png"></div>
+</div>
+
+ <p>
+ From the preferences box, you can change the color,
+ font, line style (solid or dash), and line thickness for
+ all elements of the grid. The font style, size, and
+ color can be edited, and you can add titles. It is also
+ possible to turn off the display of individual items via
+ the "View" menu.
+ </p>
+
+ <p>
+ In <a href="#color">Figure 8</a>, we have turned
+ off the grid lines and border. The axes have been
+ changed to "Exterior Axes" (from the "Type" menu).
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="color">Figure 8: Final three-color image with coordinate grid overlaid</a></h3></div>
+<div><img alt="[The three-color image is displayed in ds9.]" src="color.png"></div>
+</div>
+ <hr>
+</div>
+<div class="section">
+<h2><a name="output">Saving the Output</a></h2>
+
+
+ <p>
+ Once you are happy with your true color image, there are a
+ number of output options in ds9.
+ </p>
+
+ <ul>
+ <li>
+ <p>
+ <strong>Image formats:</strong> from the "File →
+ Save Image As..." menu, you can choose JPG, PNG, or TIFF
+ file formats.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong>Postscript:</strong> to create a postscript
+ file, go to "File → Print..." and select "Print To:
+ File".
+ </p>
+ </li>
+ </ul>
+
+ <p>
+ Currently it is not possible to save the state of the ds9
+ imager, meaning that you cannot save the composite RGB
+ frame and reopen later for further analysis.
+ </p>
+
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">04 Jun 2009</td>
+<td>
+ Original version
+
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/rgb/lock.png b/ds9/doc/user/rgb/lock.png
new file mode 100644
index 0000000..3dcb3cd
--- /dev/null
+++ b/ds9/doc/user/rgb/lock.png
Binary files differ
diff --git a/ds9/doc/user/rgb/rgb.png b/ds9/doc/user/rgb/rgb.png
new file mode 100644
index 0000000..5631351
--- /dev/null
+++ b/ds9/doc/user/rgb/rgb.png
Binary files differ
diff --git a/ds9/doc/user/rgb/scale.png b/ds9/doc/user/rgb/scale.png
new file mode 100644
index 0000000..c2c50e1
--- /dev/null
+++ b/ds9/doc/user/rgb/scale.png
Binary files differ
diff --git a/ds9/doc/user/rgb/smooth.png b/ds9/doc/user/rgb/smooth.png
new file mode 100644
index 0000000..6d4f631
--- /dev/null
+++ b/ds9/doc/user/rgb/smooth.png
Binary files differ
diff --git a/ds9/doc/user/rgb/thread.xml b/ds9/doc/user/rgb/thread.xml
new file mode 100644
index 0000000..51e3503
--- /dev/null
+++ b/ds9/doc/user/rgb/thread.xml
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="us-ascii" ?>
+<!DOCTYPE thread>
+
+<thread>
+
+ <info>
+
+ <version>June 2009</version>
+ <title>
+ <long>Create a True Color Image in an RGB frame</long>
+ </title>
+ <history>
+ <entry day="4" month="June" year="9" who="liz">
+ Original version
+ <!--// built from CIAO true_color_ds9 thread //-->
+ </entry>
+ </history>
+ </info>
+
+ <text>
+ <overview>
+
+ <synopsis>
+ <p>
+ Most astronomical images map color to intensity level,
+ e.g. lighter tones may correspond to a brighter intensity
+ level in a greyscale image. An alternative way of
+ presenting data is via an image that correllates color and
+ energy.
+ </p>
+
+ <p>
+ ds9 has the capability to create an RGB image and
+ interactively adjust many of its parameters to achieve
+ optimal display results.
+ </p>
+ </synopsis>
+ </overview>
+
+ <sectionlist>
+
+ <section id="frame">
+ <title>Creating an RGB Frame</title>
+
+ <p>
+ To use the three-color capabilities of ds9, the data must be
+ loaded into a special RGB frame. This frame will contain
+ all three files, stacked together in separate layers.
+ </p>
+
+ <p>
+ This thread uses Chandra data from an observation of Cas A
+ (ObsID 198); the level=2 event file is named
+ "casa.fits". The same file is loaded into each layer of the
+ RGB frame; different energy filters will be applied to the
+ layers in a later step.
+ </p>
+
+ <p>
+ There are two options for creating the RGB frame:
+ </p>
+
+ <subsectionlist type="A">
+ <subsection id="frame.cmdline">
+ <title>From the command line</title>
+
+ <p>
+ The command-line syntax can be used to create the
+ RGB frame and load the three files into the red, green,
+ and blue layers:
+ </p>
+
+<screen>
+unix% ds9 -rgb -red casa.fits \
+ -green casa.fits \
+ -blue casa.fits &amp;
+</screen>
+
+ <p>
+ ds9 will open with the three files in one frame.
+ The <figlink id="rgb">RGB window</figlink> should open
+ as well. If it doesn't, open it from the "Frame &#8594;
+ RGB..." menu.
+ </p>
+
+ </subsection>
+
+ <subsection id="frame.gui">
+ <title>From the ds9 GUI</title>
+
+ <p>
+ To load the files from the ds9 GUI:
+ </p>
+
+ <list type="1">
+ <li>
+ <p>
+ Launch ds9
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Choose "New Frame RGB" from the "Frame" menu.
+ </p>
+
+ <p>
+ When the new frame is created, the
+ <figlink id="rgb">RGB window</figlink> should open as well.
+ If it doesn't, open it from the "Frame &#8594; RGB..."
+ menu.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Make sure the "Red" band is selected in the
+ "Current" column of the RGB window, then choose
+ "File &#8594; Open..." in the main ds9 window and
+ select the red file.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Change the current band to "Green" in the RGB
+ window and open the green file.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ Change the current band to "Blue" in the RGB
+ window and open the blue file.
+ </p>
+ </li>
+ </list>
+
+ </subsection>
+ </subsectionlist>
+
+ <figure id="rgb">
+ <title>RGB window</title>
+ <description>The RGB window indicates that all three
+ layers are visible and Blue is selected as the current
+ one.</description>
+ <bitmap format="png">rgb.png</bitmap>
+ </figure>
+
+ <p>
+ Each frame of the RGB image may have different binning,
+ scaling, smoothing, and colorbars applied to it. You
+ can "lock" the frames together, so that the setting
+ is applied to all three frames at once. This is done
+ with the <figlink id="lock">Lock menu in the RGB
+ window</figlink>; all four options are checked in this
+ thread.
+ </p>
+
+ <figure id="lock">
+ <title>Lock menu in the RGB window</title>
+ <description>The lock menu is expanded and all four
+ options are checked.</description>
+ <bitmap format="png">lock.png</bitmap>
+ </figure>
+
+ <p>
+ Use the binning and zoom options in ds9 to adjust the
+ image so that the full region of interest is visible.
+ <figlink id="ds9"/> uses binning=2 and zoom=1.
+ The "Scale" is set to "log: minmax"
+ </p>
+
+ <figure id="ds9">
+ <title>RGB frame with three files loaded</title>
+ <description>The data is loaded into one ds9 frame; the RGB
+ window indicates the current layer is Blue.</description>
+ <bitmap format="png">ds9.png</bitmap>
+ </figure>
+ </section>
+
+ <section id="energy">
+ <title>Apply Energy Filters</title>
+
+ <p>
+ The following energy bands are used for the RGB layers:
+ </p>
+
+ <list>
+ <li>red (soft band): 200-1500 eV</li>
+ <li>green (medium band): 1500-2500 eV</li>
+ <li>blue (hard band): 2500-8000 eV</li>
+ </list>
+
+ <p>
+ The values are just guidelines and may need to be adjusted for your analysis.
+ </p>
+
+ <p>
+ To filter the data, first select the Red frame from the RGB
+ window. Open the <tt>Bin &#8594; Binning Parameters</tt>
+ dialog box and type "<tt>energy=200:1500</tt>" in the Bin
+ Filter field. Choose "Apply" and the ds9 display will be
+ updated to reflect the energy filter.
+ </p>
+
+ <p>
+ Without closing the Binning Parameters box, select the Green
+ frame. Type "<tt>energy=1500:2500</tt>" in the Bin
+ Filter field and choose "Apply" again. Repeat these two
+ steps for the Blue layer, using the filter
+ "<tt>energy=2500:8000</tt>".
+ </p>
+
+ <p>
+ The colors in the image, as seen in <figlink id="efilt"/>,
+ are correlated to the energy of the data.
+ </p>
+
+ <figure id="efilt">
+ <title>Energy-filtered RGB data</title>
+ <description>Each layer of data has a different energy
+ filtered applied, correlating color and energy in the
+ image.</description>
+ <bitmap format="png">filtered.png</bitmap>
+ </figure>
+
+ </section>
+
+ <section id="smooth">
+ <title>Smoothing the Data (optional)</title>
+
+ <p>
+ Smoothing can help bring out finer features in the data by
+ removing statistical noise. It is an optional step;
+ experiment with smoothing to see if it improves the
+ appearance of your data.
+ </p>
+
+ <p>
+ The smoothing capability in ds9 lets you interactively
+ smooth the data. Note that for quantitative data analysis,
+ smoothing should be done with the appropriate data analysis
+ software; ds9 does a nice job for publication purposes.
+ </p>
+
+ <p>
+ Choose "Smooth" from the "Analysis" menu and the ds9 display
+ is updated with the results of smoothing. The "Smooth"
+ option can be toggled on and off during your ds9 session.
+ </p>
+
+ <p>
+ Open the "Smoothing Parameters..." dialog box from the same
+ menu to adjust the function and kernel radius of the
+ smoothing. This data were smoothed with a Gaussian function
+ with radius of two. The results are shown in
+ <figlink id="smooth"/>.
+ </p>
+
+ <figure id="smooth">
+ <title>Data smoothed with a Gaussian of radius three</title>
+ <description>The smoothed data are displayed in ds9.</description>
+ <bitmap format="png">smooth.png</bitmap>
+ </figure>
+
+ </section>
+
+ <section id="scale">
+ <title>Adjusting the Scale Parameters</title>
+
+ <p>
+ This data is being displayed with a "log: minmax" scale.
+ That means that ds9 stretches the scale to encompass
+ the range of pixel values in the file. Adjusting the
+ minimum and maximum scale values sets a threshold for the
+ background data and brings out features.
+ </p>
+
+ <p>
+ To change the minimum and maximum values, open the "Scale
+ &#8594; Scale Parameters" dialog box. The pixel distribution
+ shown is for the band selected as "Current" in the RGB
+ window; when the a different band is selected, the histogram
+ of pixel values is updated to match.
+ </p>
+
+ <p>
+ To adjust the values, use the cursor to grab the red
+ (minimum) or green (maximum) vertical lines on the plot and
+ drag them to the desired location. You can type a value in
+ to the "Low" or "High" field and hit "Apply" to set the
+ limits.
+ </p>
+
+ <p>
+ A basic guideline for setting the low value is to minimize
+ the contribution of the background. That is, adjust the
+ minimum of each band until the background of the image is
+ flat (i.e. solid black). For the maximum value, bringing it
+ in to the last data point in the pixel distribution is
+ usually sufficient.
+ </p>
+
+ <p>
+ For ObsID 198 with the smoothing applied, the following
+ limits were chosen (listed as "low:high" pairs):
+ </p>
+
+ <list>
+ <li>Red - 0.4 : 20</li>
+ <li>Green - 0.3 : 35</li>
+ <li>Blue - 0.1 : 10</li>
+ </list>
+
+ <p>
+ <figlink id="scale"/> shows the image with
+ the new pixel value limits set.
+ </p>
+
+ <figure id="scale">
+ <title>The adjusted pixel distribution for scaling</title>
+ <description>The background of the image is almost
+ completely flat (black) after changing the scaling
+ values.</description>
+ <bitmap format="png">scale.png</bitmap>
+ </figure>
+
+ </section>
+
+ <section id="coordgrid">
+ <title>Adding a Coordinate Grid</title>
+
+ <p>
+ To add a coordinate grid to the image, choose the
+ "Coordinate Grid" option from the "Analysis"
+ menu. Then choose "Coordinate Grid Parameters" from the
+ same menu to open <figlink id="grid">the preferences
+ dialog</figlink>.
+ </p>
+
+ <figure id="grid">
+ <title>Coordinate Grid parameters dialog box</title>
+ <description>The parameter box contains fields to set
+ the plot title and axis labels and to change the
+ axis spacing and numbering.</description>
+ <bitmap format="png">grid.png</bitmap>
+ </figure>
+
+ <p>
+ From the preferences box, you can change the color,
+ font, line style (solid or dash), and line thickness for
+ all elements of the grid. The font style, size, and
+ color can be edited, and you can add titles. It is also
+ possible to turn off the display of individual items via
+ the "View" menu.
+ </p>
+
+ <p>
+ In <figlink id="color"/>, we have turned
+ off the grid lines and border. The axes have been
+ changed to "Exterior Axes" (from the "Type" menu).
+ </p>
+
+ <figure id="color">
+ <title>Final three-color image with coordinate grid overlaid</title>
+ <description>The three-color image is displayed in ds9.</description>
+ <bitmap format="png">color.png</bitmap>
+ </figure>
+ </section>
+
+ <section id="output">
+ <title>Saving the Output</title>
+
+ <p>
+ Once you are happy with your true color image, there are a
+ number of output options in ds9.
+ </p>
+
+ <list>
+ <li>
+ <p>
+ <strong>Image formats:</strong> from the "File &#8594;
+ Save Image As..." menu, you can choose JPG, PNG, or TIFF
+ file formats.
+ </p>
+ </li>
+
+ <li>
+ <p>
+ <strong>Postscript:</strong> to create a postscript
+ file, go to "File &#8594; Print..." and select "Print To:
+ File".
+ </p>
+ </li>
+ </list>
+
+ <p>
+ Currently it is not possible to save the state of the ds9
+ imager, meaning that you cannot save the composite RGB
+ frame and reopen later for further analysis.
+ </p>
+
+ </section>
+
+ </sectionlist>
+ </text>
+
+</thread>
+
+
+
diff --git a/ds9/doc/user/scripts/contour.png b/ds9/doc/user/scripts/contour.png
new file mode 100644
index 0000000..3365b4d
--- /dev/null
+++ b/ds9/doc/user/scripts/contour.png
Binary files differ
diff --git a/ds9/doc/user/scripts/contourdss.png b/ds9/doc/user/scripts/contourdss.png
new file mode 100644
index 0000000..c80f8fe
--- /dev/null
+++ b/ds9/doc/user/scripts/contourdss.png
Binary files differ
diff --git a/ds9/doc/user/scripts/index.html b/ds9/doc/user/scripts/index.html
new file mode 100644
index 0000000..923ecec
--- /dev/null
+++ b/ds9/doc/user/scripts/index.html
@@ -0,0 +1,363 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Scripting ds9 - DS9 </title>
+</head>
+<!--THIS FILE IS CREATED AUTOMATICALLY - DO NOT EDIT MANUALLY-->
+<body><div class="mainbar">
+<a name="maintext"></a><div align="center"><h1>Scripting ds9</h1></div>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+<hr size="5" noshade>
+<div>
+<h2>Synopsis</h2>
+ <p>
+ Scripting with ds9 can be done in several ways: by invoking
+ the GUI with a number of command-line options or via
+ the <a href="http://hea-www.harvard.edu/RD/xpa/index.html">XPA
+ messaging system</a>. A third option, Simple Application
+ Messaging Protocol (SAMP), is introduced but not included in
+ the examples.
+ </p>
+
+ <p>
+ To illustrate how to script ds9, we
+ repeat the <a href="../contour/index.html">contours example</a>
+ with both methods,. The examples use Chandra data from an
+ observation of the galaxy cluster Abell 2142 (ObsID 5005).
+ </p>
+ <p>
+ If you encounter any problems, please email saord @ cfa.harvard.edu.
+ </p>
+</div>
+<hr size="5" noshade>
+<h2><a name="toc">Contents</a></h2>
+<ul>
+<li><strong><a href="index.html#commandline">Command-line Scripting</a></strong></li>
+<li><strong><a href="index.html#xpa">XPA Scripting</a></strong></li>
+<li><strong><a href="index.html#samp">SAMP: Simple Application Messaging Protocol</a></strong></li>
+<li><strong><a href="index.html#history">History</a></strong></li>
+<li>
+<strong>Images</strong><ul>
+<li><a href="#clcontour">Figure 1: Command line: x-ray data with contours</a></li>
+<li><a href="#clcontourdss">Figure 2: Command line: x-ray and optical data with contours</a></li>
+<li><a href="#xpacontour">Figure 3: XPA: x-ray data with contours</a></li>
+<li><a href="#xpacontourdss">Figure 4: XPA: x-ray and optical data with contours</a></li>
+</ul>
+</li>
+</ul>
+<hr>
+<div class="sectionlist">
+<div class="section">
+<h2><a name="commandline">Command-line Scripting</a></h2>
+
+
+ <p>
+ The ds9 Reference Manual
+ has <a href="../../ref/command.html">an extensive list of
+ the available command line options</a>. The most important
+ thing to note is that the commands are executed one at a
+ time in the order they are listed.
+ </p>
+
+ <p>
+ To create contours on a data image:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 acisf05005N002_evt2.fits -bin about 3800 3800 -bin factor 2 \
+ -scale log -cmap b \
+ -contour yes -contour limits 1 100 \
+ -contour smooth 5 -contour nlevels 6 -contour save ds9.con &amp;
+</pre></div>
+
+ <p>
+ This command line produces <a href="#clcontour">Figure 1</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="clcontour">Figure 1: Command line: x-ray data with contours</a></h3></div>
+<div><img alt="[Diffuse emission with contours overlaid; a point source is visible in the upper left corner of the image.]" src="contour.png"></div>
+</div>
+
+ <p>
+ The options direct ds9 to:
+ </p>
+
+ <ol type="1">
+ <li>
+<tt>-bin about 3800 3800</tt> : center the image display at (x,y)=(3800,3800)</li>
+ <li>
+<tt>-bin factor 2</tt> : bin the data by a factor of 2</li>
+ <li>
+<tt>-scale log</tt> : set the display to log scale</li>
+ <li>
+<tt>-cmap b</tt> : use the "b" colormap</li>
+ <li>
+<tt>-contour yes</tt> : display contours</li>
+ <li>
+<tt>-contour limits 1 100</tt> : set the minimum and maximum contour limits</li>
+ <li>
+<tt>-contour smooth 5</tt> : set contour smoothness to "5"</li>
+ <li>
+<tt>-contour nlevels 6</tt> : create six contour levels</li>
+ <li>
+<tt>-contour save ds9.com</tt> : save the contours to the file "ds9.con"</li>
+ </ol>
+
+ <p>
+ If you wish to add options to the command line after it has
+ been processed, the whole command must be run again from the
+ beginning. It is, however, possible to interact with
+ the ds9 GUI that has been created. For instance, instead of
+ including the "<tt>-bin about 3800 3800</tt>" modifier, the
+ image could be recentered in ds9 interactively.
+ </p>
+
+ <p>
+ The following command line builds on the previous example by
+ retrieving a DSS image and copying the contours to the new
+ frame:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 acisf05005N002_evt2.fits -bin about 3800 3800 -bin factor 2 \
+ -scale log -cmap b \
+ -contour yes -contour limits 1 100 \
+ -contour smooth 5 -contour nlevels 6 -contour copy \
+ -dsssao A2142 -cmap grey -contour paste \
+ -frame first -match frames wcs &amp;
+</pre></div>
+
+ <p>
+ The resulting image is shown in <a href="#clcontourdss">Figure 2</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="clcontourdss">Figure 2: Command line: x-ray and optical data with contours</a></h3></div>
+<div><img alt="[The x-ray data is in the left frame and the optical data is in the right frame; both have the x-ray contours displayed on the data.]" src="contourdss.png"></div>
+</div>
+
+ <p>
+ The options which have been added from the previous command
+ line are:
+ </p>
+
+ <ol type="1">
+ <li>
+<tt>-contour copy</tt> : copy the x-ray contours</li>
+ <li>
+<tt>-dsssao A2142</tt> : retrieve a DSS image of A2142
+ from the DSS-SAO server (there are also a "dsseso" and
+ "dssstsci" options)</li>
+ <li>
+<tt>-cmap grey</tt> : use the "grey" colormap in the DSS frame</li>
+ <li>
+<tt>-contour paste</tt> : paste the x-ray contours onto
+ the optical data</li>
+ <li>
+<tt>-frame first</tt> : select the first ds9 frame</li>
+ <li>
+<tt>-match frames wcs</tt> : match the WCS of the DSS
+ frame to the current (x-ray) frame</li>
+ </ol>
+
+ <p>
+ At this point, we can end the ds9 session or modify the
+ display interactively via the ds9 GUI.
+ </p>
+
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="xpa">XPA Scripting</a></h2>
+
+
+ <p>
+ X Public Access (XPA) is a messaging system which provides
+ communication between Unix programs through a set of access
+ points. The two most common actions are retrieving
+ information (<tt>xpaget</tt>) and issuing commands
+ (<tt>xpaset</tt>). For more information, see the <a href="http://hea-www.harvard.edu/RD/xpa/">XPA Messaging
+ System</a> page and the <a href="../../ref/xpa.html">XPA Access Points</a>
+ section of the ds9 manual.
+ </p>
+
+ <p>
+ XPA commands may be issued one at a time from the terminal
+ or collected in a script to run in batch mode.
+ Unlike the command line syntax, there is no predetermined
+ stopping point - commands may be sent to ds9 as long as the
+ GUI is open.
+ </p>
+
+ <p>
+ First, open ds9 with the data file:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% ds9 acisf05005N002_evt2.fits &amp;
+</pre></div>
+
+ <p>
+ The <a href="http://hea-www.harvard.edu/RD/xpa/xpans.html">xpans
+ name server</a> is used to manage the names and ports
+ of XPA access points. Use "<tt>xpaget xpans</tt>" to see
+ the list of available access points:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% xpaget xpans
+DS9 ds9 gs /tmp/.xpa/DS9_ds9.22972 username
+</pre></div>
+
+ <p>
+ Now that ds9 is running and linked to an XPA server, we can
+ use xpaset to modify the display and add contours. (Refer
+ to the <a href="http://hea-www.harvard.edu/RD/xpa/programs.html#xpaset">XPA
+ documentation</a> for details on <tt>xpaset</tt> syntax.)
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% xpaset -p ds9 bin about 3800 3800
+unix% xpaset -p ds9 bin factor 2
+unix% xpaset -p ds9 scale log
+unix% xpaset -p ds9 cmap b
+unix% xpaset -p ds9 contour yes
+unix% xpaset -p ds9 contour limits 1 100
+unix% xpaset -p ds9 contour smooth 5
+unix% xpaset -p ds9 contour nlevels 6
+unix% xpaset -p ds9 contour save xpa.con
+</pre></div>
+
+ <p>
+ This command line produces <a href="#xpacontour">Figure 3</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="xpacontour">Figure 3: XPA: x-ray data with contours</a></h3></div>
+<div><img alt="[Diffuse emission with contours overlaid; a point source is visible in the upper left corner of the image.]" src="contour.png"></div>
+</div>
+
+ <p>
+ The options direct ds9 to:
+ </p>
+
+ <ol type="1">
+ <li>
+<tt>xpaset -p bin about 3800 3800</tt> : center the image display at (x,y)=(3800,3800)</li>
+ <li>
+<tt>xpaset -p bin factor 2</tt> : bin the data by a factor of 2</li>
+ <li>
+<tt>xpaset -p scale log</tt> : set the display to log scale</li>
+ <li>
+<tt>xpaset -p cmap b</tt> : use the "b" colormap</li>
+ <li>
+<tt>xpaset -p contour yes</tt> : display contours</li>
+ <li>
+<tt>xpaset -p contour limits 1 100</tt> : set the minimum and maximum contour limits</li>
+ <li>
+<tt>xpaset -p contour smooth 5</tt> : set contour smoothness to "5"</li>
+ <li>
+<tt>xpaset -p contour nlevels 6</tt> : create six contour levels</li>
+ <li>
+<tt>xpaset -p contour save xpa.com</tt> : save the contours to the file "xpa.con"</li>
+ </ol>
+
+ <p>
+ As long as the ds9 GUI remains open, we can continue to
+ modify the display. Here we build on the previous example
+ by retrieving a DSS image and copying the contours to the
+ new frame:
+ </p>
+
+<div class="screen"><pre style="background: #cccccc; white-space: pre; border: none; padding: 0.5em; overflow: auto; border: thin solid black;">
+unix% xpaset -p ds9 contour copy
+unix% xpaset -p ds9 dsssao A2142
+unix% xpaset -p ds9 cmap grey
+unix% xpaset -p ds9 contour paste
+unix% xpaset -p ds9 frame first
+unix% xpaset -p ds9 match frames wcs
+</pre></div>
+
+ <p>
+ The resulting image is shown in <a href="#clcontourdss">Figure 2</a>.
+ </p>
+
+ <div class="figure">
+<div class="caption"><h3><a name="xpacontourdss">Figure 4: XPA: x-ray and optical data with contours</a></h3></div>
+<div><img alt="[The x-ray data is in the left frame and the optical data is in the right frame; both have the x-ray contours displayed on the data.]" src="contourdss.png"></div>
+</div>
+
+ <p>
+ The options which have been added from the previous command
+ line are:
+ </p>
+
+ <ol type="1">
+ <li>
+<tt>xpaset -p contour copy</tt> : copy the x-ray contours</li>
+ <li>
+<tt>xpaset -p dsssao A2142</tt> : retrieve a DSS image of A2142
+ from the DSS-SAO server (there are also a "dsseso" and
+ "dssstsci" options)</li>
+ <li>
+<tt>xpaset -p cmap grey</tt> : use the "grey" colormap in the DSS frame</li>
+ <li>
+<tt>xpaset -p contour paste</tt> : paste the x-ray contours onto
+ the optical data</li>
+ <li>
+<tt>xpaset -p frame first</tt> : select the first ds9 frame</li>
+ <li>
+<tt>xpaset -p match frames wcs</tt> : match the WCS of the DSS
+ frame to the current (x-ray) frame</li>
+ </ol>
+
+ <p>
+ At this point, we can end the ds9 session, issue further XPA
+ commands, or modify the display interactively via the ds9
+ GUI.
+ </p>
+
+ <hr>
+</div>
+<div class="section">
+<h2><a name="samp">SAMP: Simple Application Messaging Protocol</a></h2>
+
+
+ <p>
+ A third method of scripting ds9 is via
+ <a href="http://www.ivoa.net/Documents/latest/SAMP.html">SAMP</a>,
+ a messaging protocol that enables astronomy software
+ tools to interoperate and communicate. SAMP is also used by
+ such applications
+ as <a href="http://www.star.bris.ac.uk/~mbt/topcat/">TOPCAT</a>,
+ an interactive graphical viewer and editor for tabular data
+ and <a href="http://aladin.u-strasbg.fr/">Aladin</a>, an
+ interactive software sky atlas.
+ </p>
+
+ <p>
+ Information on the ds9 SAMP implementation is available in
+ the <a href="../../ref/samp.html">ds9 Reference Manual</a>.
+ </p>
+ </div>
+</div>
+<hr size="5" noshade>
+<h2><a name="history">History</a></h2>
+<table class="history">
+ <tr>
+<td class="historydate">21 Sep 2009</td>
+<td>
+ Original version
+
+ </td>
+</tr>
+ </table>
+<hr size="5" noshade>
+<p>
+ Return to the <a href="../index.html">DS9 Users Manual</a></p>
+</div></body>
+</html>
diff --git a/ds9/doc/user/scripts/thread.xml b/ds9/doc/user/scripts/thread.xml
new file mode 100644
index 0000000..e9da6af
--- /dev/null
+++ b/ds9/doc/user/scripts/thread.xml
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="us-ascii" ?>
+<!DOCTYPE thread>
+
+<thread>
+
+ <info>
+
+ <name>scripts</name>
+ <version>Sept 2009</version>
+ <title>
+ <long>Scripting ds9</long>
+ </title>
+ <history>
+ <entry day="21" month="September" year="9" who="liz">
+ Original version
+ <!-- scripted version of contours thread //-->
+ </entry>
+ </history>
+ </info>
+
+ <text>
+ <overview>
+
+ <synopsis>
+ <p>
+ Scripting with ds9 can be done in several ways: by invoking
+ the GUI with a number of command-line options or via
+ the <a href="http://hea-www.harvard.edu/RD/xpa/index.html">XPA
+ messaging system</a>. A third option, Simple Application
+ Messaging Protocol (SAMP), is introduced but not included in
+ the examples.
+ </p>
+
+ <p>
+ To illustrate how to script ds9, we
+ repeat the <a href="../contour/index.html">contours example</a>
+ with both methods,. The examples use Chandra data from an
+ observation of the galaxy cluster Abell 2142 (ObsID 5005).
+ </p>
+ </synopsis>
+ </overview>
+
+ <sectionlist>
+
+ <section id="commandline">
+ <title>Command-line Scripting</title>
+
+ <p>
+ The ds9 Reference Manual
+ has <a href="../../ref/command.html">an extensive list of
+ the available command line options</a>. The most important
+ thing to note is that the commands are executed one at a
+ time in the order they are listed.
+ </p>
+
+ <p>
+ To create contours on a data image:
+ </p>
+
+<screen>
+unix% ds9 acisf05005N002_evt2.fits -bin about 3800 3800 -bin factor 2 \
+ -scale log -cmap b \
+ -contour yes -contour limits 1 100 \
+ -contour smooth 5 -contour nlevels 6 -contour save ds9.con &amp;
+</screen>
+
+ <p>
+ This command line produces <figlink id="clcontour"/>.
+ </p>
+
+ <figure id="clcontour">
+ <title>Command line: x-ray data with contours</title>
+ <description>Diffuse emission with
+ contours overlaid; a point source is visible in the upper
+ left corner of the image.</description>
+ <bitmap format="png">contour.png</bitmap>
+ </figure>
+
+ <p>
+ The options direct ds9 to:
+ </p>
+
+ <list type="1">
+ <li><tt>-bin about 3800 3800</tt> : center the image display at (x,y)=(3800,3800)</li>
+ <li><tt>-bin factor 2</tt> : bin the data by a factor of 2</li>
+ <li><tt>-scale log</tt> : set the display to log scale</li>
+ <li><tt>-cmap b</tt> : use the "b" colormap</li>
+ <li><tt>-contour yes</tt> : display contours</li>
+ <li><tt>-contour limits 1 100</tt> : set the minimum and maximum contour limits</li>
+ <li><tt>-contour smooth 5</tt> : set contour smoothness to "5"</li>
+ <li><tt>-contour nlevels 6</tt> : create six contour levels</li>
+ <li><tt>-contour save ds9.com</tt> : save the contours to the file "ds9.con"</li>
+ </list>
+
+ <p>
+ If you wish to add options to the command line after it has
+ been processed, the whole command must be run again from the
+ beginning. It is, however, possible to interact with
+ the ds9 GUI that has been created. For instance, instead of
+ including the "<tt>-bin about 3800 3800</tt>" modifier, the
+ image could be recentered in ds9 interactively.
+ </p>
+
+ <p>
+ The following command line builds on the previous example by
+ retrieving a DSS image and copying the contours to the new
+ frame:
+ </p>
+
+<screen>
+unix% ds9 acisf05005N002_evt2.fits -bin about 3800 3800 -bin factor 2 \
+ -scale log -cmap b \
+ -contour yes -contour limits 1 100 \
+ -contour smooth 5 -contour nlevels 6 -contour copy \
+ -dsssao A2142 -cmap grey -contour paste \
+ -frame first -match frames wcs &amp;
+</screen>
+
+ <p>
+ The resulting image is shown in <figlink id="clcontourdss"/>.
+ </p>
+
+ <figure id="clcontourdss">
+ <title>Command line: x-ray and optical data with contours</title>
+ <description>The x-ray data is in the left frame and the
+ optical data is in the right frame; both have the x-ray
+ contours displayed on the data.</description>
+ <bitmap format="png">contourdss.png</bitmap>
+ </figure>
+
+ <p>
+ The options which have been added from the previous command
+ line are:
+ </p>
+
+ <list type="1">
+ <li><tt>-contour copy</tt> : copy the x-ray contours</li>
+ <li><tt>-dsssao A2142</tt> : retrieve a DSS image of A2142
+ from the DSS-SAO server (there are also a "dsseso" and
+ "dssstsci" options)</li>
+ <li><tt>-cmap grey</tt> : use the "grey" colormap in the DSS frame</li>
+ <li><tt>-contour paste</tt> : paste the x-ray contours onto
+ the optical data</li>
+ <li><tt>-frame first</tt> : select the first ds9 frame</li>
+ <li><tt>-match frames wcs</tt> : match the WCS of the DSS
+ frame to the current (x-ray) frame</li>
+ </list>
+
+ <p>
+ At this point, we can end the ds9 session or modify the
+ display interactively via the ds9 GUI.
+ </p>
+
+
+ </section>
+
+ <section id="xpa">
+ <title>XPA Scripting</title>
+
+ <p>
+ X Public Access (XPA) is a messaging system which provides
+ communication between Unix programs through a set of access
+ points. The two most common actions are retrieving
+ information (<tt>xpaget</tt>) and issuing commands
+ (<tt>xpaset</tt>). For more information, see the <a
+ href="http://hea-www.harvard.edu/RD/xpa/">XPA Messaging
+ System</a> page and the <a
+ href="../../ref/xpa.html">XPA Access Points</a>
+ section of the ds9 manual.
+ </p>
+
+ <p>
+ XPA commands may be issued one at a time from the terminal
+ or collected in a script to run in batch mode.
+ Unlike the command line syntax, there is no predetermined
+ stopping point - commands may be sent to ds9 as long as the
+ GUI is open.
+ </p>
+
+ <p>
+ First, open ds9 with the data file:
+ </p>
+
+<screen>
+unix% ds9 acisf05005N002_evt2.fits &amp;
+</screen>
+
+ <p>
+ The <a
+ href="http://hea-www.harvard.edu/RD/xpa/xpans.html">xpans
+ name server</a> is used to manage the names and ports
+ of XPA access points. Use "<tt>xpaget xpans</tt>" to see
+ the list of available access points:
+ </p>
+
+<screen>
+unix% xpaget xpans
+DS9 ds9 gs /tmp/.xpa/DS9_ds9.22972 username
+</screen>
+
+ <p>
+ Now that ds9 is running and linked to an XPA server, we can
+ use xpaset to modify the display and add contours. (Refer
+ to the <a
+ href="http://hea-www.harvard.edu/RD/xpa/programs.html#xpaset">XPA
+ documentation</a> for details on <tt>xpaset</tt> syntax.)
+ </p>
+
+<screen>
+unix% xpaset -p ds9 bin about 3800 3800
+unix% xpaset -p ds9 bin factor 2
+unix% xpaset -p ds9 scale log
+unix% xpaset -p ds9 cmap b
+unix% xpaset -p ds9 contour yes
+unix% xpaset -p ds9 contour limits 1 100
+unix% xpaset -p ds9 contour smooth 5
+unix% xpaset -p ds9 contour nlevels 6
+unix% xpaset -p ds9 contour save xpa.con
+</screen>
+
+ <p>
+ This command line produces <figlink id="xpacontour"/>.
+ </p>
+
+ <figure id="xpacontour">
+ <title>XPA: x-ray data with contours</title>
+ <description>Diffuse emission with
+ contours overlaid; a point source is visible in the upper
+ left corner of the image.</description>
+ <bitmap format="png">contour.png</bitmap>
+ </figure>
+
+ <p>
+ The options direct ds9 to:
+ </p>
+
+ <list type="1">
+ <li><tt>xpaset -p bin about 3800 3800</tt> : center the image display at (x,y)=(3800,3800)</li>
+ <li><tt>xpaset -p bin factor 2</tt> : bin the data by a factor of 2</li>
+ <li><tt>xpaset -p scale log</tt> : set the display to log scale</li>
+ <li><tt>xpaset -p cmap b</tt> : use the "b" colormap</li>
+ <li><tt>xpaset -p contour yes</tt> : display contours</li>
+ <li><tt>xpaset -p contour limits 1 100</tt> : set the minimum and maximum contour limits</li>
+ <li><tt>xpaset -p contour smooth 5</tt> : set contour smoothness to "5"</li>
+ <li><tt>xpaset -p contour nlevels 6</tt> : create six contour levels</li>
+ <li><tt>xpaset -p contour save xpa.com</tt> : save the contours to the file "xpa.con"</li>
+ </list>
+
+ <p>
+ As long as the ds9 GUI remains open, we can continue to
+ modify the display. Here we build on the previous example
+ by retrieving a DSS image and copying the contours to the
+ new frame:
+ </p>
+
+<screen>
+unix% xpaset -p ds9 contour copy
+unix% xpaset -p ds9 dsssao A2142
+unix% xpaset -p ds9 cmap grey
+unix% xpaset -p ds9 contour paste
+unix% xpaset -p ds9 frame first
+unix% xpaset -p ds9 match frames wcs
+</screen>
+
+ <p>
+ The resulting image is shown in <figlink id="clcontourdss"/>.
+ </p>
+
+ <figure id="xpacontourdss">
+ <title>XPA: x-ray and optical data with contours</title>
+ <description>The x-ray data is in the left frame and the
+ optical data is in the right frame; both have the x-ray
+ contours displayed on the data.</description>
+ <bitmap format="png">contourdss.png</bitmap>
+ </figure>
+
+ <p>
+ The options which have been added from the previous command
+ line are:
+ </p>
+
+ <list type="1">
+ <li><tt>xpaset -p contour copy</tt> : copy the x-ray contours</li>
+ <li><tt>xpaset -p dsssao A2142</tt> : retrieve a DSS image of A2142
+ from the DSS-SAO server (there are also a "dsseso" and
+ "dssstsci" options)</li>
+ <li><tt>xpaset -p cmap grey</tt> : use the "grey" colormap in the DSS frame</li>
+ <li><tt>xpaset -p contour paste</tt> : paste the x-ray contours onto
+ the optical data</li>
+ <li><tt>xpaset -p frame first</tt> : select the first ds9 frame</li>
+ <li><tt>xpaset -p match frames wcs</tt> : match the WCS of the DSS
+ frame to the current (x-ray) frame</li>
+ </list>
+
+ <p>
+ At this point, we can end the ds9 session, issue further XPA
+ commands, or modify the display interactively via the ds9
+ GUI.
+ </p>
+
+ </section>
+
+ <section id="samp">
+ <title>SAMP: Simple Application Messaging Protocol</title>
+
+ <p>
+ A third method of scripting ds9 is via
+ <a href="http://www.ivoa.net/Documents/latest/SAMP.html">SAMP</a>,
+ a messaging protocol that enables astronomy software
+ tools to interoperate and communicate. SAMP is also used by
+ such applications
+ as <a href="http://www.star.bris.ac.uk/~mbt/topcat/">TOPCAT</a>,
+ an interactive graphical viewer and editor for tabular data
+ and <a href="http://aladin.u-strasbg.fr/">Aladin</a>, an
+ interactive software sky atlas.
+ </p>
+
+ <p>
+ Information on the ds9 SAMP implementation is available in
+ the <a href="../../ref/samp.html">ds9 Reference Manual</a>.
+ </p>
+ </section>
+
+ </sectionlist>
+ </text>
+
+</thread>
+
+
+
diff --git a/ds9/library/2mass.tcl b/ds9/library/2mass.tcl
new file mode 100644
index 0000000..08a5527
--- /dev/null
+++ b/ds9/library/2mass.tcl
@@ -0,0 +1,141 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc 2MASSDef {} {
+ global twomass
+ global itwomass
+
+ set itwomass(top) .twomass
+ set itwomass(mb) .twomassmb
+
+ set twomass(sky) fk5
+ set twomass(rformat) arcmin
+ set twomass(width) 15
+ set twomass(height) 15
+ set twomass(mode) new
+ set twomass(save) 0
+ set twomass(survey) j
+}
+
+proc 2MASSDialog {} {
+ global twomass
+ global itwomass
+ global wcs
+
+ if {[winfo exists $itwomass(top)]} {
+ raise $itwomass(top)
+ return
+ }
+
+ set varname dtwomass
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $itwomass(top)
+ set var(mb) $itwomass(mb)
+ set var(sky) $twomass(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $twomass(rformat)
+ set var(width) $twomass(width)
+ set var(height) $twomass(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $twomass(mode)
+ set var(save) $twomass(save)
+ set var(survey) $twomass(survey)
+
+ IMGSVRInit $varname "IPAC-2MASS [msgcat::mc {Server}]" \
+ 2MASSExec 2MASSAck ARDone ARError
+
+ $var(mb) add cascade -label Survey -menu $var(mb).survey
+ menu $var(mb).survey
+ $var(mb).survey add radiobutton -label {2MASS (J Band)} \
+ -variable ${varname}(survey) -value j
+ $var(mb).survey add radiobutton -label {2MASS (H Band)} \
+ -variable ${varname}(survey) -value h
+ $var(mb).survey add radiobutton -label {2MASS (K Band)} \
+ -variable ${varname}(survey) -value k
+
+ IMGSVRUpdate $varname
+}
+
+proc 2MASSExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+
+ } else {
+ set var(fn) [tmpnam {.fits.gz}]
+ }
+
+ # size - convert to arcsec
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.*60.]
+ set hh [expr $var(height)*60.*60.]
+ }
+ arcmin {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcsec {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+ if {$rr>1024} {
+ set rr 1024
+ }
+
+ set foo "$var(x) $var(y)"
+
+ set var(query) [http::formatQuery objstr $foo size $rr band $var(survey)]
+ set url "http://irsa.ipac.caltech.edu/cgi-bin/Oasis/2MASSImg/nph-2massimg"
+ IMGSVRGetURL $varname $url
+}
+
+proc 2MASSAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the 2MASS
+
+This publication makes use of data products from the Two Micron All
+Sky Survey, which is a joint project of the University of
+Massachusetts and the Infrared Processing and Analysis
+Center/California Institute of Technology, funded by the National
+Aeronautics and Space Administration and the National Science
+Foundation.
+ }
+
+ SimpleTextDialog "${varname}ack" [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc Process2MASSCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ 2MASSDialog
+ IMGSVRProcessCmd $varname $iname dtwomass
+}
+
+proc ProcessSend2MASSCmd {proc id param} {
+ 2MASSDialog
+ IMGSVRProcessSendCmd $proc $id $param dtwomass
+}
diff --git a/ds9/library/3d.tcl b/ds9/library/3d.tcl
new file mode 100644
index 0000000..1315f1c
--- /dev/null
+++ b/ds9/library/3d.tcl
@@ -0,0 +1,534 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc 3DDef {} {
+ global threed
+ global ithreed
+ global pthreed
+
+ set ithreed(top) .threed
+ set ithreed(mb) .threedmb
+ set ithreed(status) 0
+
+ set threed(az) 0
+ set threed(el) 0
+ set threed(scale) 1
+
+ set threed(method) mip
+ set threed(background) none
+ set threed(highlite) 1
+ set threed(highlite,color) cyan
+ set threed(border) 1
+ set threed(border,color) blue
+ set threed(compass) 0
+ set threed(compass,color) green
+
+ array set pthreed [array get threed]
+ unset pthreed(az)
+ unset pthreed(el)
+}
+
+# used by backup
+proc 3DDialog {} {
+ global threed
+ global ithreed
+ global ds9
+
+ # see if we already have a window visible
+ if {[winfo exists $ithreed(top)]} {
+ raise $ithreed(top)
+ return
+ }
+
+ # create the 3d window
+ set w $ithreed(top)
+ set mb $ithreed(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {3D}] 3DDestroyDialog
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Render}] -menu $mb.render
+ $mb add cascade -label [msgcat::mc {Highlite}] -menu $mb.highlite
+ $mb add cascade -label [msgcat::mc {Border}] -menu $mb.border
+# $mb add cascade -label [msgcat::mc {Compass}] -menu $mb.compass
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command 3DApplyDialog
+ $mb.file add command -label [msgcat::mc {Reset}] -command 3DResetDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command 3DDestroyDialog
+
+ EditMenu $mb ithreed
+
+ menu $mb.render
+ $mb.render add radiobutton -label [msgcat::mc {MIP}] \
+ -variable threed(method) -value {mip} -command 3DRenderMethod
+ $mb.render add radiobutton -label [msgcat::mc {AIP}] \
+ -variable threed(method) -value {aip} -command 3DRenderMethod
+ $mb.render add separator
+ $mb.render add radiobutton -label [msgcat::mc {None}] \
+ -variable threed(background) -value {none} -command 3DBackground
+ $mb.render add radiobutton -label [msgcat::mc {Azimuth}] \
+ -variable threed(background) -value {azimuth} -command 3DBackground
+ $mb.render add radiobutton -label [msgcat::mc {Elevation}] \
+ -variable threed(background) -value {elevation} -command 3DBackground
+
+ menu $mb.highlite
+ $mb.highlite add checkbutton -label [msgcat::mc {Show}] \
+ -variable threed(highlite) -command 3DHighlite
+ $mb.highlite add separator
+ $mb.highlite add cascade -label [msgcat::mc {Color}] \
+ -menu $mb.highlite.color
+ ColorMenu $mb.highlite.color threed highlite,color 3DHighliteColor
+
+ menu $mb.border
+ $mb.border add checkbutton -label [msgcat::mc {Show}] \
+ -variable threed(border) -command 3DBorder
+ $mb.border add separator
+ $mb.border add cascade -label [msgcat::mc {Color}] \
+ -menu $mb.border.color
+ ColorMenu $mb.border.color threed border,color 3DBorderColor
+
+ menu $mb.compass
+ $mb.compass add checkbutton -label [msgcat::mc {Show}] -variable threed(compass) -command 3DCompass
+ $mb.compass add separator
+ $mb.compass add cascade -label [msgcat::mc {Color}] -menu $mb.compass.color
+ ColorMenu $mb.compass.color threed compass,color 3DCompassColor
+
+ # Param
+ set f [ttk::frame $w.param]
+ slider $f.elslider -90 90 [msgcat::mc {Elevation}] threed(el) \
+ [list 3DViewMotion]
+ slider $f.azslider -180 180 [msgcat::mc {Azimuth}] threed(az) \
+ [list 3DViewMotion]
+
+ bind $f.elslider.slider <ButtonPress-1> {3DViewButton}
+ bind $f.elslider.slider <ButtonRelease-1> {3DViewRelease}
+ bind $f.azslider.slider <ButtonPress-1> {3DViewButton}
+ bind $f.azslider.slider <ButtonRelease-1> {3DViewRelease}
+
+ grid $f.azslider -padx 2 -pady 2 -sticky ew
+ grid $f.elslider -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+ # for order of focus
+ raise $f.elslider
+
+ # Scale
+ set f [ttk::frame $w.scale]
+ ttk::label $f.tscale -text [msgcat::mc {Z Axis Scale}]
+ ttk::entry $f.scale -textvariable threed(scale) -width 7
+ grid $f.tscale $f.scale -padx 2 -pady 2 -sticky ew
+
+ # Status
+ set f [ttk::frame $w.status]
+ ttk::label $f.tstatus -text [msgcat::mc {Status}]
+ ttk::progressbar $f.status -variable ithreed(status) -length 350
+ grid $f.tstatus $f.status -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command 3DApplyDialog
+ ttk::button $f.reset -text [msgcat::mc {Reset}] -command 3DResetDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command 3DDestroyDialog
+ pack $f.apply $f.reset $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.sep2 -orient horizontal
+ ttk::separator $w.sep3 -orient horizontal
+ pack $w.buttons $w.sep $w.status $w.sep2 -side bottom -fill x
+ pack $w.param $w.sep3 $w.scale -side top -fill x
+
+ Update3DDialog
+}
+
+proc 3DDestroyDialog {} {
+ global threed
+ global ithreed
+
+ if {[winfo exists $ithreed(top)]} {
+ destroy $ithreed(top)
+ destroy $ithreed(mb)
+ }
+}
+
+proc 3DApplyDialog {} {
+ global threed
+ global current
+ global grid
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d view $threed(az) $threed(el)
+ $current(frame) 3d scale $threed(scale)
+ if {$grid(view)} {
+ GridUpdateCurrent
+ }
+ }
+}
+
+proc 3DResetDialog {} {
+ global threed
+
+ set threed(az) 0
+ set threed(el) 0
+ 3DViewPoint
+ set threed(scale) 1
+ 3DScale
+}
+
+proc Update3DDialog {} {
+ global threed
+ global ithreed
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "Update3DDialog"
+ }
+
+ set w $ithreed(top)
+
+ if {[winfo exists $ithreed(top)] && $current(frame) != {}} {
+ set rr [$current(frame) get 3d view]
+ set threed(az) [lindex $rr 0]
+ set threed(el) [lindex $rr 1]
+ set threed(scale) [$current(frame) get 3d scale]
+ set threed(method) [$current(frame) get 3d method]
+ set threed(background) [$current(frame) get 3d background]
+ set threed(highlite) [$current(frame) get 3d highlite]
+ set threed(highlite,color) [$current(frame) get 3d highlite color]
+ set threed(border) [$current(frame) get 3d border]
+ set threed(border,color) [$current(frame) get 3d border color]
+ set threed(compass) [$current(frame) get 3d compass]
+ set threed(compass,color) [$current(frame) get 3d compass color]
+ }
+}
+
+proc 3DBackup {ch which} {
+ puts $ch "$which 3d view [$which get 3d view]"
+ puts $ch "$which 3d scale [$which get 3d scale]"
+ puts $ch "$which 3d method [$which get 3d method]"
+ puts $ch "$which 3d highlite [$which get 3d highlite]"
+ puts $ch "$which 3d border [$which get 3d border]"
+ puts $ch "$which 3d background [$which get 3d background]"
+ # this must come after panto and blockto
+ puts $ch "$which 3d view point [$which get 3d view point]"
+
+}
+
+proc 3DViewPoint {} {
+ global threed
+ global current
+ global grid
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d view $threed(az) $threed(el)
+ if {$grid(view)} {
+ GridUpdateCurrent
+ }
+ }
+}
+
+proc 3DViewButton {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d view begin $threed(az) $threed(el)
+ }
+}
+
+proc 3DViewMotion {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d view motion $threed(az) $threed(el)
+ }
+}
+
+proc 3DViewRelease {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d view end $threed(az) $threed(el)
+ }
+}
+
+proc 3DScale {} {
+ global threed
+ global current
+ global grid
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d scale $threed(scale)
+ if {$grid(view)} {
+ GridUpdateCurrent
+ }
+ }
+}
+
+proc 3DRenderMethod {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d method $threed(method)
+ }
+}
+
+proc 3DHighlite {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d highlite $threed(highlite)
+ }
+}
+
+proc 3DHighliteColor {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d highlite color $threed(highlite,color)
+ }
+}
+
+proc 3DBorder {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d border $threed(border)
+ }
+}
+
+proc 3DBorderColor {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d border color $threed(border,color)
+ }
+}
+
+proc 3DCompass {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d compass $threed(compass)
+ }
+}
+
+proc 3DCompassColor {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d compass color $threed(compass,color)
+ }
+}
+
+proc 3DBackground {} {
+ global threed
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) 3d background $threed(background)
+ }
+}
+
+# Prefs
+
+proc PrefsDialog3d {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {3D}]
+ lappend dprefs(tabs) [ttk::frame $w.threed]
+
+ set f [ttk::labelframe $w.threed.misc -text [msgcat::mc {Render}]]
+ ttk::label $f.tmethod -text [msgcat::mc {Method}]
+ ttk::menubutton $f.method -textvariable pthreed(method) \
+ -menu $f.method.menu
+ ttk::label $f.tbackground -text [msgcat::mc {Background}]
+ ttk::menubutton $f.background -textvariable pthreed(background) \
+ -menu $f.background.menu
+
+ grid $f.tmethod $f.method -padx 2 -pady 2 -sticky w
+ grid $f.tbackground $f.background -padx 2 -pady 2 -sticky w
+
+ set m $f.method.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {MIP}] \
+ -variable pthreed(method) -value {mip}
+ $m add radiobutton -label [msgcat::mc {AIP}] \
+ -variable pthreed(method) -value {aip}
+
+ set m $f.background.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {None}] \
+ -variable pthreed(background) -value {none}
+ $m add radiobutton -label [msgcat::mc {Azimuth}] \
+ -variable pthreed(background) -value {azimuth}
+ $m add radiobutton -label [msgcat::mc {Elevation}] \
+ -variable pthreed(background) -value {elevation}
+
+ set f [ttk::labelframe $w.threed.highlite -text [msgcat::mc {Highlite}]]
+ ttk::checkbutton $f.show -text [msgcat::mc {Show}] \
+ -variable pthreed(highlite)
+ ttk::label $f.tcolor -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pthreed highlite,color {}
+
+ grid $f.show -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+
+ set f [ttk::labelframe $w.threed.border -text [msgcat::mc {Border}]]
+ ttk::checkbutton $f.show -text [msgcat::mc {Show}] \
+ -variable pthreed(border)
+ ttk::label $f.tcolor -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pthreed border,color {}
+
+ grid $f.show -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+
+# set f [ttk::labelframe $w.threed.compass -text [msgcat::mc {Compass}]]
+# ttk::checkbutton $f.show -text [msgcat::mc {Show}] -variable pthreed(compass)
+# ttk::label $f.tcolor -text [msgcat::mc {Color}]
+# ColorMenuButton $f.color pthreed compass,color {}
+
+ grid $f.show -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+
+ pack $w.threed.misc $w.threed.highlite $w.threed.border \
+ -side top -fill both -expand true
+}
+
+proc Process3DCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global threed
+
+ 3DDialog
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {}
+ close {3DDestroyDialog}
+ az {
+ incr i
+ set threed(az) [lindex $var $i]
+ 3DViewPoint
+ }
+ el {
+ incr i
+ set threed(el) [lindex $var $i]
+ 3DViewPoint
+ }
+ view -
+ vp {
+ incr i
+ set threed(az) [lindex $var $i]
+ incr i
+ set threed(el) [lindex $var $i]
+ 3DViewPoint
+ }
+ scale {
+ incr i
+ set threed(scale) [lindex $var $i]
+ 3DScale
+ }
+ method {
+ incr i
+ set threed(method) [lindex $var $i]
+ 3DRenderMethod
+ }
+ background {
+ incr i
+ set threed(background) [lindex $var $i]
+ 3DBackground
+ }
+ highlite {
+ incr i
+ switch [string tolower [lindex $var $i]] {
+ color {
+ incr i
+ set threed(highlite,color) [lindex $var $i]
+ 3DHighliteColor
+ }
+ default {
+ set threed(highlite) [FromYesNo [lindex $var $i]]
+ 3DHighlite
+ }
+ }
+ }
+ border {
+ incr i
+ switch [string tolower [lindex $var $i]] {
+ color {
+ incr i
+ set threed(border,color) [lindex $var $i]
+ 3DBorderColor
+ }
+ default {
+ set threed(border) [FromYesNo [lindex $var $i]]
+ 3DBorder
+ }
+ }
+ }
+ compass {
+ incr i
+ switch [string tolower [lindex $var $i]] {
+ color {
+ incr i
+ set threed(compass,color) [lindex $var $i]
+ 3DCompassColor
+ }
+ default {
+ set threed(compass) [FromYesNo [lindex $var $i]]
+ 3DCompass
+ }
+ }
+ }
+ default {Create3DFrame; incr i -1}
+ }
+}
+
+proc ProcessSend3DCmd {proc id param} {
+ global threed
+
+ switch -- [string tolower [lindex $param 0]] {
+ az {$proc $id "$threed(az)\n"}
+ el {$proc $id "$threed(el)\n"}
+ view -
+ vp {$proc $id "$threed(az) $threed(el)\n"}
+ scale {$proc $id "$threed(scale)\n"}
+ method {$proc $id "$threed(method)\n"}
+ background {$proc $id "$threed(background)\n"}
+ highlite {
+ switch [string tolower [lindex $param 1]] {
+ color {$proc $id "$threed(highlite,color)\n"}
+ default {$proc $id [ToYesNo $threed(highlite)]}
+ }
+ }
+ border {
+ switch [string tolower [lindex $param 1]] {
+ color {$proc $id "$threed(border,color)\n"}
+ default {$proc $id [ToYesNo $threed(border)]}
+ }
+ }
+ compass {
+ switch [string tolower [lindex $param 1]] {
+ color {$proc $id "$threed(compass,color)\n"}
+ default {$proc $id [ToYesNo $threed(compass)]}
+ }
+ }
+ }
+}
diff --git a/ds9/library/Makefile b/ds9/library/Makefile
new file mode 100644
index 0000000..ef058c0
--- /dev/null
+++ b/ds9/library/Makefile
@@ -0,0 +1,188 @@
+SCRIPTS = \
+ 2mass.tcl \
+ 3d.tcl \
+ array.tcl \
+ analysis.tcl \
+ analysisparam.tcl \
+ annulus.tcl \
+ ar.tcl \
+ backup.tcl \
+ bin.tcl \
+ box.tcl \
+ boxannulus.tcl \
+ bpanda.tcl \
+ buttons.tcl \
+ cat.tcl \
+ catcds.tcl \
+ catcdssrch.tcl \
+ catcdssrchdialog.tcl \
+ catcmd.tcl \
+ catcxc.tcl \
+ catdialog.tcl \
+ catflt.tcl \
+ catmatch.tcl \
+ catned.tcl \
+ catopt.tcl \
+ catplot.tcl \
+ catreg.tcl \
+ catsdss.tcl \
+ catsimbad.tcl \
+ catskybot.tcl \
+ catsym.tcl \
+ cattsv.tcl \
+ catvot.tcl \
+ centroid.tcl \
+ circle.tcl \
+ colorbar.tcl \
+ comm.tcl \
+ command.tcl \
+ compass.tcl \
+ composite.tcl \
+ contour.tcl \
+ convert.tcl \
+ coord.tcl \
+ cpanda.tcl \
+ crop.tcl \
+ crosshair.tcl \
+ cube.tcl \
+ debug.tcl \
+ dialog.tcl \
+ ellipse.tcl \
+ ellipseannulus.tcl \
+ envi.tcl \
+ epanda.tcl \
+ error.tcl \
+ eso.tcl \
+ examine.tcl \
+ export.tcl \
+ external.tcl \
+ file.tcl \
+ fits.tcl \
+ frame.tcl \
+ graph.tcl \
+ grid.tcl \
+ group.tcl \
+ header.tcl \
+ help.tcl \
+ http.tcl \
+ hv.tcl \
+ hvform.tcl \
+ hvsup.tcl \
+ iis.tcl \
+ imexam.tcl \
+ imgsvr.tcl \
+ import.tcl \
+ info.tcl \
+ layout.tcl \
+ line.tcl \
+ load.tcl \
+ magnifier.tcl \
+ marker.tcl \
+ markeranalysispanda.tcl \
+ markeranalysisplot2d.tcl \
+ markeranalysisplot3d.tcl \
+ markeranalysisradial.tcl \
+ markeranalysisstats.tcl \
+ markerbase.tcl \
+ markerbaseannulus.tcl \
+ markerbaseannulusrect.tcl \
+ markerbasecenter.tcl \
+ markerbaseline.tcl \
+ markerbasepanda.tcl \
+ markerbasepandarect.tcl \
+ markerdialog.tcl \
+ mask.tcl \
+ manalysis.tcl \
+ mbin.tcl \
+ mcolor.tcl \
+ mecube.tcl \
+ medit.tcl \
+ menu.tcl \
+ mfile.tcl \
+ mframe.tcl \
+ mhelp.tcl \
+ macosx.tcl \
+ macosxextra.tcl \
+ mosaicimage.tcl \
+ mosaicimageiraf.tcl \
+ mosaicimagewcs.tcl \
+ mosaicimagewfpc2.tcl \
+ mosaic.tcl \
+ mosaiciraf.tcl \
+ mosaicwcs.tcl \
+ movie.tcl \
+ mregion.tcl \
+ mscale.tcl \
+ multiframe.tcl \
+ mview.tcl \
+ mwcs.tcl \
+ mzoom.tcl \
+ nameres.tcl \
+ nrrd.tcl \
+ nsvr.tcl \
+ nvss.tcl \
+ pagesetup.tcl \
+ panner.tcl \
+ panzoom.tcl \
+ pixel.tcl \
+ photo.tcl \
+ plot.tcl \
+ plotbar.tcl \
+ plotdialog.tcl \
+ plotelement.tcl \
+ plotline.tcl \
+ plotprint.tcl \
+ plotprocess.tcl \
+ plotscatter.tcl \
+ point.tcl \
+ polygon.tcl \
+ prefs.tcl \
+ prefsdialog.tcl \
+ print.tcl \
+ projection.tcl \
+ open.tcl \
+ rgb.tcl \
+ rgbarray.tcl \
+ rgbcube.tcl \
+ rgbimage.tcl \
+ ruler.tcl \
+ samp.tcl \
+ sao.tcl \
+ save.tcl \
+ saveimage.tcl \
+ scale.tcl \
+ segment.tcl \
+ sfits.tcl \
+ shm.tcl \
+ skyview.tcl \
+ slider.tcl \
+ smosaic.tcl \
+ smosaiciraf.tcl \
+ smosaicwcs.tcl \
+ smooth.tcl \
+ source.tcl \
+ srgbcube.tcl \
+ starbase.tcl \
+ stdfbox.tcl \
+ stsci.tcl \
+ template.tcl \
+ text.tcl \
+ tkfbox.tcl \
+ url.tcl \
+ util.tcl \
+ var.tcl \
+ vector.tcl \
+ vla.tcl \
+ vo.tcl \
+ wcs.tcl \
+ win32.tcl \
+ xmfbox.tcl \
+ xpa.tcl
+
+.PHONY : msgs clean
+
+msgs :
+ grep 'msgcat::mc' $(SCRIPTS) | cut -d[ -f2 | sed -e 's/::mc/::mcset AAA /' -e 's/]/ ""/' | sort | uniq > ../msgs/tmpl.tcl
+
+clean :
+ $(RM) core *~ *#
diff --git a/ds9/library/analysis.tcl b/ds9/library/analysis.tcl
new file mode 100644
index 0000000..da1de2e
--- /dev/null
+++ b/ds9/library/analysis.tcl
@@ -0,0 +1,1958 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc AnalysisDef {} {
+ global ianalysis
+ global panalysis
+
+ global ds9
+
+ set ianalysis(menu,count) 0
+ set ianalysis(menu,hmenu,count) 0
+ set ianalysis(menu,hmenu) {}
+ set ianalysis(bind,count) 0
+ set ianalysis(param,count) 0
+ set ianalysis(param,seq) 0
+ set ianalysis(file) ".$ds9(app).ans"
+ set ianalysis(alt) ".$ds9(app).analysis"
+
+ # prefs only
+ set panalysis(log) 0
+ set panalysis(autoload) 1
+ set panalysis(user) {}
+ set panalysis(user2) {}
+ set panalysis(user3) {}
+ set panalysis(user4) {}
+}
+
+proc OpenAnalysisMenu {} {
+ set fn [OpenFileDialog analysisfbox]
+ if {$fn != {}} {
+ ProcessAnalysisFile $fn
+ }
+}
+
+proc ClearAnalysisMenu {} {
+ global pds9
+
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message [msgcat::mc {Clear External Analysis Commands?}]] != {ok}} {
+ return
+ }
+ }
+ ClearAnalysis
+}
+
+# Analysis Menu Delete
+proc ClearAnalysis {} {
+ global ds9
+ global ianalysis
+
+ # is something loaded?
+ if {$ianalysis(menu,count) == 0} {
+ return
+ }
+
+ # delete cascade menus
+ for {set ii 0} {$ii<$ianalysis(menu,hmenu,count)} {incr ii} {
+ destroy [lindex $ianalysis(menu,hmenu) $ii]
+ }
+ set ianalysis(menu,hmenu) {}
+ set ianalysis(menu,hmenu,count) 0
+
+ # clear menu
+ $ds9(mb).analysis delete $ds9(menu,size,analysis) end
+
+ for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
+ unset ianalysis(menu,$ii,parent)
+ unset ianalysis(menu,$ii,item)
+ unset ianalysis(menu,$ii,template)
+ unset ianalysis(menu,$ii,cmd)
+ unset ianalysis(menu,$ii,inuse)
+ unset ianalysis(menu,$ii,var)
+ }
+ set ianalysis(menu,count) 0
+
+ # clear all bindings, first
+
+ foreach ff $ds9(frames) {
+ for {set ii 0} {$ii<$ianalysis(bind,count)} {incr ii} {
+ $ds9(canvas) bind $ff "$ianalysis(bind,$ii,item)" {}
+ }
+ }
+
+ # clear bindings
+
+ for {set ii 0} {$ii<$ianalysis(bind,count)} {incr ii} {
+ unset ianalysis(bind,$ii,item)
+ unset ianalysis(bind,$ii,template)
+ unset ianalysis(bind,$ii,cmd)
+ unset ianalysis(bind,$ii,inuse)
+ }
+ set ianalysis(bind,count) 0
+
+ # clear params
+
+ for {set ii 0} {$ii<$ianalysis(param,count)} {incr ii} {
+ for {set jj 0} {$jj<$ianalysis(param,$ii,count)} {incr jj} {
+ unset ianalysis(param,$ii,$jj,var)
+ unset ianalysis(param,$ii,$jj,type)
+ unset ianalysis(param,$ii,$jj,title)
+ unset ianalysis(param,$ii,$jj,default)
+ unset ianalysis(param,$ii,$jj,last)
+ unset ianalysis(param,$ii,$jj,value)
+ unset ianalysis(param,$ii,$jj,info)
+ }
+ unset ianalysis(param,$ii,count)
+ unset ianalysis(param,$ii)
+ }
+ set ianalysis(param,count) 0
+}
+
+proc InitAnalysisFile {} {
+ global ianalysis
+ global panalysis
+ global ds9
+
+ set done {}
+
+ # autoload
+ if {$panalysis(autoload)} {
+ foreach dir [list {.} "[GetEnvHome]/bin" {/usr/local/bin} {/opt/local/bin} {/soft/saord/bin}] {
+ foreach fn [glob -directory $dir -nocomplain "*.ds9"] {
+ if {[file exists $fn]} {
+ ProcessAnalysisFile $fn
+ lappend done $fn
+ }
+ }
+ }
+ }
+
+ # default name ds9.ans
+ # backward compatible ds9.analysis
+ foreach ff {{.} {~}} {
+ foreach gg {{} {.}} {
+ foreach ext {{ans} {analysis}} {
+ set fn "$ff/$gg$ds9(app).$ext"
+ if {[file exists $fn]} {
+ if {[lsearch $done $fn] == -1} {
+ ProcessAnalysisFile $fn
+ lappend done $fn
+ }
+ }
+ }
+ }
+ }
+
+ # user specified
+ foreach ii {{user} {user2} {user3} {user4}} {
+ if {[info exists panalysis($ii)]} {
+ set fn $panalysis($ii)
+ if {[file exists $fn]} {
+ if {[lsearch $done $fn] == -1} {
+ ProcessAnalysisFile $fn
+ lappend done $fn
+ }
+ }
+ }
+ }
+
+ UpdateAnalysisMenu
+}
+
+proc ProcessAnalysisFile {fn} {
+ global env
+
+ # check for simple file
+ if {[file exists "$fn"] &&
+ [file isfile "$fn"] &&
+ ![file executable "$fn"] &&
+ ![file isdirectory "$fn"]} {
+
+ set ch [open $fn r]
+ set data [read $ch]
+ close $ch
+
+ if {![ProcessAnalysis data]} {
+ Error "[msgcat::mc {Unable to process Analysis file}] $fn"
+ return
+ }
+
+ # add directory to path
+ set env(PATH) "[file dirname $fn]:$env(PATH)"
+ } else {
+ Error "[msgcat::mc {Unable to open file}] $fn"
+ }
+}
+
+proc ProcessAnalysis {varname} {
+ upvar $varname var
+
+ global ds9
+ global ianalysis
+
+ # simple check for ascii data
+ if {![string is ascii $var]} {
+ return 0
+ }
+
+ set state 1
+ set baseparent $ds9(mb).analysis
+ set currentparent $baseparent
+ set parentstack $baseparent
+
+ $baseparent add separator
+
+ set lines [split $var \n]
+ set l [llength $lines]
+
+ for {set ii 0} {$ii<$l} {incr ii} {
+ set line [string trim [lindex $lines $ii]]
+
+ # eat empty lines and comments for all except help
+ if {$state != 6} {
+ # empty line
+ if {[string length $line] == 0} continue
+
+ # comments
+ if {[string range $line 0 0] == "\#"} continue
+
+ # strip any end of line comments
+ set id [string first "\#" $line]
+ if {$id > 0} {
+ set line [string range $line 0 [expr $id-1]]
+ }
+ }
+
+ switch -- $state {
+ 1 {
+ # param
+ if {[lindex $line 0] == {param}} {
+ if {[lindex $line 1] != {}} {
+ set ianalysis(param,$ianalysis(param,count)) \
+ [lindex $line 1]
+ set ianalysis(param,$ianalysis(param,count),count) 0
+ set state 5
+ }
+ continue
+ }
+
+ # help
+ if {[lindex $line 0] == {help}} {
+ set id [string first " " $line]
+ if {$id > 0} {
+ set item [string range $line [expr $id+1] end]
+ } else {
+ set item Help
+ }
+
+ set i $ianalysis(menu,count)
+ set ianalysis(menu,$i,parent) $currentparent
+ set ianalysis(menu,$i,item) $item
+ set ianalysis(menu,$i,template) {*}
+ set ianalysis(menu,$i,cmd) {help}
+ set ianalysis(menu,$i,inuse) 0
+ set ianalysis(menu,$i,var) {}
+ $currentparent add command -label $item \
+ -command [list AnalysisTask $i menu]
+
+ set state 6
+ continue
+ }
+
+ # hmenu
+ if {[lindex $line 0] == {hmenu}} {
+ set id [string first " " $line]
+ if {$id > 0} {
+ set item [string range $line [expr $id+1] end]
+ } else {
+ set item Tasks
+ }
+
+ # make the menu label unique
+ set nmenu "$currentparent.hmenu$ianalysis(menu,hmenu,count)"
+ lappend ianalysis(menu,hmenu) $nmenu
+ incr ianalysis(menu,hmenu,count)
+
+ menu $nmenu
+ $currentparent add cascade -label "$item" -menu $nmenu
+
+ set currentparent $nmenu
+ lappend parentstack $currentparent
+ continue
+ }
+
+ # end hmenu
+ if {[lindex $line 0] == {endhmenu} ||
+ [lindex $line 0] == {end}} {
+ set parentstack [lreplace $parentstack end end]
+ set currentparent [lindex $parentstack end]
+ continue
+ }
+
+ if {[lindex $line 0] == {---}} {
+ $currentparent add separator
+ continue
+ }
+
+ # assume new command
+
+ set item "$line"
+ set template {}
+ set type {}
+ set cmd {}
+ set state 2
+ }
+
+ 2 {
+ set template "$line"
+ set state 3
+ }
+
+ 3 {
+ set type "$line"
+ set state 4
+ }
+
+ 4 {
+ set cmd "$line"
+ if {$item != {} && $template != {} &&
+ $type != {} && $cmd != {}} {
+ switch -- [lindex $type 0] {
+ bind {
+ set b [lindex $type 1]
+ if {$b != {}} {
+ set i $ianalysis(bind,count)
+ set ianalysis(bind,$i,item) "<$b>"
+ set ianalysis(bind,$i,template) "$template"
+ set ianalysis(bind,$i,cmd) "$cmd"
+ set ianalysis(bind,$i,inuse) 0
+ incr ianalysis(bind,count)
+ }
+ }
+ web {
+ set i $ianalysis(menu,count)
+ set ianalysis(menu,$i,parent) $currentparent
+ set ianalysis(menu,$i,item) $item
+ set ianalysis(menu,$i,template) "$template"
+ set ianalysis(menu,$i,cmd) {web}
+ set ianalysis(menu,$i,inuse) 0
+ set ianalysis(menu,$i,var) "$cmd"
+ $currentparent add command -label "$item" \
+ -command [list AnalysisTask $i menu]
+ incr ianalysis(menu,count)
+ }
+ menu {
+ set i $ianalysis(menu,count)
+ set ianalysis(menu,$i,parent) $currentparent
+ set ianalysis(menu,$i,item) "$item"
+ set ianalysis(menu,$i,template) "$template"
+ set ianalysis(menu,$i,cmd) "$cmd"
+ set ianalysis(menu,$i,inuse) 0
+ set ianalysis(menu,$i,var) {}
+ $currentparent add check -label "$item" \
+ -command [list AnalysisTask $i menu] \
+ -variable ianalysis(menu,$i,inuse) \
+ -selectcolor green
+ incr ianalysis(menu,count)
+ }
+ default {
+ # something really wrong here, abort
+ return 0
+ }
+ }
+ }
+ set state 1
+ }
+
+ 5 {
+ # end param
+ if {[lindex $line 0] == {endparam} ||
+ [lindex $line 0] == {end}} {
+ incr ianalysis(param,count)
+ set state 1
+ continue
+ }
+
+ if {[string range $line 0 0] == {@}} {
+ ParseIRAFParam [string range $line 1 end]
+ continue
+ }
+
+ set i $ianalysis(param,count)
+ set j $ianalysis(param,$i,count)
+ set ianalysis(param,$i,$j,var) [lindex $line 0]
+ set ianalysis(param,$i,$j,type) [lindex $line 1]
+ set ianalysis(param,$i,$j,title) [lindex $line 2]
+
+ # default can contain the full menu 'aaa|bbb|ccc'
+ set ianalysis(param,$i,$j,default) [lindex $line 3]
+ # set last to first item
+ set ianalysis(param,$i,$j,last) \
+ [lindex [split [lindex $line 3] |] 0]
+ # and set value to last
+ set ianalysis(param,$i,$j,value) \
+ $ianalysis(param,$i,$j,last)
+
+ set ianalysis(param,$i,$j,info) [lindex $line 4]
+ incr ianalysis(param,$i,count)
+ }
+
+ 6 {
+ # end help
+ if {[lindex $line 0] == {endhelp} ||
+ [lindex $line 0] == {end}} {
+ incr ianalysis(menu,count)
+ set state 1
+ continue
+ }
+
+ set i $ianalysis(menu,count)
+ append ianalysis(menu,$i,var) "$line\n"
+ }
+ }
+ }
+
+ # events
+ UnBindEventsCanvas
+ BindEventsCanvas
+
+ UpdateAnalysisMenu
+
+ return 1
+}
+
+proc AnalysisTask {i which {frame {}} {x 0} {y 0} {sync 0}} {
+ global ianalysis
+ global current
+
+ if {$frame == {}} {
+ set frame $current(frame)
+ }
+
+ switch -- $ianalysis($which,$i,cmd) {
+ help {
+ AnalysisText "at${which}${i}" $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,var) insert
+ }
+ web {
+ if {$frame != {}} {
+ AnalysisWebDoit $i $which $frame $x $y $sync
+ }
+ }
+ default {
+ if {$frame != {}} {
+ AnalysisTaskDoit $i $which $frame $x $y $sync
+ }
+ }
+ }
+}
+
+proc AnalysisWebDoit {i which frame x y sync} {
+ global ianalysis
+ global panalysis
+
+ set cmd "$ianalysis($which,$i,var)"
+
+ # do select macro expansion
+
+ # escaped macros
+ SetEscapedMacros cmd
+
+ # $xpa_method
+ ParseXPAMethodMacro cmd
+
+ # $xpa
+ ParseXPAMacro cmd
+
+ # $vo_method
+ ParseVOMethodMacro cmd
+
+ # $xdim,$ydim,$bitpix
+ ParseXYBitpixMacro cmd $frame
+
+ # $filename[$regions]
+ ParseFilenameRegionMacro cmd $frame
+
+ # $filename
+ ParseFilenameMacro cmd $frame
+
+ # $filedialog
+ ParseFileDialogMacro cmd
+
+ # $regions
+ ParseRegionMacro cmd $frame
+
+ # $env
+ ParseEnvMacro cmd
+
+ # $pan
+ ParsePanMacro cmd $frame
+
+ # $value
+ ParseValueMacro cmd $frame $x $y
+
+ # $x,$y
+ ParseXYMacro cmd $frame $x $y
+
+ # $z
+ ParseZMacro cmd $frame
+
+ # escaped macros
+ UnsetEscapedMacros cmd
+
+ if {$panalysis(log)} {
+ SimpleTextDialog acmd [msgcat::mc {Analysis Commands}] \
+ 80 20 append bottom "$cmd\n"
+ }
+
+ HVAnalysisCmd "at${which}${i}" "$ianalysis($which,$i,item)" "$cmd" $sync
+}
+
+proc AnalysisTaskDoit {i which frame x y sync} {
+ global ianalysis
+ global pds9
+
+ if {[info exists ianalysis($which,$i,pid)]} {
+ set ianalysis($which,$i,inuse) 1
+
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message [msgcat::mc {This analysis task is already running. Do you wish to kill it?}]] != {ok}} {
+ return
+ }
+ }
+
+ if {[info exists ianalysis($which,$i,pid)]} {
+ if {$ianalysis($which,$i,pid)>0} {
+ eval "exec kill -9 $ianalysis($which,$i,pid)"
+ } else {
+ HVAnalysisCancel $which $i
+ }
+ }
+
+ return
+ }
+
+ # don't turn on til task has started
+ set ianalysis($which,$i,inuse) 0
+
+ set ianalysis($which,$i,start) {}
+ set ianalysis($which,$i,start,fn) {}
+ set ianalysis($which,$i,start,url) {}
+ set ianalysis($which,$i,finish) {}
+ set ianalysis($which,$i,result) {}
+ set ianalysis($which,$i,plot,title) {}
+ set ianalysis($which,$i,plot,xaxis) {}
+ set ianalysis($which,$i,plot,yaxis) {}
+ set ianalysis($which,$i,plot,dim) 2
+ set ianalysis($which,$i,image) {}
+
+ set cmd $ianalysis($which,$i,cmd)
+
+ # escaped macros
+ SetEscapedMacros cmd
+
+ # $data
+ ParseDataMacro cmd $which $i
+
+ # $xpa_method
+ ParseXPAMethodMacro cmd
+
+ # $xpa
+ ParseXPAMacro cmd
+
+ # $vo_method
+ ParseVOMethodMacro cmd
+
+ # $xdim,$ydim,$bitpix
+ ParseXYBitpixMacro cmd $frame
+
+ # $filename[$regions]
+ ParseFilenameRegionMacro cmd $frame
+
+ # $filename
+ ParseFilenameMacro cmd $frame
+
+ # $filedialog
+ ParseFileDialogMacro cmd
+
+ # $regions
+ ParseRegionMacro cmd $frame
+
+ # $env
+ ParseEnvMacro cmd
+
+ # $cen
+ ParsePanMacro cmd $frame
+
+ # $value
+ ParseValueMacro cmd $frame $x $y
+
+ # $x,$y
+ ParseXYMacro cmd $frame $x $y
+
+ # $z
+ ParseZMacro cmd $frame
+
+ # $message
+ if {![ParseMessageMacro cmd]} {
+ AnalysisTaskEnd $which $i
+ return
+ }
+
+ # $entry
+ if {![ParseEntryMacro cmd]} {
+ AnalysisTaskEnd $which $i
+ return
+ }
+
+ # $param
+ if {![ParseParamMacro cmd]} {
+ AnalysisTaskEnd $which $i
+ return
+ }
+
+ # $text
+ ParseTextMacro cmd $which $i
+
+ # $plot
+ ParsePlotMacro cmd $which $i
+
+ # $null
+ ParseNullMacro cmd $which $i
+
+ # $url
+ ParseURLMacro cmd $which $i
+
+ # $geturl
+ # do this next to last
+ ParseGetURLMacro cmd $which $i
+
+ # $image
+ # do this last
+ ParseImageMacro cmd $which $i
+
+ # escaped macros
+ UnsetEscapedMacros cmd
+
+ # ok, we are off and running
+ set ianalysis($which,$i,inuse) 1
+
+ switch -- $ianalysis($which,$i,start) {
+ geturl {
+ AnalysisGetURL $which $i $sync
+ }
+ default {
+ AnalysisPipe $which $i $cmd $sync
+ }
+ }
+}
+
+proc AnalysisPipe {which i cmd sync} {
+ global ianalysis
+ global panalysis
+ global current
+
+ switch -- $ianalysis($which,$i,start) {
+ data {$current(frame) save fits image file "\{$ianalysis($which,$i,start,fn)\}"}
+ url {GetFileURL $ianalysis($which,$i,start,url) ianalysis($which,$i,start,fn)}
+ }
+
+ # last step, change all '][' into ',' so that multiple filters work right
+ regsub -all {\]\[} $cmd "," cmd
+
+ # log the command, if necessary
+ if {$panalysis(log)} {
+ SimpleTextDialog acmd [msgcat::mc {Analysis Commands}] \
+ 80 20 append bottom "$cmd\n"
+ }
+
+ switch -- $ianalysis($which,$i,finish) {
+ null {
+ # nothing is returned, so there is aways an error,
+ # however, the command will be executed.
+ catch {open "| $cmd"}
+ global errorInfo
+ set errorInfo {}
+ AnalysisTaskEnd $which $i
+ return
+ }
+ default {
+ if {[catch {set ch [open "| $cmd"]}]} {
+ Error [msgcat::mc {An error has occurred invoking the Analysis task}]
+ AnalysisTaskEnd $which $i
+ return
+ }
+ set ianalysis($which,$i,pid) [pid $ch]
+
+ switch -- $ianalysis($which,$i,finish) {
+ image {
+ switch -- $ianalysis($which,$i,image) {
+ new {CreateFrame}
+ rgb {CreateRGBFrame}
+ 3d {Create3DFrame}
+ current {}
+ }
+ global loadParam
+ set loadParam(load,type) channel
+ set loadParam(load,layer) {}
+ set loadParam(channel,name) $ch
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {}
+ set loadParam(file,name) \
+ "[string tolower [lindex $ianalysis($which,$i,item) 0]].fits"
+
+ StartLoad
+ ProcessLoad
+ FinishLoad
+
+ AnalysisTaskEnd $which $i
+ }
+ default {
+ if {$sync} {
+ AnalysisReaderAppend $ch $which $i
+ AnalysisReaderFinish $ch $which $i
+ } else {
+ fileevent $ch readable \
+ [list AnalysisReader $ch $which $i]
+ fconfigure $ch -blocking 0 -buffering none
+ }
+ }
+ }
+ }
+ }
+}
+
+proc AnalysisReader {ch which i} {
+ global ianalysis
+
+ if {[eof $ch]} {
+ AnalysisReaderFinish $ch $which $i
+ return
+ }
+ AnalysisReaderAppend $ch $which $i
+}
+
+proc AnalysisReaderAppend {ch which i} {
+ global ianalysis
+
+ set r [read $ch]
+ # for real-time update
+ switch -- $ianalysis($which,$i,finish) {
+ text {
+ AnalysisText "at${which}${i}" $ianalysis($which,$i,item) $r append
+
+ global debug
+ if {$debug(tcl,idletasks)} {
+ puts stderr "AnalysisReader"
+ }
+ update idletasks
+ }
+ }
+ append ianalysis($which,$i,result) $r
+}
+
+proc AnalysisReaderFinish {ch which i} {
+ global ianalysis
+
+ catch {close $ch}
+
+ switch -- $ianalysis($which,$i,finish) {
+ null -
+ image -
+ text {}
+ plot {
+ PlotLine "at${which}${i}" \
+ $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,plot,title) \
+ $ianalysis($which,$i,plot,xaxis) \
+ $ianalysis($which,$i,plot,yaxis) \
+ $ianalysis($which,$i,plot,dim) \
+ $ianalysis($which,$i,result)
+ }
+ plotstdin {
+ AnalysisPlotStdin line "at${which}${i}" $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,result)
+ }
+ default {puts stdout $ianalysis($which,$i,result)}
+ }
+
+ AnalysisTaskEnd $which $i
+}
+
+proc AnalysisPlotStdin {type w wtt result} {
+ # if no result, just return
+ if {$result == {}} {
+ return
+ }
+
+ # check for $ERROR
+ set id [string first {$ERROR} $result]
+ if {$id >= 0} {
+ AnalysisText "${w}e" $wtt \
+ [string range $result [expr $id+1] end] append
+ return
+ }
+
+ # check for ERROR:
+ set id [string first {ERROR:} $result]
+ if {$id >= 0} {
+ AnalysisText "${w}e" $wtt [string range $result $id end] append
+ return
+ }
+
+ # check for $BEGINTEXT/$ENDTEXT
+ # assume each is followed by a \n, so skip it
+ if {[string range $result 0 9] == {$BEGINTEXT}} {
+ set eid [string first {$ENDTEXT} $result]
+ if {$eid > 0} {
+ AnalysisText "${w}t" $wtt \
+ [string range $result 11 [expr $eid-1]] append
+ set result [string range $result [expr $eid+9] end]
+ } else {
+ # looks like all text
+ AnalysisText "${w}t" $wtt [string range $result 11 end] append
+ return
+ }
+ }
+
+ # now find the title, x axis label, y axis label, and dimension
+ set id [string first "\n" $result]
+ set tt [string range $result 0 $id]
+ set rr [string range $result [expr $id+1] end]
+
+ set l [llength $tt]
+ set t [join [lrange $tt 0 [expr $l-4]]]
+ set x [lindex $tt [expr $l-3]]
+ set y [lindex $tt [expr $l-2]]
+ set d [lindex $tt [expr $l-1]]
+
+ if {$d != {} && $rr != {}} {
+ switch $type {
+ line {PlotLine $w $wtt $t $x $y $d $rr}
+ bar {PlotBar $w $wtt $t $x $y $d $rr}
+ scatter {PlotScatter $w $wtt $t $x $y $d $rr}
+ }
+ } else {
+ Error "[msgcat::mc {Error}] [string range $tt 0 40]"
+ }
+}
+
+proc AnalysisGetURL {which i sync} {
+ global ianalysis
+ global panalysis
+
+ if {![ParseURL $ianalysis($which,$i,start,url) r]} {
+ Error [msgcat::mc {An error has occurred invoking the Analysis task}]
+ AnalysisTaskEnd $which $i
+ return
+ }
+
+ # format all spaces and brackets
+ set url {}
+ regsub -all { } $ianalysis($which,$i,start,url) "%20" url
+ regsub -all {\[} $url "%5B" url
+ regsub -all {\]} $url "%5D" url
+
+ if {$panalysis(log)} {
+ SimpleTextDialog acmd [msgcat::mc {Analysis Commands}] \
+ 80 20 append bottom "$url\n"
+ }
+
+ set ianalysis($which,$i,pid) -1
+ HVAnalysisURL $which $i $url $sync
+}
+
+proc AnalysisProcessGetURL {which i result} {
+ global ianalysis
+
+ set ianalysis($which,$i,result) $result
+ switch -- $ianalysis($which,$i,finish) {
+ text {AnalysisText "at${which}${i}" $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,result) append}
+ plot {PlotLine "at${which}${i}" \
+ $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,plot,title) \
+ $ianalysis($which,$i,plot,xaxis) \
+ $ianalysis($which,$i,plot,yaxis) \
+ $ianalysis($which,$i,plot,dim) \
+ $ianalysis($which,$i,result)}
+ plotstdin {AnalysisPlotStdin line "at${which}${i}" \
+ $ianalysis($which,$i,item) \
+ $ianalysis($which,$i,result)}
+ image {
+ set fn "[string tolower [lindex $ianalysis($which,$i,item) 0]].fits"
+ LoadVar result $fn {} {}
+ }
+ default {Error $ianalysis($which,$i,result)}
+ }
+}
+
+proc AnalysisTaskEnd {which i} {
+ global ianalysis
+
+ set ianalysis($which,$i,inuse) 0
+ if {$ianalysis($which,$i,start,fn) != {}} {
+ if {[file exists $ianalysis($which,$i,start,fn)]} {
+ catch {file delete -force $ianalysis($which,$i,start,fn)}
+ }
+ }
+
+ if {[info exists ianalysis($which,$i,pid)]} {
+ unset ianalysis($which,$i,pid)
+ }
+ unset ianalysis($which,$i,start)
+ unset ianalysis($which,$i,start,fn)
+ unset ianalysis($which,$i,start,url)
+ unset ianalysis($which,$i,finish)
+ unset ianalysis($which,$i,result)
+ unset ianalysis($which,$i,plot,title)
+ unset ianalysis($which,$i,plot,xaxis)
+ unset ianalysis($which,$i,plot,yaxis)
+ unset ianalysis($which,$i,plot,dim)
+ unset ianalysis($which,$i,image)
+}
+
+proc SetEscapedMacros {cmdname} {
+ upvar $cmdname cmd
+ global xpa
+
+ set seq "WaJaWaJaW"
+ if {[regexp {\$\$} $cmd]} {
+ # fill with tempory sequence
+ regsub -all {\$\$} $cmd $seq cmd
+ }
+}
+
+proc UnsetEscapedMacros {cmdname} {
+ upvar $cmdname cmd
+ global xpa
+
+ set seq "WaJaWaJaW"
+ if {[regexp $seq $cmd]} {
+ # reset to $
+ regsub -all $seq $cmd {\$} cmd
+ }
+}
+
+proc ParseDataMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\$data.?\|}
+ if {[regexp $exp $cmd]} {
+ set ianalysis($which,$i,start) data
+ set ianalysis($which,$i,start,fn) [tmpnam {.fits}]
+
+ regsub $exp $cmd "cat \{$ianalysis($which,$i,start,fn)\} |" cmd
+ }
+}
+
+proc ParseVOMethodMacro {cmdname} {
+ upvar $cmdname cmd
+ global pvo
+
+ if {[regexp {\$vo_method} $cmd]} {
+ regsub -all {\$vo_method} $cmd $pvo(method) cmd
+ }
+}
+
+proc ParseXPAMethodMacro {cmdname} {
+ upvar $cmdname cmd
+ global ds9
+
+ if {[regexp {\$xpa_method} $cmd]} {
+ regsub -all {\$xpa_method} $cmd [XPAMethod] cmd
+ }
+}
+
+proc ParseXPAMacro {cmdname} {
+ upvar $cmdname cmd
+ global ds9
+
+ if {[regexp {\$xpa} $cmd]} {
+ regsub -all {\$xpa} $cmd $ds9(title) cmd
+ }
+}
+
+proc ParseXYBitpixMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ if {$frame != {}} {
+ if {[regexp {\$width} $cmd]} {
+ regsub -all {\$width} $cmd [$frame get fits width] cmd
+ }
+
+ if {[regexp {\$height} $cmd]} {
+ regsub -all {\$height} $cmd [$frame get fits height] cmd
+ }
+
+ if {[regexp {\$depth} $cmd]} {
+ regsub -all {\$depth} $cmd [$frame get fits depth 2] cmd
+ }
+
+ if {[regexp {\$bitpix} $cmd]} {
+ regsub -all {\$bitpix} $cmd [$frame get fits bitpix] cmd
+ }
+
+ if {[regexp {\$xdim} $cmd]} {
+ regsub -all {\$xdim} $cmd [$frame get fits width] cmd
+ }
+
+ if {[regexp {\$ydim} $cmd]} {
+ regsub -all {\$ydim} $cmd [$frame get fits height] cmd
+ }
+ }
+}
+
+proc ParseFilenameRegionMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ set exp {(\$filename)\[(\$regions\(([^)]*)\))\]}
+ while {[regexp $exp $cmd foo fn reg pp]} {
+ set type ds9
+ set prop {}
+ set sys physical
+ set sky fk5
+ set format degrees
+
+ # default for mosaics
+ if {$frame != {}} {
+ if {[$frame has fits mosaic]} {
+ set sys wcs
+ }
+ }
+
+ foreach p [split $pp ,] {
+ switch -- $p {
+ ds9 -
+ ciao -
+ saotng -
+ saoimage -
+ pros -
+ xy {set type $p}
+
+ include {append prop {include = yes }}
+ exclude {append prop {include = no }}
+ source {append prop {source = yes }}
+ background {append prop {source = no }}
+
+ image -
+ physical -
+ detector -
+ amplifier
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {set sys $p}
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {
+ if {"$sys"=="physical"} {
+ set sys wcs
+ }
+ set sky $p
+ }
+
+ hms {set format sexagesimal}
+ sexagesimal -
+ degrees {set format $p}
+ }
+ }
+
+ SubstFilenameRegion cmd $frame $exp $type $prop $sys $sky $format
+ }
+
+ set exp {(\$filename)\[(\$regions)\]}
+ while {[regexp $exp $cmd foo fn reg]} {
+ set type ds9
+ set prop {}
+ set sys physical
+ set sky fk5
+ set format degrees
+
+ # default for mosaics
+ if {$frame != {}} {
+ if {[$frame has fits mosaic]} {
+ set sys wcs
+ }
+ }
+
+ SubstFilenameRegion cmd $frame $exp $type $prop $sys $sky $format
+ }
+}
+
+proc SubstFilenameRegion {cmdname frame exp type prop sys sky format} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set fn [$frame get fits file name full]
+ set region [string trimright [$frame marker list $type $sys $sky $format yes $prop] ";"]
+
+ if {$region != {}} {
+ set sub {}
+ foreach f $fn {
+ append sub "$f\[$region\] "
+ }
+ } else {
+ set sub $fn
+ }
+
+ # substitute
+ # ok, we need to check the length
+ if {[string length $region] > 256} {
+ # since we are writing to a file,
+ # we don't have to worry about quoting
+ # special characters
+ set fn [tmpnam {.reg}]
+ incr ianalysis(param,seq)
+
+ if {![catch {set ch [open "$fn" w]}]} {
+ puts $ch "$sub"
+ close $ch
+ }
+
+ regsub $exp $cmd "\@$fn" cmd
+
+ } else {
+ CleanFileName sub
+ regsub $exp $cmd $sub cmd
+ }
+}
+
+proc ParseFilenameMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ set exp {\$filename\(([^)]*)\)}
+ if {[regexp $exp $cmd foo pp]} {
+ switch $pp {
+ root -
+ root,base {
+ set sub [join [$frame get fits file name root base]]
+ CleanFileName sub
+ regsub -all $exp $cmd $sub cmd
+ }
+ full -
+ full,base {
+ set sub [join [$frame get fits file name full base]]
+ CleanFileName sub
+ regsub -all $exp $cmd $sub cmd
+ }
+ }
+ }
+
+ set exp {\$filename}
+ if {[regexp $exp $cmd]} {
+ set sub [join [$frame get fits file name full]]
+ CleanFileName sub
+ regsub -all $exp $cmd $sub cmd
+ }
+}
+
+proc ParseFileDialogMacro {cmdname} {
+ upvar $cmdname cmd
+
+ set exp {\$filedialog\(open\)}
+ if {[regexp $exp $cmd]} {
+ set sub [OpenFileDialog analysisparamfbox]
+ regsub -all $exp $cmd $sub cmd
+ }
+
+ set exp {\$filedialog\(save\)}
+ if {[regexp $exp $cmd]} {
+ set sub [SaveFileDialog analysisparamfbox]
+ regsub -all $exp $cmd $sub cmd
+ }
+}
+
+proc CleanFileName {varname} {
+ upvar $varname sub
+
+ # we have to quote {"}, else problems down the road
+ regsub -all {\"} $sub {\\"} sub
+
+ # we have to quote {&}, else problems down the road
+ regsub -all {\&} $sub {\\&} sub
+}
+
+proc ParseRegionMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ set exp {\$regions\(([^)]*)\)}
+while {[regexp $exp $cmd foo pp]} {
+
+ set type ds9
+ set prop {}
+ set sys physical
+ set sky fk5
+ set format degrees
+
+ # default for mosaics
+ if {$frame != {}} {
+ if {[$frame has fits mosaic]} {
+ set sys wcs
+ }
+ }
+
+ foreach p [split $pp ,] {
+ switch -- $p {
+ ds9 -
+ ciao -
+ saotng -
+ saoimage -
+ pros -
+ xy {set type $p}
+
+ include {append prop {include = yes }}
+ exclude {append prop {include = no }}
+ source {append prop {source = yes }}
+ background {append prop {source = no }}
+
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {set sys $p}
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {
+ if {"$sys"=="physical"} {
+ set sys wcs
+ }
+ set sky $p
+ }
+
+ hms {set format sexagesimal}
+ sexagesimal -
+ degrees {set format $p}
+ }
+ }
+
+ SubstRegion cmd $frame $exp $type $prop $sys $sky $format
+}
+
+# SAOtng format
+set exp {\$((|include|exclude|source|background)_)?regions(_(|degrees|hms|pixels))?}
+while {[regexp $exp $cmd foo a prop b sys]} {
+
+ # check valid props
+ switch -- $prop {
+ include {set prop {include = yes}}
+ exclude {set prop {include = no}}
+ source {set prop {source = yes}}
+ background {set prop {source = no}}
+ default {set prop {}}
+ }
+
+ # check valid coordinate systems
+ set sky fk5
+ switch -- $sys {
+ degrees {set sys wcs; set format degrees}
+ hms {set sys wcs; set format sexagesimal}
+ pixels -
+ default {set sys physical; set format degrees}
+ }
+
+ SubstRegion cmd $frame $exp ds9 $prop $sys $sky $format
+}
+}
+
+proc SubstRegion {cmdname frame exp type prop sys sky format} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ # get any regions
+ set region [string trimright [$frame marker list $type $sys $sky $format yes $prop] ";"]
+
+ # substitute
+ # ok, we need to check the length
+ if {[string length $region] > 8192} {
+ # since we are writing to a file, we don't have to worry about quoting
+ # special characters
+ set fn [tmpnam {.reg}]
+ incr ianalysis(param,seq)
+
+ if {![catch {set ch [open "$fn" w]}]} {
+ puts $ch "$region"
+ close $ch
+ }
+
+ regsub $exp $cmd "\@$fn" cmd
+
+ } else {
+ # we have to quote {"}, else problems down the road
+ regsub -all {\"} $region {\\"} region
+
+ # we have to quote {&}, else problems down the road
+ regsub -all {\&} $region {\\&} region
+
+ regsub $exp $cmd $region cmd
+ }
+}
+
+proc ParseEnvMacro {cmdname} {
+ upvar $cmdname cmd
+ global env
+
+ set exp {\$env\(([^)]*)\)}
+if {[regexp $exp $cmd foo ee]} {
+ if {[info exists env($ee)]} {
+ regsub -all $exp $cmd "$env($ee)" cmd
+ } else {
+ regsub -all $exp $cmd {} cmd
+ }
+}
+}
+
+proc ParsePanMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ set exp {\$pan\(([^)]*)\)}
+if {[regexp $exp $cmd foo pp]} {
+ set sys physical
+ set sky fk5
+ set format degrees
+
+ foreach p [split $pp ,] {
+ switch -- $p {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {set sys $p}
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {set sky $p; set sys wcs}
+
+ hms {set format sexagesimal}
+ sexagesimal -
+ degrees {set format $p}
+ }
+ }
+
+ set coord [$frame get cursor $sys $sky $format]
+ regsub -all $exp $cmd "[lindex $coord 0],[lindex $coord 1]" cmd
+
+ return
+}
+
+# no args
+
+set exp {\$pan}
+if {[regexp $exp $cmd foo1]} {
+ set coord [$frame get cursor physical]
+ regsub -all $exp $cmd "[lindex $coord 0],[lindex $coord 1]" cmd
+}
+}
+
+proc ParseValueMacro {cmdname frame x y} {
+ upvar $cmdname cmd
+
+ # menu items will not have a frame arg
+ if {$frame == {}} {
+ return
+ }
+
+ set exp1 {\$value}
+ if {[regexp $exp1 $cmd foo]} {
+ set vv [$frame get value canvas $x $y]
+ regsub -all $exp1 $cmd "$vv" cmd
+ }
+}
+
+proc ParseXYMacro {cmdname frame x y} {
+ upvar $cmdname cmd
+
+ # menu items will not have a frame arg
+ if {$frame == {}} {
+ return
+ }
+
+ set exp1 {\$x\(([^)]*)\)}
+set exp2 {\$y\(([^)]*)\)}
+if {[regexp $exp1 $cmd foo pp] && [regexp $exp2 $cmd foo2 pp2]} {
+ set sys physical
+ set sky fk5
+ set format degrees
+
+ foreach p [split $pp ,] {
+ switch -- $p {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {set sys $p}
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {set sky $p; set sys wcs}
+
+ hms {set format sexagesimal}
+ sexagesimal -
+ degrees {set format $p}
+ }
+ }
+
+ switch -- $sys {
+ image -
+ physical -
+ detector -
+ amplifier {set coord [$frame get coordinates $x $y $sys]}
+ default {set coord [$frame get coordinates $x $y $sys $sky $format]}
+ }
+
+ regsub -all $exp1 $cmd [lindex $coord 0] cmd
+ regsub -all $exp2 $cmd [lindex $coord 1] cmd
+
+ return
+}
+
+# no args
+
+set exp1 {\$x}
+set exp2 {\$y}
+if {[regexp $exp1 $cmd foo1] && [regexp $exp2 $cmd foo2]} {
+ set coord [$frame get coordinates $x $y physical]
+
+ regsub -all $exp1 $cmd [lindex $coord 0] cmd
+ regsub -all $exp2 $cmd [lindex $coord 1] cmd
+}
+}
+
+proc ParseZMacro {cmdname frame} {
+ upvar $cmdname cmd
+
+ # menu items will not have a frame arg
+ if {$frame == {}} {
+ return
+ }
+
+ set sl [$frame get fits slice]
+
+ # args
+ set exp1 {\$z\(([^)]*)\)}
+ if {[regexp $exp1 $cmd foo pp]} {
+ set sys $pp
+ set coord [$frame get coordinates $sl image $sys 2]
+ regsub -all $exp1 $cmd "$coord" cmd
+ return
+ }
+
+ # no args
+ # look for '$z"'
+ set exp1 {\$z\"}
+ if {[regexp $exp1 $cmd foo1]} {
+ regsub -all $exp1 $cmd "$sl\"" cmd
+ }
+ # look for "$z "
+ set exp1 {\$z\s}
+ if {[regexp $exp1 $cmd foo1]} {
+ regsub -all $exp1 $cmd "$sl " cmd
+ }
+}
+
+proc ParseMessageMacro {cmdname} {
+ upvar $cmdname cmd
+
+ # two args
+ set exp {\|?.?\$message\((ok|okcancel|yesno),([^)]*)\).?\|?}
+while {[regexp $exp $cmd foo type message]} {
+ regsub $exp $cmd {} cmd
+ if {![AnalysisMessage $type $message]} {
+ return 0
+ }
+}
+
+# one args
+set exp {\|?.?\$message\(([^)]*)\).?\|?}
+while {[regexp $exp $cmd foo message]} {
+ regsub $exp $cmd {} cmd
+ AnalysisMessage ok $message
+}
+
+return 1
+}
+
+proc ParseEntryMacro {cmdname} {
+ upvar $cmdname cmd
+
+ # one args
+ set exp {\|?.?\$entry\(([^)]*)\).?\|?}
+while {[regexp $exp $cmd foo message]} {
+ set result {}
+ if {![AnalysisEntry $message result]} {
+ return 0
+ }
+ regsub $exp $cmd $result cmd
+}
+
+return 1
+}
+
+proc ParseParamMacro {cmdname} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\$param\(([^)]*)\).?;?}
+while {[regexp $exp $cmd foo param]} {
+ regsub $exp $cmd {} cmd
+ if {![AnalysisParam cmd $param]} {
+ return 0
+ }
+}
+return 1
+}
+
+proc ParseTextMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp1 {\|.?\$text}
+ set exp2 {\|\&.?\$text}
+ if {[regexp $exp1 $cmd]} {
+ regsub $exp1 $cmd {} cmd
+
+ set ianalysis($which,$i,finish) text
+ } elseif {[regexp $exp2 $cmd]} {
+ regsub $exp2 $cmd { 2>@ stdout} cmd
+
+ set ianalysis($which,$i,finish) text
+ }
+}
+
+proc ParseNullMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\|.?\$null}
+ if {[regexp $exp $cmd]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) null
+ }
+}
+
+proc ParsePlotMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\|.?\$plot\(([^,]+),([^,]+),([^,]+),([^)]+)\)}
+if {[regexp $exp $cmd foo \
+ ianalysis($which,$i,plot,title) \
+ ianalysis($which,$i,plot,xaxis) \
+ ianalysis($which,$i,plot,yaxis) \
+ ianalysis($which,$i,plot,dim)]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) plot
+}
+
+set exp {\|.?\$plot\(stdin\)}
+if {[regexp $exp $cmd]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) plotstdin
+}
+
+set exp {\|.?\$plot}
+if {[regexp $exp $cmd]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) plot
+}
+}
+
+proc ParseURLMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\$url\((.*)\) \|}
+ if {[regexp $exp $cmd foo ianalysis($which,$i,start,url)]} {
+ set ianalysis($which,$i,start) url
+ set ianalysis($which,$i,start,fn) [tmpnam {.fits}]
+
+ regsub $exp $cmd "cat \{$ianalysis($which,$i,start,fn)\} |" cmd
+ }
+}
+
+proc ParseGetURLMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\$geturl\((.*)\)}
+ if {[regexp $exp $cmd foo ianalysis($which,$i,start,url)]} {
+ set ianalysis($which,$i,start) geturl
+ set ianalysis($which,$i,start,fn) [tmpnam {.fits}]
+
+ regsub $exp $cmd {} cmd
+ }
+}
+
+proc ParseImageMacro {cmdname which i} {
+ upvar $cmdname cmd
+ global ianalysis
+
+ set exp {\|.?\$image\(([^)]*)\)}
+if {[regexp $exp $cmd foo ianalysis($which,$i,image)]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) image
+}
+
+set exp {\|.?\$image}
+if {[regexp $exp $cmd]} {
+ regsub $exp $cmd {} cmd
+
+ set ianalysis($which,$i,finish) image
+}
+}
+
+proc AnalysisText {tt title txt method} {
+ if {$txt != {} && $txt != "\n"} {
+ SimpleTextDialog ${tt}txt $title 80 20 $method bottom $txt
+ }
+}
+
+proc AnalysisMessage {type message} {
+ if {$type == {}} {
+ set type ok
+ }
+
+ switch -- [tk_messageBox -message $message -type $type] {
+ ok {return 1}
+ yes {return 1}
+ cancel {return 0}
+ default {return 0}
+ }
+}
+
+proc AnalysisEntry {message resultvar} {
+ upvar $resultvar result
+
+ return [EntryDialog [msgcat::mc {Entry}] $message 60 result]
+}
+
+proc AnalysisPrefOpen {varname} {
+ upvar $varname var
+
+ FileLast analysisfbox $var
+ set var [OpenFileDialog analysisfbox]
+}
+
+# Cmds
+
+proc ProcessAnalysisCmd {varname iname buf fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global ime
+ global ianalysis
+
+ switch -- [string tolower [lindex $var $i]] {
+ message {
+ incr i
+ switch [string tolower [lindex $var $i]] {
+ ok -
+ okcancel -
+ retrycancel -
+ yesno -
+ yesnocancel {
+ AnalysisMessage [lindex $var $i] [lindex $var [expr $i+1]]
+ incr i
+ }
+ default {
+ AnalysisMessage ok [lindex $var $i]
+ }
+ }
+ }
+ text {
+ if {$buf != {}} {
+ AnalysisText apXPA Analysis $buf append
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set txt [read $ch]
+ close $ch
+ AnalysisText apXPA Analysis $txt append
+ }
+ } else {
+ incr i
+ AnalysisText apXPA Analysis [lindex $var $i] append
+ }
+ }
+ plot {
+ # for backward compatibility
+ # used by chandra-ed
+ # use xpa plot instead
+
+ incr i
+ if {$buf != {}} {
+ ProcessAnalysisPlotCmd $varname $iname $buf
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set rr [read $ch]
+ close $ch
+ ProcessAnalysisPlotCmd $varname $iname $rr
+ }
+ } else {
+ ProcessAnalysisPlotCmd $varname $iname {}
+ }
+ }
+ load {
+ if {$buf != {}} {
+ ProcessAnalysis buf
+ } elseif {$fn != {}} {
+ ProcessAnalysisFile $fn
+ } else {
+ incr i
+ ProcessAnalysisFile [lindex $var $i]
+ }
+ }
+ clear {
+ ClearAnalysis
+ incr i
+ switch -- [lindex $var $i] {
+ load {
+ if {$buf != {}} {
+ ProcessAnalysis buf
+ } elseif {$fn != {}} {
+ ProcessAnalysisFile $fn
+ } else {
+ incr i
+ ProcessAnalysisFile [lindex $var $i]
+ }
+ }
+ default {incr i -1}
+ }
+ }
+ mode {
+ incr i
+ switch -- [lindex $var $i] {
+ stats -
+ statistics {set ime(task) stats}
+ hist -
+ histogram {set ime(task) hist}
+ radial -
+ radialprofile {set ime(task) radial}
+ 2d -
+ plot2d {set ime(task) plot2d}
+ 3d -
+ plot3d {set ime(task) plot3d}
+ }
+
+ ProcessRealizeDS9
+ IMEChangeTask
+ }
+ task {
+ incr i
+ if {[string is integer [lindex $var $i]]} {
+ AnalysisTask [lindex $var $i] menu
+ } else {
+ # invoke by name
+ for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
+ if {[string equal -nocase $ianalysis(menu,$ii,item) [lindex $var $i]]} {
+ AnalysisTask $ii menu
+ }
+ }
+ }
+ }
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ AnalysisTask [lindex $var $i] menu
+ } else {
+ ProcessAnalysisFile [lindex $var $i]
+ }
+ }
+ }
+}
+
+proc ProcessAnalysisPlotCmd {varname iname buf} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ global iap
+ switch -- [string tolower [lindex $var $i]] {
+ stdin {AnalysisPlotStdin line $iap(tt) {} $buf}
+ default {
+ PlotLine $iap(tt) Plot \
+ [lindex $var [expr $i+0]] \
+ [lindex $var [expr $i+1]] \
+ [lindex $var [expr $i+2]] \
+ [lindex $var [expr $i+3]] \
+ $buf
+ incr i 3
+ }
+ }
+}
+
+proc ProcessSendAnalysisCmd {proc id param sock fn} {
+ global ianalysis
+ global ime
+
+ set result {}
+ switch -- [string tolower [lindex $param 0]] {
+ entry {
+ AnalysisEntry [lrange $param 1 end] result
+ append result "\n"
+ $proc $id $result
+ }
+ mode {$proc $id "$ime(task)\n"}
+ task {
+ # invoke by name
+ for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
+ append result "$ii $ianalysis(menu,$ii,item)\n"
+ }
+ $proc $id $result
+ }
+ lock {$proc $id "$ime(lock)\n"}
+ default {
+ for {set i 0} {$i<$ianalysis(menu,count)} {incr i} {
+ append result "\#$i menu"
+ append result "\n$ianalysis(menu,$i,item)"
+ append result "\n$ianalysis(menu,$i,template)"
+ if {$ianalysis(menu,$i,cmd) != {web}} {
+ append result "\nmenu"
+ append result "\n$ianalysis(menu,$i,cmd)"
+ } else {
+ append result "\n$ianalysis(menu,$i,cmd)"
+ append result "\n$ianalysis(menu,$i,var)"
+ }
+ append result "\n\n"
+ }
+ for {set i 0} {$i<$ianalysis(bind,count)} {incr i} {
+ set key [string range $ianalysis(bind,$i,item) 1 1]
+ append result "\#$i bind"
+ append result "\nbind key $ianalysis(bind,$i,item)"
+ append result "\n$ianalysis(bind,$i,template)"
+ append result "\nbind $key"
+ append result "\n$ianalysis(bind,$i,cmd)"
+ append result "\n\n"
+ }
+ ProcessSend $proc $id $sock $fn {.ans} $result
+ }
+ }
+}
diff --git a/ds9/library/analysisparam.tcl b/ds9/library/analysisparam.tcl
new file mode 100644
index 0000000..a45711b
--- /dev/null
+++ b/ds9/library/analysisparam.tcl
@@ -0,0 +1,176 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc AnalysisParam {strname param} {
+ upvar $strname str
+ global ianalysis
+ global ed
+
+ global ds9
+ global pds9
+
+ # find it
+ for {set i 0} {$i<$ianalysis(param,count)} {incr i} {
+ if {$ianalysis(param,$i) == "$param"} {
+ break
+ }
+ }
+ if {$i == $ianalysis(param,count)} {
+ return
+ }
+
+ set w {.param}
+
+ set ed(ok) 0
+
+ DialogCreate $w $param ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ for {set j 0} {$j<$ianalysis(param,$i,count)} {incr j} {
+ set ianalysis(param,$i,$j,value) $ianalysis(param,$i,$j,last)
+ ttk::label $f.l$j -text "$ianalysis(param,$i,$j,title)"
+ switch -- $ianalysis(param,$i,$j,type) {
+ entry {
+ ttk::entry $f.a$j \
+ -textvariable ianalysis(param,$i,$j,value) \
+ -width 40
+ }
+ checkbox {
+ ttk::checkbutton $f.a$j -text {} \
+ -variable ianalysis(param,$i,$j,value)
+ }
+ menu {
+ set l [split $ianalysis(param,$i,$j,default) |]
+ ttk::menubutton $f.a$j \
+ -text "$ianalysis(param,$i,$j,value)" \
+ -menu $f.a$j.menu
+ set m [menu $f.a$j.menu]
+ for {set k 0} {$k<[llength $l]} {incr k} {
+ $m add command -label [lindex $l $k] \
+ -command "AnalysisParamMenu ianalysis(param,$i,$j,value) [lindex $l $k] $f.a$j"
+ }
+ }
+ }
+ ttk::label $f.i$j -text "$ianalysis(param,$i,$j,info)" \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+
+ grid $f.l$j $f.a$j $f.i$j -padx 2 -pady 2 -sticky w
+ }
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ for {set j 0} {$j<$ianalysis(param,$i,count)} {incr j} {
+ set exp "\\\$$ianalysis(param,$i,$j,var)"
+ if {[regexp $exp $str]} {
+ regsub -all $exp $str "$ianalysis(param,$i,$j,value)" str
+ }
+ set ianalysis(param,$i,$j,last) $ianalysis(param,$i,$j,value)
+ }
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc AnalysisParamMenu {varname value menu} {
+ upvar $varname var
+
+ set var $value
+ $menu configure -text $value
+}
+
+proc ParseIRAFParam {filename} {
+ global ianalysis
+ global env
+
+ # we are only concerned with unix like os
+ set uparm {}
+ if {[info exists env(UPARM)]} {
+ set uparm "$env(UPARM)/$filename"
+ }
+ set iraf {}
+ if {[info exists env(HOME)]} {
+ set iraf "$env(HOME)/$filename"
+ }
+
+ if {[file exists "$filename"]} {
+ catch {set ch [open "$filename"]}
+ } elseif {[file exists "$uparm"]} {
+ catch {set ch [open "$uparm"]}
+ } elseif {[file exists "$iraf"]} {
+ catch {set ch [open "$iraf"]}
+ } else {
+ return
+ }
+
+ set i $ianalysis(param,count)
+
+ while {[gets $ch line] >= 0} {
+ set exp {([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*),([^,]*)}
+ if {[regexp $exp $line foo p1 p2 p3 p4 p5 p6 p7]} {
+ if {$p1 != {mode}} {
+ regsub -all {\"} $p4 {} p4
+ regsub -all {\"} $p7 {} p7
+ set j $ianalysis(param,$i,count)
+ set ianalysis(param,$i,$j,var) "$p1"
+ if {$p3 == {h}} {
+ set ianalysis(param,$i,$j,title) "(${p1})"
+ } else {
+ set ianalysis(param,$i,$j,title) "$p1"
+ }
+ set ianalysis(param,$i,$j,info) "$p7"
+ incr ianalysis(param,$i,count)
+ switch -- $p2 {
+ b {
+ set ianalysis(param,$i,$j,type) checkbox
+ set ianalysis(param,$i,$j,default) [FromYesNo $p4]
+ set ianalysis(param,$i,$j,last) [FromYesNo $p4]
+ set ianalysis(param,$i,$j,value) [FromYesNo $p4]
+ }
+ s {
+ if {$p5 != {}} {
+ set ianalysis(param,$i,$j,type) menu
+ set ianalysis(param,$i,$j,default) "$p5"
+ } else {
+ set ianalysis(param,$i,$j,type) entry
+ set ianalysis(param,$i,$j,default) "$p4"
+ }
+ set ianalysis(param,$i,$j,last) "$p4"
+ set ianalysis(param,$i,$j,value) "$p4"
+ }
+ default {
+ set ianalysis(param,$i,$j,type) entry
+ set ianalysis(param,$i,$j,default) "$p4"
+ set ianalysis(param,$i,$j,last) "$p4"
+ set ianalysis(param,$i,$j,value) "$p4"
+ }
+ }
+ }
+ }
+ }
+
+ close $ch
+}
diff --git a/ds9/library/annulus.tcl b/ds9/library/annulus.tcl
new file mode 100644
index 0000000..1ccaba2
--- /dev/null
+++ b/ds9/library/annulus.tcl
@@ -0,0 +1,182 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc AnnulusDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ set var(method) dist
+
+ # procs
+ set var(which) annulus
+ set var(proc,apply) AnnulusApply
+ set var(proc,close) AnnulusClose
+ set var(proc,generate) AnnulusGenerate
+ set var(proc,coordCB) AnnulusCoordCB
+ set var(proc,editCB) AnnulusEditCB
+ set var(proc,distCB) AnnulusDistCB
+
+ # base
+ MarkerBaseAnnulusDialog $varname
+
+ # menus
+ MarkerBaseAnnulusMethodMenu $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisRadialDialog $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback edit AnnulusEditCB $varname
+ $var(frame) marker $var(id) callback end edit AnnulusEditCB $varname
+
+ set f $var(top).param
+
+ # Annuli
+ ttk::label $f.tinner -text [msgcat::mc {Inner}]
+ ttk::label $f.touter -text [msgcat::mc {Outer}]
+ ttk::label $f.tradius -text [msgcat::mc {Radius}]
+ ttk::entry $f.inner -textvariable ${varname}(inner) -width 13
+ ttk::entry $f.outer -textvariable ${varname}(outer) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list AnnulusDistCB $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+ ttk::label $f.tannuli -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable ${varname}(annuli) -width 13
+
+ grid x $f.tinner $f.touter -padx 2 -pady 2 -sticky w
+ grid $f.tradius $f.inner $f.outer $f.uradius -padx 2 -pady 2 -sticky w
+ grid $f.tannuli $f.annuli -padx 2 -pady 2 -sticky w
+
+ # Radius
+ set f [ttk::labelframe $var(top).radius -text [msgcat::mc {Radius}] \
+ -padding 2]
+
+ set var(annulitxt) [text $f.txt \
+ -height 10 \
+ -width 15 \
+ -wrap none \
+ -font [font actual TkDefaultFont] \
+ -yscrollcommand [list $f.yscroll set] \
+ ]
+ ttk::scrollbar $f.yscroll -command [list $var(annulitxt) yview] \
+ -orient vertical
+
+ grid $var(annulitxt) $f.yscroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Radius Fini
+ grid $var(top).radius -row 0 -column 1 -sticky news
+ grid rowconfigure $var(top) 0 -weight 1
+ grid columnconfigure $var(top) 1 -weight 1
+
+ # init - do this last
+ AnnulusDistCB $varname
+}
+
+# actions
+
+proc AnnulusClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback edit AnnulusEditCB
+ $var(frame) marker $var(id) delete callback end edit AnnulusEditCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc AnnulusApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set levels {}
+ regsub -all "\n" "[$var(annulitxt) get 1.0 end]" " " levels
+ # and trim any trailing spaces
+ set levels [string trimright $levels " "]
+
+ if {$levels != {}} {
+ $var(frame) marker $var(id) annulus radius "\{$levels\}" \
+ $var(dcoord) $var(dformat)
+ }
+
+ MarkerBaseCenterApply $varname
+}
+
+proc AnnulusGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseAnnulusGenerateCircle $varname
+}
+
+# callbacks
+
+proc AnnulusCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "AnnulusCoordCB"
+ }
+
+ MarkerAnalysisRadialSystem $varname
+ MarkerAnalysisStatsSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+}
+
+proc AnnulusEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "AnnulusEditCB"
+ }
+
+ set t [$var(frame) get marker $var(id) annulus radius \
+ $var(dcoord) $var(dformat)]
+
+ set last [expr [llength $t]-1]
+ set var(inner) [lindex $t 0]
+ set var(outer) [lindex $t $last]
+ set var(annuli) $last
+
+ $var(annulitxt) delete 1.0 end
+ $var(annulitxt) insert end "$t"
+}
+
+proc AnnulusDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "AnnulusDistCB"
+ }
+
+ AnnulusEditCB $varname
+}
diff --git a/ds9/library/ar.tcl b/ds9/library/ar.tcl
new file mode 100644
index 0000000..5864b9d
--- /dev/null
+++ b/ds9/library/ar.tcl
@@ -0,0 +1,208 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ARInit {varname next} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(sync) 0
+ set var(proc,next) $next
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(status) {}
+}
+
+proc ARApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARStatus $varname {}
+
+ $var(mb).file entryconfig [msgcat::mc {Retrieve}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Cancel}] -state normal
+
+ $var(apply) configure -state disabled
+ $var(cancel) configure -state normal
+}
+
+proc ARCancel {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # set state to 0 so that we don't process the finish proc
+ set var(active) 0
+
+ if {[info exists var(token)]} {
+ http::reset $var(token)
+ }
+}
+
+proc ARDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARCancel $varname
+
+ if {[winfo exists $var(top)]} {
+ destroy $var(top)
+ destroy $var(mb)
+ }
+
+ unset $varname
+}
+
+proc ARReset {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(active) 0
+
+ if {[info exists var(token)]} {
+ http::cleanup $var(token)
+ unset var(token)
+ }
+
+ $var(mb).file entryconfig [msgcat::mc {Retrieve}] -state normal
+ $var(mb).file entryconfig [msgcat::mc {Cancel}] -state disabled
+
+ $var(apply) configure -state normal
+ $var(cancel) configure -state disabled
+}
+
+proc ARDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(status) [msgcat::mc {Done}]
+ ARReset $varname
+}
+
+proc ARCancelled {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(status) [msgcat::mc {Cancelled}]
+ ARReset $varname
+}
+
+proc ARError {varname message} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(status) [string range $message 0 80]
+ ARReset $varname
+}
+
+proc ARStatus {varname message} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(status) [string range $message 0 80]
+}
+
+proc ARClear {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(status) {}
+}
+
+proc ARCoord {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global pds9
+
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {
+ $var(xname) configure -text "\u03b1" \
+ -font "$ds9(times) $pds9(font,size)"
+ $var(yname) configure -text "\u03b4" \
+ -font "$ds9(times) $pds9(font,size)"
+ }
+ galactic {
+ $var(xname) configure -text {l} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ $var(yname) configure -text {b} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ }
+ ecliptic {
+ $var(xname) configure -text "\u03bb" \
+ -font "$ds9(times) $pds9(font,size)"
+ $var(yname) configure -text "\u03b2" \
+ -font "$ds9(times) $pds9(font,size)"
+ }
+ }
+}
+
+proc AREditMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ $var(mb) add cascade -label [msgcat::mc {Edit}] -menu $var(mb).edit
+ EditMenu $var(mb) $varname
+ $var(mb).edit add separator
+ $var(mb).edit add command -label [msgcat::mc {Clear}] \
+ -command "ARClear $varname"
+}
+
+proc ARSkyFormat {w varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(skyformat,msg) [msgcat::mc $var(skyformat)]
+ ttk::menubutton $w -textvariable ${varname}(skyformat,msg) -menu $w.menu
+ menu $w.menu
+ $w.menu add radiobutton -label [msgcat::mc {Degrees}] \
+ -variable ${varname}(skyformat) -value degrees \
+ -command "ARSkyFormatMenu $varname"
+ $w.menu add radiobutton -label {Sexagesimal} \
+ -variable ${varname}(skyformat) -value sexagesimal \
+ -command "ARSkyFormatMenu $varname"
+}
+
+proc ARSkyFormatMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(skyformat,msg) $var(skyformat)
+}
+
+proc ARRFormat {w varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(rformat,msg) [msgcat::mc $var(rformat)]
+ ttk::menubutton $w -textvariable ${varname}(rformat,msg) -menu $w.menu
+ menu $w.menu
+ $w.menu add radiobutton -label [msgcat::mc {Degrees}] \
+ -variable ${varname}(rformat) -value degrees \
+ -command "ARRFormatMenu $varname"
+ $w.menu add radiobutton -label [msgcat::mc {ArcMin}] \
+ -variable ${varname}(rformat) -value arcmin \
+ -command "ARRFormatMenu $varname"
+ $w.menu add radiobutton -label [msgcat::mc {ArcSec}] \
+ -variable ${varname}(rformat) -value arcsec \
+ -command "ARRFormatMenu $varname"
+}
+
+proc ARRFormatMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(rformat,msg) $var(rformat)
+}
+
diff --git a/ds9/library/array.tcl b/ds9/library/array.tcl
new file mode 100644
index 0000000..efe9027
--- /dev/null
+++ b/ds9/library/array.tcl
@@ -0,0 +1,167 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ImportArrayFile {fn layer} {
+ global loadParam
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ # check for stdin/gz
+ ConvertArrayFile
+ ProcessLoad
+}
+
+proc ImportArrayAlloc {path fn layer} {
+ global loadParam
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc ImportArraySocket {sock fn layer} {
+ global loadParam
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc ExportArrayFile {fn opt} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save array file "\{$fn\}" $opt
+}
+
+proc ExportArraySocket {sock opt} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save array socket $sock $opt
+}
+
+proc ProcessArrayCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ if {[ProcessArrayBackwardCmd $varname $iname $sock $fn]} {
+ return
+ }
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not suppported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![ImportArraySocket $sock $param $layer]} {
+ InitError xpa
+ ImportArrayFile $param $layer
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ ImportArrayAlloc $fn $param $layer
+ } else {
+ ImportArrayFile $param $layer
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendArrayCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set opt [string tolower [lindex $param 0]]
+ if {$sock != {}} {
+ # xpa
+ ExportArraySocket $sock $opt
+ } elseif {$fn != {}} {
+ # comm
+ ExportArrayFile $fn $opt
+ $proc $id {} $fn
+ }
+}
+
+# backward compatibility
+proc ProcessArrayBackwardCmd {varname iname sock fn} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ set vvar $var
+ set ii $i
+
+ switch -- [string tolower [lindex $var $i]] {
+ rgb {
+ set vvar [lreplace $var 0 0]
+ ProcessRGBArrayCmd vvar ii $sock $fn
+ return 1
+ }
+ new {
+ switch -- [string tolower [lindex $var [expr $i+1]]] {
+ rgb {
+ set vvar [lreplace $var 1 1]
+ ProcessRGBArrayCmd vvar ii $sock $fn
+ return 1
+ }
+ }
+ }
+ }
+
+ return 0
+}
+
diff --git a/ds9/library/backup.tcl b/ds9/library/backup.tcl
new file mode 100644
index 0000000..37cc314
--- /dev/null
+++ b/ds9/library/backup.tcl
@@ -0,0 +1,802 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BackupDialog {} {
+ set fn [SaveFileDialog backupfbox]
+ if {[string length $fn] != 0} {
+ Backup $fn
+ }
+}
+
+proc Backup {fn} {
+ global ds9
+ global current
+
+ # script, always overwrite if present
+ if {[catch {set ch [open $fn w]}]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+
+ # aux directory, create if needed
+ set dir "${fn}.dir"
+ if {[file exists $dir]} {
+ if {![file isdirectory $dir]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+ } else {
+ if {[catch {file mkdir $dir}]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+ }
+
+ # update any tags
+ if {$current(frame) != {}} {
+ $current(frame) colorbar tag "\{[$current(colorbar) get tag]\}"
+ }
+
+ # check for newer backup version
+ puts $ch "global ds9"
+ puts $ch "set vv [lindex $ds9(version) 0]"
+
+ puts $ch "\# this is a check for to ensure a match between the"
+ puts $ch "\# current ds9 version matches the prefs version"
+ puts $ch "switch -- \[string compare \$vv \[lindex \$ds9(version)\ 0\]\] {"
+ puts $ch " -1 {"
+ puts $ch " if {\[tk_messageBox -type yesno -icon question -message \[msgcat::mc {DS9 has detected an older backup file, do you wish to continue?}\]\] == {no}} {"
+ puts $ch " return"
+ puts $ch " }"
+ puts $ch " }"
+ puts $ch " 0 {}"
+ puts $ch " 1 {"
+ puts $ch " tk_messageBox -type ok -icon warning -message \[msgcat::mc {DS9 has detected a newer version of a backup file and therefore will not process this file.}\]"
+ puts $ch " return"
+ puts $ch " }"
+ puts $ch "}"
+
+ # and file find proc
+ puts $ch "proc BackupFindFile {varname} {"
+ puts $ch " upvar \$varname var"
+ puts $ch ""
+ puts $ch " set id \[string first \"\\\[\" \$var(file,name)\]"
+ puts $ch " if {\$id > 0} {"
+ puts $ch " set fn \[string range \$var(file,name) 0 \[expr \$id-1\]\]"
+ puts $ch " set ext \[string range \$var(file,name) \$id end\]"
+ puts $ch " } else {"
+ puts $ch " set fn \$var(file,name)"
+ puts $ch " set ext {}"
+ puts $ch " }"
+ puts $ch ""
+ puts $ch " if {!\[file exists \$fn\]} {"
+ puts $ch " Error \"\[msgcat::mc {Unable to load}\] \$fn\""
+ puts $ch " global fitsfbox"
+ puts $ch " set fn \[OpenFileDialog fitsfbox\]"
+ puts $ch " if {\$fn == {}} {"
+ puts $ch " Error \[msgcat::mc {An error has occurred during restore}\]"
+ puts $ch " return 0"
+ puts $ch " }"
+ puts $ch " if {!\[file exists \$fn\]} {"
+ puts $ch " Error \[msgcat::mc {An error has occurred during restore}\]"
+ puts $ch " return 0"
+ puts $ch " }"
+ puts $ch " set var(file,name) \"\$fn\$ext\""
+ puts $ch " }"
+ puts $ch ""
+ puts $ch " return 1"
+ puts $ch "}"
+
+ # Panner
+ PannerBackup $ch
+
+ # Colorbar
+ ColorbarBackupCmaps $ch $dir
+ ColorbarBackup $ch colorbar
+ ColorbarBackup $ch colorbarrgb
+
+ # Frames
+ foreach ff $ds9(frames) {
+ if {![$ff has iis]} {
+ BackupFrame $ch $ff $dir
+ }
+ }
+
+ # Geometry
+ BackupGUI $ch
+
+ # User Plots
+ PlotBackup $ch $dir
+
+ # all done
+ close $ch
+}
+
+proc RestoreDialog {} {
+ set fn [OpenFileDialog backupfbox]
+ if {[string length $fn] != 0} {
+ Restore $fn
+ }
+}
+
+proc Restore {fn} {
+ global ds9
+ global pds9
+
+ if {[string length $fn] == 0} {
+ return
+ }
+
+ # clear all frames
+ DeleteAllFrames
+
+ # kill all image server dialogs
+ foreach dlg [list dtwomass dsao deso dstsci dvla dnvss dskyview dvlss] {
+ global $dlg
+ if {[array exists $dlg]} {
+ ARDestroy $dlg
+ }
+ }
+
+ # kill all simple text dialogs
+ global istxt
+ foreach varname $istxt(dialogs) {
+ SimpleTextDestroy $varname
+ }
+
+ # kill all cats
+ global icat
+ foreach varname $icat(cats) {
+ CATDestroy $varname
+ }
+
+ # kill all plots
+ global iap
+ foreach varname $iap(windows) {
+ PlotDestroy $varname
+ }
+
+ set dir [file dirname $fn]
+ set ffn [lindex [file split $fn] end]
+ set cd [pwd]
+ cd $dir
+
+ # fix a problem with 6.1.2
+ global prefs
+ set rr $prefs(version)
+
+ # ok, this is a major kludge to fix a major booboo.
+ # Beta versions generated backup save sets with vv set to
+ # something like '7.4b7'. We need to remove the 'b7' part.
+ set src {}
+ if {![catch {set ch [open "$ffn" r]}]} {
+ set src [read $ch]
+ close $ch
+ } else {
+ Error [msgcat::mc {An error has occurred during restore}]
+ return
+ }
+
+ set aa [string first {set vv } $src]
+ set bb [string first {# this is} $src]
+ if {$aa != -1 && $bb != -1 && $aa < $bb} {
+ set bb [expr $bb -2]
+ set ver [string range $src $aa $bb]
+ set ll [string first {b} $ver]
+ if {$ll != -1} {
+ set ll [expr $ll -1]
+ set src [string replace $src $aa $bb [string range $ver 0 $ll]]
+ }
+ } else {
+ Error [msgcat::mc {An error has occurred during restore}]
+ return
+ }
+
+ # and load the world
+ if {[catch {eval $src}]} {
+ Error [msgcat::mc {An error has occurred during restore}]
+ global debug
+ if {$debug(tcl,restore)} {
+ global errorInfo
+ puts stderr "$errorInfo"
+ }
+ return
+ }
+
+ # historical note, vv contains version number of save set originator
+ if {![info exists vv]} {
+ set vv [lindex $ds9(version) 0]
+ }
+
+ # fix 6.1.2
+ if {$vv == {6.1.2}} {
+ set prefs(version) $rr
+ }
+
+ # fix any prefs
+ FixPrefs $vv
+
+ # reset standard dialog
+ switch $ds9(wm) {
+ x11 {set pds9(dialog) motif}
+ aqua -
+ win32 {set pds9(dialog) native}
+ }
+
+ # return to start dir
+ cd $cd
+
+ # and update it
+ UpdateGraphGrid
+ LayoutOrient
+ UpdateActiveFrames
+ ChangeMode
+ UpdateDS9
+}
+
+proc BackupFrame {ch which dir} {
+ set fdir [file join $dir $which]
+ set rdir "./[lindex [file split $dir] end]/$which"
+
+ # create dir if needed
+ if {![file isdirectory $fdir]} {
+ if {[catch {file mkdir $fdir}]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+ }
+
+ # frame
+ set type [$which get type]
+ puts $ch "CreateNameNumberFrame $which $type"
+ switch -- $type {
+ base {BackupFrameLoad $ch $which $fdir $rdir {}}
+ 3d {
+ BackupFrameLoad $ch $which $fdir $rdir {}
+ puts $ch "3DDialog"
+ }
+ rgb {
+ foreach cc {{} red green blue} {
+ BackupFrameLoad $ch $which $fdir $rdir $cc
+ }
+ puts $ch "RGBDialog"
+ }
+ }
+
+ MagnifierFrameBackup $ch $which
+ ColorFrameBackup $ch $which
+ ColormapFrameBackup $ch $which
+
+ DS9Backup $ch $which
+ CubeBackup $ch $which
+ RGBBackup $ch $which
+ BinBackup $ch $which
+ ScaleBackup $ch $which
+ PanZoomBackup $ch $which
+ # Block need to be before Crop
+ BlockBackup $ch $which
+ CropBackup $ch $which
+ # must be after Pan and Block
+ 3DBackup $ch $which
+ MarkerBackup $ch $which $fdir $rdir
+ CentroidBackup $ch $which
+ WCSBackup $ch $which $fdir $rdir
+ MaskBackup $ch $which
+ SmoothBackup $ch $which
+ ContourBackup $ch $which $fdir $rdir
+ GridBackup $ch $which
+ CATBackup $ch $which $fdir $rdir
+}
+
+proc BackupFrameLoad {ch which fdir rdir channel} {
+ set base $which$channel
+ set seq 1
+
+ set varname $base
+ global $varname
+ if {![info exists $varname]} {
+ # special case
+ set varname "$base.$seq"
+ global $varname
+ }
+
+ while {[info exists $varname]} {
+ if {$channel != {}} {
+ puts $ch "$which rgb channel $channel"
+ }
+
+ array set param [array get $varname]
+ switch $param(load,type) {
+ mmap -
+ mmapincr -
+ smmap -
+ shared -
+ sshared {
+ if {![BackupFrameLoadMMap param $fdir $rdir]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+ }
+ alloc -
+ allocgz {
+ if {![BackupFrameLoadMMap param $fdir $rdir]} {
+ BackupFrameLoadAlloc $which param $fdir $rdir
+ }
+ }
+ channel -
+ socket -
+ socketgz -
+ var {BackupFrameLoadAlloc $which param $fdir $rdir}
+ photo {
+ if {[BackupFrameLoadMMap param $fdir $rdir]} {
+ puts $ch "global bcktmp"
+ puts $ch "if {\[catch {image create photo -file $param(file,name)} bcktmp\]} {"
+ puts $ch "Error \[msgcat::mc {An error has occurred during restore}\]"
+ puts $ch "return"
+ puts $ch "}"
+ } else {
+ BackupFrameLoadAlloc $which param $fdir $rdir
+ }
+ }
+ }
+
+ puts $ch "global loadParam"
+ puts $ch "array set loadParam \[list [array get param]\]"
+
+ switch $param(load,type) {
+ photo {
+ puts $ch "set loadParam(var,name) \$bcktmp"
+ }
+ }
+
+ puts $ch "if \[BackupFindFile loadParam\] {"
+ puts $ch " ProcessLoad"
+ puts $ch "}"
+
+ switch $param(load,type) {
+ photo {
+ puts $ch "image delete \$bcktmp"
+ }
+ }
+
+ incr seq
+ set varname "$base.$seq"
+ global $varname
+ }
+}
+
+proc BackupFrameLoadMMap {varname fdir rdir} {
+ upvar $varname param
+
+ global pds9
+
+ set id [string first "\[" $param(file,name)]
+ if {$id > 0} {
+ set fn [string range $param(file,name) 0 [expr $id-1]]
+ set ext [string range $param(file,name) $id end]
+ } else {
+ set fn $param(file,name)
+ set ext {}
+ }
+
+ if {![file exists $fn]} {
+ return 0
+ }
+
+ # special case, we use 'stdin' for input from stdin, ignore
+ if {$fn == {stdin}} {
+ return 0
+ }
+
+ if {$pds9(backup)} {
+ # look for sym links
+ switch [file type $fn] {
+ file {}
+ link {set fn [file readlink $fn]}
+ default {
+ return 0
+ }
+ }
+
+ set src [lindex [file split $fn] end]
+ if {![file exists [file join $fdir $src]]} {
+ if {[catch {file copy $fn $fdir}]} {
+ return 0
+ }
+ }
+ set param(file,name) "$rdir/[lindex [file split $fn] end]$ext"
+ } else {
+ if {[file pathtype $param(file,name)] == {relative}} {
+ set param(file,name) [file join [pwd] $param(file,name)]
+ }
+ }
+
+ # special case: mmap to allocgz via ConvertFitsFile/ConvertArrayFile
+ if {[info exists param(file,fn)]} {
+ set param(file,fn) $param(file,name)
+ }
+ return 1
+}
+
+proc BackupFrameLoadAlloc {which varname fdir rdir} {
+ upvar $varname param
+
+ set ff [$which get fits file name root base]
+ set id [string first "\[" $ff]
+ if {$id > 0} {
+ set fn [string range $ff 0 [expr $id-1]]
+ } else {
+ set fn $ff
+ }
+
+ if {$ff == {}} {
+ set ff ds9.fits
+ set fn ds9.fits
+ }
+
+ set ffn [file join $fdir $fn]
+ switch $param(file,type) {
+ fits {
+ switch $param(file,mode) {
+ {} {
+ if {[$which has fits bin]} {
+ $which save fits table file \"$ffn\"
+ } else {
+ $which save fits image file \"$ffn\"
+ }
+ }
+
+ {rgb cube} {$which save fits rgb cube file \"$ffn\"}
+ {rgb image} {$which save fits rgb image file \"$ffn\"}
+ {ext cube} {$which save fits image file \"$ffn\"}
+
+ default {
+ if {[string range $param(file,mode) 0 5] == {mosaic}} {
+ $which save fits mosaic image file "\{$ffn\}"
+ }
+ }
+ }
+ }
+ array {
+ switch $param(file,mode) {
+ {} {$which save fits image file \"$ffn\"}
+ {rgb cube} {$which save fits rgb cube file \"$ffn\"}
+ }
+ }
+ nrrd {$which save fits image file \"$ffn\"}
+ photo {
+ switch -- [$which get type] {
+ base -
+ 3d {$which save fits image file \"$ffn\"}
+ rgb {
+ $which save fits rgb cube file \"$ffn\"
+ set param(file,mode) {rgb cube}
+ }
+ }
+ }
+ }
+
+ set param(load,type) mmapincr
+ set param(file,type) fits
+ # use $fn as we are not saving multiple extentions if present
+ set param(file,name) "[file join $rdir $fn]"
+}
+
+proc BackupGUI {ch} {
+
+ # Basic
+
+ global pds9
+ puts $ch "global pds9"
+ puts $ch "array set pds9 \{ [array get pds9] \}"
+
+ global current
+ puts $ch "global current"
+ puts $ch "array set current \{ [array get current] \}"
+ global pcurrent
+ puts $ch "global pcurrent"
+ puts $ch "array set pcurrent \{ [array get pcurrent] \}"
+
+ global view
+ puts $ch "global view"
+ puts $ch "array set view \{ [array get view] \}"
+ global pview
+ puts $ch "global pview"
+ puts $ch "array set pview \{ [array get pview] \}"
+
+ global canvas
+ puts $ch "global canvas"
+ puts $ch "array set canvas \{ [array get canvas] \}"
+
+ global phttp
+ puts $ch "global phttp"
+ puts $ch "array set phttp \{ [array get phttp] \}"
+
+ global pbuttons
+ puts $ch "global pbuttons"
+ puts $ch "array set pbuttons \{ [array get pbuttons] \}"
+
+ global ppanner
+ puts $ch "global ppanner"
+ puts $ch "array set ppanner \{ [array get ppanner] \}"
+
+ global pmagnifier
+ puts $ch "global pmagnifier"
+ puts $ch "array set pmagnifier \{ [array get pmagnifier] \}"
+
+ global colorbar
+ puts $ch "global colorbar"
+ puts $ch "array set colorbar \{ [array get colorbar] \}"
+
+ global saveimage
+ puts $ch "global saveimage"
+ puts $ch "array set saveimage \{ [array get saveimage] \}"
+
+ # don't save prefs(version), keep the current, not the save set version
+ # removed after 6.1.2
+ # global prefs
+ # puts $ch "global prefs"
+ # puts $ch "array set prefs \{ [array get prefs] \}"
+
+ global debug
+ puts $ch "global debug"
+ puts $ch "array set debug \{ [array get debug] \}"
+
+ # File
+
+ global ps
+ puts $ch "global ps"
+ puts $ch "array set ps \{ [array get ps] \}"
+ global pps
+ puts $ch "global pps"
+ puts $ch "array set pps \{ [array get pps] \}"
+
+ # Frame
+
+ global rgb
+ puts $ch "global rgb"
+ puts $ch "array set rgb \{ [array get rgb] \}"
+
+ global threed
+ puts $ch "global threed"
+ puts $ch "array set threed \{ [array get threed] \}"
+
+ global blink
+ puts $ch "global blink"
+ puts $ch "array set blink \{ [array get blink] \}"
+ global pblink
+ puts $ch "global pblink"
+ puts $ch "array set pblink \{ [array get pblink] \}"
+
+ global tile
+ puts $ch "global tile"
+ puts $ch "array set tile \{ [array get tile] \}"
+ global ptile
+ puts $ch "global ptile"
+ puts $ch "array set ptile \{ [array get ptile] \}"
+
+ global crosshair
+ puts $ch "global crosshair"
+ puts $ch "array set crosshair \{ [array get crosshair] \}"
+
+ global cube
+ puts $ch "global cube"
+ puts $ch "array set cube \{ [array get cube] \}"
+
+ # Bin
+
+ global bin
+ puts $ch "global bin"
+ puts $ch "array set bin \{ [array get bin] \}"
+ global pbin
+ puts $ch "global pbin"
+ puts $ch "array set pbin \{ [array get pbin] \}"
+
+ # Zoom
+
+ global panzoom
+ puts $ch "global panzoom"
+ puts $ch "array set panzoom \{ [array get panzoom] \}"
+ global ppanzoom
+ puts $ch "global ppanzoom"
+ puts $ch "array set ppanzoom \{ [array get ppanzoom] \}"
+
+ # Crop
+
+ global crop
+ puts $ch "global crop"
+ puts $ch "array set crop \{ [array get crop] \}"
+
+ # Scale
+
+ global scale
+ puts $ch "global scale"
+ puts $ch "array set scale \{ [array get scale] \}"
+ global pscale
+ puts $ch "global pscale"
+ puts $ch "array set pscale \{ [array get pscale] \}"
+
+ global minmax
+ puts $ch "global minmax"
+ puts $ch "array set minmax \{ [array get minmax] \}"
+ global pminmax
+ puts $ch "global pminmax"
+ puts $ch "array set pminmax \{ [array get pminmax] \}"
+
+ global zscale
+ puts $ch "global zscale"
+ puts $ch "array set zscale \{ [array get zscale] \}"
+ global pzscale
+ puts $ch "global pzscale"
+ puts $ch "array set pzscale \{ [array get pzscale] \}"
+
+ # Region
+
+ global marker
+ puts $ch "global marker"
+ puts $ch "array set marker \{ [array get marker] \}"
+ global pmarker
+ puts $ch "global pmarker"
+ puts $ch "array set pmarker \{ [array get pmarker] \}"
+
+ global centroid
+ puts $ch "global centroid"
+ puts $ch "array set centroid \{ [array get centroid] \}"
+
+ # WCS
+
+ global wcs
+ puts $ch "global wcs"
+ puts $ch "array set wcs \{ [array get wcs] \}"
+ global pwcs
+ puts $ch "global pwcs"
+ puts $ch "array set pwcs \{ [array get pwcs] \}"
+
+ # Analysis
+
+ global ime
+ puts $ch "global ime"
+ puts $ch "array set ime \{ [array get ime] \}"
+ global pime
+ puts $ch "global pime"
+ puts $ch "array set pime \{ [array get pime] \}"
+
+ global pgraph
+ puts $ch "global pgraph"
+ puts $ch "array set pgraph \{ [array get pgraph] \}"
+
+ global pcoord
+ puts $ch "global pcoord"
+ puts $ch "array set pcoord \{ [array get pcoord] \}"
+
+ global pexamine
+ puts $ch "global pexamine"
+ puts $ch "array set pexamine \{ [array get pexamine] \}"
+
+ global pixel
+ puts $ch "global pixel"
+ puts $ch "array set pixel \{ [array get pixel] \}"
+
+ global mask
+ puts $ch "global mask"
+ puts $ch "array set mask \{ [array get mask] \}"
+ global pmask
+ puts $ch "global pmask"
+ puts $ch "array set pmask \{ [array get pmask] \}"
+
+ global contour
+ puts $ch "global contour"
+ puts $ch "array set contour \{ [array get contour] \}"
+ global pcontour
+ puts $ch "global pcontour"
+ puts $ch "array set pcontour \{ [array get pcontour] \}"
+
+ global grid
+ puts $ch "global grid"
+ puts $ch "array set grid \{ [array get grid] \}"
+ global pgrid
+ puts $ch "global pgrid"
+ puts $ch "array set pgrid \{ [array get pgrid] \}"
+
+ global block
+ puts $ch "global block"
+ puts $ch "array set block \{ [array get block] \}"
+ global pblock
+ puts $ch "global pblock"
+ puts $ch "array set pblock \{ [array get pblock] \}"
+
+ global smooth
+ puts $ch "global smooth"
+ puts $ch "array set smooth \{ [array get smooth] \}"
+ global psmooth
+ puts $ch "global psmooth"
+ puts $ch "array set psmooth \{ [array get psmooth] \}"
+
+ global pnres
+ puts $ch "global pnres"
+ puts $ch "array set pnres \{ [array get pnres] \}"
+
+ global sao
+ puts $ch "global sao"
+ puts $ch "array set sao \{ [array get sao] \}"
+
+ global eso
+ puts $ch "global eso"
+ puts $ch "array set eso \{ [array get eso] \}"
+
+ global stsci
+ puts $ch "global stsci"
+ puts $ch "array set stsci \{ [array get stsci] \}"
+
+ global twomass
+ puts $ch "global twomass"
+ puts $ch "array set twomass \{ [array get twomass] \}"
+
+ global nvss
+ puts $ch "global nvss"
+ puts $ch "array set nvss \{ [array get nvss] \}"
+
+ global vlss
+ puts $ch "global vlss"
+ puts $ch "array set vlss \{ [array get vlss] \}"
+
+ global skyview
+ puts $ch "global skyview"
+ puts $ch "array set skyview \{ [array get skyview] \}"
+
+ global cat
+ puts $ch "global cat"
+ puts $ch "array set cat \{ [array get cat] \}"
+ global pcat
+ puts $ch "global pcat"
+ puts $ch "array set pcat \{ [array get pcat] \}"
+
+ global vla
+ puts $ch "global vla"
+ puts $ch "array set vla \{ [array get vla] \}"
+
+ global pvo
+ puts $ch "global pvo"
+ puts $ch "array set pvo \{ [array get pvo] \}"
+
+ global pap
+ puts $ch "global pap"
+ puts $ch "array set pap \{ [array get pap] \}"
+
+ global panalysis
+ puts $ch "global panalysis"
+ puts $ch "array set panalysis \{ [array get panalysis] \}"
+
+ global active
+ puts $ch "global active"
+ puts $ch "array set active \{ [array get active] \}"
+}
+
+proc ProcessBackupCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set fn [lindex $var $i]
+ if {$fn != {}} {
+ FileLast backupfbox $fn
+ Backup $fn
+ } else {
+ Error [msgcat::mc {Unable to open file}]
+ }
+}
+
+proc ProcessRestoreCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set fn [lindex $var $i]
+ if {$fn != {}} {
+ FileLast backupfbox $fn
+ Restore $fn
+ } else {
+ Error [msgcat::mc {Unable to open file}]
+ }
+}
diff --git a/ds9/library/bin.tcl b/ds9/library/bin.tcl
new file mode 100644
index 0000000..cdcfbe5
--- /dev/null
+++ b/ds9/library/bin.tcl
@@ -0,0 +1,830 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BinDef {} {
+ global bin
+ global ibin
+ global pbin
+ global tcl_platform
+
+ set ibin(top) .bl
+ set ibin(mb) .blmb
+
+ set bin(lock) 0
+ set bin(function) sum
+ set bin(factor) { 1 1 }
+ set bin(depth) 1
+ set bin(buffersize) 1024
+
+ array set pbin [array get bin]
+
+ # prefs only
+ set pbin(wheel) 0
+ set pbin(wheel,factor) 1.2
+ # special case
+ switch -- $tcl_platform(os) {
+ Darwin {
+ switch [lindex [split $tcl_platform(osVersion) {.}] 0] {
+ 11 {set pbin(wheel,factor) 1.01}
+ }
+ }
+ }
+}
+
+proc Bin {bx by} {
+ global current
+
+ if {$current(frame) != {}} {
+ BinFrame $current(frame) $bx $by
+ }
+}
+
+proc BinFrame {which bx by} {
+ global bin
+ global current
+ global rgb
+
+ RGBEvalLock rgb(lock,bin) $which [list $which bin factor $bx $by]
+ if {$which == $current(frame)} {
+ set bin(factor) "[$current(frame) get bin factor]"
+ }
+ UpdateBin
+}
+
+proc BinAbout {x y} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin about $x $y]
+ UpdateBin
+ }
+}
+
+proc BinAboutCenter {} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin about center]
+ UpdateBin
+ }
+}
+
+proc BinCols {x y z} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {![$current(frame) has bin column $x]} {
+ Error "[msgcat::mc {Invalid Column Name}] $x"
+ return
+ }
+ if {![$current(frame) has bin column $y]} {
+ Error "[msgcat::mc {Invalid Column Name}] $y"
+ return
+ }
+ if {$z!={""}} {
+ if {![$current(frame) has bin column $z]} {
+ Error "[msgcat::mc {Invalid Column Name}] $z"
+ return
+ }
+ }
+
+ RGBEvalLockCurrent rgb(lock,bin) "$current(frame) bin cols \{$x\} \{$y\} \{$z\}"
+ UpdateBin
+ }
+}
+
+proc BinFilter {str} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) "$current(frame) bin filter \{\{$str\}\}"
+ UpdateBin
+ }
+}
+
+proc BinToFit {} {
+ global current
+ global bin
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin to fit]
+ set bin(factor) "[$current(frame) get bin factor]"
+ UpdateBin
+ }
+}
+
+proc ChangeBinFactor {} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin factor to $bin(factor)]
+ UpdateBin
+ }
+}
+
+proc ChangeBinDepth {} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin depth $bin(depth)]
+ UpdateBin
+ }
+}
+
+proc ChangeBinFunction {} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin function $bin(function)]
+ UpdateBin
+ }
+}
+
+proc ChangeBinBufferSize {} {
+ global bin
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,bin) [list $current(frame) bin buffer size $bin(buffersize)]
+ UpdateBin
+ }
+}
+
+proc UpdateBin {} {
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateBin"
+ }
+
+ LockBinCurrent
+ UpdateBinDialog
+ UpdateCrosshairDialog
+ UpdateCropDialog
+ UpdateCubeDialog
+ UpdateScaleDialog
+ UpdateContourScale
+ UpdateContourDialog
+ UpdateWCSDialog
+ UpdateGraphXAxis $current(frame)
+ UpdateGraphYAxis $current(frame)
+ UpdateMain
+}
+
+proc BinDialog {} {
+ global bin
+ global ibin
+ global dbin
+ global ds9
+
+ # see if we already have a window visible
+
+ if {[winfo exists $ibin(top)]} {
+ raise $ibin(top)
+ return
+ }
+
+ # create the window
+ set w $ibin(top)
+ set mb $ibin(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Binning Parameters}] BinDestroyDialog
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Method}] -menu $mb.method
+ $mb add cascade -label [msgcat::mc {Bin}] -menu $mb.bin
+ $mb add cascade -label [msgcat::mc {Buffer}] -menu $mb.buffer
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command BinApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Update Filter}] \
+ -command BinUpdateFilterDialog
+ $mb.file add command -label [msgcat::mc {Clear Filter}] \
+ -command BinClearFilterDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command BinDestroyDialog
+
+ EditMenu $mb ibin
+
+ menu $mb.method
+ $mb.method add radiobutton -label [msgcat::mc {Average}] \
+ -variable bin(function) -value average -command ChangeBinFunction
+ $mb.method add radiobutton -label [msgcat::mc {Sum}] \
+ -variable bin(function) -value sum -command ChangeBinFunction
+
+ menu $mb.bin
+ $mb.bin add command -label [msgcat::mc {Bin In}] \
+ -command {Bin .5 .5}
+ $mb.bin add command -label [msgcat::mc {Bin Out}] \
+ -command {Bin 2 2}
+ $mb.bin add command -label [msgcat::mc {Bin Fit}] \
+ -command BinToFit
+ $mb.bin add separator
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 1" \
+ -variable bin(factor) -value { 1 1 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 2" \
+ -variable bin(factor) -value { 2 2 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 4" \
+ -variable bin(factor) -value { 4 4 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 8" \
+ -variable bin(factor) -value { 8 8 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 16" \
+ -variable bin(factor) -value { 16 16 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 32" \
+ -variable bin(factor) -value { 32 32 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 64" \
+ -variable bin(factor) -value { 64 64 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 128" \
+ -variable bin(factor) -value { 128 128 } -command ChangeBinFactor
+ $mb.bin add radiobutton -label "[msgcat::mc {Bin}] 256" \
+ -variable bin(factor) -value { 256 256 } -command ChangeBinFactor
+
+ menu $mb.buffer
+ $mb.buffer add radiobutton -label {128x128} \
+ -variable bin(buffersize) -value 128 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {256x256} \
+ -variable bin(buffersize) -value 256 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {512x512} \
+ -variable bin(buffersize) -value 512 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {1024x1024} \
+ -variable bin(buffersize) -value 1024 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {2048x2048} \
+ -variable bin(buffersize) -value 2048 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {4096x4096} \
+ -variable bin(buffersize) -value 4096 -command ChangeBinBufferSize
+ $mb.buffer add radiobutton -label {8192x8192} \
+ -variable bin(buffersize) -value 8192 -command ChangeBinBufferSize
+
+ # Columns
+ set f [ttk::labelframe $w.cols -text [msgcat::mc {Bin Columns}] -padding 2]
+
+ ttk::label $f.title -text [msgcat::mc {Column}]
+ ttk::label $f.titlefactor -text [msgcat::mc {Bin}]
+ ttk::label $f.titlemin -text [msgcat::mc {Min}]
+ ttk::label $f.titlemax -text [msgcat::mc {Max}]
+ ttk::menubutton $f.x -textvariable dbin(xcol) -menu $f.x.m -width 10
+ ttk::entry $f.xfactor -textvariable dbin(factor,x) -width 8
+ ttk::label $f.xmin -textvariable dbin(xcol,min) -width 12 -relief groove
+ ttk::label $f.xmax -textvariable dbin(xcol,max) -width 12 -relief groove
+ ttk::menubutton $f.y -textvariable dbin(ycol) -menu $f.y.m -width 10
+ ttk::entry $f.yfactor -textvariable dbin(factor,y) -width 8
+ ttk::label $f.ymin -textvariable dbin(ycol,min) -width 12 -relief groove
+ ttk::label $f.ymax -textvariable dbin(ycol,max) -width 12 -relief groove
+
+ grid $f.title $f.titlefactor $f.titlemin $f.titlemax -padx 2 -pady 2
+ grid $f.x $f.xfactor $f.xmin $f.xmax -padx 2 -pady 2
+ grid $f.y $f.yfactor $f.ymin $f.ymax -padx 2 -pady 2
+
+ # Center
+ set f [ttk::labelframe $w.center -text [msgcat::mc {Bin Center}] -padding 2]
+ ttk::entry $f.x -textvariable dbin(x) -width 12
+ ttk::entry $f.y -textvariable dbin(y) -width 12
+ ttk::checkbutton $f.auto -text [msgcat::mc {or center of data}] \
+ -variable dbin(auto)
+ grid $f.x $f.y $f.auto -padx 2 -pady 2
+
+ # Filter
+ set f [ttk::labelframe $w.filter -text [msgcat::mc {Bin Filter}] -padding 2]
+ set dbin(filter,entry) \
+ [ttk::entry $f.filter -textvariable dbin(filter) -width 40]
+ grid $f.filter -padx 2 -pady 2
+
+ # Bin 3rd Column
+ set f [ttk::labelframe $w.z -text [msgcat::mc {Bin 3rd Column}] -padding 2]
+ ttk::label $f.title -text [msgcat::mc {Column}]
+ ttk::label $f.titledepth -text [msgcat::mc {Depth}]
+ ttk::label $f.titlemin -text [msgcat::mc {Min}]
+ ttk::label $f.titlemax -text [msgcat::mc {Max}]
+
+ ttk::menubutton $f.z -textvariable dbin(zcol) -menu $f.z.m -width 10
+ ttk::entry $f.depth -textvariable dbin(depth) -width 8
+ ttk::entry $f.min -textvariable dbin(zcol,min) -width 12
+ ttk::entry $f.max -textvariable dbin(zcol,max) -width 12
+
+ grid $f.title $f.titledepth $f.titlemin $f.titlemax -padx 2 -pady 2
+ grid $f.z $f.depth $f.min $f.max -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command BinApplyDialog
+ ttk::button $f.update -text [msgcat::mc {Update Filter}] \
+ -command BinUpdateFilterDialog
+ ttk::button $f.clear -text [msgcat::mc {Clear Filter}] \
+ -command BinClearFilterDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command BinDestroyDialog
+ pack $f.apply $f.update $f.clear $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ grid $w.cols -sticky news
+ grid $w.center -sticky news
+ grid $w.filter -sticky news
+ grid $w.z -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid rowconfigure $w 2 -weight 1
+ grid rowconfigure $w 3 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ $w.cols.xfactor select range 0 end
+
+ set dbin(auto) 0
+ set dbin(minmax) 1
+
+ UpdateBinDialog
+}
+
+proc PopUp {b m l cmd} {
+ global ds9
+
+ destroy $m
+
+ menu $m -tearoff 0
+ set cnt -1
+ for {set ii 0} {$ii<[llength $l]} {incr ii} {
+ $m add command -label [lindex $l $ii] \
+ -command "global dbin;set $b [lindex $l $ii]; $cmd"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $m entryconfig $ii -columnbreak 1
+ }
+ }
+}
+
+proc BlankPopUp {m} {
+ destroy $m
+ menu $m -tearoff 0
+}
+
+proc UpdateBinDialog {} {
+ global bin
+ global ibin
+ global dbin
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateBinDialog"
+ }
+
+ if {![winfo exists $ibin(top)]} {
+ return
+ }
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set w $ibin(top)
+
+ set bf "[$current(frame) get bin factor]"
+ set dbin(factor,x) [lindex $bf 0]
+ set dbin(factor,y) [lindex $bf 1]
+ set dbin(depth) [$current(frame) get bin depth]
+
+ if {[$current(frame) has fits bin]} {
+
+ set cols [$current(frame) get bin cols]
+ set colslist "[$current(frame) get bin list]"
+
+ set dbin(xcol) [lindex $cols 0]
+ set dbin(ycol) [lindex $cols 1]
+ PopUp dbin(xcol) $w.cols.x.m $colslist UpdateXCol
+ PopUp dbin(ycol) $w.cols.y.m $colslist UpdateYCol
+
+ set mm [$current(frame) get bin cols minmax \{$dbin(xcol)\}]
+ set dbin(xcol,min) [lindex $mm 0]
+ set dbin(xcol,max) [lindex $mm 1]
+
+ set mm [$current(frame) get bin cols minmax \{$dbin(ycol)\}]
+ set dbin(ycol,min) [lindex $mm 0]
+ set dbin(ycol,max) [lindex $mm 1]
+
+ set cursor [$current(frame) get bin cursor]
+ set dbin(x) [lindex $cursor 0]
+ set dbin(y) [lindex $cursor 1]
+
+ set dbin(filter) [$current(frame) get bin filter]
+
+ set dbin(zcol) [lindex $cols 2]
+ PopUp dbin(zcol) $w.z.z.m $colslist UpdateZCol
+ set mm [$current(frame) get bin cols dim \{$dbin(zcol)\}]
+ set dbin(zcol,min) [lindex $mm 0]
+ set dbin(zcol,max) [lindex $mm 1]
+
+ } else {
+ set dbin(xcol) {}
+ set dbin(xcol,min) {}
+ set dbin(xcol,max) {}
+ set dbin(ycol) {}
+ set dbin(ycol,min) {}
+ set dbin(ycol,max) {}
+
+ set dbin(x) {}
+ set dbin(y) {}
+
+ set dbin(filter) {}
+
+ set dbin(zcol) {}
+ set dbin(zcol,min) {}
+ set dbin(zcol,max) {}
+
+ BlankPopUp $w.cols.x.m
+ BlankPopUp $w.cols.y.m
+ BlankPopUp $w.z.z.m
+ }
+}
+
+proc UpdateXCol {} {
+ global current
+ global dbin
+
+ if {$current(frame) != {}
+ && [$current(frame) has fits bin]
+ && $dbin(xcol) != {}} {
+
+ set mm [$current(frame) get bin cols minmax \{$dbin(xcol)\}]
+ set dbin(xcol,min) [lindex $mm 0]
+ set dbin(xcol,max) [lindex $mm 1]
+ } else {
+ set dbin(xcol,min) {}
+ set dbin(xcol,max) {}
+ }
+}
+
+proc UpdateYCol {} {
+ global current
+ global dbin
+
+ if {$current(frame) != {}
+ && [$current(frame) has fits bin]
+ && $dbin(ycol) != {}} {
+
+ set mm [$current(frame) get bin cols minmax \{$dbin(ycol)\}]
+ set dbin(ycol,min) [lindex $mm 0]
+ set dbin(ycol,max) [lindex $mm 1]
+ } else {
+ set dbin(ycol,min) {}
+ set dbin(ycol,max) {}
+ }
+}
+
+proc UpdateZCol {} {
+ global current
+ global dbin
+
+ if {$current(frame) != {}
+ && [$current(frame) has fits bin]
+ && $dbin(zcol) != {}} {
+
+ if {$dbin(minmax)} {
+ set mm [$current(frame) get bin cols dim \{$dbin(zcol)\}]
+ set dbin(zcol,min) [lindex $mm 0]
+ set dbin(zcol,max) [lindex $mm 1]
+ }
+ } else {
+ set dbin(zcol,min) {}
+ set dbin(zcol,max) {}
+ }
+}
+
+proc BinApplyDialog {} {
+ global bin
+ global dbin
+ global current
+ global rgb
+
+ if {$current(frame) == {}} {
+ # reset
+ set dbin(auto) 0
+ return
+ }
+
+ # clean up filter if needed
+ set dbin(filter) [string trimleft $dbin(filter)]
+ set dbin(filter) [string trimright $dbin(filter)]
+
+ # delete any markers if needed
+ if {[$current(frame) has fits bin]} {
+ set foo [$current(frame) get bin cols]
+ set xcol [lindex $foo 0]
+ set ycol [lindex $foo 1]
+
+ if {$xcol != $dbin(xcol) || $ycol != $dbin(ycol)} {
+ $current(frame) marker delete all
+ }
+ }
+
+ if {$dbin(depth)>1} {
+ CubeDialog
+
+ if {$dbin(auto)} {
+ if {$dbin(factor,x) != {}
+ && $dbin(factor,y) != {}
+ && $dbin(depth) != {}
+ && $dbin(zcol,min) != {}
+ && $dbin(zcol,max) != {}
+ && $dbin(xcol) != {}
+ && $dbin(ycol) != {}
+ && $dbin(zcol) != {}} {
+
+ RGBEvalLockCurrent rgb(lock,bin) \
+ [list $current(frame) bin to $dbin(factor,x) $dbin(factor,y) $dbin(depth) $dbin(zcol,min) $dbin(zcol,max) about center \{$dbin(xcol)\} \{$dbin(ycol)\} \{$dbin(zcol)\} \{$dbin(filter)\}]
+ }
+ } else {
+ if {$dbin(factor,x) != {}
+ && $dbin(factor,y) != {}
+ && $dbin(depth) != {}
+ && $dbin(zcol,min) != {}
+ && $dbin(zcol,max) != {}
+ && $dbin(x) != {}
+ && $dbin(y) != {}
+ && $dbin(xcol) != {}
+ && $dbin(ycol) != {}
+ && $dbin(zcol) != {}} {
+
+ RGBEvalLockCurrent rgb(lock,bin) \
+ [list $current(frame) bin to $dbin(factor,x) $dbin(factor,y) $dbin(depth) $dbin(zcol,min) $dbin(zcol,max) about $dbin(x) $dbin(y) \{$dbin(xcol)\} \{$dbin(ycol)\} \{$dbin(zcol)\} \{$dbin(filter)\}]
+ }
+ }
+ } else {
+ if {$dbin(auto)} {
+ if {$dbin(factor,x) != {}
+ && $dbin(factor,y) != {}
+ && $dbin(xcol) != {}
+ && $dbin(ycol) != {}} {
+
+ RGBEvalLockCurrent rgb(lock,bin) \
+ [list $current(frame) bin to $dbin(factor,x) $dbin(factor,y) about center \{$dbin(xcol)\} \{$dbin(ycol)\} \{$dbin(filter)\}]
+ }
+ } else {
+ if {$dbin(factor,x) != {}
+ && $dbin(factor,y) != {}
+ && $dbin(x) != {}
+ && $dbin(y) != {}
+ && $dbin(xcol) != {}
+ && $dbin(ycol) != {}} {
+
+ RGBEvalLockCurrent rgb(lock,bin) \
+ [list $current(frame) bin to $dbin(factor,x) $dbin(factor,y) about $dbin(x) $dbin(y) \{$dbin(xcol)\} \{$dbin(ycol)\} \{$dbin(filter)\}]
+ }
+ }
+ }
+
+ UpdateScaleMenu
+ UpdateBinMenu
+ UpdateBin
+
+ # reset
+ set dbin(auto) 0
+}
+
+proc BinUpdateFilterDialog {} {
+ global dbin
+ global current
+
+ $dbin(filter,entry) delete 0 end
+ if {$current(frame) != {}} {
+ $dbin(filter,entry) insert 0 \
+ [$current(frame) marker list ds9 physical fk5 degrees yes]
+ }
+}
+
+proc BinClearFilterDialog {} {
+ global dbin
+
+ $dbin(filter,entry) delete 0 end
+}
+
+proc BinDestroyDialog {} {
+ global ibin
+ global dbin
+
+ if {[winfo exists $ibin(top)]} {
+ destroy $ibin(top)
+ destroy $ibin(mb)
+ }
+
+ unset dbin
+}
+
+proc MatchBinCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchBin $current(frame)
+ }
+}
+
+proc MatchBin {which} {
+ global ds9
+ global rgb
+
+ set factor [$which get bin factor]
+ set depth [$which get bin depth]
+ set filter [$which get bin filter]
+ set size [$which get bin buffer size]
+ set function [$which get bin function]
+ set cols [$which get bin cols]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,bin) $ff [list $ff bin factor to $factor]
+ RGBEvalLock rgb(lock,bin) $ff [list $ff bin depth $depth]
+ RGBEvalLock rgb(lock,bin) $ff "$ff bin filter \{\{$filter\}\}"
+ RGBEvalLock rgb(lock,bin) $ff [list $ff bin buffer size $size]
+ RGBEvalLock rgb(lock,bin) $ff [list $ff bin function $function]
+ RGBEvalLock rgb(lock,bin) $ff "$ff bin cols \{\{[lindex $cols 0]\}\} \{\{[lindex $cols 1]\}\} \{\{[lindex $cols 2]\}\}"
+ }
+ }
+}
+
+proc LockBinCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockBin $current(frame)
+ }
+}
+
+proc LockBin {which} {
+ global bin
+
+ if {$bin(lock)} {
+ MatchBin $which
+ }
+}
+
+proc BinBackup {ch which} {
+ switch [$which get type] {
+ base -
+ 3d {BinBackupBase $ch $which}
+ rgb {BinBackupRGB $ch $which}
+ }
+}
+
+proc BinBackupBase {ch which} {
+ puts $ch "$which bin factor to [$which get bin factor]"
+ puts $ch "$which bin depth [$which get bin depth]"
+ puts $ch "$which bin filter \{\"[$which get bin filter]\"\}"
+ puts $ch "$which bin buffer size [$which get bin buffer size]"
+ set pos [$which get bin cursor]
+ if {$pos != {}} {
+ puts $ch "$which bin about $pos"
+ }
+ puts $ch "$which bin function [$which get bin function]"
+ set cols [$which get bin cols]
+ if {$cols != {}} {
+ puts $ch "$which bin cols \{\"[lindex $cols 0]\"\} \{\"[lindex $cols 1]\"\} \{\"[lindex $cols 2]\"\} "
+ }
+}
+
+proc BinBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ BinBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+# Process Cmds
+
+proc ProcessBinCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global bin
+
+ switch -- [string tolower [lindex $var $i]] {
+ close {BinDestroyDialog}
+ open {BinDialog}
+ match {MatchBinCurrent}
+ lock {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set bin(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set bin(lock) 1
+ incr i -1
+ }
+ LockBinCurrent
+ }
+ about {
+ incr i
+ switch [lindex $var $i] {
+ center {
+ BinAboutCenter
+ }
+ default {
+ BinAbout [lindex $var [expr $i+0]] [lindex $var [expr $i+1]]
+ incr i
+ }
+ }
+ }
+ buffersize {
+ incr i
+ set bin(buffersize) [lindex $var $i]
+ ChangeBinBufferSize
+ }
+ cols {
+ BinCols \"[lindex $var [expr $i+1]]\" \"[lindex $var [expr $i+2]]\" \"\"
+ incr i 2
+ }
+ colsz {
+ BinCols \"[lindex $var [expr $i+1]]\" \"[lindex $var [expr $i+2]]\" \"[lindex $var [expr $i+3]]\"
+ incr i 3
+ }
+ factor {
+ incr i
+ set bx [lindex $var $i]
+ set by [lindex $var [expr $i+1]]
+ # note: the spaces are needed so that the menus are in sync
+ if {$by != {} && [string is double $by]} {
+ set bin(factor) " $bx $by "
+ incr i
+ } else {
+ set bin(factor) " $bx $bx "
+ }
+ ChangeBinFactor
+ }
+ depth {
+ incr i
+ set bin(depth) [lindex $var $i]
+ ChangeBinDepth
+ }
+ filter {
+ incr i
+ BinFilter [lindex $var $i]
+ }
+ function {
+ incr i
+ set bin(function) [string tolower [lindex $var $i]]
+ ChangeBinFunction
+ }
+ in {Bin .5 .5}
+ out {Bin 2 2}
+ to {
+ # eat the 'fit'
+ incr i
+ BinToFit
+ }
+ }
+}
+
+proc ProcessSendBinCmd {proc id param} {
+ global bin
+ global current
+
+ switch -- [string tolower [lindex $param 0]] {
+ lock {$proc $id [ToYesNo $bin(lock)]}
+ about {
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get bin cursor]\n"
+ }
+ }
+ buffersize {$proc $id "$bin(buffersize)\n"}
+ cols {
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get bin cols]\n"
+ }
+ }
+ factor {$proc $id "$bin(factor)\n"}
+ depth {$proc $id "$bin(depth)\n"}
+ filter {
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get bin filter]\n"
+ }
+ }
+ function {$proc $id "$bin(function)\n"}
+ }
+}
+
diff --git a/ds9/library/block.tcl b/ds9/library/block.tcl
new file mode 100644
index 0000000..f474f2d
--- /dev/null
+++ b/ds9/library/block.tcl
@@ -0,0 +1,356 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BlockDef {} {
+ global iblock
+ global block
+ global pblock
+
+ set iblock(top) .blk
+ set iblock(mb) .blkmb
+
+ set block(lock) 0
+ set block(factor) { 1 1 }
+
+ array set pblock [array get block]
+}
+
+proc BlockToFit {} {
+ global block
+ global current
+
+ if {$current(frame) != {}} {
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,block) [list $current(frame) block to fit]
+ ResetWatchCursor
+ set block(factor) [$current(frame) get block factor]
+ UpdateBlock
+ }
+}
+
+proc ChangeBlock {} {
+ global block
+ global current
+
+ if {$current(frame) != {}} {
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,block) [list $current(frame) block to $block(factor)]
+ ResetWatchCursor
+ UpdateBlock
+ }
+}
+
+proc Block {bx by} {
+ global block
+ global current
+
+ if {$current(frame) != {}} {
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,block) [list $current(frame) block $bx $by]
+ set block(factor) [$current(frame) get block factor]
+ ResetWatchCursor
+ UpdateBlock
+ }
+}
+
+proc UpdateBlock {} {
+ global current
+
+ LockBlockCurrent
+ UpdateBlockDialog
+ UpdateCrosshairDialog
+ UpdateCropDialog
+ UpdateCubeDialog
+ UpdateScaleDialog
+ UpdateContourScale
+ UpdateContourDialog
+ UpdateWCSDialog
+ UpdateGraphXAxis $current(frame)
+ UpdateGraphYAxis $current(frame)
+ UpdateMain
+
+ UpdateHeaderDialog
+}
+
+proc BlockDialog {} {
+ global block
+ global iblock
+ global dblock
+ global ds9
+ global current
+
+ # see if we already have a window visible
+ if {[winfo exists $iblock(top)]} {
+ raise $iblock(top)
+ return
+ }
+
+ # create the window
+ set w $iblock(top)
+ set mb $iblock(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Block Parameters}] \
+ BlockDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Block}] -menu $mb.block
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command BlockApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command BlockDestroyDialog
+
+ EditMenu $mb iblock
+
+ menu $mb.block
+ $mb.block add command -label [msgcat::mc {Block In}] -command {Block .5 .5}
+ $mb.block add command -label [msgcat::mc {Block Out}] -command {Block 2 2}
+ $mb.block add command -label [msgcat::mc {Block Fit}] -command BlockToFit
+ $mb.block add separator
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 1" \
+ -variable block(factor) -value { 1 1 } -command ChangeBlock
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 2" \
+ -variable block(factor) -value { 2 2 } -command ChangeBlock
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 4" \
+ -variable block(factor) -value { 4 4 } -command ChangeBlock
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 8" \
+ -variable block(factor) -value { 8 8 } -command ChangeBlock
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 16" \
+ -variable block(factor) -value { 16 16 } -command ChangeBlock
+ $mb.block add radiobutton -label "[msgcat::mc {Block}] 32" \
+ -variable block(factor) -value { 32 32 } -command ChangeBlock
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.blocktitle -text [msgcat::mc {Block}]
+ ttk::entry $f.blockx -textvariable dblock(x) -width 14
+ ttk::entry $f.blocky -textvariable dblock(y) -width 14
+
+ grid $f.blocktitle $f.blockx $f.blocky -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command BlockApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command BlockDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ $w.param.blockx select range 0 end
+
+ UpdateBlockDialog
+}
+
+proc BlockApplyDialog {} {
+ global block
+ global iblock
+ global dblock
+ global current
+
+ if {$current(frame) != {}} {
+ set block(factor) "$dblock(x) $dblock(y)"
+ RGBEvalLockCurrent rgb(lock,block) [list $current(frame) block to $block(factor)]
+
+ LockFrameCurrent
+ UpdateGraphXAxis $current(frame)
+ UpdateBlockDialog
+ RefreshInfoBox $current(frame)
+ }
+}
+
+proc BlockDestroyDialog {} {
+ global iblock
+ global dblock
+
+ if {[winfo exists $iblock(top)]} {
+ destroy $iblock(top)
+ destroy $iblock(mb)
+ }
+
+ unset dblock
+}
+
+proc UpdateBlockDialog {} {
+ global block
+ global iblock
+ global dblock
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateBlockDialog"
+ }
+
+ if {![winfo exists $iblock(top)]} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ set zz [$current(frame) get block factor]
+ set dblock(x) [lindex $zz 0]
+ set dblock(y) [lindex $zz 1]
+ } else {
+ set dblock(x) {}
+ set dblock(y) {}
+ }
+}
+
+proc UpdateBlockMenu {} {
+ global block
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateBlockMenu"
+ }
+
+ if {$current(frame) != {}} {
+ set block(factor) [$current(frame) get block factor]
+ }
+}
+
+proc MatchBlockCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchBlock $current(frame)
+ }
+}
+
+proc MatchBlock {which} {
+ global ds9
+ global rgb
+
+ set factor [$which get block factor]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,block) $ff [list $ff block to $factor]
+ }
+ }
+}
+
+proc LockBlockCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockBlock $current(frame)
+ }
+}
+
+proc LockBlock {which} {
+ global block
+
+ if {$block(lock)} {
+ MatchBlock $which
+ }
+}
+
+proc BlockBackup {ch which} {
+ switch [$which get type] {
+ base -
+ 3d {BlockBackupBase $ch $which}
+ rgb {BlockBackupRGB $ch $which}
+ }
+}
+
+proc BlockBackupBase {ch which} {
+ set factor [$which get block factor]
+ puts $ch "$which block to $factor"
+}
+
+proc BlockBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ BlockBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+proc ProcessBlockCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global block
+ switch -- [string tolower [lindex $var $i]] {
+ open {BlockDialog}
+ close {BlockDestroyDialog}
+ match {MatchBlockCurrent}
+ lock {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set block(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set block(lock) 1
+ incr i -1
+ }
+ LockBlockCurrent
+ }
+ in {Block .5 .5}
+ out {Block 2 2}
+ to {
+ switch -- [string tolower [lindex $var [expr $i+1]]] {
+ fit {
+ BlockToFit
+ incr i
+ }
+ default {
+ set b1 [lindex $var [expr $i+1]]
+ set b2 [lindex $var [expr $i+2]]
+ if {[string is double $b2] && $b2 != {}} {
+ set block(factor) " $b1 $b2 "
+ incr i 2
+ } else {
+ set block(factor) " $b1 $b1 "
+ incr i
+ }
+ ChangeBlock
+ }
+ }
+ }
+ default {
+ set b1 [lindex $var $i]
+ set b2 [lindex $var [expr $i+1]]
+ if {[string is double $b2] && $b2 != {}} {
+ Block $b1 $b2
+ incr i
+ } else {
+ Block $b1 $b1
+ }
+ }
+ }
+}
+
+proc ProcessSendBlockCmd {proc id param} {
+ global block
+
+ switch -- [lindex $param 0] {
+ lock {$proc $id [ToYesNo $block(lock)]}
+ default {
+ set z1 [lindex $block(factor) 0]
+ set z2 [lindex $block(factor) 1]
+ if {$z1 != $z2} {
+ $proc $id "$block(factor)\n"
+ } else {
+ $proc $id "$z1\n"
+ }
+ }
+ }
+}
+
diff --git a/ds9/library/box.tcl b/ds9/library/box.tcl
new file mode 100644
index 0000000..b28d84b
--- /dev/null
+++ b/ds9/library/box.tcl
@@ -0,0 +1,126 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BoxDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ # procs
+ set var(proc,apply) BoxApply
+ set var(proc,close) BoxClose
+ set var(proc,coordCB) BoxCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisHistogramDialog $varname
+ MarkerAnalysisPlot3dDialog $varname
+
+ # init
+ BoxEditCB $varname
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback edit BoxEditCB $varname
+ $var(frame) marker $var(id) callback rotate \
+ MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.tradius -text Size
+ ttk::entry $f.radius1 -textvariable ${varname}(radius1) -width 13
+ ttk::entry $f.radius2 -textvariable ${varname}(radius2) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list BoxEditCB $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.tradius $f.radius1 $f.radius2 $f.uradius -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc BoxClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback edit BoxEditCB
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc BoxApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(radius1) != {} &&
+ $var(radius2) !={}} {
+ $var(frame) marker $var(id) box radius \
+ $var(radius1) $var(radius2) $var(dcoord) $var(dformat)
+ }
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc BoxCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "BoxCoordCB"
+ }
+
+ MarkerAnalysisStatsSystem $varname
+ MarkerAnalysisPlot3dSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+proc BoxEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "BoxEditCB"
+ }
+
+ set r [$var(frame) get marker $var(id) box radius \
+ $var(dcoord) $var(dformat)]
+ set var(radius1) [lindex $r 0]
+ set var(radius2) [lindex $r 1]
+}
diff --git a/ds9/library/boxannulus.tcl b/ds9/library/boxannulus.tcl
new file mode 100644
index 0000000..733e822
--- /dev/null
+++ b/ds9/library/boxannulus.tcl
@@ -0,0 +1,28 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BoxAnnulusDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(which) boxannulus
+ set var(proc,apply) MarkerBaseAnnulusRectApply
+ set var(proc,close) MarkerBaseAnnulusRectClose
+ set var(proc,generate) MarkerBaseAnnulusGenerateBox
+ set var(proc,coordCB) MarkerBaseAnnulusRectCoordCB
+ set var(proc,editCB) MarkerBaseAnnulusRectEditCB
+ set var(proc,distCB) MarkerBaseAnnulusRectDistCB
+
+ # base
+ MarkerBaseAnnulusRectDialog $varname size Width Height
+}
diff --git a/ds9/library/bpanda.tcl b/ds9/library/bpanda.tcl
new file mode 100644
index 0000000..d7d6af8
--- /dev/null
+++ b/ds9/library/bpanda.tcl
@@ -0,0 +1,36 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BpandaDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(which) bpanda
+ set var(proc,apply) MarkerBasePandaRectApply
+ set var(proc,close) MarkerBasePandaRectClose
+ set var(proc,generate) BpandaGenerate
+ set var(proc,coordCB) MarkerBasePandaRectCoordCB
+ set var(proc,editCB) MarkerBasePandaRectEditCB
+ set var(proc,distCB) MarkerBasePandaRectDistCB
+
+ # base panda rect dialog
+ MarkerBasePandaRectDialog $varname
+}
+
+proc BpandaGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseAnnulusGenerateBox $varname
+ MarkerBasePandaGenerateAngles $varname
+}
diff --git a/ds9/library/buttons.tcl b/ds9/library/buttons.tcl
new file mode 100644
index 0000000..d9af3a5
--- /dev/null
+++ b/ds9/library/buttons.tcl
@@ -0,0 +1,310 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ButtonsDef {} {
+ global pbuttons
+
+ # TButtonBar class bindings
+ ttk::copyBindings TButton TButtonBar
+ bind TButtonBar <Enter> {}
+ bind TButtonBar <Leave> {}
+
+ ButtonsFileDef
+ ButtonsEditDef
+ ButtonsViewDef
+ ButtonsFrameDef
+ ButtonsBinDef
+ ButtonsZoomDef
+ ButtonsScaleDef
+ ButtonsColorDef
+ ButtonsRegionDef
+ ButtonsWCSDef
+ ButtonsAnalysisDef
+ ButtonsHelpDef
+}
+
+proc CreateButtons {} {
+ global ds9
+ global buttons
+
+ set ds9(buttons) [ttk::frame $ds9(main).buttons]
+ set ds9(buttons,sep) [ttk::separator $ds9(main).sbuttons -orient horizontal]
+
+ set buttons(majorPrev) $ds9(buttons).file
+ set buttons(majorCurrent) $ds9(buttons).file
+
+ ttk::frame $ds9(buttons).major
+ RadioButton $ds9(buttons).major.file \
+ [string tolower [msgcat::mc {File}]] \
+ buttons(majorCurrent) $ds9(buttons).file MajorButton
+ RadioButton $ds9(buttons).major.edit \
+ [string tolower [msgcat::mc {Edit}]] \
+ buttons(majorCurrent) $ds9(buttons).edit MajorButton
+ RadioButton $ds9(buttons).major.view \
+ [string tolower [msgcat::mc {View}]] \
+ buttons(majorCurrent) $ds9(buttons).view MajorButton
+ RadioButton $ds9(buttons).major.frame \
+ [string tolower [msgcat::mc {Frame}]] \
+ buttons(majorCurrent) $ds9(buttons).frame MajorButton
+ RadioButton $ds9(buttons).major.bin \
+ [string tolower [msgcat::mc {Bin}]] \
+ buttons(majorCurrent) $ds9(buttons).bin MajorButton
+ RadioButton $ds9(buttons).major.zoom \
+ [string tolower [msgcat::mc {Zoom}]] \
+ buttons(majorCurrent) $ds9(buttons).zoom MajorButton
+ RadioButton $ds9(buttons).major.scale \
+ [string tolower [msgcat::mc {Scale}]] \
+ buttons(majorCurrent) $ds9(buttons).scale MajorButton
+ RadioButton $ds9(buttons).major.color \
+ [string tolower [msgcat::mc {Color}]] \
+ buttons(majorCurrent) $ds9(buttons).color MajorButton
+ RadioButton $ds9(buttons).major.region \
+ [string tolower [msgcat::mc {Region}]] \
+ buttons(majorCurrent) $ds9(buttons).region MajorButton
+ RadioButton $ds9(buttons).major.wcs \
+ [string tolower [msgcat::mc {WCS}]] \
+ buttons(majorCurrent) $ds9(buttons).wcs MajorButton
+ RadioButton $ds9(buttons).major.analysis \
+ [string tolower [msgcat::mc {Analysis}]] \
+ buttons(majorCurrent) $ds9(buttons).analysis MajorButton
+ RadioButton $ds9(buttons).major.help \
+ [string tolower [msgcat::mc {Help}]] \
+ buttons(majorCurrent) $ds9(buttons).help MajorButton
+
+ global pbuttons
+ array set pbuttons {
+ major,file 1
+ major,edit 1
+ major,view 1
+ major,frame 1
+ major,bin 1
+ major,zoom 1
+ major,scale 1
+ major,color 1
+ major,region 1
+ major,wcs 1
+ major,analysis 1
+ major,help 1
+ }
+
+ set buttons(major) "
+ $ds9(buttons).major.file pbuttons(major,file)
+ $ds9(buttons).major.edit pbuttons(major,edit)
+ $ds9(buttons).major.view pbuttons(major,view)
+ $ds9(buttons).major.frame pbuttons(major,frame)
+ $ds9(buttons).major.bin pbuttons(major,bin)
+ $ds9(buttons).major.zoom pbuttons(major,zoom)
+ $ds9(buttons).major.scale pbuttons(major,scale)
+ $ds9(buttons).major.color pbuttons(major,color)
+ $ds9(buttons).major.region pbuttons(major,region)
+ $ds9(buttons).major.wcs pbuttons(major,wcs)
+ $ds9(buttons).major.analysis pbuttons(major,analysis)
+ $ds9(buttons).major.help pbuttons(major,help)
+ "
+ CreateButtonsFile
+ CreateButtonsEdit
+ CreateButtonsView
+ CreateButtonsFrame
+ CreateButtonsBin
+ CreateButtonsZoom
+ CreateButtonsScale
+ CreateButtonsColor
+ CreateButtonsRegion
+ CreateButtonsWCS
+ CreateButtonsAnalysis
+ CreateButtonsHelp
+
+ LayoutButtons
+}
+
+proc ButtonButton {button text cmd} {
+ ttk::button $button \
+ -class TButtonBar \
+ -text $text \
+ -command $cmd \
+ -width -1 \
+ -takefocus 0
+}
+
+proc RadioButton {button text varname value cmd} {
+ ttk::button $button \
+ -class TButtonBar \
+ -text $text \
+ -width -1 \
+ -takefocus 0 \
+ -command "RadioButtonSim $button $varname \{$value\} \{$cmd\}"
+
+ # setup trace on $varname, so that all buttons that use this variable
+ # will be updated when the variable is changed
+ uplevel #0 trace variable $varname w \
+ [list "RadioButtonCB $button \{$value\}"]
+
+ # setup <Map> event so that anytime the button is redrawn,
+ # it is updated
+ bind $button <Map> "ButtonMap %W $varname"
+}
+
+proc CheckButton {button text varname cmd} {
+ ttk::button $button \
+ -class TButtonBar \
+ -text $text \
+ -width -1 \
+ -takefocus 0 \
+ -command "CheckButtonSim $button $varname \{$cmd\}"
+
+ uplevel #0 trace variable $varname w [list "CheckButtonCB $button"]
+
+ bind $button <Map> "ButtonMap %W $varname"
+}
+
+proc ButtonMap {button varname} {
+ upvar #0 $varname var
+ set vv $var
+
+ # delay slightly, I don't know why this is needed
+ after 10 [list set $varname $vv]
+}
+
+proc RadioButtonSim {button varname value cmd} {
+ uplevel #0 [list set $varname $value]
+ eval $cmd
+}
+
+proc RadioButtonCB {button value varname id op} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ if {[$button cget -state] != {disabled}} {
+ switch $ds9(wm) {
+ x11 {
+ if {$var($id) == $value} {
+ $button configure -state active
+ } else {
+ $button configure -state normal
+ }
+ }
+ aqua -
+ win32 {
+ if {$var($id) == $value} {
+ $button configure -default active
+ } else {
+ $button configure -default normal
+ }
+ }
+ }
+ }
+}
+
+proc CheckButtonSim {button varname cmd} {
+ upvar #0 $varname var
+ uplevel #0 [list set $varname [expr !$var]]
+ eval $cmd
+}
+
+proc CheckButtonCB {button varname id op} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ if {[$button cget -state] != {disabled}} {
+ switch $ds9(wm) {
+ x11 {
+ if {$var($id)} {
+ $button configure -state active
+ } else {
+ $button configure -state normal
+ }
+ }
+ aqua -
+ win32 {
+ if {$var($id)} {
+ $button configure -default active
+ } else {
+ $button configure -default normal
+ }
+ }
+ }
+ }
+}
+
+proc LayoutButtons {} {
+ global ds9
+ global buttons
+ global view
+
+ pack forget $ds9(buttons).major
+ switch $view(layout) {
+ horizontal {
+ $ds9(buttons) configure -width 0
+ pack propagate $ds9(buttons) on
+ pack $ds9(buttons).major -side top -fill x -expand true
+ }
+ vertical {
+ $ds9(buttons) configure -width 125
+ pack propagate $ds9(buttons) off
+ pack $ds9(buttons).major -side top -fill x -expand true -anchor n
+ }
+ }
+
+ UpdateButtons buttons(major)
+ UpdateButtons buttons(file)
+ UpdateButtons buttons(edit)
+ UpdateButtons buttons(view)
+ UpdateButtons buttons(frame)
+ UpdateButtons buttons(bin)
+ UpdateButtons buttons(zoom)
+ UpdateButtons buttons(scale)
+ UpdateButtons buttons(color)
+ UpdateButtons buttons(region)
+ UpdateButtons buttons(wcs)
+ UpdateButtons buttons(analysis)
+ UpdateButtons buttons(help)
+
+ MajorButton
+}
+
+proc MajorButton {} {
+ global buttons
+ global view
+
+ pack forget $buttons(majorPrev)
+ switch $view(layout) {
+ horizontal {
+ pack $buttons(majorCurrent) -side top -fill x -expand true
+ }
+ vertical {
+ pack $buttons(majorCurrent) -side bottom -fill x -expand true -anchor s
+ }
+ }
+ set buttons(majorPrev) $buttons(majorCurrent)
+}
+
+proc UpdateButtons {varname} {
+ upvar #0 $varname var
+
+ foreach {which what} $var {
+ pack forget $which
+ }
+ foreach {which what} $var {
+ ShowButton $which $what
+ }
+}
+
+proc ShowButton {which varname} {
+ upvar #0 $varname var
+ global view
+
+ if {$var} {
+ switch $view(layout) {
+ horizontal {pack $which -side left -fill both -expand true}
+ vertical {pack $which -side top -fill both -expand true}
+ }
+ }
+}
+
diff --git a/ds9/library/cat.tcl b/ds9/library/cat.tcl
new file mode 100644
index 0000000..e3b748b
--- /dev/null
+++ b/ds9/library/cat.tcl
@@ -0,0 +1,1799 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATDef {} {
+ global cat
+ global icat
+ global pcat
+ global wcs
+
+ set icat(cats) {}
+
+ set icat(rformat) arcmin
+ set icat(width) 15
+ set icat(height) 15
+ set icat(max) 5000
+ set icat(allrows) 1
+ set icat(allcols) 0
+ set icat(show) 1
+ set icat(edit) 0
+ set icat(panto) 1
+
+ set icat(minrows) 20
+ set icat(mincols) 10
+
+ set icat(key) {}
+ set icat(key,update) {}
+
+ set icat(match1) {}
+ set icat(match2) {}
+ set icat(return) 1and2
+ set icat(error) 5
+ set icat(eformat) arcsec
+ set icat(function) 1and2
+ set icat(unique) 1
+
+ set icat(def) { \
+ {- {Database} db} \
+ {{NED} catned ned ned} \
+ {{SIMBAD} catsimbad simbad simbad} \
+ {{DENIS} catdenis cds {B/denis}} \
+ {{SkyBot} catskybot skybot skybot} \
+ {- {Optical} opt} \
+ {{ASCC-2.5} catascss cds {I/280A/ascc01}} \
+ {{AAVSO} cataavso cds {B/vsx}} \
+ {{Carlsberg Meridian 14} catcmc cds {I/304}}\
+ {{GSC 1.2} catgsc1 cds {I/254/out}} \
+ {{GSC 2.2} catgsc2 cds {I/271/out}} \
+ {{GSC 2.3} catgsc3 cds {I/305/out}} \
+ {{AC 2000.2} catac cds {I/275/ac2002}} \
+ {{NOMAD} catnomad cds {I/297/out}} \
+ {{PPMX} catppmx cds {I/312}} \
+ {{SAO J2000} catsao cds {I/131A/sao}} \
+ {{SDSS Release 5} catsdss5 cds {II/276}} \
+ {{SDSS Release 6} catsdss6 cds {II/282}} \
+ {{SDSS Release 7} catsdss7 cds {II/294}} \
+ {{SDSS Release 8} catsdss8 cds {II/306}} \
+ {{SDSS Release 9} catsdss9 cds {V/139}} \
+ {{Tycho-2} cattycho cds {I/259/tyc2}} \
+ {{USNO-A2.0} catua2 cds {I/252/out}} \
+ {{USNO-B1.0} catub1 cds {I/284/out}} \
+ {{USNO UCAC2} catucac2 cds {I/289/out}} \
+ {{USNO UCAC2 Bright Star Sup} catucac2sup cds {I/294A}} \
+ {{USNO UCAC3} catucac3 cds {I/315}} \
+ {{USNO UCAC4} catucac4 cds {I/322A}} \
+ {{USNO URAT1} caturat1 cds {I/329}} \
+ {- {Infrared} ir} \
+ {{2MASS Point Sources} cat2mass cds {II/246/out}}\
+ {{IRAS Point Sources} catiras cds {II/125}}\
+ {- {High Energy} hea} \
+ {{Chandra Source} catcsc cxc {Current Release}}
+ {{2XMMi Source} catxmm cds {IX/40/xmm2is}} \
+ {{Second ROSAT PSPC} catrosat cds {IX/30}} \
+ {- {Radio} radio} \
+ {{FIRST Survey} catfirst cds {VIII/71/first}} \
+ {{NVSS} catnvss cds {VIII/65/nvss}} \
+ {- {Observation Logs} log} \
+ {{Chandra Archive} catchandralog cds {B/chandra/chandra}} \
+ {{CFHT Exposures} catcfhtlog cds {B/cfht/chfht}} \
+ {{ESO Science Archive} catesolog cds {B/eso/safcat}} \
+ {{HST Archive} cathstlog cds {B/hst/hstlog}} \
+ {{XMM Observation} catxmmlog cds {B/xmm/xmmlog}} \
+ }
+
+ set cat(id) 0
+ set cat(sym,font,msg) {}
+
+ # prefs only
+ set pcat(server) cds
+ set pcat(loc) 500
+ set pcat(sym,shape) {circle point}
+ set pcat(sym,color) green
+ set pcat(sym,width) 1
+ set pcat(sym,dash) 0
+ set pcat(sym,units) physical
+ set pcat(sym,font) helvetica
+ set pcat(sym,font,size) 10
+ set pcat(sym,font,weight) normal
+ set pcat(sym,font,slant) roman
+ set pcat(vot) 1
+}
+
+# Load via HTTP
+
+proc CATGetURL {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGetURL $varname $var(url)?$var(query)"
+ }
+
+ ARStatus $varname [msgcat::mc {Loading}]
+
+ global ihttp
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -query $var(query) \
+ -timeout $ihttp(timeout) \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ CATGetURLFinish $varname $var(token)
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $var(url)"
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -query $var(query) \
+ -timeout $ihttp(timeout) \
+ -command \
+ [list CATGetURLFinish $varname] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $var(url)"
+ }
+ }
+}
+
+proc CATGetURLIncr {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGetURLIncr $varname $var(url)?$var(query)"
+ }
+
+ ARStatus $varname [msgcat::mc {Loading}]
+
+ global ihttp
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -query $var(query) \
+ -timeout $ihttp(timeout) \
+ -handler \
+ [list $var(proc,reader) $var(catdb)] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ CATGetURLFinish $varname $var(token)
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $var(url)"
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -query $var(query) \
+ -timeout $ihttp(timeout) \
+ -handler \
+ [list $var(proc,reader) $var(catdb)] \
+ -command \
+ [list CATGetURLFinish $varname] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $var(url)"
+ }
+ }
+}
+
+proc CATGetURLFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGetURLFinish $varname"
+ }
+
+ if {!($var(active))} {
+ ARCancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set code [http::ncode $token]
+
+ # Meta
+ set meta $t(meta)
+
+ # Log it
+ HTTPLog $token
+
+ # Result?
+ switch -- $code {
+ {} -
+ 200 -
+ 203 -
+ 404 -
+ 503 {
+ if {[info exist ${varname}(proc,parser)]} {
+ eval [list $var(proc,parser) $var(catdb) $token]
+ }
+
+ ARDone $varname
+ eval $var(proc,done) $varname
+ }
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGetURLFinish redirect $code to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ set var(url) $value
+ eval $var(proc,load) $varname
+ }
+ }
+ }
+
+ default {ARError $varname "[msgcat::mc {Error code was returned}] $code"}
+ }
+}
+
+proc CATLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # clear previous db
+ global $var(catdb)
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATLoad $varname $var(url)?$var(query)"
+ }
+
+ set var(proc,done) CATLoadDone
+ set var(proc,load) CATLoad
+ CATGetURL $varname
+ return
+}
+
+proc CATLoadIncr {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # clear previous db
+ global $var(catdb)
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATLoadIncr $varname $var(url)?$var(query)"
+ }
+
+ set var(proc,done) CATLoadDone
+ set var(proc,load) CATLoadIncr
+ CATGetURLIncr $varname
+ return
+}
+
+proc CATLoadDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATLoadDone $varname"
+ }
+
+ CATSortMenu $varname
+ CATConfigCols $varname
+ CATColsMenu $varname
+ CATTable $varname
+
+ CATDialogUpdate $varname
+}
+
+# Load via File
+
+proc CATLoadSBFile {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set fn [OpenFileDialog catfbox]
+ if {$fn != {}} {
+ CATLoadFn $varname $fn starbase_read
+ }
+}
+
+proc CATLoadVOTFile {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set fn [OpenFileDialog catvotfbox]
+ if {$fn != {}} {
+ CATLoadFn $varname $fn VOTRead
+ }
+}
+
+proc CATLoadTSVFile {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set fn [OpenFileDialog cattsvfbox]
+ if {$fn != {}} {
+ CATLoadFn $varname $fn TSVRead
+ }
+}
+
+# used by backup
+proc CATLoadFn {varname fn reader} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATLoadFn $varname $fn $reader"
+ }
+
+ ARStatus $varname [msgcat::mc {Loading Catalog}]
+
+ CATOff $varname
+ CATSet $varname {} {} $fn
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+
+ if {[file exists $fn]} {
+ $reader $var(catdb) $fn
+ } else {
+ Error "[msgcat::mc {Unable to open file}] $fn"
+ return
+ }
+
+ ARDone $varname
+ CATLoadDone $varname
+}
+
+# Save via File
+
+proc CATSaveSBFile {varname} {
+ set fn [SaveFileDialog catfbox]
+ CATSaveFn $varname $fn starbase_write
+}
+
+proc CATSaveVOTFile {varname} {
+ set fn [SaveFileDialog catvotfbox]
+ CATSaveFn $varname $fn VOTWrite
+}
+
+proc CATSaveTSVFile {varname} {
+ set fn [SaveFileDialog cattsvfbox]
+ CATSaveFn $varname $fn TSVWrite
+}
+
+proc CATSaveFn {varname fn writer} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {$fn == {}} {
+ return
+ }
+
+ # do we have a db?
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ $writer $var(tbldb) $fn
+ ARDone $varname
+}
+
+# Other procedures
+
+proc CATStatusRows {varname rowlist} {
+ upvar #0 $varname var
+ global $varname
+
+ # rowlist start at 1
+ if {[llength $rowlist]>0} {
+ ARStatus $varname "[msgcat::mc {Row}] [join $rowlist {,}]"
+ } else {
+ ARStatus $varname {}
+ }
+}
+
+proc CATOff {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global $var(catdb)
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+ global $var(tbldb)
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+ set db $var(tbldb)
+ set ${db}(Nrows) {}
+
+ $var(tbl) selection clear all
+
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $varname delete
+ }
+ }
+
+ CATSortMenu $varname
+ CATColsMenu $varname
+ set var(filter) {}
+ set var(sort) {}
+ set var(colx) {}
+ set var(coly) {}
+
+ set var(blink) 0
+
+ # plot window?
+ if {$var(plot)} {
+ PlotDestroy $var(plot,var)
+ set var(plot) 0
+ set var(plot,var) {}
+ set var(plot,x) {}
+ set var(plot,xerr) {}
+ set var(plot,y) {}
+ set var(plot,yerr) {}
+ }
+
+ CATDialogUpdate $varname
+}
+
+# used by backup
+proc CATTable {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ global icat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATTable $varname"
+ }
+
+ if {![CATValidDB $var(catdb)]} {
+ return
+ }
+
+ # delete any previous tbldb
+ set db ${varname}tbldb
+ global $db
+ if {[info exists $db]} {
+ unset $db
+ }
+
+ # clear the selection
+ $var(tbl) selection clear all
+
+ # clear regions
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $varname delete
+ }
+ }
+
+ if {$var(filter) == {} && $var(sort) == {}} {
+ set var(tbldb) $var(catdb)
+ } else {
+ set var(tbldb) ${varname}tbldb
+ global $var(tbldb)
+ if {![CATFltSort $varname]} {
+ Error "[msgcat::mc {Unable to evaluate filter}] $var(filter)"
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+ set var(tbldb) $var(catdb)
+ }
+ }
+
+ global $var(tbldb)
+ $var(tbl) configure -variable $var(tbldb)
+ $var(found) configure -textvariable ${var(tbldb)}(Nrows)
+
+# starbase_writefp $var(catdb) stdout
+# starbase_writefp $var(tbldb) stdout
+
+ if {[starbase_nrows $var(tbldb)] == 0} {
+ ARStatus $varname [msgcat::mc {No Items Found}]
+ return
+ }
+
+ set nc [starbase_ncols $var(tbldb)]
+ if { $nc > $icat(mincols)} {
+ $var(tbl) configure -cols $nc
+ } else {
+ $var(tbl) configure -cols $icat(mincols)
+ }
+
+ # add header
+ set nr [expr [starbase_nrows $var(tbldb)]+1]
+ if {$nr > $icat(minrows)} {
+ $var(tbl) configure -rows $nr
+ } else {
+ $var(tbl) configure -rows $icat(minrows)
+ }
+
+ CATGenerate $varname
+
+ # regenerate the plot if needed
+ if {$var(plot)} {
+ CATPlotGenerate $varname
+ }
+
+ set nr [starbase_nrows $var(tbldb)]
+ if {$nr >= $var(max) && !$var(allrows)} {
+ ARStatus $varname "$nr [msgcat::mc {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed}]"
+ }
+}
+
+proc CATGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGenerate $varname"
+ }
+
+ # do we have a db?
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ ARStatus $varname [msgcat::mc {Plotting Regions}]
+
+ # delete any previous
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $varname delete
+ }
+ }
+
+ if {$var(show)} {
+ global reg
+ set reg {}
+ CATReg $varname {} 1 reg
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ if {[catch {$var(frame) marker catalog command ds9 var reg}]} {
+ ARError $varname "[msgcat::mc {Internal Parse Error}]"
+ return
+ }
+ }
+ }
+ }
+
+ ARStatus $varname [msgcat::mc Done]
+}
+
+proc CATGenerateRegions {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGenerateRegions $varname"
+ }
+
+ # do we have a db?
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ ARStatus $varname [msgcat::mc {Generating Regions}]
+
+ global reg
+ set reg {}
+ CATReg $varname {} 0 reg
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ if {[catch {$var(frame) marker command ds9 var reg}]} {
+ ARError $varname "[msgcat::mc {Internal Parse Error}]"
+ return
+ }
+ }
+ }
+
+ ARStatus $varname [msgcat::mc Done]
+}
+
+proc CATGenerateUpdate {varname row} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATGenerateUpdate $varname $row"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ set id [$var(frame) get marker catalog "\{${varname}.${row}\}" id]
+ set sel [$var(frame) get marker catalog $id select]
+ set hh [$var(frame) get marker catalog $id highlite]
+
+ $var(frame) marker catalog "\{${varname}.${row}\}" delete
+ global reg
+ set reg {}
+ CATReg $varname $row 1 reg
+ if {$reg != {}} {
+ $var(frame) marker catalog command ds9 var reg
+
+ set id [$var(frame) get marker catalog "\{${varname}.${row}\}" id]
+ if {$sel} {
+ $var(frame) marker catalog "\{${varname}.${row}\}" select
+ }
+ if {$hh} {
+ $var(frame) marker catalog "\{${varname}.${row}\}" highlite
+ }
+ }
+ unset reg
+}
+
+proc CATSet {varname format catalog title} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSet $varname :$format:$catalog:$title:"
+ }
+
+ set var(format) $format
+ set var(catalog) $catalog
+ set var(title) $title
+ set var(filter) {}
+ set var(colx) {}
+ set var(coly) {}
+ set var(sort) {}
+ set var(sort,dir) "-increasing"
+}
+
+proc CATValidDB {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[info exists var(Nrows)] &&
+ [info exists var(Ncols)] &&
+ [info exists var(HLines)] &&
+ [info exists var(Header)]} {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+proc CATAnalysisMenu {} {
+ global icat
+ global ds9
+
+ set mm "$ds9(mb).analysis.cat"
+ set nn {}
+
+ foreach ff $icat(def) {
+ set ll [lindex $ff 0]
+ set ww [lindex $ff 1]
+ set ss [lindex $ff 2]
+ set cc [lindex $ff 3]
+
+ if {$ll != {-}} {
+ $mm.$nn add command -label $ll \
+ -command [list CATDialog $ww $ss $cc $ll apply]
+ } else {
+ set nn "$ss"
+ menu $mm.$nn
+ $mm add cascade -label $ww -menu $mm.$nn
+ }
+ }
+}
+
+proc CATServerMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(mb) add cascade -label [msgcat::mc {Catalog Server}] \
+ -menu $var(mb).server
+ menu $var(mb).server
+ $var(mb).server add radiobutton -label {CDS, Strasbourg France} \
+ -variable ${varname}(server) -value cds
+ $var(mb).server add radiobutton -label {CFA, Boston USA} \
+ -variable ${varname}(server) -value sao
+ $var(mb).server add radiobutton -label {CADC, Canada} \
+ -variable ${varname}(server) -value cadc
+ $var(mb).server add radiobutton -label {ADAC, Tokyo Japan} \
+ -variable ${varname}(server) -value adac
+ $var(mb).server add radiobutton -label {IUCAA, Pune India} \
+ -variable ${varname}(server) -value iucaa
+ $var(mb).server add radiobutton -label {INASAN, Russia} \
+ -variable ${varname}(server) -value inasan
+ $var(mb).server add radiobutton -label {BEJING, China} \
+ -variable ${varname}(server) -value bejing
+ $var(mb).server add radiobutton -label {CAMBRIDGE, UK} \
+ -variable ${varname}(server) -value cambridge
+ $var(mb).server add radiobutton -label {UKIRT, Hawaii USA} \
+ -variable ${varname}(server) -value ukirt
+}
+
+proc CATSortMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global ds9
+
+ set m $var(sortmenu).menu
+ catch {destroy $m}
+
+ menu $m -tearoff 0
+ $m add command -label {} -command "CATSortCmd $varname {}"
+ if {[CATValidDB $var(catdb)]} {
+ set cnt -1
+ foreach col [starbase_columns $var(catdb)] {
+ $m add command -label $col -command "CATSortCmd $varname \{$col\}"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $m entryconfig $col -columnbreak 1
+ }
+ }
+ }
+}
+
+proc CATSortCmd {varname val} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(sort) $val
+ CATTable $varname
+}
+
+# backward backup compatibility version 6.1
+proc CATRADECMenu {varname} {
+ CATColsMenu $varname
+}
+
+# used by backup
+proc CATColsMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global ds9
+
+ set m $var(ramenu).menu
+ catch {destroy $m}
+
+ menu $m -tearoff 0
+ if {[CATValidDB $var(catdb)]} {
+ set cnt -1
+ foreach col [starbase_columns $var(catdb)] {
+ $m add command -label $col -command "CATColXCmd $varname \{$col\}"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $m entryconfig $col -columnbreak 1
+ }
+ }
+ }
+
+ set m $var(decmenu).menu
+ catch {destroy $m}
+
+ menu $m -tearoff 0
+ if {[CATValidDB $var(catdb)]} {
+ set cnt -1
+ foreach col [starbase_columns $var(catdb)] {
+ $m add command -label $col -command "CATColYCmd $varname \{$col\}"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $m entryconfig $col -columnbreak 1
+ }
+ }
+ }
+}
+
+proc CATColXCmd {varname val} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(colx) $val
+ CATGenerate $varname
+}
+
+proc CATColYCmd {varname val} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(coly) $val
+ CATGenerate $varname
+}
+
+proc CATColsCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ CATColsUpdate $varname
+ CATGenerate $varname
+}
+
+proc CATConfigCols {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ set var(colx) {}
+ set var(coly) {}
+
+ if {![CATValidDB $var(catdb)]} {
+ return
+ }
+
+ if {[starbase_ncols $var(catdb)] < 2} {
+ return
+ }
+
+ # determine psystem/psky if present in cat header
+ # psystem has already been adjusted based on loaded fits at menu creation
+ switch -- $var(psystem) {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set cols {
+ "X" "Y"
+ }
+ foreach {colx coly} $cols {
+ if {!([lsearch [starbase_columns $var(catdb)] $colx] == -1) &&
+ !([lsearch [starbase_columns $var(catdb)] $coly] == -1)} {
+ set var(colx) $colx
+ set var(coly) $coly
+ return
+ }
+
+ # try lower case
+ set colx [string tolower $colx]
+ set coly [string tolower $coly]
+ if {!([lsearch [starbase_columns $var(catdb)] $colx] == -1) &&
+ !([lsearch [starbase_columns $var(catdb)] $coly] == -1)} {
+ set var(colx) $colx
+ set var(coly) $coly
+ return
+ }
+ }
+
+ # default
+ set var(colx) [starbase_colname $var(catdb) 1]
+ set var(coly) [starbase_colname $var(catdb) 2]
+
+ return
+ }
+ default {
+ if {[info commands $var(frame)] == {}} {
+ # linear
+ set var(colx) [starbase_colname $var(catdb) 1]
+ set var(coly) [starbase_colname $var(catdb) 2]
+
+ return
+ } elseif {![$var(frame) has wcs equatorial $var(psystem)]} {
+ # linear
+ set var(colx) [starbase_colname $var(catdb) 1]
+ set var(coly) [starbase_colname $var(catdb) 2]
+
+ return
+ } else {
+ if {![catch {starbase_hdrget $var(catdb) equinox} sys]} {
+ switch -- $sys {
+ 1950.0 -
+ B1950 {
+ set var(psystem) wcs
+ set var(psky) fk4
+ }
+ 2000.0 -
+ J2000 {
+ set var(psystem) wcs
+ set var(psky) fk5
+ }
+ }
+ }
+
+ switch -- $var(psky) {
+ fk5 -
+ icrs {
+ set cols {
+ "_RAJ2000" "_DEJ2000"
+ "_RAJ2000" "_DECJ2000"
+ "RAJ2000" "DEJ2000"
+ "RAJ2000" "DECJ2000"
+ "RA_J2000" "DE_J2000"
+ "RA_J2000" "DEC_J2000"
+ "RA (J2000)" "Dec (J2000)"
+ "RA" "DEC"
+ "RA" "DECL"
+ "RA" "Dec"
+ "RA(deg)" "DEC(deg)"
+ }
+ if {[CATConfigColsSearch $varname $cols]} {
+ return
+ }
+
+ # next, look for an UCD (via VOTABLE)
+ set db $var(catdb)
+ upvar #0 $db T
+ for {set cc 0} {$cc < $T(Ncols)} {incr cc} {
+ if {[info exists ${db}(Ucd)]} {
+ switch -- [string tolower [string range [lindex $T(Ucd) $cc] 0 8]] {
+ pos.eq.ra {set var(colx) [lindex $T(Header) $cc]}
+ pos.eq.de {set var(coly) [lindex $T(Header) $cc]}
+ }
+ }
+ }
+
+ if {$var(colx) != {} && $var(coly) != {}} {
+ return
+ }
+ }
+ fk4 {
+ set cols {
+ "_RAB1950" "_DEB1950"
+ "RA_B1950" "DEC_B1950"
+ "RA (B1950)" "Dec (1950)"
+ "RA" "DEC"
+ "RA" "DECL"
+ "RA" "Dec"
+ "RA(deg)" "DEC(deg)"
+ }
+ if {[CATConfigColsSearch $varname $cols]} {
+ return
+ }
+ }
+ galactic {
+ set cols {
+ "_GLON" "_GLAT"
+ "LON" "LAT"
+ "LON.Gal(deg)" "LAT.Gal(deg)"
+ }
+ if {[CATConfigColsSearch $varname $cols]} {
+ return
+ }
+ }
+ ecliptic {
+ set cols {
+ "_ELON" "_ELAT"
+ "LON.Ecl(deg)" "LAT.Ecl(deg)"
+ }
+ if {[CATConfigColsSearch $varname $cols]} {
+ return
+ }
+ }
+ }
+
+ # default
+ set var(colx) [starbase_colname $var(catdb) 1]
+ set var(coly) [starbase_colname $var(catdb) 2]
+ }
+ }
+ }
+}
+
+proc CATConfigColsSearch {varname cols} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ foreach {colx coly} $cols {
+ if {!([lsearch [starbase_columns $var(catdb)] $colx] == -1) &&
+ !([lsearch [starbase_columns $var(catdb)] $coly] == -1)} {
+ set var(colx) $colx
+ set var(coly) $coly
+ return 1
+ }
+
+ # try lower case
+ set colx [string tolower $colx]
+ set coly [string tolower $coly]
+ if {!([lsearch [starbase_columns $var(catdb)] $colx] == -1) &&
+ !([lsearch [starbase_columns $var(catdb)] $coly] == -1)} {
+ set var(colx) $colx
+ set var(coly) $coly
+ return 1
+ }
+ }
+
+ return 0
+}
+
+# Other interface
+
+proc CATTool {} {
+ CATDialog cattool {} {} [msgcat::mc {Catalog Tool}] none
+}
+
+proc CATClearFrame {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker catalog delete all
+ }
+}
+
+proc CATUpdateWCS {} {
+ global icat
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker catalog delete all
+
+ foreach varname $icat(cats) {
+ upvar #0 $varname var
+ global $varname
+
+ CATGenerate $varname
+
+ # regenerate the plot if needed
+ if {$var(plot)} {
+ CATPlotGenerate $varname
+ }
+ }
+ }
+}
+
+proc CATUpdateFont {} {
+ global icat
+
+ foreach varname $icat(cats) {
+ upvar #0 $varname var
+ global $varname
+
+ $var(tbl) configure -font [font actual TkDefaultFont]
+ }
+}
+
+proc CATBackup {ch which fdir rdir} {
+ global icat
+
+ foreach varname $icat(cats) {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(frame) == $which} {
+ set catdb ${varname}catdb
+ global $catdb
+
+ puts $ch "CATDialog $varname {} {} {} none"
+ if {[starbase_nrows $var(catdb)]>500} {
+ # external file
+ set fn $fdir/${varname}.cat
+ set rfn $rdir/${varname}.cat
+
+ catch {file delete -force $fn}
+ CATSaveFn $varname "$fn" VOTWrite
+ puts $ch "CATLoadFn $varname \"$rfn\" VOTRead"
+ } else {
+ # internal var
+ puts $ch "global $catdb"
+ puts $ch "array set $catdb \{ [array get $catdb] \}"
+ }
+ puts $ch "global $varname"
+ puts $ch "array set $varname \{ [array get $varname] \}"
+
+ set symdb ${varname}symdb
+ global $symdb
+ puts $ch "global $symdb"
+ puts $ch "array set $symdb \{ [array get $symdb] \}"
+
+ puts $ch "CATColsMenu $varname"
+ puts $ch "CATTable $varname"
+ }
+ }
+}
+
+proc PrefsDialogCatalog {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Catalogs}]
+ lappend dprefs(tabs) [ttk::frame $w.cat]
+
+ # Catalog
+ set f [ttk::labelframe $w.cat.param -text [msgcat::mc {Catalogs}]]
+
+ ttk::label $f.stitle -text [msgcat::mc {Server}]
+ ttk::menubutton $f.svr -textvariable pcat(server) -menu $f.svr.menu
+ ttk::label $f.shtitle -text [msgcat::mc {Shape}]
+ ttk::menubutton $f.shape -textvariable pcat(sym,shape) -menu $f.shape.menu
+ ttk::checkbutton $f.vot -variable pcat(vot) \
+ -text [msgcat::mc {Download VOTABLE format if available}]
+ ttk::label $f.loctitle -text [msgcat::mc {IAU Location Code}]
+ ttk::entry $f.loc -textvariable pcat(loc) -width 7
+
+ global pcat
+ ttk::label $f.ctitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pcat sym,color {}
+
+ ttk::label $f.cwidth -text [msgcat::mc {Width}]
+ WidthDashMenuButton $f.width pcat sym,width sym,dash {} {}
+
+ ttk::label $f.ftitle -text [msgcat::mc {Font}]
+ FontMenuButton $f.font pcat sym,font sym,font,size \
+ sym,font,weight, sym,font,slant {}
+
+ menu $f.svr.menu
+ $f.svr.menu add radiobutton -label {CDS} \
+ -variable pcat(server) -value cds
+ $f.svr.menu add radiobutton -label {SAO} \
+ -variable pcat(server) -value sao
+ $f.svr.menu add radiobutton -label {CADC} \
+ -variable pcat(server) -value cadc
+ $f.svr.menu add radiobutton -label {ADAC} \
+ -variable pcat(server) -value adac
+ $f.svr.menu add radiobutton -label {IUCAA} \
+ -variable pcat(server) -value iucaa
+ $f.svr.menu add radiobutton -label {BEJING} \
+ -variable pcat(server) -value bejing
+ $f.svr.menu add radiobutton -label {CAMBRIDGE UK} \
+ -variable pcat(server) -value cambridge
+ $f.svr.menu add radiobutton -label {UKIRT HAWAII} \
+ -variable pcat(server) -value ukirt
+
+ menu $f.shape.menu
+ $f.shape.menu add radiobutton -label [msgcat::mc {Circle}] \
+ -variable pcat(sym,shape) -value circle
+ $f.shape.menu add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable pcat(sym,shape) -value ellipse
+ $f.shape.menu add radiobutton -label [msgcat::mc {Box}] \
+ -variable pcat(sym,shape) -value box
+ $f.shape.menu add radiobutton -label [msgcat::mc {Text}] \
+ -variable pcat(sym,shape) -value text
+ $f.shape.menu add cascade -label [msgcat::mc {Point}] \
+ -menu $f.shape.menu.point
+
+ menu $f.shape.menu.point
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Circle}] \
+ -variable pcat(sym,shape) -value {circle point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Box}] \
+ -variable pcat(sym,shape) -value {box point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable pcat(sym,shape) -value {diamond point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Cross}] \
+ -variable pcat(sym,shape) -value {cross point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {X}] \
+ -variable pcat(sym,shape) -value {x point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable pcat(sym,shape) -value {arrow point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {BoxCircle}] \
+ -variable pcat(sym,shape) -value {boxcircle point}
+ $f.shape.menu.point add separator
+
+ grid $f.stitle $f.svr -padx 2 -pady 2 -sticky w
+ grid $f.shtitle $f.shape -padx 2 -pady 2 -sticky w
+ grid $f.ctitle $f.color -padx 2 -pady 2 -sticky w
+ grid $f.cwidth $f.width -padx 2 -pady 2 -sticky w
+ grid $f.ftitle $f.font -padx 2 -pady 2 -sticky w
+ grid $f.loctitle - - $f.loc -padx 2 -pady 2 -sticky w
+ grid $f.vot - - - -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+# Process Cmds
+
+proc ProcessCatalogCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global icat
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ {} {CATTool}
+
+ file -
+ import -
+ load {
+ incr i
+ set reader VOTRead
+ switch -- [lindex $var $i] {
+ xml -
+ vot {incr i; set reader VOTRead}
+ sb -
+ starbase {incr i; set reader starbase_read}
+ csv -
+ tsv {incr i; set reader TSVRead}
+ }
+
+ set fn [lindex $var $i]
+ if {$fn != {}} {
+ CATDialog cattool {} {} {} none
+ CATLoadFn [lindex $icat(cats) end] $fn $reader
+ FileLast catfbox $fn
+ }
+ }
+
+ allcols -
+ allrows -
+ cancel -
+ clear -
+ close -
+ coordinate -
+ crosshair -
+ dec -
+ edit -
+ export -
+ filter -
+ header -
+ hide -
+ location -
+ match -
+ maxrows -
+ name -
+ panto -
+ plot -
+ print -
+ psky -
+ psystem -
+ ra -
+ regions -
+ retrieve -
+ samp -
+ save -
+ server -
+ show -
+ size -
+ sky -
+ skyformat -
+ sort -
+ symbol -
+ system -
+ update -
+ x -
+ y {ProcessCatalog $varname $iname [lindex $icat(cats) end]}
+
+ default {
+ # another command
+ if {[string range $item 0 0] == "-"} {
+ CATTool
+ incr i -1
+ return
+ }
+
+ # existing cat or load new one?
+ set ref $item
+
+ # backward compatibility
+ if {[string range $ref 0 2] == {cat}} {
+ set ref [string range $ref 3 end]
+ }
+
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ file -
+ import -
+ load {incr i -1}
+
+ allcols -
+ allrows -
+ cancel -
+ clear -
+ close -
+ coordinate -
+ crosshair -
+ dec -
+ edit -
+ export -
+ filter -
+ header -
+ hide -
+ location -
+ match -
+ maxrows -
+ name -
+ panto -
+ plot -
+ print -
+ psky -
+ psystem -
+ ra -
+ regions -
+ retrieve -
+ samp -
+ save -
+ server -
+ show -
+ size -
+ sky -
+ skyformat -
+ sort -
+ symbol -
+ system -
+ update -
+ x -
+ y {ProcessCatalog $varname $iname cat${ref}}
+
+ default {
+ # ok, new catalog
+ incr i -1
+ set item [string tolower [lindex $var $i]]
+
+ # backward compatibility
+ switch $item {
+ cds {incr i; set item [string tolower [lindex $var $i]]}
+ cxc {set item csc}
+ }
+
+ # see if its from our list of cats
+ foreach mm $icat(def) {
+ set ll [lindex $mm 0]
+ set ww [lindex $mm 1]
+ set ss [lindex $mm 2]
+ set cc [lindex $mm 3]
+
+ if {$ll != {-} && "cat${item}" == $ww} {
+ CATDialog $ww $ss $cc $ll sync
+ return
+ }
+ }
+
+ # not a default, assume other name
+ CATDialog catcds cds $item $item sync
+ }
+ }
+ }
+ }
+}
+
+proc ProcessCatalog {varname iname cvarname} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ global icat
+ global pcat
+ global current
+
+ # we should have a catalog now
+ global $cvarname
+ upvar #0 $cvarname cvar
+
+ if {![info exists cvar(top)]} {
+ Error "[msgcat::mc {Unable to find catalog window}] $cvarname"
+ return
+ }
+ if {![winfo exists $cvar(top)]} {
+ Error "[msgcat:: mc {Unable to find catalog window}] $cvarname"
+ return
+ }
+
+ # now, process it
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ allrows {set cvar(allrows) 1}
+ allcols {set cvar(allcols) 1}
+ cancel {ARCancel $cvarname}
+ clear {CATOff $cvarname}
+ close {CATDestroy $cvarname}
+ coordinate {
+ incr i
+ set cvar(x) [lindex $var $i]
+ incr i
+ set cvar(y) [lindex $var $i]
+ incr i
+ set cvar(sky) [lindex $var $i]
+ }
+ crosshair {CATCrosshair $cvarname}
+ edit {
+ incr i
+ set cvar(edit) [FromYesNo [lindex $var $i]]
+ CATEdit $cvarname
+ }
+ export -
+ save {
+ incr i
+ set writer VOTWrite
+ switch -- [lindex $var $i] {
+ xml -
+ vot {incr i; set writer VOTWrite}
+ sb -
+ starbase {incr i; set writer starbase_write}
+ csv -
+ tsv {incr i; set writer TSVWrite}
+ }
+
+ set fn [lindex $var $i]
+ CATSaveFn $cvarname $fn $writer
+ FileLast catfbox $fn
+ }
+ filter {
+ incr i
+ set item [lindex $var $i]
+ switch -- $item {
+ load {
+ incr i
+ set fn [lindex $var $i]
+ if {[catch {open $fn r} fp]} {
+ Error "[msgcat::mc {Unable to open file}] $fn: $fp"
+ return
+ }
+ set flt [read -nonewline $fp]
+ catch {regsub {\n} $flt " " $flt}
+ set cvar(filter) [string trim $flt]
+ catch {close $fp}
+ }
+ default {
+ set cvar(filter) $item
+ }
+ }
+ CATTable $cvarname
+ }
+ header {CATHeader $cvarname}
+ hide {
+ set cvar(show) 0
+ CATGenerate $cvarname
+ }
+ location {
+ incr i
+ set cvar(loc) [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ match {
+ incr i
+ set item [lindex $var $i]
+ switch -- $item {
+ error {
+ incr i
+ set icat(error) [lindex $var $i]
+ incr i
+ set icat(eformat) [lindex $var $i]
+ }
+ function {incr i; set icat(function) [lindex $var $i]}
+ unique {incr i; set icat(unique) [FromYesNo [lindex $var $i]]}
+ return {incr i; set icat(return) [lindex $var $i]}
+ default {
+ set icat(match1) "cat[lindex $var $i]"
+ incr i
+ set icat(match2) "cat[lindex $var $i]"
+ CATMatch $current(frame) $icat(match1) $icat(match2)
+ }
+ }
+ }
+ maxrows {
+ incr i
+ set cvar(max) [lindex $var $i]
+ }
+ name {
+ incr i
+ set cvar(name) [lindex $var $i]
+ }
+ panto {
+ incr i
+ set cvar(panto) [FromYesNo [lindex $var $i]]
+ }
+ plot {
+ incr i
+ set cvar(plot,x) [lindex $var $i]
+ incr i
+ set cvar(plot,y) [lindex $var $i]
+ incr i
+ set cvar(plot,xerr) [lindex $var $i]
+ incr i
+ set cvar(plot,yerr) [lindex $var $i]
+ CATPlotGenerate $cvarname
+ }
+ print {CATPrint $cvarname}
+ psky {
+ incr i
+ set cvar(psky) [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ psystem {
+ incr i
+ set cvar(psystem) [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ regions {CATGenerateRegions $cvarname}
+ retrieve -
+ retreive {CATApply $cvarname 1}
+ samp {
+ global ds9
+ global samp
+
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ send {
+ incr i
+ set name [string tolower [lindex $var $i]]
+ if {[info exists samp]} {
+ foreach arg $samp(apps,votable) {
+ foreach {key val} $arg {
+ if {[string tolower $val] == $name} {
+ SAMPSendTableLoadVotable $key $cvarname
+ break
+ }
+ }
+ }
+ } else {
+ Error [msgcat::mc {SAMP: not connected}]
+ }
+ }
+ broadcast {SAMPSendTableLoadVotable {} $cvarname}
+ default {
+ SAMPSendTableLoadVotable {} $cvarname
+ incr i -1
+ }
+ }
+ }
+ server {
+ incr i
+ set cvar(server) [lindex $var $i]
+ }
+ size {
+ incr i
+ set cvar(width) [lindex $var $i]
+ incr i
+ set cvar(height) [lindex $var $i]
+ incr i
+ set cvar(rformat) [lindex $var $i]
+ set cvar(rformat,msg) $cvar(rformat)
+ }
+ show {
+ set cvar(show) 1
+ CATGenerate $cvarname
+ }
+ sky {
+ incr i
+ set cvar(sky) [lindex $var $i]
+ CoordMenuButtonCmd $cvarname system sky \
+ [list CATWCSMenuUpdate $cvarname]
+ }
+ skyformat {
+ incr i
+ set cvar(skyformat) [lindex $var $i]
+ }
+ sort {
+ incr i
+ set cvar(sort) [lindex $var $i]
+ incr i
+ switch -- [lindex $var $i] {
+ incr {
+ set cvar(sort,dir) "-increasing"
+ }
+ decr {
+ set cvar(sort,dir) "-decreasing"
+ }
+ }
+ CATTable $cvarname
+ }
+ symbol {
+ global $cvar(symdb)
+ set row 1
+ incr i
+ if {[string is integer [lindex $var $i]]} {
+ set row [lindex $var $i]
+ incr i
+ }
+
+ switch -- [lindex $var $i] {
+ add {
+ set row [expr [starbase_nrows $cvar(symdb)]+1]
+ starbase_rowins $cvar(symdb) $row
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) shape] $pcat(sym,shape)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) color] $pcat(sym,color)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) width] $pcat(sym,width)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) font] $pcat(sym,font)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontsize] \
+ $pcat(sym,font,size)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontweight] \
+ $pcat(sym,font,weight)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontslant] \
+ $pcat(sym,font,slant)
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) units] $pcat(sym,units)
+ CATGenerate $cvarname
+ }
+ angle {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) angle] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ color {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) color] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ condition {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) condition] \
+ [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ font {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) font] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ fontsize {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontsize] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ fontweight {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontweight] \
+ [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ fontslant {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) fontslant] \
+ [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ load {
+ incr i
+ set fn [lindex $var $i]
+ if {[file exists $fn]} {
+ starbase_read $cvar(symdb) $fn
+ CATGenerate $cvarname
+ } else {
+ Error "[msgcat::mc {Unable to open file}] $fn"
+ return
+ }
+ }
+ remove {
+ starbase_rowdel $cvar(symdb) $row
+ CATGenerate $cvarname
+ }
+ save {
+ incr i
+ starbase_write $cvar(symdb) [lindex $var $i]
+ }
+ size {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) size] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ size2 {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) size2] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ shape {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) shape] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ text {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) text] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ units {
+ incr i
+ starbase_set $cvar(symdb) $row \
+ [starbase_colnum $cvar(symdb) units] [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ }
+ }
+ system {
+ incr i
+ set cvar(system) [lindex $var $i]
+ CoordMenuButtonCmd $cvarname system sky \
+ [list CATWCSMenuUpdate $cvarname]
+ }
+ update {CATUpdate $cvarname}
+ x -
+ ra {
+ incr i
+ set cvar(colx) [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ y -
+ dec {
+ incr i
+ set cvar(coly) [lindex $var $i]
+ CATGenerate $cvarname
+ }
+ }
+}
+
+proc ProcessSendCatalogCmd {proc id param sock fn} {
+ global icat
+
+ set cc [lindex $icat(cats) end]
+ switch -- [string tolower [lindex $param 0]] {
+ header {}
+ default {
+ set cc [lindex $param 0]
+ set param [lreplace $param 0 0]
+ }
+ }
+
+ switch -- [string tolower [lindex $param 0]] {
+ {} {$proc $id "$icat(cats)\n"}
+ header {ProcessSend $proc $id $sock $fn {.txt} "[CATGetHeader $cc]\n"}
+ }
+}
diff --git a/ds9/library/catcds.tcl b/ds9/library/catcds.tcl
new file mode 100644
index 0000000..b6100c4
--- /dev/null
+++ b/ds9/library/catcds.tcl
@@ -0,0 +1,246 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATCDS {varname} {
+ upvar #0 $varname var
+ global $varname
+ global pcat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDS $varname"
+ }
+
+ # go for votable or tsv
+ if {$pcat(vot)} {
+ set var(proc,parser) VOTParse
+ } else {
+ set var(proc,reader) CATCDSReader
+ }
+
+ # url
+ set site [CATCDSURL $var(server)]
+ set cgidir {viz-bin}
+ if {$pcat(vot)} {
+ set script {votable}
+ } else {
+ set script {asu-tsv}
+ }
+ set var(url) "http://$site/$cgidir/$script"
+
+ # query
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {set xx [h2d [Sex2H $var(x)]]}
+ galactic -
+ ecliptic {set xx [Sex2D $var(x)]}
+ }
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ if {$yy>0} {
+ set yy "+$yy"
+ }
+
+ switch -- $var(sky) {
+ fk4 {set eq "B1950"}
+ fk5 -
+ icrs {set eq "J2000"}
+ galactic {set eq "Gal"}
+ ecliptic {set eq "Ecl"}
+ }
+
+ switch -- $var(rformat) {
+ degrees {set cr "-c.rd"}
+ arcmin {set cr "-c.rm"}
+ arcsec {set cr "-c.rs"}
+ }
+
+ set ww $var(width)
+ set hh $var(height)
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ set query [http::formatQuery -source $var(catalog) -c $xx$yy -c.eq $eq $cr $rr -oc.form dec]
+
+ if {$pcat(vot)} {
+ append query "&[http::formatQuery -out.form VOTable]"
+ } else {
+ append query "&[http::formatQuery -out.form Tab-Separated-Values]"
+ }
+
+ switch -- $var(psky) {
+ fk4 {append query "&[http::formatQuery -out.add _RAB,_DEB]"}
+ fk5 -
+ icrs {append query "&[http::formatQuery -out.add _RAJ,_DEJ]"}
+ galactic {append query "&[http::formatQuery -out.add _GLON,_GLAT]"}
+ ecliptic {append query "&[http::formatQuery -out.add _ELON,_ELAT]"}
+ }
+
+ # options
+ if {!$var(allrows)} {
+ append query "&-out.max=$var(max)"
+ }
+ if {$var(allcols)} {
+ append query "&-out.all"
+ }
+
+ # url?query
+ set var(query) $query
+
+ if {$pcat(vot)} {
+ CATLoad $varname
+ } else {
+ CATLoadIncr $varname
+ }
+}
+
+proc CATCDSReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process header
+ incr ${t}(HLines)
+ set n $T(HLines)
+ if {[gets $sock line] == -1} {
+ set T(state) -1
+ set T(HLines) [expr $T(HLines) - 1]
+ set T(Nrows) 0
+ set T(Ncols) 0
+ return 0
+ }
+
+ set result [string length "$line"]
+ set T(H_$n) $line
+ if {[regexp -- {^ *(-)+ *(\t *(-)+ *)*} $line]} {
+ # remove units line, but save first
+ unset T(H_$n)
+ incr ${t}(HLines) -1
+ incr n -1
+ set units $T(H_$n)
+ set T(H_$n) $line
+
+ # clean up header column name
+ set hh $T(H_[expr $n-1])
+ regsub -all {\[} $hh {} hh
+ regsub -all {\]} $hh {} hh
+ set T(H_[expr $n-1]) $hh
+
+ # cols
+ set T(Header) [split $T(H_[expr $n-1]) "\t"]
+ set T(Unit) [split $units "\t"]
+ set T(Dashes) [split $T(H_$n) "\t"]
+ set T(Ndshs) [llength $T(Dashes)]
+
+ starbase_colmap $t
+ set T(state) 2
+ }
+ }
+
+ 2 {
+ # process table
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ } else {
+ set result [string length "$line"]
+ set line [string trim $line]
+
+ if {$line != {}} {
+ # check for beginning of another table
+ if {[string range $line 0 0] == "#"} {
+ set T(state) 3
+ return $result
+ }
+
+ # check for garbage at start of line
+ if {![string is double [lindex $line 0]]} {
+ set T(state) 3
+ return $result
+ }
+
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+ }
+ }
+
+ 3 {
+ # finished, eat everything else
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATCDSURL {server} {
+ switch -- $server {
+ cds {return {vizier.u-strasbg.fr}}
+ sao {return {vizier.cfa.harvard.edu}}
+ cadc {return {vizier.hia.nrc.ca}}
+ adac {return {vizier.nao.ac.jp}}
+ iucaa {return {vizier.iucaa.ernet.in}}
+ inasan {return {vizier.inasan.ru}}
+ bejing {return {data.bao.ac.cn}}
+ cambridge {return {vizier.ast.cam.ac.uk}}
+ ukirt {return {www.ukirt.jach.hawaii.edu}}
+ }
+}
+
+proc CATCDSAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for CDS
+
+This research has made use of the VizieR catalogue access tool, CDS,
+Strasbourg, France. VizieR is a joint effort of
+CDS (Centre de Données astronomiques de Strasbourg) and
+ESA-ESRIN (Information Systems Division).
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catcdssrch.tcl b/ds9/library/catcdssrch.tcl
new file mode 100644
index 0000000..4449e70
--- /dev/null
+++ b/ds9/library/catcdssrch.tcl
@@ -0,0 +1,471 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATCDSSrchDef {} {
+ global icatcdssrch
+
+ set icatcdssrch(minrows) 11
+ set icatcdssrch(mincols) 2
+
+ set icatcdssrch(list,wave,param) {-kw.Wavelength}
+ set icatcdssrch(list,wave) [list none Radio IR optical UV EUV X-ray Gamma-ray]
+ set icatcdssrch(list,mission,param) {-kw.Mission}
+ set icatcdssrch(list,mission) [list none AKARI ANS ASCA BeppoSAX CGRO Chandra COBE Copernicus CoRoT Einstein ESO EUVE EXOSAT FAUST Fermi FUSE GALEX GINGA GRANAT Herschel HEAO Hipparcos HST HUT INTEGRAL IRAS ISO IUE Kepler MSX OAO-2 ORFEUS Planck ROSAT RXTE SAS-1 SAS-2 SMM SOHO Spitzer STEREO Suzaku Swift TD1 UIT ULYSSES WISE WMAP WUPPE XMM]
+ set icatcdssrch(list,astro,param) {-kw.Astronomy}
+ set icatcdssrch(list,astro) [list none Abundances Ages AGN Associations Atomic_Data Binaries:cataclysmic Binaries:eclipsing Binaries:spectroscopic BL_Lac_objects Blue_objects Clusters_of_galaxies Constellations Diameters Earth Ephemerides Equivalent_widths Extinction Galaxies Galaxies:Markarian Galaxies:spectra Globular_Clusters Gravitational_lensing HII_regions Interstellar_Medium Magnetic_fields Masers Masses Models Multiple_Stars Nebulae Nonstellar Novae Obs_Log Open_Clusters Orbits Parallaxes Photometry Photometry:intermediate-band Photometry:narrow-band Photometry:surface Photometry:wide-band Planetary_Nebulae Planets+Asteroids Polarization Positional_Data Proper_Motions Pulsars QSOs Redshifts Rotational_Velocities Seyfert_Galaxies Spectral_Classification Spectrophotometry Spectroscopy Stars Stars:early-typeStars:Emission Stars:late-type Stars:peculiar Stars:variable Stars:white_dwarf Stars:WR Sun SuperNovae SuperNovae_Remnants Velocities YSOs]
+}
+
+proc CATCDSSrchLoadFile {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchLoad $varname"
+ }
+
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ set fn [OpenFileDialog catcdssrchfbox]
+ if {$fn != {}} {
+ if {[file exists $fn]} {
+ starbase_read $var(catdb) $fn
+ } else {
+ Error "[msgcat::mc {Unable to open file}] $fn"
+ return
+ }
+
+ CATCDSSrchTable $varname
+ }
+}
+
+proc CATCDSSrchSaveFile {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ set fn [SaveFileDialog catcdssrchfbox]
+ if {$fn != {}} {
+ starbase_write $var(catdb) $fn
+ }
+}
+
+proc CATCDSSrchClear {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+}
+
+proc CATCDSSrchCatalog {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchCatalog $varname"
+ }
+
+ set row 0
+ foreach ss [$var(tbl) curselection] {
+ set rr [lindex [split $ss ,] 0]
+ if {$rr != $row} {
+ set id [starbase_get $var(catdb) $rr 1]
+ set title [starbase_get $var(catdb) $rr 2]
+ if {$id != {}} {
+ # can't use id, it may have / or +
+ CATDialog catcds cds $id $title apply
+ }
+ set row $rr
+ }
+ }
+}
+
+proc CATCDSSrch {varname} {
+ upvar #0 $varname var
+ global $varname
+ global pcat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrch $varname"
+ }
+
+ # go for votable or tsv
+ if {$pcat(vot)} {
+ set var(proc,parser) CATCDSSrchVOTParse
+ } else {
+ set var(proc,reader) CATCDSSrchReader
+ }
+
+ #url
+ set site [CATCDSURL $var(server)]
+ set cgidir {viz-bin}
+ if {$pcat(vot)} {
+ set script {votable}
+ } else {
+ set script {asu-tsv}
+ }
+ set var(url) "http://$site/$cgidir/$script"
+
+ # defaults
+ set query {-meta}
+ append query "&[http::formatQuery -out.max 1000]"
+
+ if {$pcat(vot)} {
+ append query "&[http::formatQuery -out.form VOTable]"
+ } else {
+ append query "&[http::formatQuery -out.form Tab-Separated-Values]"
+ }
+
+ if {$var(source) != {}} {
+ append query "&[http::formatQuery -source $var(source)]"
+ }
+ if {$var(words) !={}} {
+ append query "&[http::formatQuery -words $var(words)]"
+ }
+ if {$var(wave) !={}} {
+ append query "&[http::formatQuery $var(list,wave,param) $var(wave)]"
+ }
+ if {$var(mission) !={}} {
+ append query "&[http::formatQuery $var(list,mission,param) $var(mission)]"
+ }
+ if {$var(astro) !={}} {
+ append query "&[http::formatQuery $var(list,astro,param) $var(astro)]"
+ }
+
+ set var(query) $query
+
+ if {$pcat(vot)} {
+ CATCDSSrchLoad $varname
+ } else {
+ CATCDSSrchLoadIncr $varname
+ }
+}
+
+proc CATCDSSrchLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchLoad $varname"
+ }
+
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ set var(proc,done) CATCDSSrchDone
+ set var(proc,load) CATCDSSrchLoad
+ CATGetURL $varname
+ return
+}
+
+proc CATCDSSrchLoadIncr {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchLoadIncr $varname"
+ }
+
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ set var(proc,done) CATCDSSrchDone
+ set var(proc,load) CATCDSSrchLoadIncr
+ CATGetURLIncr $varname
+ return
+}
+
+proc CATCDSSrchDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ CATCDSSrchTable $varname
+}
+
+proc CATCDSSrchReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ # create header
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) "Resource\tDescription"
+ set T(Header) [split $T(H_$n) "\t"]
+
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) "--------\t-----------"
+
+ set T(Dashes) [split $T(H_$n) "\t"]
+ set T(Ndshs) [llength $T(Dashes)]
+
+ starbase_colmap $t
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process RESOURCE
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ return $result
+ }
+
+ set result [string length "$line"]
+ set line [string trim $line]
+ if {$line != {}} {
+ switch -- [string range $line 0 4] {
+ "#RESO" {
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+ set T($r,1) {}
+ set T($r,2) {}
+
+ set T(state) 2
+ }
+ }
+ }
+ }
+
+ 2 {
+ # process Description
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ return $result
+ }
+
+ set result [string length "$line"]
+ set line [string trim $line]
+ set r $T(Nrows)
+ if {$line != {}} {
+ switch -- [string range $line 0 4] {
+ "#Name" {
+ set T($r,1) [string trim [lindex [split $line {:}] 1]]
+ set T(state) 3
+ }
+ }
+ }
+ }
+
+ 3 {
+ # new style process description
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ return $result
+ }
+
+ set result [string length "$line"]
+ set line [string trim $line]
+ if {$line != {}} {
+ switch -- [string range $line 0 4] {
+ "#Titl" {
+ # eat it
+ }
+ default {
+ set r $T(Nrows)
+ if {$r>0} {
+ set val [string trim [string range $line 5 end]]
+ catch {set T($r,2) "$val"}
+ set T(state) 1
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATCDSSrchVOTParse {t token} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ if {$debug(tcl,cat)} {
+ set fp [open debug.xml w]
+ puts $fp [http::data $token]
+ close $fp
+ }
+
+ set xml [xml::parser \
+ -characterdatacommand [list CATCDSSrchVOTCharCB $t] \
+ -elementstartcommand [list CATCDSSrchVOTElemStartCB $t] \
+ -elementendcommand [list CATCDSSrchVOTElemEndCB $t] \
+ -ignorewhitespace 1 \
+ ]
+
+ set T(tree,state) {}
+ set T(tree,prev) {}
+ if {[catch {$xml parse [http::data $token]} err]} {
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchVOTParse: $err"
+ }
+ }
+
+ $xml free
+}
+
+proc CATCDSSrchVOTCharCB {t data} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ switch -- $T(tree,state) {
+ DESCRIPTION {
+ set data [string trim $data]
+ if {$data != {}} {
+ switch -- $T(tree,prev) {
+ RESOURCE {
+ set r $T(Nrows)
+ set T($r,2) [lindex [split $data "\n"] 0]
+
+ set T(tree,prev) {}
+ }
+ }
+ }
+ }
+ }
+
+ # sometimes, we get a bogus call, (ignore whitespace does not work)
+ set T(tree,state) {}
+ return {}
+}
+
+proc CATCDSSrchVOTElemStartCB {t name attlist args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ switch -- $name {
+ VOTABLE {
+ # init db
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ # create header
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) "Resource\tDescription"
+ set T(Header) [split $T(H_$n) "\t"]
+
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) "--------\t-----------"
+
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Header)]
+
+ starbase_colmap $t
+ }
+ RESOURCE {
+ set fname {}
+ set id {}
+ set type {}
+ foreach {key value} $attlist {
+ switch -- [string tolower $key] {
+ name {set fname "$value"}
+ id {set id "$value"}
+ type {set type $value}
+ }
+ }
+
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+ set T($r,1) $fname
+ set T($r,2) {}
+
+ set T(tree,prev) $name
+ }
+ }
+
+ set ${t}(tree,state) $name
+
+ return {}
+}
+
+proc CATCDSSrchVOTElemEndCB {t name args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ # we can't count on this being called for all end-tags
+ switch -- $name {
+ VOTABLE {
+ # ok, we're done
+ return -code break
+ }
+ }
+ return {}
+}
+
+proc CATCDSSrchTable {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global icatcdssrch
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchTable $varname"
+ }
+
+# starbase_writefp $var(catdb) stdout
+
+ global $var(catdb)
+ $var(tbl) configure -variable $var(catdb)
+
+ if {[starbase_nrows $var(catdb)] == 0} {
+ ARStatus $varname [msgcat::mc {No Items Found}]
+ return
+ }
+
+ set nc [starbase_ncols $var(catdb)]
+ $var(tbl) configure -cols $nc
+
+ # add header row
+ set nr [expr [starbase_nrows $var(catdb)]+1]
+ if {$nr > $icatcdssrch(minrows)} {
+ $var(tbl) configure -rows $nr
+ } else {
+ $var(tbl) configure -rows $icatcdssrch(minrows)
+ }
+
+ ARStatus $varname "[starbase_nrows $var(catdb)] [msgcat::mc {Items Found}]"
+}
diff --git a/ds9/library/catcdssrchdialog.tcl b/ds9/library/catcdssrchdialog.tcl
new file mode 100644
index 0000000..84cf474
--- /dev/null
+++ b/ds9/library/catcdssrchdialog.tcl
@@ -0,0 +1,474 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATCDSSrchDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global pcat
+ global icatcdssrch
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchDialog $varname"
+ }
+
+ # main dialog
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # defaults
+ # maybe modified if pcat(vot)
+ set var(list,wave,param) $icatcdssrch(list,wave,param)
+ set var(list,wave) $icatcdssrch(list,wave)
+ set var(list,mission,param) $icatcdssrch(list,mission,param)
+ set var(list,mission) $icatcdssrch(list,mission)
+ set var(list,astro,param) $icatcdssrch(list,astro,param)
+ set var(list,astro) $icatcdssrch(list,astro)
+
+ # AR variables
+ set var(status) {}
+ set var(sync) 0
+
+ # CATCDSSrch variables
+ set var(catdb) ${varname}catdb
+ set var(server) $pcat(server)
+
+ set var(source) {}
+ set var(words) {}
+ set var(wave) {}
+ set var(mission) {}
+ set var(astro) {}
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ Toplevel $w $mb 7 [msgcat::mc {Search for Catalogs}] \
+ "CATCDSSrchDestroy $varname"
+
+ # file
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Retrieve}] \
+ -command "CATCDSSrchApply $varname"
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname"
+ $mb.file add command -label [msgcat::mc {Load}] \
+ -command "CATCDSSrchCatalog $varname"
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command "CATCDSSrchClear $varname"
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load}]..." \
+ -command "CATCDSSrchLoadFile $varname"
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command "CATCDSSrchSaveFile $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "CATCDSSrchDestroy $varname"
+
+ # edit
+ AREditMenu $varname
+
+ # catalog server
+ CATServerMenu $varname
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::frame $f.name
+ ttk::frame $f.words
+ ttk::frame $f.srch
+ pack $f.name -side top -fill x -expand true
+ pack $f.words -side top -fill x -expand true
+ pack $f.srch -side bottom -fill both -expand true
+
+ # param name
+ ttk::label $f.name.title -text [msgcat::mc {Name or Designation}]
+ ttk::entry $f.name.source -textvariable ${varname}(source)
+ pack $f.name.title -side top -anchor w -padx 2 -pady 2
+ pack $f.name.source -side top -anchor w -padx 2 -pady 2 -fill x -expand true
+
+ # param keywords
+ ttk::label $f.words.title \
+ -text [msgcat::mc {Words matching title, description}]
+ ttk::entry $f.words.key -textvariable ${varname}(words) -width 45
+ pack $f.words.title -side top -anchor w -padx 2 -pady 2
+ pack $f.words.key -side top -anchor w -padx 2 -pady 2 -fill x -expand true
+
+ # param search
+ ttk::frame $f.srch.wave
+ ttk::frame $f.srch.mission
+ ttk::frame $f.srch.astro
+ pack $f.srch.wave $f.srch.mission $f.srch.astro \
+ -side left -fill both -expand true -padx 2 -pady 2
+
+ # param search wave
+ ttk::frame $f.srch.wave.f
+ ttk::label $f.srch.wave.title -text [msgcat::mc {Wavelength}]
+ pack $f.srch.wave.title -side top -anchor w
+ pack $f.srch.wave.f -side bottom -fill both -expand true \
+ -anchor w -padx 2 -pady 2
+
+ ttk::scrollbar $f.srch.wave.f.scroll \
+ -command [list $f.srch.wave.f.list yview]
+ set ${varname}(listbox,wave) [listbox $f.srch.wave.f.list \
+ -yscroll \
+ [list $f.srch.wave.f.scroll set] \
+ -setgrid true \
+ -selectmode browse \
+ -exportselection 0 \
+ -listvariable ${varname}(list,wave)]
+ grid $f.srch.wave.f.list $f.srch.wave.f.scroll -sticky news
+ grid rowconfigure $f.srch.wave.f 0 -weight 1
+ grid columnconfigure $f.srch.wave.f 0 -weight 1
+
+ # param search mission
+ ttk::frame $f.srch.mission.f
+ ttk::label $f.srch.mission.title -text [msgcat::mc {Mission}]
+ pack $f.srch.mission.title -side top -anchor w
+ pack $f.srch.mission.f -side bottom -fill both -expand true \
+ -anchor w -padx 2 -pady 2
+
+ ttk::scrollbar $f.srch.mission.f.scroll \
+ -command [list $f.srch.mission.f.list yview]
+ set ${varname}(listbox,mission) [listbox $f.srch.mission.f.list \
+ -yscroll \
+ [list $f.srch.mission.f.scroll set] \
+ -setgrid true \
+ -selectmode browse \
+ -exportselection 0 \
+ -listvariable ${varname}(list,mission)]
+ grid $f.srch.mission.f.list $f.srch.mission.f.scroll \
+ -sticky news
+ grid rowconfigure $f.srch.mission.f 0 -weight 1
+ grid columnconfigure $f.srch.mission.f 0 -weight 1
+
+ # param search astro
+ ttk::frame $f.srch.astro.f
+ ttk::label $f.srch.astro.title -text [msgcat::mc {Astronomy}]
+ pack $f.srch.astro.title -side top -anchor w
+ pack $f.srch.astro.f -side bottom -fill both -expand true \
+ -anchor w -padx 2 -pady 2
+
+ ttk::scrollbar $f.srch.astro.f.scroll \
+ -command [list $f.srch.astro.f.list yview]
+ set ${varname}(listbox,astro) [listbox $f.srch.astro.f.list \
+ -yscroll \
+ [list $f.srch.astro.f.scroll set] \
+ -setgrid true \
+ -selectmode browse \
+ -exportselection 0 \
+ -listvariable ${varname}(list,astro)]
+ grid $f.srch.astro.f.list $f.srch.astro.f.scroll -sticky news
+ grid rowconfigure $f.srch.astro.f 0 -weight 1
+ grid columnconfigure $f.srch.astro.f 0 -weight 1
+
+ # Table
+ set f [ttk::frame $w.tbl]
+
+ set var(tbl) [table $f.t \
+ -state disabled \
+ -usecommand 0 \
+ -variable $var(catdb) \
+ -colorigin 1 \
+ -roworigin 0 \
+ -cols $icatcdssrch(mincols) \
+ -rows $icatcdssrch(minrows) \
+ -colstretchmode all \
+ -width -1 \
+ -height -1 \
+ -maxwidth 400 \
+ -maxheight 190 \
+ -titlerows 1 \
+ -xscrollcommand [list $f.xscroll set]\
+ -yscrollcommand [list $f.yscroll set]\
+ -selecttype row \
+ -selectmode extended \
+ -anchor w \
+ -font [font actual TkDefaultFont]
+ ]
+
+ ttk::scrollbar $f.yscroll -command [list $var(tbl) yview] \
+ -orient vertical
+ ttk::scrollbar $f.xscroll -command [list $var(tbl) xview] \
+ -orient horizontal
+
+ grid $var(tbl) $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Status
+ set f [ttk::frame $w.status]
+
+ ttk::label $f.title -text [msgcat::mc {Status}]
+ ttk::label $f.item -textvariable ${varname}(status)
+ pack $f.title $f.item -side left -anchor w -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+
+ set var(apply) [ttk::button $f.apply \
+ -text [msgcat::mc {Retrieve}] \
+ -command "CATCDSSrchApply $varname"]
+ set var(cancel) [ttk::button $f.cancel \
+ -text [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname" -state disabled]
+ ttk::button $f.catalog -text [msgcat::mc {Load}] \
+ -command "CATCDSSrchCatalog $varname"
+ ttk::button $f.clear -text [msgcat::mc {Clear}] \
+ -command "CATCDSSrchClear $varname"
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "CATCDSSrchDestroy $varname"
+ pack $f.apply $f.cancel $f.catalog $f.clear $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.stbl -orient horizontal
+ ttk::separator $w.sstatus -orient horizontal
+ pack $w.buttons $w.sstatus $w.status $w.stbl -side bottom -fill x
+ pack $w.param $w.sep -side top -fill x
+ pack $w.tbl -side top -fill both -expand true
+
+ ARStatus $varname {}
+
+ # initialize
+ $var(listbox,wave) selection set 0
+ $var(listbox,mission) selection set 0
+ $var(listbox,astro) selection set 0
+ $w.param.name.source select range 0 end
+}
+
+proc CATCDSSrchApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global icatcdssrch
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchApply $varname"
+ }
+
+ set id [$var(listbox,wave) curselection]
+ if {$id > 0} {
+ set var(wave) [lindex $var(list,wave) $id]
+ } else {
+ set var(wave) {}
+ }
+ set id [$var(listbox,mission) curselection]
+ if {$id > 0} {
+ set var(mission) [lindex $var(list,mission) $id]
+ } else {
+ set var(mission) {}
+ }
+ set id [$var(listbox,astro) curselection]
+ if {$id > 0} {
+ set var(astro) [lindex $var(list,astro) $id]
+ } else {
+ set var(astro) {}
+ }
+
+ ARApply $varname
+ ARStatus $varname [msgcat::mc {Searching for catalogs}]
+
+ CATCDSSrch $varname
+}
+
+proc CATCDSSrchDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchDestroy $varname"
+ }
+
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ ARDestroy $varname
+}
+
+proc CATCDSSrchConfig {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchConfig $varname"
+ }
+
+ set site [CATCDSURL $var(server)]
+ set cgidir {viz-bin}
+ set script {votable}
+
+ set var(url) "http://$site/$cgidir/$script"
+ set var(query) [http::formatQuery -meta.aladin all]
+
+ CATCDSSrchConfigLoad $varname
+ return
+}
+
+proc CATCDSSrchConfigLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchConfigLoad $varname"
+ }
+
+ set var(proc,parser) CATCDSSrchConfigParse
+ set var(proc,done) CATCDSSrchConfigDone
+ set var(proc,load) CATCDSSrchConfigLoad
+ CATGetURL $varname
+ return
+}
+
+proc CATCDSSrchConfigDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchConfigDone $varname"
+ }
+
+ CATCDSSrchConfigParse
+}
+
+proc CATCDSSrchConfigParse {t token} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchConfigParse"
+ }
+ if {$debug(tcl,cat)} {
+ set fp [open debug.xml w]
+ puts $fp [http::data $token]
+ close $fp
+ }
+
+ set xml [xml::parser \
+ -elementstartcommand [list CATCDSSrchConfigElemStartCB $t] \
+ -elementendcommand [list CATCDSSrchConfigElemEndCB $t] \
+ -ignorewhitespace 1 \
+ ]
+
+ set T(tree,enable) 0
+ set T(tree,state) {}
+ if {[catch {$xml parse [http::data $token]} err]} {
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCDSSrchConfigParse: $err"
+ }
+ }
+ unset ${t}(tree,enable)
+ unset ${t}(tree,state)
+
+ $xml free
+}
+
+proc CATCDSSrchConfigElemStartCB {t name attlist args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ # hardcoded
+ set varname catcdssrch1
+ upvar #0 $varname var
+ global $varname
+
+ switch -- $name {
+ RESOURCE {
+ set id {}
+ set type {}
+ foreach {key value} $attlist {
+ switch -- [string tolower $key] {
+ type {set type "$value"}
+ id {set id "$value"}
+ }
+ }
+ if {[string tolower $id] == "vizier"} {
+ set T(tree,enable) 1
+
+ set ${varname}(list,wave) [list none]
+ set ${varname}(list,mission) [list none]
+ set ${varname}(list,astro) [list none]
+ }
+ }
+ PARAM {
+ if {$T(tree,enable)} {
+ set id {}
+ set fname {}
+ foreach {key value} $attlist {
+ switch -- [string tolower $key] {
+ name {set fname "$value"}
+ id {set id "$value"}
+ }
+ }
+ set T(tree,state) [string trim [string tolower $id]]
+ switch -- $T(tree,state) {
+ wavelength {set ${varname}(list,wave,param) $fname}
+ mission {set ${varname}(list,mission,param) $fname}
+ astronomy {set ${varname}(list,astro,param) $fname}
+ }
+
+ }
+ }
+ VALUES {}
+ OPTION {
+ if {$T(tree,enable)} {
+ set item {}
+ foreach {key value} $attlist {
+ switch -- [string tolower $key] {
+ value {set item "$value"}
+ }
+ }
+ if {$item != {}} {
+ global icatcdssrch
+ switch -- $T(tree,state) {
+ wavelength {lappend ${varname}(list,wave) $item}
+ mission {lappend ${varname}(list,mission) $item}
+ astronomy {lappend ${varname}(list,astro) $item}
+ }
+ }
+ }
+ }
+ }
+
+ return {}
+}
+
+proc CATCDSSrchConfigElemEndCB {t name args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ # we can't count on this being called for all end-tags
+ switch -- $name {
+ RESOURCE {
+ # ok, we're done
+ set T(tree,enable) 0
+ return -code break
+ }
+ }
+
+ return {}
+}
diff --git a/ds9/library/catcmd.tcl b/ds9/library/catcmd.tcl
new file mode 100644
index 0000000..2124e22
--- /dev/null
+++ b/ds9/library/catcmd.tcl
@@ -0,0 +1,764 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Table Commands
+
+proc CATSelectCmd {varname ss rc} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSelectCmd $varname $ss $rc"
+ }
+
+ if {$var(edit)} {
+ CATSelectEditCmd $varname $ss $rc
+ } else {
+ CATSelectBrowseCmd $varname $ss $rc
+ }
+}
+
+proc CATSelectEditCmd {varname ss rc} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSelectEditCmd $varname $rc"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ $var(frame) marker catalog $varname unselect
+
+ set last [lindex [split $ss ,] 0]
+ set next [lindex [split $rc ,] 0]
+
+ if {[string is integer -strict $last]} {
+ CATGenerateUpdate $varname $last
+ }
+
+ if {[string is integer -strict $next]} {
+ set mk "\{${varname}.${next}\}"
+ CATPanTo $varname $mk
+ $var(frame) marker catalog $mk select
+ }
+}
+
+proc CATSelectBrowseCmd {varname ss rc} {
+ upvar #0 $varname var
+ global $varname
+
+ # starts at 1
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSelectBrowseCmd $varname ss=$ss rc=$rc"
+ }
+
+ global $var(catdb)
+ if {![CATValidDB $var(catdb)]} {
+ return
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ $var(frame) marker catalog $varname unhighlite
+
+ # init timer vars
+ set var(blink,count) 0
+ set var(blink,marker) {}
+
+ # now see the current selection
+ set last [lindex [split $ss ,] 0]
+ set row [lindex [split $rc ,] 0]
+
+ # needed for plot, status, samp
+ # starts at 0
+ set rowlist {}
+ foreach sel [$var(tbl) curselection] {
+ set rr [lindex [split $sel ,] 0]
+ lappend rowlist $rr
+ }
+ set rowlist [lsort -unique $rowlist]
+
+ # kludge
+ # tktable can return bogus numbers if arrow keys are used
+ # try to fix
+ if {$row == 0} {
+ set row 1
+ }
+ if {[llength $rowlist] <= 1} {
+ set rowlist $row
+ }
+
+ foreach rr $rowlist {
+ lappend ${varname}(blink,marker) "\{${varname}.${rr}\}"
+ }
+
+ # status
+ CATStatusRows $varname $rowlist
+
+ # plot
+ if {$var(plot)} {
+ PlotHighliteElement $var(plot,var) $rowlist
+ }
+
+ # samp
+ SAMPSendTableRowListCmd $varname $rowlist
+
+ # panto
+ CATPanTo $varname [lindex $var(blink,marker) 0]
+
+ # start timer, if needed
+ if {!$var(blink)} {
+ set var(blink) 1
+ CATSelectTimer $varname
+ }
+}
+
+proc CATSelectRows {varname src rowlist} {
+ upvar #0 $varname var
+ global $varname
+
+ # just in case?
+ set rowlist [lsort -unique $rowlist]
+
+ # rows start at 1
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSelectRows $varname $src $rowlist"
+ }
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ global $var(catdb)
+ if {![CATValidDB $var(catdb)]} {
+ return
+ }
+
+ # rowlist can be empty
+ if {$rowlist == {}} {
+ if {[info exists ${varname}(tbl)]} {
+ $var(tbl) selection clear all
+ }
+ $var(frame) marker catalog $varname unhighlite
+ return
+ }
+
+ if {[info exists ${varname}(tbl)]} {
+ $var(tbl) selection clear all
+ foreach rr $rowlist {
+ $var(tbl) selection set $rr,1
+ }
+ $var(tbl) see [lindex $rowlist 0],1
+ }
+
+ $var(frame) marker catalog $varname unhighlite
+
+ # init timer vars
+ set var(blink,count) 0
+ set var(blink,marker) {}
+
+ foreach rr $rowlist {
+ lappend ${varname}(blink,marker) "\{${varname}.${rr}\}"
+ }
+
+ # status
+ CATStatusRows $varname $rowlist
+
+ # source of call
+ switch $src {
+ samp {
+ if {$var(plot)} {
+ PlotHighliteElement $var(plot,var) $rowlist
+ }
+ }
+ plot {
+ SAMPSendTableRowListCmd $varname $rowlist
+ }
+ }
+
+ # panto
+ CATPanTo $varname [lindex $var(blink,marker) 0]
+
+ # start timer, if needed
+ if {!$var(blink)} {
+ set var(blink) 1
+ CATSelectTimer $varname
+ }
+}
+
+proc CATPanTo {varname mk} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ # pan to first region
+ if {$var(panto) && $mk != {}} {
+ set tt [$var(frame) get marker catalog $mk tag]
+ if {$tt!={}} {
+ set cc [$var(frame) get marker catalog $tt center \
+ $var(psystem) $var(psky)]
+ PanToFrame $var(frame) [lindex $cc 0] [lindex $cc 1] \
+ $var(psystem) $var(psky)
+ }
+ }
+}
+
+proc CATSelectTimer {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ switch -- $var(blink) {
+ 0 {
+ set var(blink) 0
+ set var(blink,count) 0
+ set var(blink,marker) {}
+ }
+ 1 {
+ foreach mm $var(blink,marker) {
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $mm highlite
+ }
+ }
+ }
+
+ incr ${varname}(blink,count)
+ if {$var(blink,count) < 5} {
+ set var(blink) 2
+ } else {
+ set var(blink) 0
+ }
+
+ after 250 [list CATSelectTimer $varname]
+ }
+ 2 {
+ foreach mm $var(blink,marker) {
+ if {[info commands $var(frame)] != {}} {
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $mm unhighlite
+ }
+ }
+ }
+ set var(blink) 1
+
+ after 250 [list CATSelectTimer $varname]
+ }
+ }
+}
+
+# Marker Callbacks
+# call backs can't call other procs
+proc CATHighliteCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATHighliteCB $tag $id"
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+
+ upvar #0 $varname var
+ global $varname
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ if {!$var(blink)} {
+ if {[info exists ${varname}(tbl)]} {
+ $var(tbl) selection set $row,1
+ $var(tbl) see $row,1
+ }
+ }
+}
+
+proc CATUnhighliteCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATUnhighliteCB $tag $id"
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+
+ upvar #0 $varname var
+ global $varname
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ if {!$var(blink)} {
+ if {[info exists ${varname}(tbl)]} {
+ $var(tbl) selection clear $row,1
+ }
+ }
+}
+
+proc CATEditCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATEditCB $tag $id"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+ set szcol [lindex $t 2]
+ set sz2col [lindex $t 3]
+ set units [lindex $t 4]
+ set angcol [lindex $t 5]
+
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ # shape
+ set shape [$var(frame) get marker catalog $id type]
+
+ # skyformat
+ switch -- $units {
+ degrees -
+ arcmin -
+ arcsec {
+ set skyformat $units
+ }
+ default {
+ set skyformat degrees
+ }
+ }
+
+ # get center and format
+ switch $shape {
+ circle {
+ if {$szcol>0} {
+ set rr [$var(frame) get marker catalog $id $shape radius \
+ $var(psystem) $skyformat]
+ starbase_set $var(tbldb) $row $szcol $rr
+ }
+ }
+ ellipse -
+ box {
+ if {$szcol>0 && $sz2col>0} {
+ set rr [$var(frame) get marker catalog $id $shape radius \
+ $var(psystem) $skyformat]
+ starbase_set $var(tbldb) $row $szcol [lindex $rr 0]
+ starbase_set $var(tbldb) $row $sz2col [lindex $rr 1]
+ }
+ }
+ vector {
+ if {$szcol>0} {
+ set ll [$var(frame) get marker catalog $id $shape length \
+ $var(psystem) $skyformat]
+ starbase_set $var(tbldb) $row $szcol $ll
+ }
+
+ if {$angcol>0} {
+ set ang [$var(frame) get marker catalog $id angle \
+ $var(psystem) $p(sky)]
+ starbase_set $var(tbldb) $row $angcol $ang
+ }
+ }
+ default {}
+ }
+}
+
+proc CATMoveCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATMoveCB $tag $id"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ # center
+ set coord [$var(frame) get marker catalog $id center \
+ $var(psystem) $var(sky) degrees]
+
+ starbase_set $var(tbldb) $row [starbase_colnum $var(tbldb) $var(colx)] \
+ [lindex $coord 0]
+ starbase_set $var(tbldb) $row [starbase_colnum $var(tbldb) $var(coly)] \
+ [lindex $coord 1]
+}
+
+proc CATRotateCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATRotateCB $tag $id"
+ }
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATMoveCB $tag $id"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+ set angcol [lindex $t 2]
+
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ # shape
+ set shape [$var(frame) get marker catalog $id type]
+
+ # get center and format
+ switch $shape {
+ ellipse -
+ box {
+ if {$angcol>0} {
+ set ang [$var(frame) get marker catalog $id angle \
+ $var(psystem) $var(sky)]
+ starbase_set $var(tbldb) $row $angcol $ang
+ }
+ }
+ default {}
+ }
+}
+
+proc CATDeleteCB {tag id} {
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATDeleteCB $tag $id"
+ }
+}
+
+# Tcl Commands
+
+proc CATButton {which x y} {
+ global imarker
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATButton $which $x $y"
+ }
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # see if we are on a handle
+ set h [$which get marker catalog handle $x $y]
+ set id [lindex $h 0]
+ set imarker(handle) [lindex $h 1]
+
+ if {$imarker(handle)} {
+ $which marker catalog $id edit begin $imarker(handle)
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a segment of a polygon
+ set h [$which get marker catalog polygon segment $x $y]
+ set id [lindex $h 0]
+ set segment [lindex $h 1]
+ if {$segment} {
+ $which marker catalog $id create polygon vertex $segment $x $y
+ $which marker catalog $id edit begin $imarker(handle)
+ set imarker(handle) [expr 4+$segment+1]
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a marker
+ set id [$which get marker catalog id $x $y]
+ if {$id != 0} {
+ # select
+ if {[$which get marker catalog $id property select]} {
+ $which marker catalog select only $x $y
+ $which marker catalog move begin $x $y
+ set imarker(motion) beginMove
+ return
+ }
+ # highlite
+ if {[$which get marker catalog $id property highlite]} {
+ $which marker catalog $id highlite only
+ $which marker catalog $id move back
+ set imarker(motion) none
+ return
+ }
+ }
+
+ # see if any markers are selected
+ if {[$which get marker catalog select number]>0} {
+ $which marker catalog unselect all
+ set imarker(motion) none
+ return
+ }
+
+ # see if any markers are selected
+ if {[$which get marker catalog highlite number]>0} {
+ $which marker catalog unhighlite all
+ set imarker(motion) none
+ return
+ }
+
+ set imarker(motion) none
+ set imarker(handle) -1
+}
+
+proc CATShift {which x y} {
+ global imarker
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATShift $which $x $y"
+ }
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # see if we are on a handle
+ set h [$which get marker catalog handle $x $y]
+ set id [lindex $h 0]
+ set imarker(handle) [lindex $h 1]
+
+ if {$imarker(handle)} {
+ $which marker catalog $id rotate begin
+ set imarker(motion) beginRotate
+ return
+ }
+
+ # else, see if we are on a marker
+ if {[$which marker catalog select toggle $x $y]} {
+ $which marker catalog move begin $x $y
+ set imarker(motion) beginMove
+ return
+ }
+
+ if {[$which marker catalog highlite toggle $x $y]} {
+ set imarker(motion) none
+ return
+ }
+
+ # else, start a region select
+ $which region catalog select begin $x $y
+ # $which region catalog highlite begin $x $y
+ set imarker(motion) shiftregion
+}
+
+proc CATMotion {which x y} {
+ global imarker
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATMotion $which $x $y"
+ }
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+
+ beginMove -
+ move {
+ $which marker catalog move motion $x $y
+ set imarker(motion) move
+ }
+
+ beginEdit -
+ edit {
+ $which marker catalog edit motion $x $y $imarker(handle)
+ set imarker(motion) edit
+ }
+
+ beginRotate -
+ rotate {
+ $which marker catalog rotate motion $x $y $imarker(handle)
+ set imarker(motion) rotate
+ }
+
+ region -
+ shiftregion {
+ $which region catalog select motion $x $y
+ # $which region catalog highlite motion $x $y
+ }
+ }
+}
+
+proc CATRelease {which x y} {
+ global imarker
+ global samp
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATRelease $which $x $y"
+ }
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+ beginMove -
+ beginRotate {}
+ beginEdit {}
+ move {$which marker catalog move end}
+ edit {$which marker catalog edit end}
+ rotate {$which marker catalog rotate end}
+ region {
+ $which region catalog select end
+ $which region catalog catalog highlite end
+ }
+ shiftregion {
+ $which region catalog select shift end
+ $which region catalog highlite shift end
+ }
+ }
+
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ # plot, stats, samp
+ set rr {}
+ foreach mm [$which get marker catalog highlite] {
+ lappend rr [string trim [lindex [$which get marker catalog $mm tag] 1]]
+ }
+
+ if {$rr != {}} {
+ set rr [lsort $rr]
+ set varname {}
+ set rowlist {}
+ foreach ss $rr {
+ set tt [split $ss {.}]
+ set varr [lindex $tt 0]
+ set row [lindex $tt 1]
+ if {$varname != $varr} {
+ # dump what we have
+ if {$varname != {}} {
+ upvar #0 $varname var
+ global $varname
+
+ # status
+ CATStatusRows $varname $rowlist
+ # plot
+ if {$var(plot)} {
+ PlotHighliteElement $var(plot,var) $rowlist
+ }
+ # samp
+ if {[info exists samp]} {
+ if {$samp(apps,votable) != {}} {
+ SAMPSendTableRowListCmd $varname $rowlist
+ }
+ }
+ }
+
+ # now a new list
+ set varname $varr
+ set rowlist {}
+ }
+ lappend rowlist $row
+ }
+
+ if {$varname != {}} {
+ upvar #0 $varname var
+ global $varname
+
+ # status
+ CATStatusRows $varname $rowlist
+ #plot
+ if {$var(plot)} {
+ PlotHighliteElement $var(plot,var) $rowlist
+ }
+ # samp
+ if {[info exists samp]} {
+ if {$samp(apps,votable) != {}} {
+ SAMPSendTableRowListCmd $varname $rowlist
+ }
+ }
+ }
+ }
+}
diff --git a/ds9/library/catcxc.tcl b/ds9/library/catcxc.tcl
new file mode 100644
index 0000000..6580650
--- /dev/null
+++ b/ds9/library/catcxc.tcl
@@ -0,0 +1,390 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATCXC {varname} {
+ upvar #0 $varname var
+ global $varname
+ global pcat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCXC $varname"
+ }
+
+ # go for votable or tsv
+ if {$pcat(vot)} {
+ CATCXCVOT $varname
+ } else {
+ CATCXCTSV $varname
+ }
+}
+
+proc CATCXCVOT {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCXCVOT $varname"
+ }
+
+ set var(proc,parser) VOTParse
+
+ # coord (degrees)
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ set xx [h2d [Sex2H $var(x)]]
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size (degrees)
+ switch $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ # output
+ if {$var(allcols)} {
+ set type 3
+ } else {
+ set type 2
+ }
+
+ # query
+ set var(query) [http::formatQuery RA $xx DEC $yy SR $rr VERB $type]
+ set var(url) "http://cda.cfa.harvard.edu/cscvo/coneSearch"
+
+ CATLoad $varname
+}
+
+proc CATCXCTSV {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATCXCTSV $varname"
+ }
+
+ set var(proc,reader) CATCXCReader
+
+ # coord (degrees)
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {set xx [h2d [Sex2H $var(x)]]}
+ galactic -
+ ecliptic {set xx [Sex2D $var(x)]}
+ }
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size (arcmin)
+ switch $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ # output
+ if {$var(allcols)} {
+ set type observation
+ } else {
+ set type master
+ }
+
+ # query
+ set var(query) "ra=$xx&dec=$yy&sr=$rr&type=$type"
+
+ # rows
+ if {!$var(allrows)} {
+ append var(query) "&rows=$var(max)"
+ }
+
+ set var(url) "http://cda.cfa.harvard.edu/cscds9/coneSearch"
+
+ CATLoadIncr $varname
+}
+
+proc CATCXCReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process header
+ if {[gets $sock line] == -1} {
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) -1
+ return $result
+ }
+
+ set result [string length "$line"]
+
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) $line
+
+ if {[regexp -- {^ *(-)+ *(\t *(-)+ *)*} $line]} {
+ # clean up header column name
+ set hh $T(H_[expr $n-1])
+ regsub -all {\[} $hh {} hh
+ regsub -all {\]} $hh {} hh
+ set T(H_[expr $n-1]) $hh
+
+ # cols
+ set T(Header) [split $T(H_[expr $n-1]) "\t"]
+ set T(Dashes) [split $T(H_$n) "\t"]
+ set T(Ndshs) [llength $T(Dashes)]
+ starbase_colmap $t
+ set T(state) 2
+
+ # these are hard coded
+ set T(Id) $T(Header)
+ set T(DataType) {}
+ set T(ArraySize) {}
+ set T(Unit) {}
+ set T(Ucd) {}
+ # name
+ lappend T(DataType) {char}
+ lappend T(ArraySize) {*}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # ra
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {pos.eq.ra;meta.main}
+ # dec
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {pos.eq.dec;meta.main}
+ # err_ellipse_r0
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # err_ellipse_r1
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # err_ellipse_ang
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {}
+ # conf_flag
+ lappend T(DataType) {boolean}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # extent_flag
+ lappend T(DataType) {boolean}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # sat_src_flag
+ lappend T(DataType) {boolean}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # flux_aper90_b
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # flux_aper90_hilim_b
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # flux_aper90_lolim_b
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # significance
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # hard_hm
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # hard_ms
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # var_intra_index_b
+ lappend T(DataType) {int}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ # var_inter_index_b
+ lappend T(DataType) {int}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+
+ if {[llength $T(Header)] > 17} {
+ # obsid
+ lappend T(DataType) {int}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # ra_aper
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {}
+ # dec_aper
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {}
+ # mjr_axis_aper
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # mnr_axis_aper
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {}
+ lappend T(Ucd) {}
+ # pos_angle_aper
+ lappend T(DataType) {float}
+ lappend T(ArraySize) {}
+ lappend T(Unit) {deg}
+ lappend T(Ucd) {}
+ }
+ }
+ }
+
+ 2 {
+ # process table
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ } else {
+ set result [string length "$line"]
+ set line [string trim $line]
+
+ if {$line != {}} {
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATCXCAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for CXC
+
+Request for Acknowledgment of Use of the Chandra Source Catalog
+
+Users are kindly requested to acknowledge in the acknowledgment
+section of any resulting publications their use of the Chandra Source
+Catalog.
+
+This will help us greatly to keep track of catalog usage, information
+that is essential for providing full accountability of our work and
+services, as well as for planning future services.
+
+The following language is suggested:
+
+This research has made use of data obtained from the Chandra Source
+Catalog, provided by the Chandra X-ray Center (CXC) as part of the
+Chandra Data Archive.
+
+We would like to remind you that it is also very helpful for us if you
+could include Dataset Identifiers in the manuscript. The Dataset
+Identifier for the Chandra Source Catalog is:
+
+ADS/Sa.CXO#CSC
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catdialog.tcl b/ds9/library/catdialog.tcl
new file mode 100644
index 0000000..8e0096d
--- /dev/null
+++ b/ds9/library/catdialog.tcl
@@ -0,0 +1,1302 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used by backup
+proc CATDialog {varname format catalog title action} {
+ global cat
+ global icat
+ global pcat
+ global ds9
+
+ global pds9
+ global wcs
+
+ # first determine if aready in use, then increment
+ if {[lsearch $icat(cats) $varname] >= 0} {
+ incr cat(id)
+ append varname $cat(id)
+ }
+
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATDialog $varname:$format:$catalog:$title:$action"
+ }
+
+ # main dialog
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ global current
+ if {$current(frame) == {}} {
+ return
+ }
+
+ # AR variables
+ ARInit $varname CATServer
+
+ # CAT variables
+ lappend icat(cats) $varname
+
+ set var(catdb) ${varname}catdb
+ set var(tbldb) ${varname}tbldb
+ set var(symdb) ${varname}symdb
+ set var(symdl) ${varname}symdl
+ set var(fltdl) ${varname}fltdl
+
+ set var(frame) $current(frame)
+
+ set var(server) $pcat(server)
+ set var(loc) $pcat(loc)
+
+ set var(system) $wcs(system)
+ set var(sky) $wcs(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $icat(rformat)
+ set var(width) $icat(width)
+ set var(height) $icat(height)
+ set var(max) $icat(max)
+ set var(allrows) $icat(allrows)
+ set var(allcols) $icat(allcols)
+ set var(show) $icat(show)
+ set var(edit) $icat(edit)
+ set var(panto) $icat(panto)
+
+ set var(psystem) $var(system)
+ set var(psky) $var(sky)
+
+ set var(blink) 0
+ set var(blink,count) 0
+ set var(blink,marker) {}
+
+ set var(plot) 0
+ set var(plot,var) {}
+ set var(plot,x) {}
+ set var(plot,xerr) {}
+ set var(plot,y) {}
+ set var(plot,yerr) {}
+
+ CATSet $varname $format $catalog $title
+ CATSymDBInit $varname
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ set tt $title
+
+ Toplevel $w $mb 7 $tt "CATDestroy $varname"
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ CATServerMenu $varname
+ NSVRServerMenu $varname
+ $mb add cascade -label [msgcat::mc {Symbol}] -menu $mb.symbol
+ $mb add cascade -label [msgcat::mc {Preferences}] -menu $mb.prefs
+
+ # file
+ menu $mb.file
+ $mb.file add command -label "[msgcat::mc {Load}]..." \
+ -command [list CATLoadVOTFile $varname]
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command [list CATSaveVOTFile $varname]
+ $mb.file add separator
+ $mb.file add cascade -label [msgcat::mc {Import}] -menu $mb.file.import
+ $mb.file add cascade -label [msgcat::mc {Export}] -menu $mb.file.export
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Retrieve}] \
+ -command [list CATApply $varname 0]
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command [list ARCancel $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Filter}] \
+ -command [list CATTable $varname]
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command [list CATOff $varname]
+ $mb.file add separator
+ $mb.file add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(show) -command [list CATGenerate $varname]
+ $mb.file add checkbutton -label [msgcat::mc {Edit}] \
+ -variable ${varname}(edit) -command [list CATEdit $varname]
+ $mb.file add separator
+ $mb.file add cascade -label [msgcat::mc {SAMP}] -menu $mb.file.samp
+ $mb.file add command -label [msgcat::mc {Plot}] \
+ -command [list CATPlot $varname]
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Display Header}]..." \
+ -command [list CATHeader $varname]
+ $mb.file add command -label [msgcat::mc {Acknowledgment}] \
+ -command [list CATAck $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Update from Current Frame}] \
+ -command [list CATUpdate $varname]
+ $mb.file add command \
+ -label [msgcat::mc {Update from Current Crosshair}] \
+ -command [list CATCrosshair $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Copy to Regions}] \
+ -command [list CATGenerateRegions $varname]
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Print}]..." \
+ -command [list CATPrint $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command [list CATDestroy $varname]
+
+ # Import
+ menu $mb.file.import
+ $mb.file.import add command -label "[msgcat::mc {Starbase}]..." \
+ -command [list CATLoadSBFile $varname]
+ $mb.file.import add command -label "[msgcat::mc {Tab-Separated-Value}]..." \
+ -command [list CATLoadTSVFile $varname]
+
+ # Export
+ menu $mb.file.export
+ $mb.file.export add command -label "[msgcat::mc {Starbase}]..." \
+ -command [list CATSaveSBFile $varname]
+ $mb.file.export add command -label "[msgcat::mc {Tab-Separated-Value}]..." \
+ -command [list CATSaveTSVFile $varname]
+
+ # SAMP
+ menu $mb.file.samp
+ $mb.file.samp add command -label [msgcat::mc {Connect}] \
+ -command SAMPConnect
+ $mb.file.samp add command -label [msgcat::mc {Disconnect}] \
+ -command SAMPDisconnect
+ $mb.file.samp add separator
+ $mb.file.samp add cascade -label [msgcat::mc {Send}] \
+ -menu $mb.file.samp.send
+
+ menu $mb.file.samp.send
+ $mb.file.samp.send add command -label [msgcat::mc {Broadcast}] \
+ -command [list SAMPSendTableLoadVotable {} $varname]
+ $mb.file.samp.send add separator
+
+ # edit
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -command "CATCut $varname" -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command "CATCopy $varname" -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -command "EntryPaste $var(top)" -accelerator "${ds9(ctrl)}V"
+ $mb.edit add separator
+ $mb.edit add command -label [msgcat::mc {Clear}] \
+ -command [list ARClear $varname]
+
+ # symbol
+ global $var(symdb)
+ set flt $var(symdb)
+ set sn [starbase_colnum $var(symdb) shape]
+ set cn [starbase_colnum $var(symdb) color]
+ set wn [starbase_colnum $var(symdb) width]
+ set dn [starbase_colnum $var(symdb) dash]
+ set fn [starbase_colnum $var(symdb) font]
+ set fs [starbase_colnum $var(symdb) fontsize]
+ set fw [starbase_colnum $var(symdb) fontweight]
+ set fl [starbase_colnum $var(symdb) fontslant]
+
+ menu $mb.symbol
+ $mb.symbol add cascade -label [msgcat::mc {Shape}] -menu $mb.symbol.shape
+ $mb.symbol add cascade -label [msgcat::mc {Color}] -menu $mb.symbol.color
+ $mb.symbol add cascade -label [msgcat::mc {Width}] -menu $mb.symbol.width
+ $mb.symbol add cascade -label [msgcat::mc {Font}] -menu $mb.symbol.font
+ $mb.symbol add separator
+ $mb.symbol add command -label "[msgcat::mc {Advanced}]..." \
+ -command [list CATSymDialog $varname]
+
+ menu $mb.symbol.shape
+ $mb.symbol.shape add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ${flt}(1,$sn) -value circle \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable ${flt}(1,$sn) -value ellipse \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape add radiobutton -label [msgcat::mc {Box}] \
+ -variable ${flt}(1,$sn) -value box \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape add radiobutton -label [msgcat::mc {Text}] \
+ -variable ${flt}(1,$sn) -value text \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape add cascade -label [msgcat::mc {Point}] \
+ -menu $mb.symbol.shape.point
+
+ menu $mb.symbol.shape.point
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ${flt}(1,$sn) -value {circle point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {Box}] \
+ -variable ${flt}(1,$sn) -value {box point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable ${flt}(1,$sn) -value {diamond point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {Cross}] \
+ -variable ${flt}(1,$sn) -value {cross point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {X}] \
+ -variable ${flt}(1,$sn) -value {x point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable ${flt}(1,$sn) -value {arrow point} \
+ -command [list CATGenerate $varname]
+ $mb.symbol.shape.point add radiobutton -label [msgcat::mc {BoxCircle}]\
+ -variable ${flt}(1,$sn) -value {boxcircle point} \
+ -command [list CATGenerate $varname]
+
+ ColorMenu $mb.symbol.color $flt 1,$cn [list CATGenerate $varname]
+
+ WidthDashMenu $mb.symbol.width $flt 1,$wn 1,$dn \
+ [list CATGenerate $varname] [list CATGenerate $varname]
+
+ FontMenu $mb.symbol.font $flt 1,$fn 1,$fs 1,$fw 1,$fl \
+ [list CATGenerate $varname]
+
+ menu $mb.prefs
+ $mb.prefs add checkbutton -label [msgcat::mc {Pan To}] \
+ -variable ${varname}(panto)
+ $mb.prefs add separator
+ $mb.prefs add checkbutton -label [msgcat::mc {All Rows}] \
+ -variable ${varname}(allrows)
+ $mb.prefs add checkbutton -label [msgcat::mc {All Columns}] \
+ -variable ${varname}(allcols)
+
+ # Catalog
+ set f [ttk::labelframe $w.cat -text [msgcat::mc {Catalog}] -padding 2]
+
+ ttk::label $f.ttitle -text [msgcat::mc {Name}]
+ ttk::label $f.title -textvariable ${varname}(title) \
+ -relief groove -width 60 -anchor w
+
+ ttk::label $f.tcat -text [msgcat::mc {Identification}]
+ ttk::label $f.cat -textvariable ${varname}(catalog) \
+ -relief groove -width 60 -anchor w
+
+ ttk::label $f.tref -text [msgcat::mc {Reference}]
+ ttk::label $f.ref -text [string range $varname 3 end] \
+ -relief groove -width 13 -anchor w
+
+ ttk::label $f.loctitle -text [msgcat::mc {IAU Location Code}]
+ ttk::entry $f.loc -textvariable ${varname}(loc) -width 7
+
+ grid $f.ttitle $f.title -padx 2 -pady 2 -sticky w
+ grid $f.tcat $f.cat -padx 2 -pady 2 -sticky w
+ grid $f.tref $f.ref -padx 2 -pady 2 -sticky w
+ grid $f.loctitle $f.loc -padx 2 -pady 2 -sticky w
+
+ # Object
+ set f [ttk::labelframe $w.obj -text [msgcat::mc {Object}] -padding 2]
+
+ ttk::label $f.nametitle -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable ${varname}(name) -width 60
+
+ set var(xname) [ttk::label $f.xtitle -text {} -width 1]
+ ttk::entry $f.x -textvariable ${varname}(x) -width 14
+ set var(yname) [ttk::label $f.ytitle -text {} -width 1]
+ ttk::entry $f.y -textvariable ${varname}(y) -width 14
+
+ CoordMenuButton $f.coord $varname system 0 sky skyformat \
+ [list CATWCSMenuUpdate $varname]
+ CoordMenuEnable $f.coord.menu $varname system 0 sky skyformat
+
+ ttk::button $f.update -text [msgcat::mc {Update}] \
+ -command [list CATUpdate $varname]
+
+ ttk::label $f.wtitle -text [msgcat::mc {Width}]
+ ttk::entry $f.w -textvariable ${varname}(width) -width 14
+ ttk::label $f.htitle -text [msgcat::mc {Height}]
+ ttk::entry $f.h -textvariable ${varname}(height) -width 14
+
+ ARRFormat $f.rformat $varname
+
+ grid $f.nametitle $f.name - - - - -padx 2 -pady 2 -sticky w
+ grid $f.xtitle $f.x $f.ytitle $f.y $f.coord $f.update \
+ -padx 2 -pady 2 -sticky w
+ grid $f.wtitle $f.w $f.htitle $f.h $f.rformat -padx 2 -pady 2 -sticky w
+
+ # Param
+ set f [ttk::labelframe $w.param -text [msgcat::mc {Table}] -padding 2]
+
+ ttk::label $f.mfilter -text [msgcat::mc {Filter}]
+ ttk::entry $f.filter -textvariable ${varname}(filter) -width 50
+ ttk::button $f.bfilter -text [msgcat::mc {Edit}] \
+ -command [list CATEditDialog $varname filter $var(catdb)]
+
+ ttk::label $f.msort -text [msgcat::mc {Sort}]
+ set var(sortmenu) [ttk::menubutton $f.sort \
+ -textvariable ${varname}(sort) \
+ -menu $f.sort.menu -width 14]
+ ttk::radiobutton $f.isort -text [msgcat::mc {Increase}] \
+ -variable ${varname}(sort,dir) -value "-increasing" \
+ -command [list CATTable $varname]
+ ttk::radiobutton $f.dsort -text [msgcat::mc {Decrease}] \
+ -variable ${varname}(sort,dir) -value "-decreasing" \
+ -command [list CATTable $varname]
+
+ ttk::label $f.mtitle -text [msgcat::mc {Max Rows}]
+ ttk::entry $f.max -textvariable ${varname}(max) -width 14
+
+ ttk::label $f.ftitle -text [msgcat::mc {Found}]
+ set var(found) [ttk::label $f.found \
+ -width 14 -relief groove -anchor w]
+
+ set var(raname) [ttk::label $f.ra -text {} -width 3]
+ set var(ramenu) [ttk::menubutton $f.ram -textvariable \
+ ${varname}(colx) -menu $f.ram.menu -width 14]
+ set var(decname) [ttk::label $f.dec -text {} -width 3]
+ set var(decmenu) [ttk::menubutton $f.decm -textvariable \
+ ${varname}(coly) -menu $f.decm.menu -width 14]
+
+ CoordMenuButton $f.pcoord $varname psystem 1 psky {} \
+ [list CATColsCmd $varname]
+ CoordMenuEnable $f.pcoord.menu $varname psystem 1 psky {}
+
+ grid $f.mfilter $f.filter - - $f.bfilter \
+ -padx 2 -pady 2 -sticky w
+ grid $f.msort $f.sort $f.isort $f.dsort \
+ -padx 2 -pady 2 -sticky w
+ grid $f.mtitle $f.max $f.ftitle $f.found \
+ -padx 2 -pady 2 -sticky w
+ grid $var(raname) $var(ramenu) $var(decname) $var(decmenu) $f.pcoord \
+ -padx 2 -pady 2 -sticky w
+
+ # Table
+ set f [ttk::frame $w.tbl]
+
+ set var(tbl) [table $f.t \
+ -state disabled \
+ -usecommand 0 \
+ -variable $var(tbldb) \
+ -colorigin 1 \
+ -roworigin 0 \
+ -cols $icat(mincols) \
+ -rows $icat(minrows) \
+ -width -1 \
+ -height -1 \
+ -maxwidth 300 \
+ -maxheight 300 \
+ -titlerows 1 \
+ -xscrollcommand [list $f.xscroll set]\
+ -yscrollcommand [list $f.yscroll set]\
+ -selecttype row \
+ -selectmode extended \
+ -anchor w \
+ -font [font actual TkDefaultFont] \
+ -browsecommand [list CATSelectCmd $varname %s %S] \
+ ]
+
+ ttk::scrollbar $f.yscroll -command [list $var(tbl) yview] -orient vertical
+ ttk::scrollbar $f.xscroll -command [list $var(tbl) xview] -orient horizontal
+
+ grid $var(tbl) $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Status
+ set f [ttk::frame $w.status]
+
+ ttk::label $f.title -text [msgcat::mc {Status}]
+ ttk::label $f.item -textvariable ${varname}(status)
+
+ grid $f.title $f.item -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+
+ ButtonButton $f.load [msgcat::mc {Load}] [list CATLoadVOTFile $varname]
+ ButtonButton $f.save [msgcat::mc {Save}] [list CATSaveVOTFile $varname]
+
+ set var(apply) [ttk::button $f.apply \
+ -text [msgcat::mc {Retrieve}] \
+ -command "CATApply $varname 0"]
+ set var(cancel) [ttk::button $f.cancel -text \
+ [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname" -state disabled]
+ ttk::button $f.filter -text [msgcat::mc {Filter}] \
+ -command [list CATTable $varname]
+ ttk::button $f.clear -text [msgcat::mc {Clear}] \
+ -command [list CATOff $varname]
+ set var(samp) [ttk::button $f.samp \
+ -text [msgcat::mc {SAMP}] \
+ -command "SAMPSendTableLoadVotable {} $varname"]
+ ttk::button $f.plot -text [msgcat::mc {Plot}] \
+ -command [list CATPlot $varname]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command [list CATDestroy $varname]
+
+ pack $f.apply $f.cancel $f.filter $f.clear $f.samp $f.plot $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.stbl -orient horizontal
+ ttk::separator $w.sstatus -orient horizontal
+ pack $w.buttons $w.sstatus $w.status $w.stbl -side bottom -fill x
+ pack $w.cat $w.obj $w.param -side top -fill x
+ pack $w.tbl -side top -fill both -expand true
+
+ # needs to go after sort menu button is defined
+ CATSortMenu $varname
+ CATColsMenu $varname
+ CATColsUpdate $varname
+ switch $var(format) {
+ cds {$mb entryconfig [msgcat::mc {Catalog Server}] -state normal}
+ cxc -
+ ned -
+ skybot -
+ sdss -
+ simbad {
+ $mb entryconfig [msgcat::mc {Catalog Server}] -state disabled
+ }
+ }
+
+ ARCoord $varname
+ CATUpdate $varname
+ CATDialogUpdate $varname
+
+ ARStatus $varname {}
+
+ switch -- $action {
+ apply {CATApply $varname 0}
+ sync {CATApply $varname 1}
+ none {}
+ }
+
+ # return the actual varname
+ return $varname
+}
+
+proc CATDialogUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global samp
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATDialogUpdate $varname"
+ }
+
+ # do we have a db?
+ if {[CATValidDB $var(tbldb)]} {
+ $var(mb).file entryconfig [msgcat::mc {Filter}] -state normal
+ $var(mb).file entryconfig [msgcat::mc {Clear}] -state normal
+ $var(mb).file entryconfig [msgcat::mc {Plot}] -state normal
+ $var(mb).file entryconfig "[msgcat::mc {Display Header}]..." \
+ -state normal
+ $var(mb).file entryconfig [msgcat::mc {Copy to Regions}] -state normal
+ $var(mb).file entryconfig "[msgcat::mc {Print}]..." -state normal
+
+ $var(top).buttons.filter configure -state normal
+ $var(top).buttons.clear configure -state normal
+ $var(top).buttons.plot configure -state normal
+ } else {
+ $var(mb).file entryconfig [msgcat::mc {Filter}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Clear}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Plot}] -state disabled
+ $var(mb).file entryconfig "[msgcat::mc {Display Header}]..." \
+ -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Copy to Regions}] -stat disabled
+ $var(mb).file entryconfig "[msgcat::mc {Print}]..." -state disabled
+
+ $var(top).buttons.filter configure -state disabled
+ $var(top).buttons.clear configure -state disabled
+ $var(top).buttons.plot configure -state disabled
+ }
+
+ set m $var(mb).file.samp
+ set ss [expr $ds9(menu,start)+2]
+
+ if {[info exists samp]} {
+ # menu
+ $m entryconfig [msgcat::mc {Send}] -state normal
+ $m entryconfig [msgcat::mc {Connect}] -state disabled
+ $m entryconfig [msgcat::mc {Disconnect}] -state normal
+
+ if {[$m.send index end] >= $ss} {
+ $m.send delete $ss end
+ }
+
+ foreach args $samp(apps,votable) {
+ foreach {id name} $args {
+ $m.send add command -label $name \
+ -command "SAMPSendTableLoadVotable $id $varname"
+ }
+ }
+
+ # button
+ $var(samp) configure -state normal
+ } else {
+ # menu
+ $m entryconfig [msgcat::mc {Send}] -state disabled
+ $m entryconfig [msgcat::mc {Connect}] -state normal
+ $m entryconfig [msgcat::mc {Disconnect}] -state disabled
+
+ # button
+ $var(samp) configure -state disabled
+ }
+
+}
+
+proc CATAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ switch $var(format) {
+ cds {CATCDSAck $varname}
+ cxc {CATCXCAck $varname}
+ ned {CATNEDAck $varname}
+ skybot {CATSkyBotAck $varname}
+ sdss {CATSDSSAck $varname}
+ simbad {CATSIMBADAck $varname}
+ }
+}
+
+proc CATApply {varname sync} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATApply $varname $sync"
+ }
+
+ if {$var(catalog) == {}} {
+ Error [msgcat::mc {No Catalog specified}]
+ return
+ }
+
+ set var(sync) $sync
+ ARApply $varname
+ if {$var(name) != {}} {
+ set var(sky) fk5
+ CoordMenuButtonCmd $varname system sky {}
+ CATWCSMenuUpdate $varname
+
+ NSVRServer $varname
+ } else {
+ CATServer $varname
+ }
+}
+
+proc CATCopy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set w [focus -displayof $var(top)]
+ if {$w == $var(tbl)} {
+ CATCopyTable $varname
+ } else {
+ EntryCopy $var(top)
+ }
+}
+
+proc CATCut {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set w [focus -displayof $var(top)]
+ if {$w == $var(tbl)} {
+ CATCopyTable $varname
+ } else {
+ EntryCut $var(top)
+ }
+}
+
+proc CATCopyTable {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set w [focus -displayof $var(top)]
+
+ set sel [$var(tbl) curselection]
+ set data {}
+ set row [lindex [split [lindex $sel 0] ,] 0]
+ foreach ss $sel {
+ set rr [lindex [split $ss ,] 0]
+ if {$rr != $row} {
+ append data "\n"
+ set row $rr
+ } else {
+ if {$data != {}} {
+ append data "\t"
+ }
+ }
+ append data "[$var(tbl) get $ss]"
+ }
+ append data "\n"
+ clipboard clear -displayof $w
+ clipboard append -displayof $w $data
+}
+
+proc CATCrosshair {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ if {[$var(frame) has wcs equatorial $var(system)]} {
+ set coord [$var(frame) get crosshair \
+ $var(system) $var(sky) $var(skyformat)]
+ set var(x) [lindex $coord 0]
+ set var(y) [lindex $coord 1]
+ set var(name) {}
+ }
+}
+
+proc CATDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ global $var(tbldb)
+ global $var(symdb)
+ global $var(symdl)
+ global icat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATDestroy $varname"
+ }
+
+ # stop timer if needed
+ if {$var(blink)} {
+ set var(blink) 0
+ after cancel [list CATSelectTimer $varname]
+ }
+
+ # frame may have been deleted
+ if {[info commands $var(frame)] != {}} {
+ # unhighlite any makers
+ if {[$var(frame) has fits]} {
+ $var(frame) marker catalog $varname unhighlite
+ }
+ }
+
+ upvar #0 $var(symdl) svar
+ if {[info exists svar(top)]} {
+ if {[winfo exists $svar(top)]} {
+ CATSymDestroy $var(symdl)
+ }
+ }
+
+ if {[info exists $var(symdb)]} {
+ unset $var(symdb)
+ }
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+ if {[info exists $var(catdb)]} {
+ unset $var(catdb)
+ }
+
+ set ii [lsearch $icat(cats) $varname]
+ if {$ii>=0} {
+ set icat(cats) [lreplace $icat(cats) $ii $ii]
+ }
+
+ # plot window?
+ if {$var(plot)} {
+ PlotDestroy $var(plot,var)
+ }
+
+ ARDestroy $varname
+}
+
+proc CATEdit {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ $var(frame) marker catalog unselect all
+ $var(frame) marker catalog unhighlite all
+
+ CATGenerate $varname
+
+ # regenerate the plot if needed
+ if {$var(plot)} {
+ CATPlotGenerate $varname
+ }
+
+ if {$var(edit)} {
+ $var(tbl) configure \
+ -state normal \
+ -selectmode single
+ } else {
+ $var(tbl) configure \
+ -state disabled \
+ -selectmode extended
+ }
+}
+
+proc CATGetHeader {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ set t $var(tbldb)
+ upvar #0 $t T
+
+ if {[CATValidDB $var(tbldb)]} {
+ set hdr {}
+
+ # header
+ set nl [expr $T(HLines)-2]
+ for {set ll 1} {$ll <= $nl} {incr ll} {
+ append hdr "$T(H_$ll)\n"
+ }
+ append hdr "\n"
+
+ # dump cols stats
+ set nc $T(Ncols)
+ for {set cc 1} {$cc <= $nc} {incr cc} {
+ append hdr "# name=[lindex $T(Header) [expr $cc-1]] "
+ if {[info exists ${t}(DataType)]} {
+ append hdr "datatype=[lindex $T(DataType) [expr $cc-1]] "
+ }
+
+ if {[info exists ${t}(Id)]} {
+ if {[lindex $T(Id) [expr $cc-1]] != {}} {
+ append hdr "id=[lindex $T(Id) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(ArraySize)]} {
+ if {[lindex $T(ArraySize) [expr $cc-1]] != {}} {
+ append hdr "arraysize=[lindex $T(ArraySize) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Width)]} {
+ if {[lindex $T(Width) [expr $cc-1]] != {}} {
+ append hdr "width=[lindex $T(Width) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Precision)]} {
+ if {[lindex $T(Precision) [expr $cc-1]] != {}} {
+ append hdr "precision=[lindex $T(Precision) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Unit)]} {
+ if {[lindex $T(Unit) [expr $cc-1]] != {}} {
+ append hdr "unit=[lindex $T(Unit) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Ref)]} {
+ if {[lindex $T(Ref) [expr $cc-1]] != {}} {
+ append hdr "ref=[lindex $T(Ref) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Ucd)]} {
+ if {[lindex $T(Ucd) [expr $cc-1]] != {}} {
+ append hdr "ucd=[lindex $T(Ucd) [expr $cc-1]] "
+ }
+ }
+
+ if {[info exists ${t}(Description)]} {
+ if {[lindex $T(Description) [expr $cc-1]] != {}} {
+ append hdr "[lindex $T(Description) [expr $cc-1]] "
+ }
+ }
+ append hdr "\n"
+ }
+
+ return $hdr
+ }
+ return {}
+}
+
+proc CATHeader {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ SimpleTextDialog ${varname}hdr "$var(title) [msgcat::mc {Header}]" \
+ 80 20 insert top [CATGetHeader $varname]
+}
+
+proc CATKey {which key} {
+ global icat
+ global ds9
+
+ set icat(key) $key
+ set icat(key,update) {}
+
+ $which marker catalog key
+ foreach rr $icat(key,update) {
+ eval "CATGenerateUpdate [lindex $rr 0] [lindex $rr 1]"
+ }
+
+ set icat(key) {}
+ set icat(key,update) {}
+}
+
+proc CATPageSetup {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ switch $ds9(wm) {
+ x11 -
+ aqua {}
+ win32 {win32 pm pagesetup}
+ }
+}
+
+proc CATPrint {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ global ds9
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {CATPSPrint $varname}
+ wwin32 {win32 pm print text [::textutil::tabify::untabify2 [starbase_write_ $var(tbldb)] 12]}
+ }
+}
+
+proc CATPSPrint {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[PRPrintDialog]} {
+ if {[catch {CATPostScript $varname} printError]} {
+ Error "[msgcat::mc {An error has occurred while printing}] $printError"
+ }
+ }
+}
+
+proc CATPostScript {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ global ps
+
+ if {$ps(dest) == "file"} {
+ set ch [open "| cat > $ps(filename,txt)" w]
+ } else {
+ set ch [open "| $ps(cmd)" w]
+ }
+
+ starbase_writefp $var(tbldb) $ch
+ close $ch
+}
+
+proc CATServer {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATServer $varname"
+ }
+
+ if {($var(x) != {}) &&
+ ($var(y) != {}) &&
+ ($var(width) != {}) &&
+ ($var(height) != {})} {
+
+ ARStatus $varname "Searching [string range $var(title) 0 50]"
+
+ switch $var(format) {
+ cds {CATCDS $varname}
+ cxc {CATCXC $varname}
+ ned {CATNED $varname}
+ skybot {CATSkyBot $varname}
+ sdss {CATSDSS $varname}
+ simbad {CATSIMBAD $varname}
+ }
+ } else {
+ ARError $varname [msgcat::mc {Please specify width, height, and either name or (ra,dec)}]
+ }
+}
+
+proc CATUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATUpdate $varname"
+ }
+
+ if {[info commands $var(frame)] == {}} {
+ return
+ }
+
+ if {![$var(frame) has fits]} {
+ return
+ }
+
+ if {[$var(frame) has wcs equatorial $var(system)]} {
+ set coord [$var(frame) get fits center \
+ $var(system) $var(sky) $var(skyformat)]
+ set var(x) [lindex $coord 0]
+ set var(y) [lindex $coord 1]
+
+ set size [$var(frame) get fits size \
+ $var(system) $var(sky) $var(rformat)]
+ set var(width) [lindex $size 0]
+ set var(height) [lindex $size 1]
+ set var(name) {}
+ }
+}
+
+proc CATWCSMenuUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARCoord $varname
+
+ set var(psystem) $var(system)
+ set var(psky) $var(sky)
+ CoordMenuButtonCmd $varname psystem psky {}
+ CATColsUpdate $varname
+}
+
+proc CATColsUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global pds9
+
+ switch $var(psystem) {
+ image -
+ physical -
+ detector -
+ amplifier {
+ $var(raname) configure -text {X} \
+ -font [font actual TkDefaultFont]
+ $var(decname) configure -text {Y} \
+ -font [font actual TkDefaultFont]
+ }
+ default {
+ if {[$var(frame) has wcs equatorial $var(psystem)]} {
+ switch $var(psky) {
+ fk4 -
+ fk5 -
+ icrs {
+ $var(raname) configure -text "\u03b1" \
+ -font "$ds9(times) $pds9(font,size)"
+ $var(decname) configure -text "\u03b4" \
+ -font "$ds9(times) $pds9(font,size)"
+ }
+ galactic {
+ $var(raname) configure -text {l} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ $var(decname) configure -text {b} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ }
+ ecliptic {
+ $var(raname) configure -text "\u03bb" \
+ -font "$ds9(times) $pds9(font,size)"
+ $var(decname) configure -text "\u03b2" \
+ -font "$ds9(times) $pds9(font,size)"
+ }
+ }
+ } else {
+ $var(raname) configure -text {X} \
+ -font [font actual TkDefaultFont]
+ $var(decname) configure -text {Y} \
+ -font [font actual TkDefaultFont]
+ }
+ }
+ }
+}
+
+# Edit Dialog
+
+proc CATEditDialog {varname which db} {
+ upvar #0 $varname var
+ global $varname
+ global ds9
+ global ed
+
+ set w ".${varname}edit"
+ set mb ".${varname}editmb"
+
+ set ed(ok) 0
+ set ed(text) $w.param.txt
+
+ DialogCreate $w [msgcat::mc {Edit}] ed(ok)
+
+ $w configure -menu $mb
+ menu $mb
+
+ # file
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command {set ed(ok) 1}
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command CATEditClear
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load}]..." \
+ -command CATEditLoad
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command CATEditSave
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command {set ed(ok) 0}
+
+ # edit
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Undo}] \
+ -command "$ed(text) edit undo" -accelerator "${ds9(ctrl)}Z"
+ $mb.edit add command -label [msgcat::mc {Redo}] \
+ -command "$ed(text) edit redo" -accelerator "${ds9(shiftctrl)}Z"
+ $mb.edit add separator
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -command "tk_textCut $ed(text)" -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command "tk_textCopy $ed(text)" -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -command "tk_textPaste $ed(text)" -accelerator "${ds9(ctrl)}V"
+
+ global $db
+ # column
+ $mb add cascade -label [msgcat::mc {Column}] -menu $mb.col
+ if {[info exists $mb.col]} {
+ destroy $mb.col
+ }
+ menu $mb.col
+ if {[CATValidDB $db]} {
+ set cnt -1
+ foreach col [starbase_columns $db] {
+ $mb.col add command -label "$col" \
+ -command "$ed(text) insert insert \{\$$col\}"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $mb.col entryconfig $col -columnbreak 1
+ }
+ }
+ }
+
+ # operator
+ $mb add cascade -label [msgcat::mc {Operator}] -menu $mb.op
+ menu $mb.op
+ $mb.op add command -label {-} \
+ -command "$ed(text) insert insert {-}"
+ $mb.op add command -label {!} \
+ -command "$ed(text) insert insert {!}"
+ $mb.op add command -label {(} \
+ -command "$ed(text) insert insert {(}"
+ $mb.op add command -label {)} \
+ -command "$ed(text) insert insert {)}"
+ $mb.op add separator
+ $mb.op add command -label {*} \
+ -command "$ed(text) insert insert {*}"
+ $mb.op add command -label {/} \
+ -command "$ed(text) insert insert {/}"
+ $mb.op add command -label {%} \
+ -command "$ed(text) insert insert {%}"
+ $mb.op add command -label {+} \
+ -command "$ed(text) insert insert {+}"
+ $mb.op add command -label {-} \
+ -command "$ed(text) insert insert {-}"
+ $mb.op add separator
+ $mb.op add command -label {<} \
+ -command "$ed(text) insert insert {<}"
+ $mb.op add command -label {>} \
+ -command "$ed(text) insert insert {>}"
+ $mb.op add command -label {<=} \
+ -command "$ed(text) insert insert {<=}"
+ $mb.op add command -label {>=} \
+ -command "$ed(text) insert insert {>=}"
+ $mb.op add command -label {==} \
+ -command "$ed(text) insert insert {==}"
+ $mb.op add command -label {!=} \
+ -command "$ed(text) insert insert {!=}"
+ $mb.op add separator
+ $mb.op add command -label {&&} \
+ -command "$ed(text) insert insert {&&}"
+ $mb.op add command -label {||} \
+ -command "$ed(text) insert insert {||}"
+
+ # operator
+ $mb add cascade -label [msgcat::mc {Math Function}] -menu $mb.math
+ menu $mb.math
+ $mb.math add command -label {acos} \
+ -command "$ed(text) insert insert {acos()}"
+ $mb.math add command -label {asin} \
+ -command "$ed(text) insert insert {asin()}"
+ $mb.math add command -label {atan} \
+ -command "$ed(text) insert insert {atan()}"
+ $mb.math add command -label {atan2} \
+ -command "$ed(text) insert insert {atan2(,)}"
+ $mb.math add command -label {ceil} \
+ -command "$ed(text) insert insert {ceil()}"
+ $mb.math add command -label {cos} \
+ -command "$ed(text) insert insert {cos()}"
+ $mb.math add command -label {cosh} \
+ -command "$ed(text) insert insert {cosh()}"
+ $mb.math add command -label {exp} \
+ -command "$ed(text) insert insert {exp()}"
+ $mb.math add command -label {floor} \
+ -command "$ed(text) insert insert {floor()}"
+ $mb.math add command -label {fmod} \
+ -command "$ed(text) insert insert {fmod(,)}"
+ $mb.math add command -label {hypot} \
+ -command "$ed(text) insert insert {hypot(,)}"
+ $mb.math add command -label {log} \
+ -command "$ed(text) insert insert {log()}"
+ $mb.math add command -label {log10} \
+ -command "$ed(text) insert insert {log10()}"
+ $mb.math add command -label {pow} \
+ -command "$ed(text) insert insert {pow(,)}"
+ $mb.math add command -label {sin} \
+ -command "$ed(text) insert insert {sin()}"
+ $mb.math add command -label {sinh} \
+ -command "$ed(text) insert insert {sinh()}"
+ $mb.math add command -label {sqrt} \
+ -command "$ed(text) insert insert {sqrt()}"
+ $mb.math add command -label {tan} \
+ -command "$ed(text) insert insert {tan()}"
+ $mb.math add command -label {tanh} \
+ -command "$ed(text) insert insert {tanh()}"
+ $mb.math add command -label {abs} \
+ -command "$ed(text) insert insert {abs()}"
+ $mb.math add command -label {double} \
+ -command "$ed(text) insert insert {double()}"
+ $mb.math add command -label {int} \
+ -command "$ed(text) insert insert {int()}"
+ $mb.math add command -label {round} \
+ -command "$ed(text) insert insert {round()}"
+
+ # Text
+ set f [ttk::frame $w.param]
+
+ text $f.txt \
+ -height 10 \
+ -width 60 \
+ -yscrollcommand "$f.yscroll set" \
+ -xscrollcommand "$f.xscroll set" \
+ -undo true \
+ -wrap none
+ ttk::scrollbar $f.yscroll -command [list $ed(text) yview] \
+ -orient vertical
+ ttk::scrollbar $f.xscroll -command [list $ed(text) xview] \
+ -orient horizontal
+
+ grid $ed(text) $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.clear -text [msgcat::mc {Clear}] -command CATEditClear
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.clear $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.param -side top -fill both -expand true
+ pack $w.buttons $w.sep -side bottom -fill x
+
+ $ed(text) insert end $var($which)
+ $ed(text) see end
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+
+ if {$ed(ok)} {
+ set flt [$ed(text) get 1.0 end]
+ catch {regsub {\n} $flt " " flt}
+ set var($which) [string trim $flt]
+ }
+
+ DialogDismiss $w
+ destroy $mb
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc CATEditClear {} {
+ global ed
+
+ $ed(text) delete 1.0 end
+}
+
+proc CATEditSave {} {
+ global ed
+
+ set fn [SaveFileDialog catfltfbox]
+ if {$fn != {}} {
+ if {[catch {open $fn w} fp]} {
+ Error "[msgcat::mc {Unable to open file}] $fn: $fp"
+ return
+ }
+ set flt [$ed(text) get 1.0 end]
+ catch {regsub {\n} $flt " " flt}
+ puts $fp [string trim $flt]
+ catch {close $fp}
+ }
+}
+
+proc CATEditLoad {} {
+ global ed
+
+ set fn [OpenFileDialog catfltfbox]
+ if {$fn != {}} {
+ if {[catch {open $fn r} fp]} {
+ Error "[msgcat::mc {Unable to open file}] $fn: $fp"
+ return
+ }
+ $ed(text) delete 1.0 end
+ $ed(text) insert end [read -nonewline $fp]
+ $ed(text) see end
+ catch {close $fp}
+ }
+}
+
+proc UpdateCATDialog {} {
+ global icat
+
+ foreach varname $icat(cats) {
+ CATDialogUpdate $varname
+ }
+}
+
+
diff --git a/ds9/library/catflt.tcl b/ds9/library/catflt.tcl
new file mode 100644
index 0000000..ba6709c
--- /dev/null
+++ b/ds9/library/catflt.tcl
@@ -0,0 +1,133 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATFltSort {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ global $var(tbldb)
+
+ upvar #0 $var(catdb) catsrc
+ upvar #0 $var(tbldb) catdest
+
+ # create header
+ set catdest(Header) $catsrc(Header)
+ starbase_colmap catdest
+
+ set catdest(Ndshs) [llength $catdest(Header)]
+ set catdest(Nrows) 0
+ set catdest(HLines) $catsrc(HLines)
+ set catdest(Dashes) $catsrc(Dashes)
+
+ # optional
+ if {[info exists catsrc(DataType)]} {
+ set catdest(DataType) $catsrc(DataType)
+ }
+ if {[info exists catsrc(Id)]} {
+ set catdest(Id) $catsrc(Id)
+ }
+ if {[info exists catsrc(ArraySize)]} {
+ set catdest(ArraySize) $catsrc(ArraySize)
+ }
+ if {[info exists catsrc(Width)]} {
+ set catdest(Width) $catsrc(Width)
+ }
+ if {[info exists catsrc(Precision)]} {
+ set catdest(Precision) $catsrc(Precision)
+ }
+ if {[info exists catsrc(Unit)]} {
+ set catdest(Unit) $catsrc(Unit)
+ }
+ if {[info exists catsrc(Ref)]} {
+ set catdest(Ref) $catsrc(Ref)
+ }
+ if {[info exists catsrc(Ucd)]} {
+ set catdest(Ucd) $catsrc(Ucd)
+ }
+ if {[info exists catsrc(Description)]} {
+ set catdest(Description) $catsrc(Description)
+ }
+
+ for {set ii 1} {$ii<=$catsrc(HLines)} {incr ii} {
+ set catdest(H_$ii) $catsrc(H_$ii)
+ }
+
+ for {set jj 1} {$jj<=$catsrc(Ncols)} {incr jj} {
+ set catdest(0,$jj) $catsrc(0,$jj)
+ }
+
+ # sort?
+ set order {}
+ if {$var(sort) != {}} {
+ set col $catsrc($var(sort))
+
+ for {set ii 1} {$ii<=$catsrc(Nrows)} {incr ii} {
+ set val $catsrc($ii,$col)
+ # if blank, set to 0
+ if {$val == {}} {
+ set val 0
+ }
+ lappend order "[list $ii $val]"
+ }
+
+ # first try as real, if error, then ascii
+ if {[catch {lsort $var(sort,dir) -real -index 1 $order} oo]} {
+ set oo [lsort $var(sort,dir) -ascii -index 1 $order]
+ }
+ set order $oo
+ } else {
+ for {set ii 1} {$ii<=$catsrc(Nrows)} {incr ii} {
+ lappend order "[list $ii {}]"
+ }
+ }
+
+ # data
+ set kk 0
+ for {set ii 1} {$ii<=$catsrc(Nrows)} {incr ii} {
+ set id [lindex [lindex $order [expr $ii-1]] 0]
+ # now filter
+ set pass 1
+ if {$var(filter) != {}} {
+ # eval all colnames
+ foreach col $catsrc(Header) {
+ set col [string trim $col]
+ set val $catsrc($id,$catsrc($col))
+ # here's a tough one--
+ # what to do if the column is blank
+ # for now, just set it to '0'
+ if {[string trim "$val"] == {}} {
+ set val 0
+ }
+ eval "set \{$col\} \{$val\}"
+ }
+ # subst any columv vars
+ if {[catch {subst $var(filter)} ff]} {
+ return 0
+ }
+ # evaluate filter
+ if {[catch {expr $ff} result]} {
+ return 0
+ }
+ # do we keep the row?
+ if {!$result} {
+ set pass 0
+ }
+ }
+
+ if {$pass} {
+ incr kk
+ for {set jj 1} {$jj<=$catsrc(Ncols)} {incr jj} {
+ set catdest($kk,$jj) $catsrc($id,$jj)
+ }
+ }
+ }
+
+ # success
+ set catdest(Nrows) $kk
+ return 1
+}
+
+
diff --git a/ds9/library/catmatch.tcl b/ds9/library/catmatch.tcl
new file mode 100644
index 0000000..bbd01ba
--- /dev/null
+++ b/ds9/library/catmatch.tcl
@@ -0,0 +1,711 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATMatchFrame {} {
+ global icat
+ global current
+
+ # find all cats for frame
+ set cats {}
+ foreach varname $icat(cats) {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(frame) == $current(frame)} {
+ lappend cats $varname
+ }
+ }
+
+ if {[llength $cats] < 2} {
+ Warning [msgcat::mc {At least 2 different catalogs are required}]
+ return
+ }
+
+ if {[CATMatchDialog $cats]} {
+ if {$icat(match1) != {} &&
+ $icat(match2) != {} &&
+ $icat(match1) != $icat(match2)} {
+ CATMatch $current(frame) $icat(match1) $icat(match2)
+ } else {
+ Warning [msgcat::mc {At least 2 different catalogs are required}]
+ }
+ }
+}
+
+proc CATMatchDialog {cats} {
+ global ds9
+ global ed
+ global icat
+
+ set w {.catmat}
+ set mb {.catmatmb}
+
+ set ed(top) $w
+ set ed(mb) $mb
+ set ed(ok) 0
+
+ set ed(match1) [lindex $cats 0]
+ set varname $ed(match1)
+ upvar #0 $varname var
+ global $varname
+ set ed(match1,msg) $var(title)
+
+ set ed(match2) [lindex $cats 1]
+ set varname $ed(match2)
+ upvar #0 $varname var
+ global $varname
+ set ed(match2,msg) $var(title)
+
+ set ed(error) $icat(error)
+ set ed(rformat) $icat(eformat)
+ set ed(function) $icat(function)
+ set ed(unique) $icat(unique)
+ set ed(return) $icat(return)
+
+ DialogCreate $w [msgcat::mc {Match}] ed(ok)
+
+ $w configure -menu $mb
+ menu $mb
+
+ # file
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command {set ed(ok) 1}
+ $mb.file add command -label [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+
+ # edit
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ EditMenu $mb ed
+
+ # param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.tmatch -text [msgcat::mc {Match}]
+ ttk::menubutton $f.match1 -textvariable ed(match1,msg) -menu $f.match1.menu
+ ttk::label $f.tand -text [msgcat::mc {and}]
+ ttk::menubutton $f.match2 -textvariable ed(match2,msg) -menu $f.match2.menu
+
+ CATMatchDialogCatsMenu $f match1 $cats
+ CATMatchDialogCatsMenu $f match2 $cats
+
+ ttk::label $f.terror -text [msgcat::mc {Error}]
+ ttk::entry $f.error -textvariable ed(error) -width 14
+ ARRFormat $f.eformat ed
+
+ ttk::label $f.tfunction -text [msgcat::mc {Function}]
+ ttk::menubutton $f.function -textvariable ed(function,msg) \
+ -menu $f.function.menu
+ menu $f.function.menu -tearoff 0
+ $f.function.menu add radiobutton -variable ed(function) \
+ -label "1 [msgcat::mc {and}] 2" \
+ -value 1and2 -command [list CATMatchDialogFunctionMenu $f]
+ $f.function.menu add radiobutton -variable ed(function) \
+ -label "1 [msgcat::mc {not}] 2" \
+ -value 1not2 -command [list CATMatchDialogFunctionMenu $f]
+ $f.function.menu add radiobutton -variable ed(function) \
+ -label "2 [msgcat::mc {not}] 1" \
+ -value 2not1 -command [list CATMatchDialogFunctionMenu $f]
+ ttk::checkbutton $f.unique -text [msgcat::mc {Unique}] -variable ed(unique)
+
+ ttk::label $f.treturn -text [msgcat::mc {Return}]
+ ttk::menubutton $f.return -textvariable ed(return,msg) \
+ -menu $f.return.menu
+ menu $f.return.menu -tearoff 0
+ $f.return.menu add radiobutton -variable ed(return) \
+ -label "1 [msgcat::mc {and}] 2" \
+ -value 1and2 -command [list CATMatchDialogReturnMenu $f]
+ $f.return.menu add radiobutton -variable ed(return) \
+ -label "1 [msgcat::mc {only}]" \
+ -value 1only -command [list CATMatchDialogReturnMenu $f]
+ $f.return.menu add radiobutton -variable ed(return) \
+ -label "2 [msgcat::mc {only}]" \
+ -value 2only -command [list CATMatchDialogReturnMenu $f]
+
+ grid $f.tmatch $f.match1 $f.tand $f.match2 -padx 2 -pady 2 -sticky ew
+ grid $f.terror $f.error x $f.eformat -padx 2 -pady 2 -sticky w
+ grid $f.tfunction $f.function x $f.unique -padx 2 -pady 2 -sticky ew
+ grid $f.treturn $f.return -padx 2 -pady 2 -sticky ew
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.param -side top -fill both -expand true
+ pack $w.buttons $w.sep -side bottom -fill x
+
+ CATMatchDialogFunctionMenu $w.param
+ CATMatchDialogReturnMenu $w.param
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+
+ if {$ed(ok)} {
+ set icat(match1) $ed(match1)
+ set icat(match2) $ed(match2)
+ set icat(error) $ed(error)
+ set icat(eformat) $ed(rformat)
+ set icat(function) $ed(function)
+ set icat(unique) $ed(unique)
+ set icat(return) $ed(return)
+ }
+
+ DialogDismiss $w
+ destroy $mb
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc CATMatchDialogFunctionMenu {f} {
+ global ed
+
+ switch $ed(function) {
+ 1and2 {
+ $f.unique configure -state normal
+ $f.return configure -state normal
+ set ed(function,msg) "1 [msgcat::mc {and}] 2"
+ }
+ 1not2 {
+ $f.unique configure -state disabled
+ $f.return configure -state disabled
+ set ed(function,msg) "1 [msgcat::mc {not}] 2"
+ }
+ 2not1 {
+ $f.unique configure -state disabled
+ $f.return configure -state disabled
+ set ed(function,msg) "2 [msgcat::mc {not}] 1"
+ }
+ }
+}
+
+proc CATMatchDialogReturnMenu {f} {
+ global ed
+
+ switch $ed(return) {
+ 1and2 {
+ set ed(return,msg) "1 [msgcat::mc {and}] 2"
+ }
+ 1only {
+ set ed(return,msg) "1 [msgcat::mc {only}]"
+ }
+ 2only {
+ set ed(return,msg) "2 [msgcat::mc {only}]"
+ }
+ }
+}
+
+proc CATMatchDialogCatsMenu {f which cats} {
+ global ed
+
+ set m $f.$which.menu
+
+ menu $m -tearoff 0
+ foreach varname $cats {
+ upvar #0 $varname var
+ global $varname
+
+ $m add radiobutton -variable ed($which) -label $var(title) \
+ -value $varname -command [list set ed($which,msg) $var(title)]
+ }
+}
+
+proc CATMatch {frame varname1 varname2} {
+ global icat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATMatch $frame $varname1 $varname2"
+ }
+
+ upvar #0 $varname1 var1
+ global $varname1
+ global $var1(tbldb)
+ set t1 $var1(tbldb)
+ upvar #0 $t1 T1
+
+ upvar #0 $varname2 var2
+ global $varname2
+ global $var2(tbldb)
+ set t2 $var2(tbldb)
+ upvar #0 $t2 T2
+
+ if {![CATValidDB $var1(tbldb)] || ![CATValidDB $var2(tbldb)]} {
+ return
+ }
+
+ if {$T1(Nrows)==0 || $T2(Nrows)==0} {
+ Warning [msgcat::mc {Match Catalog requires at least 1 row per catalog}]
+ return
+ }
+
+ # cat1
+ set nrows1 [starbase_nrows $var1(tbldb)]
+ set cols1 [starbase_columns $var1(tbldb)]
+ set colx1 [starbase_colnum $var1(tbldb) $var1(colx)]
+ set coly1 [starbase_colnum $var1(tbldb) $var1(coly)]
+
+ set nrows2 [starbase_nrows $var2(tbldb)]
+ set cols2 [starbase_columns $var2(tbldb)]
+ set colx2 [starbase_colnum $var2(tbldb) $var2(colx)]
+ set coly2 [starbase_colnum $var2(tbldb) $var2(coly)]
+
+ global xx1 yy1
+ global xx2 yy2
+ global rr
+ set xx1 {}
+ set yy1 {}
+ set xx2 {}
+ set yy2 {}
+ set rr {}
+
+ for {set ii 1} {$ii <= $nrows1} {incr ii} {
+ lappend xx1 [starbase_get $var1(tbldb) $ii $colx1]
+ lappend yy1 [starbase_get $var1(tbldb) $ii $coly1]
+ }
+ for {set jj 1} {$jj <= $nrows2} {incr jj} {
+ lappend xx2 [starbase_get $var2(tbldb) $jj $colx2]
+ lappend yy2 [starbase_get $var2(tbldb) $jj $coly2]
+ }
+
+ global current
+ $current(frame) match xx1 yy1 $var1(system) $var1(sky) \
+ xx2 yy2 $var2(system) $var2(sky) \
+ $icat(error) $var1(system) $icat(eformat) rr
+
+ switch $icat(function) {
+ 1and2 {
+ if {$icat(unique)} {
+ set aa [lsort -index 0 -integer -unique $rr]
+ set rr [lsort -index 1 -integer -unique $aa]
+ } else {
+ set rr [lsort -index 0 -integer $rr]
+ }
+ }
+ 1not2 {}
+ 2not1 {}
+ }
+
+ if {[llength $rr] == 0} {
+ Info [msgcat::mc {No Items Found}]
+ return
+ }
+
+ switch $icat(function) {
+ 1and2 {
+ switch $icat(return) {
+ 1and2 {CATMatchAnd1and2 $varname1 $varname2 rr}
+ 1only {CATMatchAnd1only $varname1 $varname2 rr}
+ 2only {CATMatchAnd2only $varname1 $varname2 rr}
+ }
+
+ }
+ 1not2 {CATMatchNot $varname1 $varname2 rr}
+ 2not1 {CATMatchNot $varname2 $varname1 rr}
+ }
+}
+
+proc CATMatchAnd1and2 {varname1 varname2 rrname} {
+ upvar $rrname rr
+
+ upvar #0 $varname1 var1
+ global $varname1
+ global $var1(tbldb)
+ set t1 $var1(tbldb)
+ upvar #0 $t1 T1
+
+ upvar #0 $varname2 var2
+ global $varname2
+ global $var2(tbldb)
+ set t2 $var2(tbldb)
+ upvar #0 $t2 T2
+
+ set varname [CATDialog catmatch {} {} {} none]
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ set db $var(catdb)
+ upvar #0 $db T
+
+ ARStatus $varname [msgcat::mc {Loading Catalog}]
+
+ CATOff $varname
+ CATSet $varname {} "$var1(catalog) and $var2(catalog)" \
+ "$var1(title) and $var2(title)"
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+
+ # required
+ set T(Header) $T1(Header)
+ foreach ll $T2(Header) {
+ # make cols unique
+ lappend T(Header) "2_$ll"
+ }
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(Header) {-}]
+ set T(Ndshs) [expr $T1(Ndshs)+$T2(Ndshs)]
+ set T(H_1) $T(Header)
+ set T(H_2) $T(Dashes)
+ set T(HLines) 2
+ set T(Nrows) 0
+ starbase_colmap T
+
+ # optional
+ if {[info exists ${t1}(DataType)]} {
+ set T(DataType) $T1(DataType)
+ if {[info exists ${t2}(DataType)]} {
+ append T(DataType) " $T2(DataType)"
+ }
+ }
+ if {[info exists ${t1}(Id)]} {
+ set T(Id) $T1(Id)
+ if {[info exists ${t2}(Id)]} {
+ append T(Id) " $T2(Id)"
+ }
+ }
+ if {[info exists ${t1}(ArraySize)]} {
+ set T(ArraySize) $T1(ArraySize)
+ if {[info exists ${t2}(ArraySize)]} {
+ append T(ArraySize) " $T2(ArraySize)"
+ }
+ }
+ if {[info exists ${t1}(Width)]} {
+ set T(Width) $T1(Width)
+ if {[info exists ${t2}(Width)]} {
+ append T(Width) " $T2(Width)"
+ }
+ }
+ if {[info exists ${t1}(Precision)]} {
+ set T(Precision) $T1(Precision)
+ if {[info exists ${t2}(Precision)]} {
+ append T(Precision) " $T2(Precision)"
+ }
+ }
+ if {[info exists ${t1}(Unit)]} {
+ set T(Unit) "$T1(Unit) "
+ if {[info exists ${t2}(Unit)]} {
+ append T(Unit) " $T2(Unit)"
+ }
+ }
+ if {[info exists ${t1}(Ref)]} {
+ set T(Ref) $T1(Ref)
+ if {[info exists ${t2}(Ref)]} {
+ append T(Ref) " $T2(Ref)"
+ }
+ }
+ if {[info exists ${t1}(Ucd)]} {
+ set T(Ucd) $T1(Ucd)
+ if {[info exists ${t2}(Ucd)]} {
+ append T(Ucd) " $T2(Ucd)"
+ }
+ }
+ if {[info exists ${t1}(Description)]} {
+ set T(Description) $T1(Description)
+ if {[info exists ${t2}(Description)]} {
+ append T(Description) " $T2(Description)"
+ }
+ }
+
+ set ll 0
+ foreach {r1 r2} [join $rr] {
+ incr ll
+
+ for {set ii 1} {$ii<=$T1(Ncols)} {incr ii} {
+ set T($ll,$ii) $T1($r1,$ii)
+ }
+ for {set jj 1} {$jj<=$T2(Ncols)} {incr jj} {
+ set T($ll,[expr $ii+$jj-1]) $T2($r2,$jj)
+ }
+
+ incr T(Nrows)
+ }
+
+ ARDone $varname
+ CATLoadDone $varname
+}
+
+proc CATMatchAnd1only {varname1 varname2 rrname} {
+ upvar $rrname rr
+
+ upvar #0 $varname1 var1
+ global $varname1
+ global $var1(tbldb)
+ set t1 $var1(tbldb)
+ upvar #0 $t1 T1
+
+ upvar #0 $varname2 var2
+ global $varname2
+ global $var2(tbldb)
+ set t2 $var2(tbldb)
+ upvar #0 $t2 T2
+
+ set varname [CATDialog catmatch {} {} {} none]
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ set db $var(catdb)
+ upvar #0 $db T
+
+ ARStatus $varname [msgcat::mc {Loading Catalog}]
+
+ CATOff $varname
+ CATSet $varname {} "$var1(catalog) and $var2(catalog)" \
+ "$var1(title) and $var2(title)"
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+
+ # required
+ set T(Header) $T1(Header)
+ set T(Dashes) $T1(Dashes)
+ set T(Ndshs) $T1(Ndshs)
+ set T(HLines) $T1(HLines)
+ for {set ii 1} {$ii<=$T1(HLines)} {incr ii} {
+ set T(H_$ii) $T1(H_$ii)
+ }
+ set T(Nrows) 0
+ starbase_colmap T
+
+ # optional
+ if {[info exists ${t1}(DataType)]} {
+ set T(DataType) $T1(DataType)
+ }
+ if {[info exists ${t1}(Id)]} {
+ set T(Id) $T1(Id)
+ }
+ if {[info exists ${t1}(ArraySize)]} {
+ set T(ArraySize) $T1(ArraySize)
+ }
+ if {[info exists ${t1}(Width)]} {
+ set T(Width) $T1(Width)
+ }
+ if {[info exists ${t1}(Precision)]} {
+ set T(Precision) $T1(Precision)
+ }
+ if {[info exists ${t1}(Unit)]} {
+ set T(Unit) $T1(Unit)
+ }
+ if {[info exists ${t1}(Ref)]} {
+ set T(Ref) $T1(Ref)
+ }
+ if {[info exists ${t1}(Ucd)]} {
+ set T(Ucd) $T1(Ucd)
+ }
+ if {[info exists ${t1}(Description)]} {
+ set T(Description) $T1(Description)
+ }
+
+ set ll 0
+ foreach {r1 r2} [join $rr] {
+ incr ll
+
+ for {set ii 1} {$ii<=$T1(Ncols)} {incr ii} {
+ set T($ll,$ii) $T1($r1,$ii)
+ }
+
+ incr T(Nrows)
+ }
+
+ ARDone $varname
+ CATLoadDone $varname
+}
+
+proc CATMatchAnd2only {varname1 varname2 rrname} {
+ upvar $rrname rr
+
+ upvar #0 $varname1 var1
+ global $varname1
+ global $var1(tbldb)
+ set t1 $var1(tbldb)
+ upvar #0 $t1 T1
+
+ upvar #0 $varname2 var2
+ global $varname2
+ global $var2(tbldb)
+ set t2 $var2(tbldb)
+ upvar #0 $t2 T2
+
+ set varname [CATDialog catmatch {} {} {} none]
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ set db $var(catdb)
+ upvar #0 $db T
+
+ ARStatus $varname [msgcat::mc {Loading Catalog}]
+
+ CATOff $varname
+ CATSet $varname {} "$var1(catalog) and $var2(catalog)" \
+ "$var1(title) and $var2(title)"
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+
+ # required
+ set T(Header) $T2(Header)
+ set T(Dashes) $T2(Dashes)
+ set T(Ndshs) $T2(Ndshs)
+ set T(HLines) $T2(HLines)
+ for {set ii 1} {$ii<=$T2(HLines)} {incr ii} {
+ set T(H_$ii) $T2(H_$ii)
+ }
+ set T(Nrows) 0
+ starbase_colmap T
+
+ # optional
+ if {[info exists ${t2}(DataType)]} {
+ set T(DataType) $T2(DataType)
+ }
+ if {[info exists ${t2}(Id)]} {
+ set T(Id) $T2(Id)
+ }
+ if {[info exists ${t2}(ArraySize)]} {
+ set T(ArraySize) $T2(ArraySize)
+ }
+ if {[info exists ${t2}(Width)]} {
+ set T(Width) $T2(Width)
+ }
+ if {[info exists ${t2}(Precision)]} {
+ set T(Precision) $T2(Precision)
+ }
+ if {[info exists ${t2}(Unit)]} {
+ set T(Unit) $T2(Unit)
+ }
+ if {[info exists ${t2}(Ref)]} {
+ set T(Ref) $T2(Ref)
+ }
+ if {[info exists ${t2}(Ucd)]} {
+ set T(Ucd) $T2(Ucd)
+ }
+ if {[info exists ${t2}(Description)]} {
+ set T(Description) $T2(Description)
+ }
+
+ set ll 0
+ foreach {r1 r2} [join $rr] {
+ incr ll
+
+ for {set ii 1} {$ii<=$T2(Ncols)} {incr ii} {
+ set T($ll,$ii) $T2($r2,$ii)
+ }
+
+ incr T(Nrows)
+ }
+
+ ARDone $varname
+ CATLoadDone $varname
+}
+
+proc CATMatchNot {varname1 varname2 rrname} {
+ upvar $rrname rr
+
+ upvar #0 $varname1 var1
+ global $varname1
+ global $var1(tbldb)
+ set t1 $var1(tbldb)
+ upvar #0 $t1 T1
+
+ upvar #0 $varname2 var2
+ global $varname2
+ global $var2(tbldb)
+ set t2 $var2(tbldb)
+ upvar #0 $t2 T2
+
+ set varname [CATDialog catmatch {} {} {} none]
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ set db $var(catdb)
+ upvar #0 $db T
+
+ ARStatus $varname [msgcat::mc {Loading Catalog}]
+
+ CATOff $varname
+ CATSet $varname {} "$var1(catalog) and not $var2(catalog)" \
+ "$var1(title) and not $var2(title)"
+
+ set var(name) {}
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+
+ # required
+ set T(Header) $T1(Header)
+ set T(Dashes) $T1(Dashes)
+ set T(Ndshs) $T1(Ndshs)
+ set T(HLines) $T1(HLines)
+ for {set ii 1} {$ii<=$T1(HLines)} {incr ii} {
+ set T(H_$ii) $T1(H_$ii)
+ }
+ set T(Nrows) 0
+ starbase_colmap T
+
+ # optional
+ if {[info exists ${t1}(DataType)]} {
+ set T(DataType) $T1(DataType)
+ }
+ if {[info exists ${t1}(Id)]} {
+ set T(Id) $T1(Id)
+ }
+ if {[info exists ${t1}(ArraySize)]} {
+ set T(ArraySize) $T1(ArraySize)
+ }
+ if {[info exists ${t1}(Width)]} {
+ set T(Width) $T1(Width)
+ }
+ if {[info exists ${t1}(Precision)]} {
+ set T(Precision) $T1(Precision)
+ }
+ if {[info exists ${t1}(Unit)]} {
+ set T(Unit) $T1(Unit)
+ }
+ if {[info exists ${t1}(Ref)]} {
+ set T(Ref) $T1(Ref)
+ }
+ if {[info exists ${t1}(Ucd)]} {
+ set T(Ucd) $T1(Ucd)
+ }
+ if {[info exists ${t1}(Description)]} {
+ set T(Description) $T1(Description)
+ }
+
+ set ss {}
+ foreach {r1 r2} [join $rr] {
+ lappend ss $r1
+ }
+ set ss [lsort -integer -unique $ss]
+
+ set ll 0
+ for {set jj 1} {$jj<=$T1(Nrows)} {incr jj} {
+ if {[lsearch -integer -sorted $ss $jj] == -1} {
+ incr ll
+ for {set ii 1} {$ii<=$T1(Ncols)} {incr ii} {
+ set T($ll,$ii) $T1($jj,$ii)
+ }
+ incr T(Nrows)
+ }
+ }
+
+ ARDone $varname
+ CATLoadDone $varname
+}
diff --git a/ds9/library/catned.tcl b/ds9/library/catned.tcl
new file mode 100644
index 0000000..71d99c0
--- /dev/null
+++ b/ds9/library/catned.tcl
@@ -0,0 +1,212 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATNED {varname} {
+ upvar #0 $varname var
+ global $varname
+ global pcat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATNED $varname"
+ }
+
+ # parser
+ if {$pcat(vot)} {
+ set var(proc,parser) VOTParse
+ } else {
+ set var(proc,reader) CATNEDReader
+ }
+
+ # query
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {set xx [h2d [Sex2H $var(x)]]}
+ galactic -
+ ecliptic {set xx [Sex2D $var(x)]}
+ }
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ switch -- $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ if {$pcat(vot)} {
+ set out "xml_main"
+ } else {
+ set out "ascii_tab"
+ }
+
+ switch -- $var(sky) {
+ fk4 {
+ set sky "Equatorial"
+ set eq "B1950.0"
+ }
+ fk5 -
+ icrs {
+ set sky "Equatorial"
+ set eq "J2000.0"
+ }
+ galactic {
+ set sky "Galactic"
+ set eq {}
+ }
+ ecliptic {
+ set sky "Ecliptic"
+ set eq {}
+ }
+ }
+ switch -- $var(psky) {
+ fk4 {
+ set psky "Equatorial"
+ set peq "B1950.0"
+ }
+ fk5 -
+ icrs {
+ set psky "Equatorial"
+ set peq "J2000.0"
+ }
+ galactic {
+ set psky "Galactic"
+ set peq {}
+ }
+ ecliptic {
+ set psky "Ecliptic"
+ set peq {}
+ }
+ }
+
+ # url
+ set var(query) {}
+ set query [http::formatQuery search_type "Near Position Search" RA $xx DEC $yy SR $rr of $out in_csys $sky in_equinox $eq out_csys $psky out_equinox $peq]
+ set var(url) "http://ned.ipac.caltech.edu/cgi-bin/nph-objsearch?$query"
+
+ if {$pcat(vot)} {
+ CATLoad $varname
+ } else {
+ CATLoadIncr $varname
+ }
+}
+
+proc CATNEDReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process header
+ if {[gets $sock line] == -1} {
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) -1
+ return $result
+ }
+
+ set result [string length "$line"]
+
+ # start of data?
+ if {[string range $line 0 2] == {No.}} {
+ # cols
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) $line
+ set T(Header) [split $T(H_$n) "\t"]
+
+ # dashes
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Dashes)]
+ starbase_colmap $t
+
+ set T(state) 2
+ }
+ }
+
+ 2 {
+ # process table
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ } else {
+ set result [string length "$line"]
+ set line [string trim $line]
+
+ if {$line != {}} {
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATNEDAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for NED
+
+This research has made use of the NASA/IPAC Extragalactic Database (NED)
+which is operated by the Jet Propulsion Laboratory, California Institute
+of Technology, under contract with the National Aeronautics and Space
+Administration.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catopt.tcl b/ds9/library/catopt.tcl
new file mode 100644
index 0000000..6b03d74
--- /dev/null
+++ b/ds9/library/catopt.tcl
@@ -0,0 +1,57 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# sample CATKeyCB
+# Allow the user to define callbacks to be called when
+# the user presses a key with selected regions while in edit mode.
+
+if {0} {
+# add to CATReg
+# callback=key CATKeyCB {${varname}.\${ii}.a}
+
+proc CATKeyCB {tag id} {
+ global icat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATKeyCB $tag $id"
+ }
+
+ set t [split $tag .]
+ set varname [lindex $t 0]
+ set row [lindex $t 1]
+ set key [lindex $t 2]
+
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+
+ if {![info exists ${varname}(top)]} {
+ return
+ }
+
+ if {$icat(key) == $key} {
+ switch -- $key {
+ a {
+ puts stderr "Key: $key $row"
+ return
+
+ # column name 'TooManySrcs'
+ set tcol [starbase_colnum $var(tbldb) {TooManySrcs}]
+
+ # toggle between '0' and '1'
+ set tt [starbase_get $var(tbldb) $row $tcol]
+ if {$tt == {1}} {
+ starbase_set $var(tbldb) $row $tcol {0}
+ } else {
+ starbase_set $var(tbldb) $row $tcol {1}
+ }
+ lappend icat(key,update) [list $varname $row]
+ }
+ }
+ }
+}
+}
diff --git a/ds9/library/catplot.tcl b/ds9/library/catplot.tcl
new file mode 100644
index 0000000..298b7a0
--- /dev/null
+++ b/ds9/library/catplot.tcl
@@ -0,0 +1,216 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATPlot {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # do we have a db?
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ if {$var(plot,x) == {}} {
+ set var(plot,x) "\$$var(colx)"
+ }
+ if {$var(plot,y) == {}} {
+ set var(plot,y) "\$$var(coly)"
+ }
+
+ if {[CATPlotDialog $varname]} {
+ if {$var(plot,x) != {} && $var(plot,y) != {}} {
+ CATPlotGenerate $varname
+ }
+ }
+}
+
+proc CATPlotGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(plot,xerr) == {} && $var(plot,yerr) == {}} {
+ set dim xy
+ } elseif {$var(plot,xerr) != {} && $var(plot,yerr) == {}} {
+ set dim xyex
+ } elseif {$var(plot,xerr) == {} && $var(plot,yerr) != {}} {
+ set dim xyey
+ } else {
+ set dim xyexey
+ }
+
+ global $var(tbldb)
+ set nrows [starbase_nrows $var(tbldb)]
+ set cols [starbase_columns $var(tbldb)]
+
+ set rr {}
+ for {set ii 1} {$ii <= $nrows} {incr ii} {
+ foreach col $cols {
+ set val [starbase_get $var(tbldb) $ii \
+ [starbase_colnum $var(tbldb) $col]]
+ # here's a tough one-- what to do if the col is blank
+ # for now, just set it to '0'
+ if {[string trim "$val"] == {}} {
+ set val 0
+ }
+ eval "set \{$col\} \{$val\}"
+ }
+
+ switch $dim {
+ xy {append rr [subst "$var(plot,x), $var(plot,y)\n"]}
+ xyex {append rr [subst "$var(plot,x), $var(plot,y), $var(plot,xerr)\n"]}
+ xyey {append rr [subst "$var(plot,x), $var(plot,y), $var(plot,yerr)\n"]}
+ xyexey {append rr [subst "$var(plot,x), $var(plot,y), $var(plot,xerr), $var(plot,yerr)\n"]}
+ }
+ }
+
+ set xtitle [regsub -all {\$*} $var(plot,x) {}]
+ set ytitle [regsub -all {\$*} $var(plot,y) {}]
+
+ set vvarname plot${varname}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ PlotScatterDialog $vvarname $var(title) {} {} {}
+ set vvar(callback) "CATSelectRows $varname plot"
+ set var(plot) 1
+ set var(plot,var) $vvarname
+ }
+
+ PlotClearData $vvarname
+ PlotDataSet $vvarname $dim $rr
+ PlotTitle $vvarname $var(title) $xtitle $ytitle
+ $vvar(proc,updategraph) $vvarname
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc CATPlotDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ds9
+ global ed2
+
+ set w ".${varname}plot"
+ set mb ".${varname}plotmb"
+
+ set ed2(ok) 0
+ set ed2(x) $var(plot,x)
+ set ed2(xerr) $var(plot,xerr)
+ set ed2(y) $var(plot,y)
+ set ed2(yerr) $var(plot,yerr)
+
+ DialogCreate $w [msgcat::mc {Plot}] ed2(ok)
+
+ $w configure -menu $mb
+ menu $mb
+
+ # file
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command {set ed2(ok) 1}
+ $mb.file add command -label [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+
+ # edit
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ EditMenu $mb $varname
+
+ # param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.taxis -text {Axis}
+ ttk::label $f.terr -text {Error}
+
+ ttk::label $f.tx -text {X}
+ ttk::entry $f.x -textvariable ed2(x) -width 21
+ ttk::button $f.bx -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog ed2 x $var(catdb)"
+ ttk::entry $f.xerr -textvariable ed2(xerr) -width 21
+ ttk::button $f.bxerr -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog ed2 xerr $var(catdb)"
+ ttk::menubutton $f.mx -text {Cols} -menu $f.mx.menu
+ ttk::menubutton $f.mxerr -text {Cols} -menu $f.mxerr.menu
+
+ CATPlotDialogColsMenu $varname $f.mx x
+ CATPlotDialogColsMenu $varname $f.mxerr xerr
+
+ ttk::label $f.ty -text {Y}
+ ttk::entry $f.y -textvariable ed2(y) -width 21
+ ttk::button $f.by -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog ed2 y $var(catdb)"
+ ttk::entry $f.yerr -textvariable ed2(yerr) -width 21
+ ttk::button $f.byerr -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog ed2 yerr $var(catdb)"
+ ttk::menubutton $f.my -text {Cols} -menu $f.my.menu
+ ttk::menubutton $f.myerr -text {Cols} -menu $f.myerr.menu
+
+ CATPlotDialogColsMenu $varname $f.my y
+ CATPlotDialogColsMenu $varname $f.myerr yerr
+
+ grid x $f.taxis x $f.terr -padx 2 -pady 2 -sticky ew
+ grid $f.tx $f.x $f.bx $f.xerr $f.bxerr -padx 2 -pady 2 -sticky ew
+ grid x $f.mx x $f.mxerr -padx 2 -pady 2 -sticky ew
+ grid $f.ty $f.y $f.by $f.yerr $f.byerr -padx 2 -pady 2 -sticky ew
+ grid x $f.my x $f.myerr -padx 2 -pady 2 -sticky ew
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.param -side top -fill both -expand true
+ pack $w.buttons $w.sep -side bottom -fill x
+
+ DialogCenter $w
+ DialogWait $w ed2(ok) $w.buttons.ok
+
+ if {$ed2(ok)} {
+ set var(plot,x) $ed2(x)
+ set var(plot,xerr) $ed2(xerr)
+ set var(plot,y) $ed2(y)
+ set var(plot,yerr) $ed2(yerr)
+ }
+
+ DialogDismiss $w
+ destroy $mb
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc CATPlotDialogColsMenu {varname f ww} {
+ upvar #0 $varname var
+ global $varname
+ global $var(catdb)
+ global ed2
+ global ds9
+
+ set m $f.menu
+
+ menu $m -tearoff 0
+ if {[CATValidDB $var(catdb)]} {
+ set cnt -1
+ foreach col [starbase_columns $var(catdb)] {
+ $m add command -label $col -command "set ed2($ww) \\$$col"
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 0
+ $m entryconfig $col -columnbreak 1
+ }
+ }
+ }
+}
diff --git a/ds9/library/catreg.tcl b/ds9/library/catreg.tcl
new file mode 100644
index 0000000..505e919
--- /dev/null
+++ b/ds9/library/catreg.tcl
@@ -0,0 +1,395 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# catreg -- convert catalog table into region string
+proc CATReg {varname row interactive resultname} {
+ upvar $resultname result
+
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+ global $var(symdb)
+
+ # init result
+ set result {}
+
+ # How to process each field of a filter
+ # -------------------------------------
+ # condition: subst/expr
+ # shape: constant
+ # color: constant
+ # width: constant
+ # dash: constant
+ # font: constant
+ # fontsize: constant
+ # fontweight: constant
+ # fontslant: constant
+ # text: subst
+ # size1: expr
+ # size2: expr
+ # angle: expr
+
+ # valid cols?
+ if {$var(colx) == {} || $var(coly) == {}} {
+ return
+ }
+ set colx [starbase_colnum $var(tbldb) $var(colx)]
+ set coly [starbase_colnum $var(tbldb) $var(coly)]
+
+ # do we have formats for colx and coly?
+ if {[catch {starbase_hdrget $var(tbldb) UFMT} ff]} {
+ set ff {}
+ global errorInfo
+ set errorInfo {}
+ }
+ set xformat [lindex $ff 0]
+ set yformat [lindex $ff 1]
+
+ # else, do we have T(Units), i.e. votable
+ set db $var(tbldb)
+ upvar #0 $db T
+ if {[info exists T(Unit)]} {
+ set xformat [string trim [lindex $T(Unit) [expr $colx-1]] {"}]
+ set yformat [string trim [lindex $T(Unit) [expr $coly-1]] {"}]
+ }
+
+ # process prologue
+ append result "# Region file format: DS9 version 4.0\n"
+
+ # for speed...
+ # tbldb
+ set nrows [starbase_nrows $var(tbldb)]
+ set cols [starbase_columns $var(tbldb)]
+
+ # system
+ switch $var(psystem) {
+ image -
+ physical -
+ detector -
+ amplifier {set sys $var(psystem)}
+ default {set sys "$var(psystem); $var(psky)"}
+ }
+
+ # symdb
+ set snrows [starbase_nrows $var(symdb)]
+ set sncond [starbase_colnum $var(symdb) condition]
+ set snshape [starbase_colnum $var(symdb) shape]
+ set sncolor [starbase_colnum $var(symdb) color]
+ set snwidth [starbase_colnum $var(symdb) width]
+ set sndash [starbase_colnum $var(symdb) dash]
+ set snfont [starbase_colnum $var(symdb) font]
+ set snfontsize [starbase_colnum $var(symdb) fontsize]
+ set snfontweight [starbase_colnum $var(symdb) fontweight]
+ set snfontslant [starbase_colnum $var(symdb) fontslant]
+ set sntext [starbase_colnum $var(symdb) text]
+ set snsize [starbase_colnum $var(symdb) size]
+ set snsize2 [starbase_colnum $var(symdb) size2]
+ set snunits [starbase_colnum $var(symdb) units]
+ set snangle [starbase_colnum $var(symdb) angle]
+
+ # for each row in the catalog table ...
+ if {[string is integer -strict $row]} {
+ set start $row
+ set end $row
+ } else {
+ set start 1
+ set end $nrows
+ }
+
+ # look for need to eval colnames (only used for conditionals and text
+ set doEval 0
+ for {set jj 1} {$jj <= $snrows} {incr jj} {
+ set cond [starbase_get $var(symdb) $jj $sncond]
+ set text [starbase_get $var(symdb) $jj $sntext]
+ set sz [starbase_get $var(symdb) $jj $snsize]
+ set sz2 [starbase_get $var(symdb) $jj $snsize2]
+ set angle [starbase_get $var(symdb) $jj $snangle]
+ if {$cond!={} || $text!={} || $sz!={} || $sz2!={} || $angle!={}} {
+ set doEval 1
+ }
+ }
+
+ for {set ii $start} {$ii <= $end} {incr ii} {
+ if {$doEval} {
+ # define each colunm variable
+ foreach col $cols {
+ set val [starbase_get $var(tbldb) $ii \
+ [starbase_colnum $var(tbldb) $col]]
+ # here's a tough one-- what to do if the col is blank
+ # for now, just set it to '0'
+ if {[string trim "$val"] == {}} {
+ set val 0
+ }
+ eval "set \{$col\} \{$val\}"
+ }
+ }
+
+ # look through each filter
+ for {set jj 1} {$jj <= $snrows} {incr jj} {
+ # eval condition
+ set cond [starbase_get $var(symdb) $jj $sncond]
+
+ if {$cond != {}} {
+ set found 0
+
+ # subst any column vars
+ if {[catch {subst $cond} cc]} {
+ Error "Unable to evaluate condition $cc"
+ return
+ }
+ # evaluate filter
+ if {[catch {expr $cc} found]} {
+ Error "Unable to evaluate condition $cc"
+ return
+ }
+ } else {
+ set found 1
+ }
+
+ # if not true, goto the next filter
+ if {!$found} {
+ continue
+ }
+
+ # shape
+ set shape [starbase_get $var(symdb) $jj $snshape]
+ if {$shape == {}} {
+ set shape circle
+ }
+
+ # xx
+ set xx [starbase_get $var(tbldb) $ii $colx]
+ switch $xformat {
+ {h:m:s} -
+ {d:m:s} {set xx [uformat $xformat d $xx]}
+ }
+
+ # yy
+ set yy [starbase_get $var(tbldb) $ii $coly]
+ if {$yformat == {d:m:s}} {
+ set yy [uformat $yformat d $yy]
+ }
+
+ # size/angle
+ set szcol {}
+ set sz2col {}
+ set angcol {}
+
+ set units [starbase_get $var(symdb) $jj $snunits]
+ switch -- $units {
+ image {set unitval i}
+ physical {set unitval p}
+ degrees {set unitval d}
+ arcmin {set unitval {'}}
+ arcsec {set unitval {"}}
+ default {set unitval p}
+ }
+
+ switch -- $shape {
+ text -
+ point -
+ {circle point} -
+ {box point} -
+ {diamond point} -
+ {cross point} -
+ {x point} -
+ {arrow point} -
+ {boxcircle point} {set size {}}
+
+ circle {
+ set sz [starbase_get $var(symdb) $jj $snsize]
+
+ set szcolnm [string range $sz 1 end]
+ if {[lsearch -exact $cols $szcolnm] != -1} {
+ set szcol [starbase_colnum $var(tbldb) $szcolnm]
+ }
+
+ if {$sz != {}} {
+ if {[catch {expr $sz} ss]} {
+ Error "Unable to evaluate size $sz"
+ return
+ } else {
+ set sz $ss
+ }
+ } else {
+ set sz 5
+ }
+ set size "${sz}${unitval}"
+ }
+
+ vector {
+ set sz [starbase_get $var(symdb) $jj $snsize]
+
+ set szcolnm [string range $sz 1 end]
+ if {[lsearch -exact $cols $szcolnm] != -1} {
+ set szcol [starbase_colnum $var(tbldb) $szcolnm]
+ }
+
+ if {$sz != {}} {
+ if {[catch {expr $sz} ss]} {
+ Error "Unable to evaluate size $sz"
+ return
+ } else {
+ set sz $ss
+ }
+ } else {
+ set sz 5
+ }
+
+ set angle [starbase_get $var(symdb) $jj $snangle]
+
+ set angcolnm [string range $angle 1 end]
+ if {[lsearch -exact $cols $angcolnm] != -1} {
+ set angcol [starbase_colnum $var(tbldb) $angcolnm]
+ }
+
+ if {$angle != {}} {
+ if {[catch {expr $angle} aa]} {
+ Error "Unable to evaluate angle $angle"
+ return
+ } else {
+ set angle $aa
+ }
+ } else {
+ set angle 0
+ }
+
+ set size "${sz}${unitval} ${angle}"
+ }
+
+ ellipse -
+ box {
+ # size
+ set sz [starbase_get $var(symdb) $jj $snsize]
+
+ set szcolnm [string range $sz 1 end]
+ if {[lsearch -exact $cols $szcolnm] != -1} {
+ set szcol [starbase_colnum $var(tbldb) $szcolnm]
+ }
+
+ if {$sz != {}} {
+ if {[catch {expr $sz} ss]} {
+ Error "Unable to evaluate size $sz"
+ return
+ } else {
+ set sz $ss
+ }
+ } else {
+ set sz 5
+ }
+
+ # size2
+ set sz2 [starbase_get $var(symdb) $jj $snsize2]
+
+ set sz2colnm [string range $sz2 1 end]
+ if {[lsearch -exact $cols $sz2colnm] != -1} {
+ set sz2col [starbase_colnum $var(tbldb) $sz2colnm]
+ }
+
+ if {$sz2 != {}} {
+ if {[catch {expr $sz2} ss]} {
+ Error "Unable to evaluate size $sz2"
+ return
+ } else {
+ set sz2 $ss
+ }
+ } else {
+ set sz2 5
+ }
+
+ # angle
+ set angle [starbase_get $var(symdb) $jj $snangle]
+
+ set angcolnm [string range $angle 1 end]
+ if {[lsearch -exact $cols $angcolnm] != -1} {
+ set angcol [starbase_colnum $var(tbldb) $angcolnm]
+ }
+
+ if {$angle != {}} {
+ if {[catch {expr $angle} aa]} {
+ Error "Unable to evaluate angle $angle"
+ return
+ } else {
+ set angle $aa
+ }
+ } else {
+ set angle 0
+ }
+
+ # put it all together
+ set size "${sz}${unitval} ${sz2}${unitval} ${angle}"
+ }
+ }
+
+ # color
+ set color [starbase_get $var(symdb) $jj $sncolor]
+ if {$color == {}} {
+ set color green
+ }
+
+ # width
+ set width [starbase_get $var(symdb) $jj $snwidth]
+ if {$width == {}} {
+ set width 1
+ }
+
+ # dash
+ set dash [starbase_get $var(symdb) $jj $sndash]
+ if {$dash == {}} {
+ set dash 0
+ }
+
+
+ #font
+ set font [starbase_get $var(symdb) $jj $snfont]
+ if {$font == {}} {
+ set font helvetica
+ }
+ set fontsize [starbase_get $var(symdb) $jj $snfontsize]
+ if {$fontsize == {}} {
+ set fontsize 10
+ }
+ set fontweight [starbase_get $var(symdb) $jj $snfontweight]
+ if {$fontweight == {}} {
+ set fontweight normal
+ }
+ set fontslant [starbase_get $var(symdb) $jj $snfontslant]
+ if {$fontslant == {}} {
+ set fontslant roman
+ }
+
+ # text
+ set text [starbase_get $var(symdb) $jj $sntext]
+ if {$text != {}} {
+ if {[catch {subst $text} tt]} {
+ Error "Unable to evaluate text $text"
+ return
+ } else {
+ set text $tt
+ }
+ }
+ if {$shape == {text} && $text == {}} {
+ set text "$ii"
+ }
+
+ # final substitution and append result
+ # init result for substitutions
+ if {$interactive} {
+ if {$var(edit)} {
+ set template "\${sys};\${shape}(\${xx} \${yy} \${size}) # color=\${color} width=\${width} dash=\${dash} font=\{${font} ${fontsize} ${fontweight} ${fontslant}\} text=\{\${text}\} tag={${varname}} tag={${varname}.\${ii}} select=1 edit=1 move=1 rotate=1 delete=1 highlite=0 callback=select CATHighliteCB {${varname}.\${ii}} callback=unselect CATUnhighliteCB {${varname}.\${ii}} callback=edit CATEditCB {${varname}.\${ii}.\${szcol}.\${sz2col}.\${units}.\${angcol}} callback=move CATMoveCB {${varname}.\${ii}} callback=rotate CATRotateCB {${varname}.\${ii}.\${angcol}} callback=delete CATDeleteCB {${varname}.\${ii}}\n"
+ } else {
+ set template "\${sys};\${shape}(\${xx} \${yy} \${size}) # color=\${color} width=\${width} dash=\${dash} font=\{${font} ${fontsize} ${fontweight} ${fontslant}\} text=\{\${text}\} tag={${varname}} tag={${varname}.\${ii}} select=0 edit=0 move=0 rotate=0 delete=1 highlite=1 callback=delete CATDeleteCB {${varname}.\${ii}} callback=highlite CATHighliteCB {${varname}.\${ii}} callback=unhighlite CATUnhighliteCB {${varname}.\${ii}}\n"
+ }
+ } else {
+ set template "\${sys};\${shape}(\${xx} \${yy} \${size}) # color=\${color} width=\${width} dash=\${dash} text=\{\${text}\} tag=$varname\n"
+ }
+ append result [subst $template]
+
+ # ok, we are done
+ break
+ }
+ }
+}
diff --git a/ds9/library/catsdss.tcl b/ds9/library/catsdss.tcl
new file mode 100644
index 0000000..a2d6769
--- /dev/null
+++ b/ds9/library/catsdss.tcl
@@ -0,0 +1,176 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATSDSS {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSDSS $varname"
+ }
+
+ set var(proc,reader) CATSDSSReader
+
+ # coord (degrees)
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ set xx [h2d [Sex2H $var(x)]]
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size (arcmin)
+ switch $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ set query {}
+ append query "ra=$xx&"
+ append query "dec=$yy&"
+ append query "radius=$rr&"
+
+# append query "min_ra=[expr $xx-$ww/2.]&max_ra=[expr $xx+$ww/2.]&"
+# append query "min_dec=[expr $yy-$hh/2.]&max_dec=[expr $yy+$hh/2.]&"
+
+ # output
+ if {$var(allrows)} {
+ append query "entries=all&"
+ } else {
+ append query "topnum=$var(max)&"
+ }
+ append query "format=csv&"
+
+ set var(url) "http://cas.sdss.org/astrodr${var(catalog)}/en/tools/search/x_radial.asp?$query"
+
+ set var(query) {}
+
+ CATLoadIncr $varname
+}
+
+proc CATSDSSReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process header
+ if {[gets $sock line] == -1} {
+ return
+ }
+
+ if {[string equal $line "No objects have been found"]} {
+ return
+ }
+
+ # cols
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set result [string length "$line"]
+ set T(H_$n) $line
+ set T(Header) [split $T(H_$n) ","]
+
+ # dashes
+
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Dashes)]
+
+ starbase_colmap $t
+ set T(state) 2
+ }
+
+ 2 {
+ # process table
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ } else {
+ set result [string length "$line"]
+ set line [string trim $line]
+ if {$line != {}} {
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line ","] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATSDSSAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for SDSS
+
+Funding for the Sloan Digital Sky Survey (SDSS) has been provided
+by the Alfred P. Sloan Foundation, the Participating Institutions,
+the National Aeronautics and Space Administration, the National
+Science Foundation, the U.S. Department of Energy, the Japanese
+Monbukagakusho, and the Max Planck Society. The SDSS Web site is
+http://www.sdss.org/.
+
+The SDSS is managed by the Astrophysical Research Consortium (ARC)
+for the Participating Institutions. The Participating Institutions
+are The University of Chicago, Fermilab, the Institute for
+Advanced Study, the Japan Participation Group, The Johns Hopkins
+University, the Korean Scientist Group, Los Alamos National
+Laboratory, the Max-Planck-Institute for Astronomy (MPIA), the
+Max-Planck-Institute for Astrophysics (MPA), New Mexico State
+University, University of Pittsburgh, University of Portsmouth,
+Princeton University, the United States Naval Observatory, and the
+University of Washington.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catsimbad.tcl b/ds9/library/catsimbad.tcl
new file mode 100644
index 0000000..2a6085c
--- /dev/null
+++ b/ds9/library/catsimbad.tcl
@@ -0,0 +1,236 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATSIMBAD {varname} {
+ upvar #0 $varname var
+ global $varname
+ global pcat
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSIMBAD $varname"
+ }
+
+ # parser
+ if {$pcat(vot)} {
+ set var(proc,parser) CATSIMBADParse
+ } else {
+ set var(proc,reader) CATSIMBADReader
+ }
+
+ # query
+ set qq {}
+
+ if {$pcat(vot)} {
+ append qq "output script=off\n"
+ append qq "output console=off\n"
+ }
+
+ if {$pcat(vot)} {
+ append qq "votable v1 "
+ } else {
+ append qq "format object f1 "
+ }
+
+ switch -- $var(psky) {
+ fk4 {set psky "FK4;1950;1950"}
+ fk5 {set psky "FK5;2000;2000"}
+ icrs {set psky "ICRS"}
+ galactic {set psky "GAL"}
+ ecliptic {set psky "ECL"}
+ }
+
+ if {$pcat(vot)} {
+ append qq "{ coo(d;$psky), main_id, otype(S), pmra, pmdec, plx, z_value, flux(B), flux(V), sp }\n"
+ append qq "votable open v1\n"
+ } else {
+ append qq {"%COO(d;A)\t%COO(d;D)\t%IDLIST(1)\t%OTYPE(S)\t%PM(A)\t%PM(D)\t%PLX(V)\t%RV(Z)\t%FLUXLIST(B;F)\t%FLUXLIST(V;F)\t%SP(S)\n"}
+ append qq "\n"
+ }
+
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {set xx [h2d [Sex2H $var(x)]]}
+ galactic -
+ ecliptic {set xx [Sex2D $var(x)]}
+ }
+ set yy [Sex2D $var(y)]
+ }
+ }
+ append qq "query coo $xx "
+ if {$yy>0} {
+ append qq "+$yy"
+ } else {
+ append qq "$yy"
+ }
+
+ set ww $var(width)
+ set hh $var(height)
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ append qq " radius=$rr"
+ switch -- $var(rformat) {
+ degrees {append qq "d"}
+ arcmin {append qq "m"}
+ arcsec {append qq "s"}
+ }
+
+ switch -- $var(sky) {
+ fk4 {append qq " frame=FK4 epoch=B1950 equinox=1950"}
+ fk5 {append qq " frame=FK5 epoch=J2000 equinox=2000"}
+ icrs {append qq " frame=ICRS"}
+ galactic {append qq " frame=GAL"}
+ ecliptic {append qq " frame=ECL"}
+ }
+
+ if {$pcat(vot)} {
+ append qq "\nvotable close\n"
+ } else {
+ append qq "\n"
+ }
+
+ # url
+ set var(url) "http://simbad.u-strasbg.fr/simbad/sim-script"
+ set var(query) [http::formatQuery script $qq]
+
+ if {$pcat(vot)} {
+ CATLoad $varname
+ } else {
+ CATLoadIncr $varname
+ }
+}
+
+proc CATSIMBADParse {t token} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ # we can't trust simbad to turn off any error messages
+ variable $token
+ upvar 0 $token state
+
+ set id [string first {<?xml} $state(body)]
+ set ${token}(body) [string range $state(body) $id end]
+
+ VOTParse $t $token
+}
+
+proc CATSIMBADReader {t sock token} {
+ upvar #0 $t T
+ global $t
+
+ set result 0
+
+ if { ![info exists ${t}(state)] } {
+ set T(state) 0
+ }
+
+ switch -- $T(state) {
+ 0 {
+ # init db
+ fconfigure $sock -blocking 1
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) 1
+ }
+
+ 1 {
+ # process header
+ if {[gets $sock line] == -1} {
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) -1
+ return $result
+ }
+
+ set result [string length "$line"]
+
+ # error?
+ if {[string range $line 0 8] == {::error::}} {
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ set T(state) -1
+ return $result
+ }
+
+ # start of data?
+ if {[string range $line 0 7] == {::data::}} {
+ # cols
+ set line "RA\tDEC\tIdentifier\tObject\tPMRA\tPMDEC\tPX\tRV(z)\tB\tV\tSpectralType"
+
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) $line
+ set T(Header) [split $T(H_$n) "\t"]
+
+ # dashes
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Dashes)]
+ starbase_colmap $t
+
+ set T(state) 2
+ }
+ }
+
+ 2 {
+ # process table
+ if {[gets $sock line] == -1} {
+ set T(state) 0
+ } else {
+ set result [string length "$line"]
+ set line [string trim $line]
+
+ if {$line != {}} {
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+ }
+ }
+ }
+
+ return $result
+}
+
+proc CATSIMBADAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for SIMBAD
+
+This research has made use of the SIMBAD database,
+operated at CDS, Strasbourg, France.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catskybot.tcl b/ds9/library/catskybot.tcl
new file mode 100644
index 0000000..c89f9f0
--- /dev/null
+++ b/ds9/library/catskybot.tcl
@@ -0,0 +1,158 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATSkyBot {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSkyBot $varname"
+ }
+
+ CATSkyBotVOT $varname
+}
+
+proc CATSkyBotVOT {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,cat)} {
+ puts stderr "CATSkyBotVOT $varname"
+ }
+
+ set var(proc,parser) VOTParse
+
+ # coord (degrees)
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ switch -- $var(sky) {
+ fk4 -
+ fk5 -
+ icrs {set xx [h2d [Sex2H $var(x)]]}
+ galactic -
+ ecliptic {set xx [Sex2D $var(x)]}
+ }
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size (arcmin)
+ switch $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ # output
+ if {$var(allcols)} {
+ set type 3
+ } else {
+ set type 2
+ }
+
+ # figure out a epoch (DATE-OBS, then DATE)
+ global current
+ set epoch [string trim [$current(frame) get fits header keyword DATE-OBS]]
+ if {$epoch == {}} {
+ set epoch [string trim [$current(frame) get fits header keyword DATE_OBS]]
+ }
+ if {$epoch == {}} {
+ set epoch [string trim [$current(frame) get fits header keyword DATE]]
+ }
+ if {$epoch == {}} {
+ ARError $varname [msgcat::mc {Unable to determine date of observation}]
+ return
+ }
+
+ # do we have a time? else check UT, UTC-OBS, UTIME, TIME-OBS
+ set ut {}
+ if {[string first {T} $epoch] == -1} {
+ set ut [string trim [$current(frame) get fits header keyword UT]]
+ if {$ut == {}} {
+ set ut [string trim [$current(frame) get fits header keyword UTC-OBS]]
+ }
+ if {$ut == {}} {
+ set ut [string trim [$current(frame) get fits header keyword UTIME]]
+ }
+ if {$ut == {}} {
+ set ut [string trim [$current(frame) get fits header keyword TIME-OBS]]
+ }
+ if {$ut == {}} {
+ set ut [string trim [$current(frame) get fits header keyword TIME_OBS]]
+ }
+
+ if {$ut != {}} {
+ append epoch "T$ut"
+ } else {
+ ARError $varname [msgcat::mc {Unable to determine time of observation}]
+ return
+ }
+ }
+
+ # do we finally have a date with time?
+ set dt [split $epoch {T}]
+ set dd [lindex $dt 0]
+ set tt [lindex $dt 1]
+ if {$tt != {}} {
+ # do we have EXPTIME or EXP_TIME?
+ set exp [string trim [$current(frame) get fits header keyword EXPTIME]]
+ if {$exp == {}} {
+ set exp [string trim [$current(frame) get fits header keyword EXP_TIME]]
+ }
+
+ if {$exp != {} && [string is double $exp]} {
+ # ok, rebuild epoch
+ set ttt [split $tt {:}]
+ set total [expr [lindex $ttt 0]*60.*60. + [lindex $ttt 1]*60. + [lindex $ttt 2] + [expr $exp/2.]]
+ set hh [format "%02d" [expr int($total/60./60.)]]
+ set total [expr $total - $hh*60.*60.]
+ set mm [format "%02d" [expr int($total/60.)]]
+ set ss [format "%02.1f" [expr $total - $mm*60.]]
+ set epoch "${dd}T${hh}:${mm}:${ss}"
+ }
+ }
+
+ # query
+ set var(query) [http::formatQuery EPOCH $epoch RA $xx DEC $yy SR $rr VERB $type -mime votable -loc $var(loc) -filter=0]
+ set var(url) "http://vo.imcce.fr/webservices/skybot/skybotconesearch_query.php"
+
+ CATLoad $varname
+}
+
+proc CATSkyBotAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for SkyBot
+
+Request for Acknowledgment of Use of SkyBot
+
+If SkyBoT was helpful for your research work, the following acknowledgment
+would be appreciated: "This research has made use of IMCCE's SkyBoT VO tool",
+or cite the following article 2006ASPC..351..367B.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 10 insert top $msg
+}
diff --git a/ds9/library/catsym.tcl b/ds9/library/catsym.tcl
new file mode 100644
index 0000000..1dafc67
--- /dev/null
+++ b/ds9/library/catsym.tcl
@@ -0,0 +1,502 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CATSymDef {} {
+ global icatsym
+
+ set icatsym(minrows) 8
+ set icatsym(mincols) 8
+}
+
+proc CATSymDialog {parent} {
+ upvar #0 $parent pvar
+ global $parent
+
+ set varname $pvar(symdl)
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global icatsym
+
+ # main dialog
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set var(parent) $parent
+ set var(symdb) $pvar(symdb)
+
+ global $var(symdb)
+ set var(row) 1
+
+ # initialize
+ if {$var(row) <= [starbase_nrows $var(symdb)]} {
+ set var(condition) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) condition]]
+ set var(shape) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) shape]]
+ set var(color) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) color]]
+ set var(width) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) width]]
+ set var(dash) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) dash]]
+ set var(font) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) font]]
+ set var(font,size) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontsize]]
+ set var(font,weight) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontweight]]
+ set var(font,slant) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontslant]]
+ set var(text) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) text]]
+ set var(size) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size]]
+ set var(size2) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size2]]
+ set var(units) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) units]]
+ set var(angle) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) angle]]
+ }
+
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ Toplevel $w $mb 7 [msgcat::mc {Symbol Editor}] "CATSymDestroy $varname"
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+
+ # menu
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command "CATSymApply $varname"
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command "CATSymSave $varname"
+ $mb.file add command -label "[msgcat::mc {Load}]..." \
+ -command "CATSymLoad $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Add}] \
+ -command "CATSymAdd $varname"
+ $mb.file add command -label [msgcat::mc {Delete}] \
+ -command "CATSymRemove $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "CATSymDestroy $varname"
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.tcondition -text [msgcat::mc {If}]
+ ttk::entry $f.condition -textvariable ${varname}(condition) -width 40
+ ttk::button $f.bcondition -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog $varname condition $pvar(catdb)"
+ ttk::label $f.tthen -text [msgcat::mc {Then}]
+ ttk::label $f.tshape -text [msgcat::mc {Shape}]
+ ttk::menubutton $f.shape -textvariable ${varname}(shape) -menu $f.shape.menu
+ ttk::label $f.tcolor -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color $varname color {}
+ ttk::label $f.twidth -text [msgcat::mc {Width}]
+ WidthDashMenuButton $f.width $varname width dash {} {}
+ ttk::label $f.tfont -text [msgcat::mc {Font}]
+ FontMenuButton $f.font $varname font font,size font,weight font,slant {}
+ ttk::label $f.ttext -text [msgcat::mc {Text}]
+ ttk::entry $f.text -textvariable ${varname}(text) -width 40
+ ttk::button $f.btext -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog $varname text $pvar(catdb)"
+ ttk::label $f.tsize -text [msgcat::mc {Size/Radius}]
+ ttk::entry $f.size -textvariable ${varname}(size) -width 40
+ ttk::button $f.bsize -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog $varname size $pvar(catdb)"
+ ttk::label $f.tsize2 -text "[msgcat::mc {Size/Radius}] 2"
+ ttk::entry $f.size2 -textvariable ${varname}(size2) -width 40
+ ttk::button $f.bsize2 -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog $varname size2 $pvar(catdb)"
+ ttk::label $f.tunits -text [msgcat::mc {Units}]
+ tk_optionMenu $f.units ${varname}(units) \
+ image physical degrees arcmin arcsec
+ $f.units.menu configure
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 40
+ ttk::button $f.bangle -text [msgcat::mc {Edit}] \
+ -command "CATEditDialog $varname angle $pvar(catdb)"
+
+ menu $f.shape.menu
+ $f.shape.menu add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ${varname}(shape) -value {circle}
+ $f.shape.menu add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable ${varname}(shape) -value {ellipse}
+ $f.shape.menu add radiobutton -label [msgcat::mc {Box}] \
+ -variable ${varname}(shape) -value {box}
+ $f.shape.menu add radiobutton -label [msgcat::mc {Vector}] \
+ -variable ${varname}(shape) -value {vector}
+ $f.shape.menu add radiobutton -label [msgcat::mc {Text}] \
+ -variable ${varname}(shape) -value {text}
+ $f.shape.menu add cascade -label [msgcat::mc {Point}] \
+ -menu $f.shape.menu.point
+
+ menu $f.shape.menu.point
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ${varname}(shape) -value {circle point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Box}] \
+ -variable ${varname}(shape) -value {box point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable ${varname}(shape) -value {diamond point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Cross}] \
+ -variable ${varname}(shape) -value {cross point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {X}] \
+ -variable ${varname}(shape) -value {x point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable ${varname}(shape) -value {arrow point}
+ $f.shape.menu.point add radiobutton -label [msgcat::mc {BoxCircle}] \
+ -variable ${varname}(shape) -value {boxcircle point}
+
+ grid $f.tcondition $f.condition $f.bcondition -padx 2 -pady 2 -sticky w
+ grid $f.tthen -padx 2 -pady 2 -sticky w
+ grid $f.tshape $f.shape -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+ grid $f.twidth $f.width -padx 2 -pady 2 -sticky w
+ grid $f.tfont $f.font -padx 2 -pady 2 -sticky w
+ grid $f.ttext $f.text $f.btext -padx 2 -pady 2 -sticky w
+ grid $f.tsize $f.size $f.bsize -padx 2 -pady 2 -sticky w
+ grid $f.tsize2 $f.size2 $f.bsize2 -padx 2 -pady 2 -sticky w
+ grid $f.tunits $f.units -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.angle $f.bangle -padx 2 -pady 2 -sticky w
+
+ # Table
+ set f [ttk::frame $w.tbl]
+
+ set var(tbl) [table $f.t \
+ -state disabled \
+ -usecommand 0 \
+ -variable $var(symdb) \
+ -colorigin 1 \
+ -roworigin 0 \
+ -cols $icatsym(mincols) \
+ -rows $icatsym(minrows) \
+ -width -1 \
+ -height -1 \
+ -maxwidth 550 \
+ -maxheight 300 \
+ -titlerows 1 \
+ -xscrollcommand [list $f.xscroll set]\
+ -yscrollcommand [list $f.yscroll set]\
+ -selecttype row \
+ -selectmode single \
+ -anchor w \
+ -font [font actual TkDefaultFont] \
+ -browsecommand [list CATSymSelectCB $varname]
+ ]
+
+ ttk::scrollbar $f.yscroll -command [list $var(tbl) yview] -orient vertical
+ ttk::scrollbar $f.xscroll -command [list $var(tbl) xview] -orient horizontal
+
+ grid $var(tbl) $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command "CATSymApply $varname"
+ ttk::button $f.add -text [msgcat::mc {Add}] \
+ -command "CATSymAdd $varname"
+ ttk::button $f.remove -text [msgcat::mc {Delete}] \
+ -command "CATSymRemove $varname"
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "CATSymDestroy $varname"
+ pack $f.apply $f.add $f.remove $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sparam -orient horizontal
+ ttk::separator $w.sstatus -orient horizontal
+ pack $w.buttons $w.sstatus -side bottom -fill x
+ pack $w.param $w.sparam -side top -fill x
+ pack $w.tbl -side top -fill both -expand true
+
+ CATSymTable $varname
+
+ $var(tbl) selection set $var(row),1
+}
+
+proc CATSymDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ destroy $var(top)
+ destroy $var(mb)
+
+ unset var
+}
+
+proc CATSymApply {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+
+ if {$var(row) != {}} {
+ if {$var(row) <= [starbase_nrows $var(symdb)]} {
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) condition] $var(condition)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) shape] $var(shape)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) color] $var(color)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) width] $var(width)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) dash] $var(dash)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) font] $var(font)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontsize] $var(font,size)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontweight] $var(font,weight)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontslant] $var(font,slant)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) text] $var(text)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size] $var(size)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size2] $var(size2)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) units] $var(units)
+ starbase_set $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) angle] $var(angle)
+ }
+ }
+
+ CATSymUpdate $varname
+}
+
+proc CATSymAdd {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+ global pcat
+
+ set row [expr [starbase_nrows $var(symdb)]+1]
+ starbase_rowins $var(symdb) $row
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) shape] $pcat(sym,shape)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) color] $pcat(sym,color)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) width] $pcat(sym,width)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) dash] $pcat(sym,dash)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) font] $pcat(sym,font)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) fontsize] $pcat(sym,font,size)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) fontweight] $pcat(sym,font,weight)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) fontslant] $pcat(sym,font,slant)
+ starbase_set $var(symdb) $row \
+ [starbase_colnum $var(symdb) units] $pcat(sym,units)
+
+ $var(tbl) selection clear all
+ $var(tbl) selection set $row,1
+ $var(tbl) see $row,1
+
+ CATSymSelectCB $varname
+ CATSymTable $varname
+}
+
+proc CATSymRemove {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+
+ set ss "[$var(tbl) curselection]"
+ set var(row) [string trim [lindex [split $ss ,] 0]]
+ if {$var(row) != {}} {
+ set nr [starbase_nrows $var(symdb)]
+ if {$nr > 1 && $var(row) <= $nr} {
+ starbase_rowdel $var(symdb) $var(row)
+ set var(row) {}
+ }
+ }
+
+ CATSymClear $varname
+ CATSymTable $varname
+}
+
+proc CATSymSave {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+
+ set fn [SaveFileDialog catsymfbox]
+ if {$fn != {}} {
+ starbase_write $var(symdb) $fn
+ }
+}
+
+proc CATSymLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+
+ set fn [OpenFileDialog catsymfbox]
+ if {$fn != {}} {
+ if {[file exists $fn]} {
+ if {[info exists $var(symdb)]} {
+ unset $var(symdb)
+ }
+ starbase_read $var(symdb) $fn
+ CATSymUpdate $varname
+ } else {
+ Error "[msgcat::mc {Unable to open file}] $fn"
+ return
+ }
+ }
+}
+
+proc CATSymClear {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(tbl) selection clear all
+
+ set var(row) {}
+
+ set var(condition) {}
+ set var(shape) {}
+ set var(color) {}
+ set var(width) {}
+ set var(dash) {}
+ set var(font) {}
+ set var(font,size) {}
+ set var(font,weight) {}
+ set var(font,slant) {}
+ set var(text) {}
+ set var(size) {}
+ set var(size2) {}
+ set var(units) {}
+ set var(angle) {}
+}
+
+# Support
+
+proc CATSymDBInit {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+ global pcat
+
+ if {[info exists $var(symdb)]} {
+ unset $var(symdb)
+ }
+
+ starbase_new $var(symdb) condition shape color width dash \
+ font fontsize fontweight fontslant text size size2 units angle
+ starbase_rowins $var(symdb) 1
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) shape] $pcat(sym,shape)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) color] $pcat(sym,color)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) width] $pcat(sym,width)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) dash] $pcat(sym,dash)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) font] $pcat(sym,font)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) fontsize] $pcat(sym,font,size)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) fontweight] $pcat(sym,font,weight)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) fontslant] $pcat(sym,font,slant)
+ starbase_set $var(symdb) 1 \
+ [starbase_colnum $var(symdb) units] $pcat(sym,units)
+}
+
+proc CATSymUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ CATGenerate $var(parent)
+}
+
+proc CATSymTable {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+ global icatsym
+
+ set nc [starbase_ncols $var(symdb)]
+ if { $nc > $icatsym(mincols)} {
+ $var(tbl) configure -cols $nc
+ } else {
+ $var(tbl) configure -cols $icatsym(mincols)
+ }
+
+ # add header row
+ set nr [expr [starbase_nrows $var(symdb)]+1]
+ if {$nr > $icatsym(minrows)} {
+ $var(tbl) configure -rows $nr
+ } else {
+ $var(tbl) configure -rows $icatsym(minrows)
+ }
+}
+
+proc CATSymSelectCB {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(symdb)
+
+ set ss "[$var(tbl) curselection]"
+ set var(row) [string trim [lindex [split $ss ,] 0]]
+ if {$var(row) != {}} {
+ if {$var(row) <= [starbase_nrows $var(symdb)]} {
+ set var(condition) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) condition]]
+ set var(shape) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) shape]]
+ set var(color) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) color]]
+ set var(width) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) width]]
+ set var(dash) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) dash]]
+ set var(font) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) font]]
+ set var(font,size) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontsize]]
+ set var(font,weight) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontweight]]
+ set var(font,slant) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) fontslant]]
+ set var(text) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) text]]
+ set var(size) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size]]
+ set var(size2) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) size2]]
+ set var(units) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) units]]
+ set var(angle) [starbase_get $var(symdb) $var(row) \
+ [starbase_colnum $var(symdb) angle]]
+ return
+ }
+ }
+
+ CATSymClear $varname
+}
diff --git a/ds9/library/catvot.tcl b/ds9/library/catvot.tcl
new file mode 100644
index 0000000..ad040ef
--- /dev/null
+++ b/ds9/library/catvot.tcl
@@ -0,0 +1,70 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# SAMP
+
+proc CATVOTURL {url catalog title} {
+ if {[string length $url] == 0} {
+ return
+ }
+
+ ParseURL $url r
+ switch -- $r(scheme) {
+ ftp {CATVOTFTP $r(authority) $r(path)}
+ file {CATVOTFile $r(path)}
+ http -
+ default {CATVOTHTTP $url $catalog $title}
+ }
+}
+
+proc CATVOTFTP {host path} {
+ global loadParam
+ global ds9
+ global debug
+
+ set ftp [ftp::Open $host "ftp" "-ds9@" -mode passive]
+ if {$ftp > -1} {
+ set fn [tmpnam [file extension $path]]
+ set ftp::VERBOSE $debug(tcl,ftp)
+ set "ftp::ftp${ftp}(Output)" FTPLog
+ ftp::Type $ftp binary
+ if {[ftp::Get $ftp $path $fn]} {
+ CATVOTFile $fn
+ }
+
+ ftp::Close $ftp
+
+ if {[file exists $fn]} {
+ catch {file delete -force $fn}
+ }
+ }
+}
+
+proc CATVOTHTTP {url catalog title} {
+ global icat
+
+ CATDialog catvot {} $catalog $title none
+
+ set varname [lindex $icat(cats) end]
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}(query) {}
+ set ${varname}(url) $url
+ set ${varname}(proc,parser) VOTParse
+
+ CATLoad $varname
+}
+
+proc CATVOTFile {fn} {
+ global icat
+
+ CATDialog catvot {} {} {} none
+ if {$fn != {}} {
+ CATLoadFn [lindex $icat(cats) end] $fn VOTRead
+ }
+}
+
diff --git a/ds9/library/centroid.tcl b/ds9/library/centroid.tcl
new file mode 100644
index 0000000..254ae83
--- /dev/null
+++ b/ds9/library/centroid.tcl
@@ -0,0 +1,115 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CentroidDef {} {
+ global centroid
+ global icentroid
+
+ set icentroid(top) .centroid
+ set icentroid(mb) .centroidmb
+}
+
+proc CentroidDialog {} {
+ global centroid
+ global icentroid
+ global ds9
+
+ # see if we already have a window visible
+
+ if {[winfo exists $icentroid(top)]} {
+ raise $icentroid(top)
+ return
+ }
+
+ # create the window
+ set w $icentroid(top)
+ set mb $icentroid(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Centroid Parameters}] CentroidDestroyDialog
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command CentroidApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command CentroidDestroyDialog
+
+ EditMenu $mb icentroid
+
+ UpdateCentroidDialog
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ slider $f.islider 1 100 [msgcat::mc {Iteration}] \
+ marker(centroid,iteration) [list CentroidApplyDialog]
+ slider $f.rslider 0 50 [msgcat::mc {Radius}] \
+ marker(centroid,radius) [list CentroidApplyDialog]
+
+ grid $f.islider -padx 2 -pady 2 -sticky ew
+ grid $f.rslider -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command CentroidApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command CentroidDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+}
+
+proc CentroidDestroyDialog {} {
+ global icentroid
+
+ if {[winfo exists $icentroid(top)]} {
+ destroy $icentroid(top)
+ destroy $icentroid(mb)
+ }
+}
+
+proc CentroidApplyDialog {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker centroid radius $marker(centroid,radius)
+ $current(frame) marker centroid iteration $marker(centroid,iteration)
+ }
+}
+
+proc UpdateCentroidDialog {} {
+ global centroid
+ global icentroid
+ global current
+ global marker
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCentroidDialog"
+ }
+
+ if {[winfo exists $icentroid(top)]} {
+ if {$current(frame) != {}} {
+ set marker(centroid,radius) \
+ [$current(frame) get marker centroid radius]
+ set marker(centroid,iteration) \
+ [$current(frame) get marker centroid iteration]
+ }
+ }
+}
+
+proc CentroidBackup {ch which} {
+ puts $ch "$which marker centroid radius [$which get marker centroid radius]"
+ puts $ch "$which marker centroid iteration [$which get marker centroid iteration]"
+}
diff --git a/ds9/library/circle.tcl b/ds9/library/circle.tcl
new file mode 100644
index 0000000..209af01
--- /dev/null
+++ b/ds9/library/circle.tcl
@@ -0,0 +1,108 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CircleDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ # procs
+ set var(proc,apply) CircleApply
+ set var(proc,close) CircleClose
+ set var(proc,coordCB) CircleCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisHistogramDialog $varname
+ MarkerAnalysisPlot3dDialog $varname
+
+ # init
+ CircleEditCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback edit CircleEditCB $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.tradius -text [msgcat::mc {Radius}]
+ ttk::entry $f.radius -textvariable ${varname}(radius) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list CircleEditCB $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+
+ grid $f.tradius $f.radius $f.uradius -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc CircleClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback edit CircleEditCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc CircleApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) circle radius $var(radius) \
+ $var(dcoord) $var(dformat)
+
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc CircleCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "CircleCoordCB"
+ }
+
+ MarkerAnalysisStatsSystem $varname
+ MarkerAnalysisPlot3dSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+}
+
+proc CircleEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "CircleEditCB"
+ }
+
+ set var(radius) [$var(frame) get marker $var(id) circle radius \
+ $var(dcoord) $var(dformat)]
+}
diff --git a/ds9/library/colorbar.tcl b/ds9/library/colorbar.tcl
new file mode 100644
index 0000000..c7c3602
--- /dev/null
+++ b/ds9/library/colorbar.tcl
@@ -0,0 +1,1449 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ColorbarDef {} {
+ global colorbar
+ global icolorbar
+ global pcolorbar
+
+ global ds9
+
+ set icolorbar(top) .clrbar
+ set icolorbar(mb) .clrbarmb
+
+ set icolorbar(vertical,width) 75
+ set icolorbar(horizontal,height) 45
+ set icolorbar(num) 1024
+ set icolorbar(start) $ds9(menu,start)
+ set icolorbar(end) 0
+ set icolorbar(count) 0
+
+ set icolorbar(h5) 0
+ set icolorbar(h5,fn) [list h5_autumn.sao h5_bluered.sao h5_bone.sao h5_cool.sao h5_copper.sao h5_dkbluered.sao h5_gray.sao h5_green.sao h5_hot.sao h5_hsv.sao h5_jet.sao h5_pink.sao h5_spring.sao h5_summer.sao h5_winter.sao h5_yarg.sao h5_yellow.sao
+]
+
+ set icolorbar(matplotlib) 0
+ set icolorbar(matplotlib,fn) [list viridis.lut]
+
+ set icolorbar(cubehelix) 0
+ set icolorbar(cubehelix,fn) [list ch05m151008.sao ch05m151010.sao ch05m151012.sao ch05m151410.sao ch05p151010.sao ch20m151010.sao - cubehelix0.sao cubehelix1.sao]
+
+ set icolorbar(gist) 0
+ set icolorbar(gist,fn) [list gist_earth.sao gist_heat.sao gist_rainbow.sao gist_yarg.sao gist_gray.sao gist_ncar.sao gist_stern.sao]
+
+ set icolorbar(topo) 0
+ set icolorbar(topo,fn) [list tpglarf.sao tpglhcf.sao tpglhwf.sao tpglpof.sao tpglarm.sao tpglhcm.sao tpglhwm.sao tpglpom.sao]
+
+ set icolorbar(user) 0
+ set icolorbar(user,fn) {}
+
+ set colorbar(lock) 0
+ set colorbar(size) 20
+ set colorbar(ticks) 11
+ set colorbar(map) grey
+ set colorbar(invert) 0
+ set colorbar(numerics) 1
+ set colorbar(space) 0
+ set colorbar(orientation) horizontal
+ set colorbar(tag) red
+ set colorbar(font) helvetica
+ set colorbar(font,size) 9
+ set colorbar(font,weight) normal
+ set colorbar(font,slant) roman
+
+ array set pcolorbar [array get colorbar]
+}
+
+proc CreateColorbar {} {
+ global icolorbar
+
+ global ds9
+ global canvas
+ global view
+
+ $ds9(canvas) create colorbar$ds9(visual)$ds9(depth) \
+ -colors 2048 \
+ -tag colorbar \
+ -anchor nw \
+ -helvetica $ds9(helvetica) \
+ -courier $ds9(courier) \
+ -times $ds9(times)
+
+ $ds9(canvas) bind colorbar <Motion> [list ColorbarMotion %x %y]
+ $ds9(canvas) bind colorbar <Enter> [list ColorbarEnter %x %y]
+ $ds9(canvas) bind colorbar <Leave> [list ColorbarLeave]
+
+ $ds9(canvas) bind colorbar <Button-1> [list ColorbarButton1 %x %y]
+ $ds9(canvas) bind colorbar <B1-Motion> [list ColorbarMotion1 %x %y]
+ $ds9(canvas) bind colorbar <ButtonRelease-1> [list ColorbarRelease1 %x %y]
+ $ds9(canvas) bind colorbar <Double-1> [list ColorbarDouble1 %x %y]
+ $ds9(canvas) bind colorbar <Double-ButtonRelease-1> \
+ [list ColorbarDoubleRelease1 %x %y]
+
+ $ds9(canvas) bind colorbar <Key> [list ColorbarKey %K %A %x %y]
+ $ds9(canvas) bind colorbar <KeyRelease> \
+ [list ColorbarKeyRelease %K %A %x %y]
+
+ $ds9(canvas) create colorbarrgb$ds9(visual)$ds9(depth) \
+ -colors 2048 \
+ -tag colorbarrgb \
+ -anchor nw \
+ -helvetica $ds9(helvetica) \
+ -courier $ds9(courier) \
+ -times $ds9(times)
+
+ $ds9(canvas) bind colorbarrgb <Motion> [list ColorbarMotion %x %y]
+ $ds9(canvas) bind colorbarrgb <Enter> [list ColorbarEnter %x %y]
+ $ds9(canvas) bind colorbarrgb <Leave> [list ColorbarLeave]
+
+ LayoutColorbar
+}
+
+proc InitColorbar {} {
+ global colorbar
+
+ global current
+
+ set current(colorbar) colorbar
+
+ $current(colorbar) map "{$colorbar(map)}"
+ $current(colorbar) invert $colorbar(invert)
+}
+
+proc ResetColormap {} {
+ global colorbar
+
+ global current
+ global rgb
+
+ $current(colorbar) reset
+ if {$current(frame) != {} } {
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap [$current(colorbar) get colormap]]
+ set colorbar(invert) [$current(colorbar) get invert]
+ }
+ LockColorCurrent
+ UpdateColorDialog
+}
+
+proc LoadColormap {} {
+ LoadColormapFile [OpenFileDialog colorbarfbox]
+}
+
+# used by backup
+proc LoadColormapFile {filename} {
+ global colorbar
+ global icolorbar
+
+ global current
+ global ds9
+
+ if {$filename != {}} {
+ colorbar load "\{$filename\}"
+ set id [colorbar get id]
+ set colorbar(map) [colorbar get name]
+
+ $ds9(mb).color.user add radiobutton \
+ -label "$colorbar(map)" \
+ -variable colorbar(map) \
+ -command [list ChangeColormapID $id]
+
+ if {[winfo exists $icolorbar(top)]} {
+ $icolorbar(mb).colormap.user add radiobutton \
+ -label "$colorbar(map)" \
+ -variable colorbar(map) \
+ -command [list ChangeColormapID $id]
+ }
+ incr icolorbar(count)
+
+ ChangeColormapID $id
+ }
+}
+
+proc SaveColormap {} {
+ FileLast colorbarfbox [colorbar get file name]
+ SaveColormapFile [SaveFileDialog colorbarfbox]
+}
+
+proc SaveColormapFile {filename} {
+ if {$filename != {}} {
+ colorbar save "\{$filename\}"
+ }
+}
+
+proc LoadContrastBias {} {
+ global dcolorbar
+
+ set filename [OpenFileDialog contrastbiasfbox]
+ if {$filename != {}} {
+ if {![catch {set ch [open $filename r]}]} {
+ set ll [gets $ch]
+ close $ch
+ set dcolorbar(contrast) [lindex $ll 0]
+ set dcolorbar(bias) [lindex $ll 1]
+ ApplyColormap
+ }
+ }
+}
+
+proc SaveContrastBias {} {
+ global dcolorbar
+
+ set filename [SaveFileDialog contrastbiasfbox]
+ if {$filename != {}} {
+ if {![catch {set ch [open $filename w]}]} {
+ puts $ch "$dcolorbar(contrast) $dcolorbar(bias)"
+ close $ch
+ }
+ }
+}
+
+proc ColorbarEnter {x y} {
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarEnter"
+ }
+
+ # check to see if this event was generated while processing other events
+ if {$ds9(b1) || $ds9(sb1) || $ds9(cb1) ||
+ $ds9(csb1) || $ds9(b2) || $ds9(b3)} {
+ return
+ }
+
+ $ds9(canvas) focus $current(colorbar)
+
+ switch -- $current(colorbar) {
+ colorbar {UpdateFrameInfoBox base}
+ colorbarrgb {UpdateFrameInfoBox rgb}
+ }
+}
+
+proc ColorbarLeave {} {
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarLeave"
+ }
+
+ # check to see if this event was generated while processing other events
+ if {$ds9(b1) || $ds9(sb1) || $ds9(cb1) ||
+ $ds9(csb1) || $ds9(b2) || $ds9(b3)} {
+ return
+ }
+
+ $ds9(canvas) focus {}
+ ClearInfoBoxCoords
+}
+
+proc ColorbarMotion {x y} {
+ global current
+ global infobox
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarMotion $x $y"
+ }
+
+ switch -- $current(colorbar) {
+ colorbar {
+ set infobox(value) [$current(colorbar) get value $x $y]
+ }
+ colorbarrgb {
+ set vv [$current(colorbar) get value $x $y]
+ switch -- $current(rgb) {
+ red {set infobox(value,red) $vv}
+ green {set infobox(value,green) $vv}
+ blue {set infobox(value,blue) $vv}
+ }
+ }
+ }
+}
+
+proc ColorbarKey {K A xx yy} {
+ global current
+ global ds9
+
+ # MacOSX and Ubuntu returns bogus values in xx,yy
+ # calculate our own values
+ set xx [expr {[winfo pointerx $ds9(canvas)] - [winfo rootx $ds9(canvas)]}]
+ set yy [expr {[winfo pointery $ds9(canvas)] - [winfo rooty $ds9(canvas)]}]
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarKey $K $A $xx $yy"
+ }
+
+ switch -- $current(mode) {
+ colorbar {
+ switch -- $K {
+ Delete -
+ BackSpace {
+ $current(colorbar) tag delete $xx $yy
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ }
+ }
+ }
+ }
+}
+
+proc ColorbarKeyRelease {K A xx yy} {
+ global current
+ global ds9
+
+ # MacOSX and Ubuntu returns bogus values in xx,yy
+ # calculate our own values
+ set xx [expr {[winfo pointerx $ds9(canvas)] - [winfo rootx $ds9(canvas)]}]
+ set yy [expr {[winfo pointery $ds9(canvas)] - [winfo rooty $ds9(canvas)]}]
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarKeyRelease $K $A $xx $yy"
+ }
+}
+
+proc ColorbarButton1 {x y} {
+ global icolorbar
+ global colorbar
+ global ds9
+ global current
+ global icursor
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarButton1"
+ }
+
+ # let others know that the mouse is down
+ set ds9(b1) 1
+
+ # turn off blinking cursor
+ if {$icursor(timer)} {
+ catch {after cancel $icursor(id)}
+ set icursor(id) 0
+ }
+
+ # are we on a tag? else create
+ switch -- $current(mode) {
+ colorbar {$current(colorbar) tag edit begin $x $y $colorbar(tag)}
+ }
+}
+
+proc ColorbarMotion1 {x y} {
+ global icolorbar
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarMotion1"
+ }
+
+ # abort if we are here by accident (such as a double click)
+ if {($ds9(b1) == 0) && ($ds9(sb1) == 0) &&
+ ($ds9(cb1) == 0) && ($ds9(csb1) == 0)} {
+ return
+ }
+
+ switch -- $current(mode) {
+ colorbar {
+ $current(colorbar) tag edit motion $x $y
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ }
+ }
+}
+
+proc ColorbarRelease1 {x y} {
+ global icolorbar
+ global current
+ global icursor
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarRelease1"
+ }
+
+ # abort if we are here by accident (such as a double click)
+ if {($ds9(b1) == 0) && ($ds9(sb1) == 0) &&
+ ($ds9(cb1) == 0) && ($ds9(csb1) == 0)} {
+ return
+ }
+
+ # and turn on blinking cursor if needed
+ if {$icursor(timer)} {
+ CursorTimer
+ }
+
+ switch -- $current(mode) {
+ colorbar {
+ $current(colorbar) tag edit end $x $y
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ }
+ }
+
+ # let others know that the mouse is up
+ set ds9(b1) 0
+ set ds9(sb1) 0
+ set ds9(cb1) 0
+ set ds9(csb1) 0
+}
+
+proc ColorbarDouble1 {x y} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarDouble1"
+ }
+
+ switch -- $current(mode) {
+ colorbar {ColorTagDialog $x $y}
+ }
+}
+
+proc ColorbarDoubleRelease1 {x y} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ColorbarDoubleRelease1"
+ }
+}
+
+proc ColorbarButton3 {x y} {
+ global icolorbar
+
+ global current
+ global rgb
+ global icursor
+
+ # turn off blinking cursor
+ if {$icursor(timer)} {
+ catch {after cancel $icursor(id)}
+ set icursor(id) 0
+ }
+
+ if {$current(frame) != {}} {
+ # we need to hold the current frame, since we may be blinking
+ set icolorbar(frame) $current(frame)
+ $icolorbar(frame) colormap begin
+ }
+}
+
+proc ColorbarMotion3 {x y} {
+ global icolorbar
+
+ global current
+ global canvas
+
+ # X sets bias
+ set bias [expr double($x)/$canvas(width)]
+
+ # Y sets contrast
+ set contrast [expr double($y)/$canvas(height) * 10]
+
+ RGBEvalLockColorbar [list $current(colorbar) adjust $contrast $bias]
+ if {$icolorbar(frame) != {}} {
+ # only update the current colorbar frame
+ $icolorbar(frame) colormap motion [$current(colorbar) get colormap]
+ }
+ UpdateColorDialog
+}
+
+proc ColorbarRelease3 {x y} {
+ global icolorbar
+
+ global current
+ global rgb
+ global icursor
+
+ # and turn on blinking cursor if needed
+ if {$icursor(timer)} {
+ CursorTimer
+ }
+
+ # only update the current colorbar frame
+ if {$icolorbar(frame) != {}} {
+ $icolorbar(frame) colormap end
+ set icolorbar(frame) {}
+ }
+ LockColorCurrent
+ UpdateColorDialog
+}
+
+proc ChangeColormapID {id} {
+ global colorbar
+
+ global current
+
+ colorbar map $id
+ if {$current(frame) != {} } {
+ $current(frame) colormap [colorbar get colormap]
+ set colorbar(map) [colorbar get name]
+ set colorbar(invert) [colorbar get invert]
+ }
+ LockColorCurrent
+ UpdateColorDialog
+}
+
+proc MatchColorCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchColor $current(frame)
+ }
+}
+
+proc MatchColor {which} {
+ global ds9
+ global current
+ global colorbar
+
+ set tt [$which get type]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ switch -- [$ff get type] {
+ base -
+ 3d {
+ if {$tt != {rgb}} {
+ $ff colormap [colorbar get colormap]
+ }
+ }
+ rgb {
+ if {$tt == {rgb}} {
+ $ff colormap [colorbarrgb get colormap]
+ }
+ }
+ }
+ }
+ }
+}
+
+proc LockColorCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockColor $current(frame)
+ }
+}
+
+proc LockColor {which} {
+ global colorbar
+
+ if {$colorbar(lock)} {
+ MatchColor $which
+ }
+}
+
+proc InvertColorbar {} {
+ global colorbar
+
+ global current
+
+ $current(colorbar) invert $colorbar(invert)
+ if {$current(frame) != {} } {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ LockColorCurrent
+ UpdateColorDialog
+}
+
+proc UpdateColormapLevel {} {
+ global icolorbar
+
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateColormapLevel"
+ }
+
+ if {$current(frame) != {}} {
+ $current(colorbar) colormap level \
+ [$current(frame) get colormap level $icolorbar(num)]
+ } else {
+ $current(colorbar) colormap level
+ }
+}
+
+proc UpdateColormapLevelMosaic {which x y sys} {
+ global icolorbar
+
+ global current
+ global current
+ global scale
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateColormapLevelMosaic"
+ }
+
+ if {$current(frame) == {}} {
+ $current(colorbar) colormap level
+ return
+ }
+
+ if {($current(frame) == $which) &&
+ ($scale(scope) == "local") &&
+ [$which has fits mosaic]} {
+
+ set ext [$which get fits ext $sys $x $y]
+
+ if {$current(ext) != $ext} {
+ $current(colorbar) colormap level \
+ [$current(frame) get colormap level $icolorbar(num) $sys $x $y]
+ }
+
+ set current(ext) $ext
+ } else {
+ set current(ext) {}
+ }
+}
+
+proc ColorFrameBackup {ch which} {
+ puts $ch "$which colorbar tag \"\{[$which get colorbar tag]\}\""
+ puts $ch "colorbar tag \"\{[$which get colorbar tag]\}\""
+}
+
+proc ColorbarSizeDialog {} {
+ global colorbar
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ if {[EntryDialog [msgcat::mc {Colorbar}] [msgcat::mc {Size}] 10 colorbar(size)]} {
+ UpdateView
+ }
+ }
+ aqua {
+ # we have a race condition here. the main window needs focus
+ # back from the dialog before UpdateView is run, otherwise,
+ # our pretty blue buttons are not activated
+ if {[EntryDialog [msgcat::mc {Colorbar}] [msgcat::mc {Size}] 10 colorbar(size)]} {
+ after 100 UpdateView
+ }
+ }
+ }
+}
+
+proc TicksDialog {} {
+ global colorbar
+
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ if {[EntryDialog [msgcat::mc {Colorbar}] [msgcat::mc {Number of Ticks}] 10 colorbar(ticks)]} {
+ UpdateView
+ }
+ }
+ aqua {
+ # we have a race condition here. the main window needs focus
+ # back from the dialog before UpdateView is run, otherwise,
+ # our pretty blue buttons are not activated
+ if {[EntryDialog [msgcat::mc {Colorbar}] [msgcat::mc {Number of Ticks}] 10 colorbar(ticks)]} {
+ after 100 UpdateView
+ }
+ }
+ }
+}
+
+proc OpenColorTag {} {
+ LoadColorTag [OpenFileDialog colortagfbox]
+}
+
+proc LoadColorTag {fn} {
+ global current
+
+ if {$fn != {}} {
+ $current(colorbar) tag load "\{$fn\}"
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ }
+}
+
+proc SaveColorTag {} {
+ global current
+
+ set fn [SaveFileDialog colortagfbox]
+ if {$fn != {}} {
+ $current(colorbar) tag save "\{$fn\}"
+ }
+}
+
+proc DeleteColorTag {} {
+ global current
+
+ $current(colorbar) tag delete
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+}
+
+proc ColorTagDialog {x y} {
+ global ds9
+ global current
+ global colorbar
+ global ed2
+
+ set w {.ctagd}
+
+ set rr [$current(colorbar) get tag $x $y]
+
+ set ed2(ok) 0
+ set ed2(id) [lindex $rr 0]
+ set ed2(start) [lindex $rr 1]
+ set ed2(stop) [lindex $rr 2]
+ set ed2(color) [lindex $rr 3]
+
+ DialogCreate $w [msgcat::mc {Color}] ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.tstart -text [msgcat::mc {Start}]
+ ttk::entry $f.start -textvariable ed2(start) -width 10
+ ttk::label $f.tstop -text [msgcat::mc {Stop}]
+ ttk::entry $f.stop -textvariable ed2(stop) -width 10
+ ttk::label $f.tcolor -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color ed2 color {}
+
+ grid $f.tstart $f.start -padx 2 -pady 2 -sticky w
+ grid $f.tstop $f.stop -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ $current(colorbar) tag $ed2(id) $ed2(start) $ed2(stop) $ed2(color)
+ if {$current(frame) != {}} {
+ $current(frame) colormap [$current(colorbar) get colormap]
+ }
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc ColormapDialog {} {
+ global colorbar
+ global icolorbar
+ global dcolorbar
+
+ global ds9
+
+ # see if we already have a window visible
+
+ if {[winfo exists $icolorbar(top)]} {
+ raise $icolorbar(top)
+ return
+ }
+
+ # create the window
+ set w $icolorbar(top)
+ set mb $icolorbar(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Colormap Parameters}] ColormapDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Colormap}] -menu $mb.colormap
+ $mb add cascade -label [msgcat::mc {Color}] -menu $mb.color
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command ApplyColormap
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Colormap}]..." \
+ -command LoadColormap
+ $mb.file add command -label "[msgcat::mc {Save Colormap}]..." \
+ -command SaveColormap
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Download Colormap}]..." \
+ -command {HV cpt CPT-CITY http://soliton.vm.bytemark.co.uk/pub/cpt-city}
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Contrast/Bias}]..."\
+ -command LoadContrastBias
+ $mb.file add command -label "[msgcat::mc {Save Contrast/Bias}]..." \
+ -command SaveContrastBias
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Color Tags}]..."\
+ -command OpenColorTag
+ $mb.file add command -label "[msgcat::mc {Save Color Tags}]..." \
+ -command SaveColorTag
+ $mb.file add command -label "[msgcat::mc {Delete Color Tags}]..." \
+ -command DeleteColorTag
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command ColormapDestroyDialog
+
+ EditMenu $mb icolorbar
+
+ ColorMenu $mb.color colorbar tag {}
+
+ menu $mb.colormap
+ menu $mb.colormap.h5
+ menu $mb.colormap.matplotlib
+ menu $mb.colormap.cubehelix
+ menu $mb.colormap.gist
+ menu $mb.colormap.topo
+ menu $mb.colormap.user
+
+ set id [colorbar list id]
+
+ ColormapCreateMenu id $mb.colormap \
+ 0 $icolorbar(end)
+ ColormapCreateMenu id $mb.colormap.h5 \
+ $icolorbar(h5) $icolorbar(matplotlib)
+ ColormapCreateMenu id $mb.colormap.matplotlib \
+ $icolorbar(matplotlib) $icolorbar(cubehelix)
+ ColormapCreateMenu id $mb.colormap.cubehelix \
+ $icolorbar(cubehelix) $icolorbar(gist)
+ ColormapCreateMenu id $mb.colormap.gist \
+ $icolorbar(gist) $icolorbar(topo)
+ ColormapCreateMenu id $mb.colormap.topo \
+ $icolorbar(topo) $icolorbar(user)
+ ColormapCreateMenu id $mb.colormap.user \
+ $icolorbar(user) $icolorbar(count)
+
+ $mb.colormap add separator
+ $mb.colormap add cascade -label [msgcat::mc {h5utils}] \
+ -menu $mb.colormap.h5
+ $mb.colormap add cascade -label [msgcat::mc {Matplotlib}] \
+ -menu $mb.colormap.matplotlib
+ $mb.colormap add cascade -label [msgcat::mc {Cubehelix}] \
+ -menu $mb.colormap.cubehelix
+ $mb.colormap add cascade -label [msgcat::mc {Gist}] \
+ -menu $mb.colormap.gist
+ $mb.colormap add cascade -label [msgcat::mc {Topographic}] \
+ -menu $mb.colormap.topo
+ $mb.colormap add cascade -label [msgcat::mc {User}] \
+ -menu $mb.colormap.user
+ $mb.colormap add separator
+ $mb.colormap add checkbutton \
+ -label [msgcat::mc {Invert Colormap}] \
+ -variable colorbar(invert) -command InvertColorbar
+ $mb.colormap add command -label [msgcat::mc {Reset Colormap}] \
+ -command ResetColormap
+
+ UpdateColorDialog
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ slider $f.cslider 0. 10. [msgcat::mc {Contrast}] \
+ dcolorbar(contrast) [list AdjustColormap]
+ slider $f.bslider 0. 1. [msgcat::mc {Bias}] \
+ dcolorbar(bias) [list AdjustColormap]
+
+ grid $f.cslider -padx 2 -pady 2 -sticky ew
+ grid $f.bslider -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ bind $f.cslider.slider <Button-1> BeginAdjustColormap
+ bind $f.cslider.slider <ButtonRelease-1> EndAdjustColormap
+ bind $f.bslider.slider <Button-1> BeginAdjustColormap
+ bind $f.bslider.slider <ButtonRelease-1> EndAdjustColormap
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command ApplyColormap
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command ColormapDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+}
+
+proc ColormapCreateMenu {varname which start stop} {
+ upvar $varname var
+
+ for {set ii $start} {$ii<$stop} {incr ii} {
+ set jj [lindex $var $ii]
+ set name [colorbar get name $jj]
+ $which add radiobutton \
+ -label [msgcat::mc $name] \
+ -variable colorbar(map) -value $name \
+ -command "ChangeColormapID $jj"
+ }
+}
+
+proc ColormapDestroyDialog {} {
+ global icolorbar
+ global dcolorbar
+
+ if {[winfo exists $icolorbar(top)]} {
+ destroy $icolorbar(top)
+ destroy $icolorbar(mb)
+ }
+
+ unset dcolorbar
+}
+
+proc ApplyColormap {} {
+ global dcolorbar
+
+ global current
+ global rgb
+
+ RGBEvalLockColorbar [list $current(colorbar) adjust $dcolorbar(contrast) $dcolorbar(bias)]
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap [$current(colorbar) get colormap]]
+ LockColorCurrent
+ }
+}
+
+proc BeginAdjustColormap {} {
+ global icolorbar
+
+ global current
+ global rgb
+
+ set icolorbar(adjustok) 1
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap begin]
+ }
+}
+
+proc AdjustColormap {} {
+ global icolorbar
+ global dcolorbar
+
+ global current
+ global rgb
+
+ if {[info exists icolorbar(adjustok)]} {
+ RGBEvalLockColorbar [list $current(colorbar) adjust $dcolorbar(contrast) $dcolorbar(bias)]
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap motion [$current(colorbar) get colormap]]
+ }
+ }
+}
+
+proc EndAdjustColormap {} {
+ global icolorbar
+
+ global current
+ global rgb
+
+ if {[info exists icolorbar(adjustok)]} {
+ unset icolorbar(adjustok)
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap end]
+ LockColorCurrent
+ }
+ }
+}
+
+proc UpdateColorDialog {} {
+ global icolorbar
+ global dcolorbar
+
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateColorDialog"
+ }
+
+ if {[winfo exists $icolorbar(top)]} {
+ set dcolorbar(contrast) [$current(colorbar) get contrast]
+ set dcolorbar(bias) [$current(colorbar) get bias]
+ set end [expr $icolorbar(end)+$icolorbar(start)]
+
+ if {$current(frame) != {}} {
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Load Colormap}]..." -state normal
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Save Colormap}]..." -state normal
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $icolorbar(mb).colormap entryconfig $ii -state normal
+ }
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {h5utils}] -state normal
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Matplotlib}] -state normal
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Cubehelix}] -state normal
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Gist}] -state normal
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Topographic}] -state normal
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {User}] -state normal
+ }
+ rgb {
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Load Colormap}]..." -state disabled
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Save Colormap}]..." -state disabled
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $icolorbar(mb).colormap entryconfig $ii -state disabled
+ }
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {h5utils}] -state disabled
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Matplotlib}] -state disabled
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Cubehelix}] -state disabled
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Gist}] -state disabled
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {Topographic}] -state disabled
+ $icolorbar(mb).colormap entryconfig \
+ [msgcat::mc {User}] -state disabled
+ }
+ }
+ } else {
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Load Colormap}]..." -state normal
+ $icolorbar(mb).file entryconfig \
+ "[msgcat::mc {Save Colormap}]..." -state normal
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $icolorbar(mb).colormap entryconfig $ii -state normal
+ }
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {h5utils}] \
+ -state normal
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {Matplotlib}] \
+ -state normal
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {Cubehelix}] \
+ -state normal
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {Gist}] \
+ -state normal
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {Topographic}] \
+ -state normal
+ $icolorbar(mb).colormap entryconfig [msgcat::mc {User}] \
+ -state normal
+ }
+ }
+}
+
+proc LayoutColorbar {} {
+ global colorbar
+ global icolorbar
+
+ global ds9
+ global canvas
+
+ colorbar configure \
+ -size $colorbar(size) \
+ -ticks $colorbar(ticks) \
+ -numerics $colorbar(numerics) \
+ -space $colorbar(space) \
+ -font $colorbar(font) \
+ -fontsize $colorbar(font,size) \
+ -fontweight $colorbar(font,weight) \
+ -fontslant $colorbar(font,slant) \
+
+ colorbarrgb configure \
+ -size $colorbar(size) \
+ -ticks $colorbar(ticks) \
+ -numerics $colorbar(numerics) \
+ -space $colorbar(space) \
+ -font $colorbar(font) \
+ -fontsize $colorbar(font,size) \
+ -fontweight $colorbar(font,weight) \
+ -fontslant $colorbar(font,slant) \
+
+ switch -- $colorbar(orientation) {
+ horizontal {
+ set xx 0
+ set yy [expr $canvas(height) + $canvas(gap)]
+
+ colorbar configure -x $xx -y $yy \
+ -width $canvas(width) \
+ -height $icolorbar(horizontal,height) \
+ -orientation 0
+
+ colorbarrgb configure -x $xx -y $yy \
+ -width $canvas(width) \
+ -height $icolorbar(horizontal,height) \
+ -orientation 0
+ }
+ vertical {
+ set xx [expr $canvas(width) + $canvas(gap)]
+ set yy 0
+
+ colorbar configure -x $xx -y $yy \
+ -width $icolorbar(vertical,width) \
+ -height $canvas(height) \
+ -orientation 1
+
+ colorbarrgb configure -x $xx -y $yy \
+ -width $icolorbar(vertical,width) \
+ -height $canvas(height) \
+ -orientation 1
+ }
+ }
+}
+
+proc ColorbarBackup {ch which} {
+ global colorbar
+
+ puts $ch "$which configure -size $colorbar(size)"
+ puts $ch "$which configure -ticks $colorbar(ticks)"
+ puts $ch "$which configure -numerics $colorbar(numerics)"
+ puts $ch "$which configure -space $colorbar(space)"
+ switch $colorbar(orientation) {
+ horizontal {puts $ch "$which configure -orientation 0"}
+ vertical {puts $ch "$which configure -orientation 1"}
+ }
+ puts $ch "$which configure -font $colorbar(font)"
+ puts $ch "$which configure -fontsize $colorbar(font,size)"
+ puts $ch "$which configure -fontweight $colorbar(font,weight)"
+ puts $ch "$which configure -fontslant $colorbar(font,slant)"
+
+ puts $ch "$which colorbar [$which get colorbar]"
+ puts $ch "$which tag \"\{[$which get tag]\}\""
+}
+
+proc ColormapFrameBackup {ch which} {
+ switch -- [$which get type] {
+ base -
+ 3d {
+ puts $ch "set sav \[colorbar get colorbar\]"
+ puts $ch "colorbar colorbar [$which get colorbar]"
+ puts $ch "$which colormap \[colorbar get colormap\]"
+ puts $ch "colorbar colorbar \$sav"
+ }
+ rgb {
+ puts $ch "set sav \[colorbarrgb get colorbar\]"
+ puts $ch "colorbarrgb colorbar [$which get colorbar]"
+ puts $ch "$which colormap \[colorbarrgb get colormap\]"
+ puts $ch "colorbarrgb colorbar \$sav"
+ }
+ }
+}
+
+proc ColorbarBackupCmaps {ch dir} {
+ global icolorbar
+
+ set rdir "./[lindex [file split $dir] end]"
+
+ # delete old cmaps
+ foreach ff [glob -directory $dir -nocomplain "*.sao"] {
+ catch {file delete -force $ff}
+ }
+ foreach ff [glob -directory $dir -nocomplain "*.lut"] {
+ catch {file delete -force $ff}
+ }
+
+ # save any loaded cmaps
+ set id [colorbar list id]
+ if {$icolorbar(user)<[llength $id]} {
+ for {set ii $icolorbar(user)} {$ii<[llength $id]} {incr ii} {
+ set which [lindex $id $ii]
+ set nn [lindex [file split [colorbar get file name $which]] end]
+ colorbar save $which \"[file join $dir $nn]\"
+ puts $ch "LoadColormapFile \"[file join $rdir $nn]\""
+ }
+ }
+}
+
+# Process Cmds
+
+proc ProcessCmapCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global colorbar
+ global current
+
+ global ds9
+ global current
+ global rgb
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {ColormapDialog}
+ close {ColormapDestroyDialog}
+ match {
+ # backward compatibility
+ MatchColorCurrent
+ }
+ lock {
+ # backward compatibility
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set colorbar(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set colorbar(lock) 1
+ incr i -1
+ }
+ LockColorCurrent
+ }
+ load -
+ file {
+ incr i
+ set fn [lindex $var $i]
+ LoadColormapFile $fn
+ FileLast colormapfbox $fn
+ }
+ save {
+ incr i
+ set fn [lindex $var $i]
+ SaveColormapFile $fn
+ FileLast colormapfbox $fn
+ }
+ invert {
+ incr i
+ set colorbar(invert) [FromYesNo [lindex $var $i]]
+ InvertColorbar
+ }
+ tag {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch $item {
+ load {incr i; LoadColorTag [lindex $var $i]}
+ save {incr i; $current(colorbar) tag save [lindex $var $i]}
+ delete {DeleteColorTag}
+ }
+ }
+ value {
+ incr i
+ set c [lindex $var $i]
+ incr i
+ set b [lindex $var $i]
+ if {$current(frame) != {}} {
+ RGBEvalLockColorbar [list $current(colorbar) adjust $c $b]
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap begin]
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap motion [$current(colorbar) get colormap]]
+ RGBEvalLockCurrent rgb(lock,colorbar) [list $current(frame) colormap end]
+ }
+ LockColorCurrent
+ UpdateColorDialog
+ }
+ default {
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ set cmap [lindex $var $i]
+ # common variants on spellings
+ switch -- [string tolower $cmap] {
+ gray {set cmap grey}
+ }
+
+ set id [colorbar list id]
+ set found 0
+ foreach ii $id {
+ set title [colorbar get name $ii]
+ if {[string equal -nocase $title $cmap]} {
+ set colorbar(map) $title
+ colorbar map "{$colorbar(map)}"
+ $current(frame) colormap [colorbar get colormap]
+ set colorbar(invert) [colorbar get invert]
+
+ set found 1
+ break
+ }
+ }
+ if {!$found} {
+ Error "[msgcat::mc {Unknown Colormap}] $cmap"
+ }
+ }
+ rgb {}
+ }
+ LockColorCurrent
+ UpdateColorDialog
+ }
+ }
+}
+
+proc ProcessSendCmapCmd {proc id param} {
+ global colorbar
+ global current
+
+ switch -- [string tolower $param] {
+ file {$proc $id "[$current(colorbar) get file name]\n"}
+ invert {$proc $id [ToYesNo $colorbar(invert)]}
+ value {$proc $id "[$current(colorbar) get contrast] [$current(colorbar) get bias]\n"}
+ lock {$proc $id [ToYesNo $colorbar(lock)]}
+ {} {$proc $id "[$current(colorbar) get name]\n"}
+ }
+}
+
+proc ProcessColorbarCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global colorbar
+ global view
+
+ set item [string tolower [lindex $var $i]]
+
+ switch -- $item {
+ match {
+ # backward compatibility
+ MatchColorCurrent
+ }
+ lock {
+ # backward compatibility
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set colorbar(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set colorbar(lock) 1
+ incr i -1
+ }
+ LockColorCurrent
+ }
+ numerics {
+ incr i
+ set yesno [string tolower [lindex $var $i]]
+ set colorbar(numerics) [FromYesNo $yesno]
+ UpdateView
+ }
+ space {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ value {set item 1}
+ default {set item 0}
+ }
+ set colorbar(space) $item
+ UpdateView
+ }
+ font {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ set colorbar(font) $item
+ UpdateView
+ }
+ fontsize {
+ incr i
+ set item [lindex $var $i]
+ set colorbar(font,size) $item
+ UpdateView
+ }
+ fontweight {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ set colorbar(font,weight) $item
+ UpdateView
+ }
+ fontslant {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ set colorbar(font,slant) $item
+ UpdateView
+ }
+ fontstyle {
+ # backward compatibility
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch $item {
+ normal {
+ set colorbar(font,weight) normal
+ set colorbar(font,slant) roman
+ }
+ bold {
+ set colorbar(font,weight) bold
+ set colorbar(font,slant) roman
+ }
+ italic {
+ set colorbar(font,weight) normal
+ set colorbar(font,slant) italic
+ }
+ }
+ UpdateView
+ }
+ orientation {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ set colorbar(orientation) $item
+ UpdateView
+ }
+ vertical -
+ horizontal {
+ set colorbar(orientation) $item
+ UpdateView
+ }
+ size {
+ incr i
+ set item [lindex $var $i]
+ set colorbar(size) $item
+ UpdateView
+ }
+ ticks {
+ incr i
+ set item [lindex $var $i]
+ set colorbar(ticks) $item
+ UpdateView
+ }
+ default {
+ set yesno [string tolower [lindex $var $i]]
+ set view(colorbar) [FromYesNo $yesno]
+ UpdateView
+ }
+ }
+}
+
+proc ProcessSendColorbarCmd {proc id param} {
+ global colorbar
+ global view
+
+ switch -- [string tolower [lindex $param 0]] {
+ lock {
+ #backward compatibility
+ $proc $id [ToYesNo $colorbar(lock)]
+ }
+ orientation {$proc $id "$colorbar(orientation)\n"}
+ numerics {$proc $id [ToYesNo $colorbar(numerics)]}
+ space {
+ if {$colorbar(space)} {
+ $proc $id "value\n"
+ } else {
+ $proc $id "distance\n"
+ }
+ }
+ font {$proc $id "$colorbar(font)\n"}
+ fontsize {$proc $id "$colorbar(font,size)\n"}
+ fontstyle -
+ fontweight {$proc $id "$colorbar(font,weight)\n"}
+ fontslant {$proc $id "$colorbar(font,slant)\n"}
+ size {$proc $id "$colorbar(size)\n"}
+ ticks {$proc $id "$colorbar(ticks)\n"}
+ default {$proc $id [ToYesNo $view(colorbar)]}
+ }
+}
diff --git a/ds9/library/comm.tcl b/ds9/library/comm.tcl
new file mode 100644
index 0000000..7fdd0d8
--- /dev/null
+++ b/ds9/library/comm.tcl
@@ -0,0 +1,386 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used to access ProcessSend*Cmd via tcl
+proc CommReturn {id rr} {
+ return "$id $rr"
+}
+
+proc CommSet {fn paramlist {safemode 0}} {
+ global debug
+ if {$debug(tcl,hv) || $debug(tcl,samp)} {
+ puts stderr "CommSet:$fn:$paramlist:$safemode"
+ }
+
+ set cmd [lindex $paramlist 0]
+ set param [lrange $paramlist 1 end]
+ set len 0
+
+ set i 0
+
+ catch {
+ switch -- $cmd {
+ 2mass {Process2MASSCmd param i}
+ 3d {Process3DCmd param i}
+ about {}
+ align {ProcessAlignCmd param i}
+ analysis {ProcessAnalysisCmd param i {} $fn}
+ array {ProcessArrayCmd param i {} $fn}
+ bg -
+ background {ProcessBgCmd param i}
+ backup {ProcessBackupCmd param i}
+ blink {ProcessBlinkCmd param i}
+ bin {ProcessBinCmd param i}
+ block {ProcessBlockCmd param i}
+ cat -
+ catalog {ProcessCatalogCmd param i}
+ cd {ProcessCDCmd param i}
+ cmap {ProcessCmapCmd param i}
+ colorbar {ProcessColorbarCmd param i}
+ console {ProcessConsoleCmd param i}
+ contours -
+ contour {ProcessContourCmd param i}
+ crop {ProcessCropCmd param i}
+ crosshair {ProcessCrosshairCmd param i}
+ cursor {ProcessCursorCmd param i}
+ data {}
+ datacube -
+ cube {ProcessCubeCmd param i}
+ dss -
+ dsssao {ProcessSAOCmd param i}
+ dsseso {ProcessESOCmd param i}
+ dssstsci {ProcessSTSCICmd param i}
+ envi {ProcessENVICmd param i {} $fn}
+ export {ProcessExportCmd param i}
+ file {ProcessFileCmd param i {} {} {}}
+ fits {ProcessFitsCmd param i {} $fn}
+ frame {ProcessFrameCmd param i}
+ gif {ProcessGIFCmd param i {} $fn}
+ grid {ProcessGridCmd param i}
+ header {ProcessHeaderCmd param i}
+ height {ProcessHeightCmd param i}
+ iconify {ProcessIconifyCmd param i}
+ iexam -
+ imexam {}
+ iis {ProcessIISCmd param i}
+ irafalign {
+ # backward compatibility
+ ProcessIRAFAlignCmd param i
+ }
+ jpg -
+ jpeg {ProcessJPEGCmd param i {} $fn}
+ lock {ProcessLockCmd param i}
+ lower {ProcessLowerCmd param i}
+ magnifier {ProcessMagnifierCmd param i}
+ mask {ProcessMaskCmd param i}
+ match {ProcessMatchCmd param i}
+ mecube {ProcessMECubeCmd param i {} $fn}
+ minmax {ProcessMinMaxCmd param i}
+ mode {ProcessModeCmd param i}
+ mosaic {ProcessMosaicCmd param i {} $fn}
+ mosaicimage {ProcessMosaicImageCmd param i {} $fn}
+ mosaicwcs {
+ # backward compatibility
+ ProcessMosaicWCSCmd param i {} $fn
+ }
+ mosaiciraf {
+ # backward compatibility
+ ProcessMosaicIRAFCmd param i {} $fn
+ }
+ mosaicimagewcs {
+ # backward compatibility
+ ProcessMosaicImageWCSCmd param i {} $fn
+ }
+ mosaicimageiraf {
+ # backward compatibility
+ ProcessMosaicImageIRAFCmd param i {} $fn
+ }
+ mosaicimagewfpc2 {
+ # backward compatibility
+ ProcessMosaicImageWFPC2Cmd param i {} $fn
+ }
+ savempeg -
+ movie {ProcessMovieCmd param i}
+ memf -
+ multiframe {ProcessMultiFrameCmd param i {} $fn}
+ nameserver {ProcessNRESCmd param i}
+ nan {ProcessNanCmd param i}
+ nrrd {ProcessNRRDCmd param i {} $fn}
+ nvss {ProcessNVSSCmd param i}
+ orient {ProcessOrientCmd param i}
+ {page setup} -
+ pagesetup {ProcessPageSetupCmd param i}
+ pspagesetup {ProcessPSPageSetupCmd param i}
+ pan {ProcessPanCmd param i}
+ pixeltable {ProcessPixelTableCmd param i}
+ plot {ProcessPlotCmd param i {} $fn}
+ png {ProcessPNGCmd param i {} $fn}
+ prefs {ProcessPrefsCmd param i}
+ preserve {ProcessPreserveCmd param i}
+ print {
+ if {$safemode} {
+ Error [msgcat::mc {Command not allowed}]
+ } else {
+ ProcessPrintCmd param i
+ }
+ }
+ psprint {
+ if {$safemode} {
+ Error [msgcat::mc {Command not allowed}]
+ } else {
+ ProcessPSPrintCmd param i
+ }
+ }
+ exit -
+ quit {ProcessQuitCmd param i}
+ raise {ProcessRaiseCmd param i}
+ restore {ProcessRestoreCmd param i}
+ region -
+ regions {ProcessRegionsCmd param i {} $fn}
+ rgb {ProcessRGBCmd param i}
+ rgbarray {ProcessRGBArrayCmd param i {} $fn}
+ rgbcube {ProcessRGBCubeCmd param i {} $fn}
+ rgbimage {ProcessRGBImageCmd param i {} $fn}
+ rotate {ProcessRotateCmd param i}
+ samp {ProcessSAMPCmd param i}
+ save -
+ savefits {ProcessSaveCmd param i}
+ saveimage {ProcessSaveImageCmd param i}
+ scale {ProcessScaleCmd param i}
+ sfits {
+ # backward compatibility
+ ProcessSFitsCmd param i {} $fn
+ }
+ sia {ProcessSIACmd param i}
+ single {ProcessSingleCmd param i}
+ shm {ProcessShmCmd param i 0}
+ skyview {ProcessSkyViewCmd param i}
+ sleep {ProcessSleepCmd param i}
+ smosaic {
+ # backward compatibility
+ ProcessSMosaicCmd param i {} $fn
+ }
+ smosaicwcs {
+ # backward compatibility
+ ProcessSMosaicWCSCmd param i {} $fn
+ }
+ smosaiciraf {
+ # backward compatibility
+ ProcessSMosaicIRAFCmd param i {} $fn
+ }
+ smooth {ProcessSmoothCmd param i}
+ source {
+ if {$safemode} {
+ Error [msgcat::mc {Command not allowed}]
+ } else {
+ ProcessSourceCmd param i
+ }
+ }
+ srgbcube {ProcessSRGBCubeCmd param i {} $fn}
+ tcl {
+ if {$safemode} {
+ Error [msgcat::mc {Command not allowed}]
+ } else {
+ ProcessTclCmd param i {} $fn
+ }
+ }
+ theme {
+ # backward compatibility
+ ProcessThemeCmd param i
+ }
+ threads {ProcessThreadsCmd param i}
+ tif -
+ tiff {ProcessTIFFCmd param i {} $fn}
+ tile {ProcessTileCmd param i}
+ update {ProcessUpdateCmd param i}
+ url {ProcessURLFitsCmd param i}
+ version {}
+ view {ProcessViewCmd param i}
+ vla -
+ first {ProcessVLACmd param i}
+ vlss {ProcessVLSSCmd param i}
+ vo {ProcessVOCmd param i}
+ wcs {ProcessWCSCmd param i {} $fn}
+ web {ProcessWebCmd param i}
+ width {ProcessWidthCmd param i}
+ zoom {ProcessZoomCmd param i}
+ zscale {ProcessZScaleCmd param i}
+ default {Error "[msgcat::mc {Unknown command}]: $cmd"}
+ }
+ }
+}
+
+proc CommGet {proc id paramlist fn} {
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "CommGet:$proc:$id:$paramlist:$fn"
+ }
+
+ set cmd [lindex $paramlist 0]
+ set param [lrange $paramlist 1 end]
+
+ catch {
+ switch -- $cmd {
+ 2mass {ProcessSend2MASSCmd $proc $id $param}
+ 3d {ProcessSend3DCmd $proc $id $param}
+ about {ProcessSendAboutCmd $proc $id $param {} $fn}
+ align {ProcessSendAlignCmd $proc $id $param}
+ analysis {ProcessSendAnalysisCmd $proc $id $param {} $fn}
+ array {ProcessSendArrayCmd $proc $id $param {} $fn}
+ bg -
+ background {ProcessSendBgCmd $proc $id $param}
+ blink {ProcessSendBlinkCmd $proc $id $param}
+ bin {ProcessSendBinCmd $proc $id $param}
+ block {ProcessSendBlockCmd $proc $id $param}
+ cat -
+ catalog {ProcessSendCatalogCmd $proc $id $param {} $fn}
+ cd {ProcessSendCDCmd $proc $id $param}
+ cmap {ProcessSendCmapCmd $proc $id $param}
+ colorbar {ProcessSendColorbarCmd $proc $id $param}
+ console {}
+ contours -
+ contour {ProcessSendContourCmd $proc $id $param {} $fn}
+ crop {ProcessSendCropCmd $proc $id $param}
+ crosshair {ProcessSendCrosshairCmd $proc $id $param}
+ cursor {}
+ data {ProcessSendDataCmd $proc $id $param {} $fn}
+ datacube -
+ cube {ProcessSendCubeCmd $proc $id $param}
+ dss -
+ dsssao {ProcessSendSAOCmd $proc $id $param}
+ dsseso {ProcessSendESOCmd $proc $id $param}
+ dssstsci {ProcessSendSTSCICmd $proc $id $param}
+ envi {}
+ exit {}
+ export {}
+ file {ProcessSendFileCmd $proc $id $param}
+ fits {ProcessSendFitsCmd $proc $id $param {} $fn}
+ frame {ProcessSendFrameCmd $proc $id $param}
+ gif {ProcessSendGIFCmd $proc $id $param {} $fn}
+ grid {ProcessSendGridCmd $proc $id $param}
+ header {}
+ height {ProcessSendHeightCmd $proc $id $param}
+ iconify {ProcessSendIconifyCmd $proc $id $param}
+ iexam -
+ imexam {ProcessSendIExamCmd $proc $id $param}
+ iis {ProcessSendIISCmd $proc $id $param}
+ irafalign {
+ # backward compatibility
+ ProcessSendIRAFAlignCmd $proc $id $param
+ }
+ jpg -
+ jpeg {ProcessSendJPEGCmd $proc $id $param {} $fn}
+ lock {ProcessSendLockCmd $proc $id $param}
+ lower {}
+ magnifier {ProcessSendMagnifierCmd $proc $id $param}
+ mask {ProcessSendMaskCmd $proc $id $param}
+ match {}
+ mecube {ProcessSendMECubeCmd $proc $id $param {} $fn}
+ minmax {ProcessSendMinMaxCmd $proc $id $param}
+ mode {ProcessSendModeCmd $proc $id $param}
+ mosaic {ProcessSendMosaicCmd $proc $id $param {} $fn}
+ mosaicimage {ProcessSendMosaicImageCmd $proc $id $param {} $fn}
+ mosaicwcs {
+ # backward compatibility
+ ProcessSendMosaicWCSCmd $proc $id $param {} $fn
+ }
+ mosaiciraf {
+ # backward compatibility
+ }
+ mosaicimagewcs {
+ # backward compatibility
+ ProcessSendMosaicImageWCSCmd $proc $id $param {} $fn
+ }
+ mosaicimageiraf {
+ # backward compatibility
+ }
+ mosaicimagewfpc2 {
+ # backward compatibility
+ }
+ savempeg -
+ movie {}
+ memf -
+ multiframe {}
+ nameserver {ProcessSendNRESCmd $proc $id $param}
+ nan {ProcessSendNanCmd $proc $id $param}
+ nrrd {ProcessSendNRRDCmd $proc $id $param {} $fn}
+ nvss {ProcessSendNVSSCmd $proc $id $param}
+ orient {ProcessSendOrientCmd $proc $id $param}
+ {page setup} -
+ pagesetup {ProcessSendPageSetupCmd $proc $id $param}
+ pan {ProcessSendPanCmd $proc $id $param}
+ pixeltable {ProcessSendPixelTableCmd $proc $id $param {} $fn}
+ plot {ProcessSendPlotCmd $proc $id $param}
+ png {ProcessSendPNGCmd $proc $id $param {} $fn}
+ prefs {ProcessSendPrefsCmd $proc $id $param}
+ preserve {ProcessSendPreserveCmd $proc $id $param}
+ pspagesetup {ProcessSendPSPageSetupCmd $proc $id $param}
+ print {ProcessSendPrintCmd $proc $id $param}
+ psprint {ProcessSendPSPrintCmd $proc $id $param}
+ exit -
+ quit {}
+ raise {}
+ region -
+ regions {ProcessSendRegionsCmd $proc $id $param {} $fn}
+ rgb {ProcessSendRGBCmd $proc $id $param}
+ rgbarray {ProcessSendRGBArrayCmd $proc $id $param {} $fn}
+ rgbcube {ProcessSendRGBCubeCmd $proc $id $param {} $fn}
+ rgbimage {ProcessSendRGBImageCmd $proc $id $param {} $fn}
+ rotate {ProcessSendRotateCmd $proc $id $param}
+ samp {}
+ save -
+ savefits {}
+ saveimage {}
+ scale {ProcessSendScaleCmd $proc $id $param}
+ sfits {
+ # backward compatibility
+ }
+ single {ProcessSendSingleCmd $proc $id $param}
+ shm {ProcessSendShmCmd $proc $id $param}
+ skyview {ProcessSendSkyViewCmd $proc $id $param}
+ smosaic {
+ # backward compatibility
+ }
+ smosaiciraf {
+ # backward compatibility
+ }
+ smosaicwcs {
+ # backward compatibility
+ }
+ smooth {ProcessSendSmoothCmd $proc $id $param}
+ source {}
+ srgbcube {}
+ tcl {}
+ theme {
+ # backward compatibility
+ ProcessSendThemeCmd $proc $id $param
+ }
+ threads {ProcessSendThreadsCmd $proc $id $param}
+ tif -
+ tiff {ProcessSendTIFFCmd $proc $id $param {} $fn}
+ tile {ProcessSendTileCmd $proc $id $param}
+ update {}
+ url {}
+ version {ProcessSendVersionCmd $proc $id $param}
+ view {ProcessSendViewCmd $proc $id $param}
+ vla -
+ first {ProcessSendVLACmd $proc $id $param}
+ vlss {ProcessSendVLSSCmd $proc $id $param}
+ vo {ProcessSendVOCmd $proc $id $param}
+ wcs {ProcessSendWCSCmd $proc $id $param}
+ web {ProcessSendWebCmd $proc $id $param}
+ width {ProcessSendWidthCmd $proc $id $param}
+ zscale {ProcessSendZScaleCmd $proc $id $param}
+ zoom {ProcessSendZoomCmd $proc $id $param}
+ default {
+ Error "[msgcat::mc {Unknown command}]: $cmd"
+ $proc $id {}
+ }
+ }
+ }
+}
+
+
diff --git a/ds9/library/command.tcl b/ds9/library/command.tcl
new file mode 100644
index 0000000..50f8151
--- /dev/null
+++ b/ds9/library/command.tcl
@@ -0,0 +1,918 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc BadVisualError {} {
+ global ds9
+
+ Error [msgcat::mc {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}]
+ exit
+}
+
+proc ProcessCommandLineFirst {} {
+ global argc
+ global argv
+ global icolorbar
+ global ds9
+ global pds9
+
+ set i 0
+ while {$i < $argc} {
+ set item [lindex $argv $i]
+
+ switch -- $item {
+ -help {
+ puts "For more information, use --help"
+ QuitDS9
+ }
+ -debug {incr i; ProcessDebugTclCmd argv i}
+ -private {
+ # backward compatibility
+ }
+ -title {
+ incr i
+ set ds9(title) [lindex $argv $i]
+ set t "SAOImage $ds9(title)"
+ wm title $ds9(top) "$t"
+ wm iconname $ds9(top) "$t"
+ }
+ -language {
+ incr i
+ set pds9(language) [lindex $argv $i]
+ set pds9(language,name) [LanguageToName $pds9(language)]
+ }
+ -msg {
+ incr i
+ set pds9(language,dir) [lindex $argv $i]
+ }
+ -xpa {incr i; ProcessXPAFirstCmd argv i}
+ }
+ incr i
+ }
+}
+
+proc ProcessCommandLine {} {
+ global argc
+ global argv
+
+ ProcessCommand $argv $argc
+}
+
+proc ds9Cmd {argv} {
+ ProcessCommand $argv [llength $argv]
+}
+
+proc ProcessCommand {argv argc} {
+ global ds9
+ global pds9
+ global help
+ global current
+ global contour
+ global colorbar
+ global debug
+ global wcs
+ global view
+ global grid
+ global bin
+ global scale
+ global minmax
+ global zscale
+ global iis
+ global file
+
+ set file(type) fits
+ set file(mode) {}
+ set file(layer) {}
+ set file(mosaic) wcs
+
+ set load 0
+ set noopts 0
+ set i 0
+
+ # Note: -help is processed previously for fv (temporary)
+ set item {}
+
+ while {$i < $argc} {
+ set item [lindex $argv $i]
+ switch -- $item {
+ -- {set noopts 1}
+ -? -
+ -help -
+ --help {HelpCommand}
+
+ -version {
+ ProcessSendVersionCmd puts stdout {}
+ QuitDS9
+ }
+
+ -2mass {incr i; Process2MASSCmd argv i}
+ -3d -
+ -3D {incr i; Process3DCmd argv i}
+ -about {ProcessSendAboutCmd puts stdout {} {} {}}
+ -align {incr i; ProcessAlignCmd argv i}
+ -analysis {incr i; ProcessAnalysisCmd argv i {} {}}
+ -array {set file(type) array}
+ -asinh {set scale(type) asinh; ChangeScale}
+ -bg -
+ -background {incr i; ProcessBgCmd argv i}
+ -backup {incr i; ProcessBackupCmd argv i}
+ -bin {incr i; ProcessBinCmd argv i}
+ -block {incr i; ProcessBlockCmd argv i}
+ -blink {incr i; ProcessBlinkCmd argv i}
+ -blue {set current(rgb) blue; RGBChannel}
+ -cat -
+ -catalog {incr i; ProcessCatalogCmd argv i}
+ -cd {incr i; ProcessCDCmd argv i}
+ -cmap {incr i; ProcessCmapCmd argv i}
+ -colorbar {incr i; ProcessColorbarCmd argv i}
+ -console {ProcessConsoleCmd argv i}
+ -contours -
+ -contour {incr i; ProcessContourCmd argv i}
+ -nocontour {set contour(view) 0; ContourUpdate}
+ -crop {incr i; ProcessCropCmd argv i}
+ -crosshair {incr i; ProcessCrosshairCmd argv i}
+ -cursor {incr i; ProcessCursorCmd argv i}
+ -datacube -
+ -cube {incr i; ProcessCubeCmd argv i}
+ -debug {incr i; ProcessDebugCmd argv i}
+ -dss -
+ -dsssao {incr i; ProcessSAOCmd argv i}
+ -dsseso {incr i; ProcessESOCmd argv i}
+ -dssstsci {incr i; ProcessSTSCICmd argv i}
+ -envi {set file(type) envi}
+ -export {incr i; ProcessExportCmd argv i}
+ -exit -
+ -quit {ProcessQuitCmd argv i}
+ -frame {incr i; ProcessFrameCmd argv i}
+ -fifo {
+ incr i
+ set fifo [lindex $argv $i]
+ if {$fifo!="none"} {
+ set iis(ififo) ${fifo}i
+ set iis(ofifo) ${fifo}o
+ } else {
+ set iis(ififo) none
+ set iis(ofifo) none
+ }
+ }
+ -fifo_only {
+ set iis(port) 0
+ set iis(unix) none
+ }
+ -file -
+ -fits {set file(type) fits; CommandFitsCmd argv i}
+ -geometry {
+ # already processed
+ }
+ -gif {set file(type) gif}
+ -green {set current(rgb) green; RGBChannel}
+ -grid {incr i; ProcessGridCmd argv i}
+ -nogrid {set grid(view) 0; GridUpdateCurrent}
+ -header {incr i; ProcessHeaderCmd argv i}
+ -height {incr i; ProcessHeightCmd argv i}
+ -histequ {set scale(type) histequ; ChangeScale}
+ -horzgraph {
+ # backward compatibility
+ set view(graph,horz) 1
+ UpdateView
+ }
+ -nohorzgraph {
+ # backward compatibility
+ set view(graph,horz) 0
+ UpdateView
+ }
+ -iconify {incr i; ProcessIconifyCmd argv i}
+ -iis {incr i; ProcessIISCmd argv i}
+ -info {
+ # backward compatibility
+ set view(info) 1
+ UpdateView
+ }
+ -noinfo {
+ # backward compatibility
+ set view(info) 0
+ UpdateView
+ }
+ -invert {set colorbar(invert) 1; InvertColorbar}
+ -jpg -
+ -jpeg {set file(type) jpeg}
+ -language {
+ # already processed
+ incr i
+ }
+ -lock {incr i; ProcessLockCmd argv i}
+ -linear {set scale(type) linear; ChangeScale}
+ -log {set scale(type) log; ChangeScale}
+ -lower {ProcessLowerCmd argv i}
+ -magnifier {incr i; ProcessMagnifierCmd argv i}
+ -nomagnifier {
+ # backward compatibility
+ set view(magnifier) 0
+ UpdateView
+ }
+ -mask {incr i; set file(layer) [ProcessMaskCmd argv i]}
+ -nomask {set file(layer) {}}
+ -match {incr i; ProcessMatchCmd argv i}
+ -mecube {set file(type) mecube}
+ -memf -
+ -multiframe {set file(type) multiframe}
+ -minmax {incr i; ProcessMinMaxCmd argv i}
+ -minmaxmode {
+ # backward compatibility
+ incr i
+ set minmax(mode) [lindex $argv $i]
+ }
+ -minmaxsample {
+ # backward compatibility
+ incr i
+ set minmax(sample) [lindex $argv $i]
+ }
+ -mode {incr i; ProcessModeCmd argv i}
+
+ -mosaic {
+ set file(type) mosaic
+ CommandMosaicCmd argv i
+ }
+ -mosaicimage {
+ set file(type) mosaicimage
+ CommandMosaicImageCmd argv i
+ }
+
+ -mosaicimageiraf {
+ # backward compatibility
+ set file(type) mosaicimage
+ set file(mosaic) iraf
+ }
+ -mosaicimagewcs {
+ # backward compatibility
+ set file(type) mosaicimage
+ set file(mosaic) wcs
+ }
+ -mosaicimagewfpc2 {
+ # backward compatibility
+ set file(type) mosaicimage
+ set file(mosaic) wfpc2
+ }
+
+ -mosaiciraf {
+ # backward compatibility
+ set file(type) mosaic
+ set file(mosaic) iraf
+ }
+ -mosaicwcs {
+ # backward compatibility
+ set file(type) mosaic
+ set file(mosaic) wcs
+ }
+ -savempeg -
+ -movie {incr i; ProcessMovieCmd argv i}
+
+ -msg {
+ # already processed
+ incr i
+ }
+ -nameserver {incr i; ProcessNRESCmd argv i}
+ -nan {incr i; ProcessNanCmd argv i}
+ -nrrd {set file(type) nrrd}
+ -nvss {incr i; ProcessNVSSCmd argv i}
+ -orient {incr i; ProcessOrientCmd argv i}
+ -pagesetup {incr i; ProcessPageSetupCmd argv i}
+ -pspagesetup {incr i; ProcessPSPageSetupCmd argv i}
+ -pan {incr i; ProcessPanCmd argv i}
+ -panner {
+ # backward compatibility
+ set view(panner) 1
+ UpdateView
+ }
+ -nopanner {
+ # backward compatibility
+ set view(panner) 0
+ UpdateView
+ }
+ -photo {
+ # backward compatibility
+ set file(type) tiff
+ }
+ -pixeltable {incr i; ProcessPixelTableCmd argv i}
+ -nopixeltable {PixelTableDestroyDialog}
+ -plot {incr i; ProcessPlotCmd argv i {} {}}
+ -png {set file(type) png}
+ -port {incr i; set iis(port) [lindex $argv $i]}
+ -inet_only -
+ -port_only {
+ set iis(ififo) none
+ set iis(ofifo) none
+ set iis(unix) none
+ }
+ -pow {set scale(type) pow; ChangeScale}
+ -prefs {incr i; ProcessPrefsCmd argv i}
+ -preserve {incr i; ProcessPreserveCmd argv i}
+ -print {incr i; ProcessPrintCmd argv i}
+ -psprint {incr i; ProcessPSPrintCmd argv i}
+ -private {
+ #already processed
+ }
+ -raise {ProcessRaiseCmd argv i}
+ -red {set current(rgb) red; RGBChannel}
+ -region -
+ -regions -
+ -regionfile {incr i; ProcessRegionsCmd argv i {} {}}
+ -restore {incr i; ProcessRestoreCmd argv i}
+ -rgb {incr i; ProcessRGBCmd argv i}
+ -rgbcube {set file(type) rgbcube}
+ -srgbcube {
+ # backward compatibility
+ set file(type) srgbcube
+ }
+ -rgbimage {set file(type) rgbimage}
+ -rgbarray {set file(type) rgbarray}
+ -rotate {incr i; ProcessRotateCmd argv i}
+ -samp {incr i; ProcessSAMPCmd argv i}
+ -savefits -
+ -save {incr i; ProcessSaveCmd argv i}
+ -saveimage {incr i; ProcessSaveImageCmd argv i}
+ -scale -
+ -ztrans {incr i; ProcessScaleCmd argv i}
+ -scalelims -
+ -scalelimits {
+ #backward compatibility
+ incr i
+ set scale(min) [lindex $argv $i]
+ incr i
+ set scale(max) [lindex $argv $i]
+ ChangeScaleLimit
+ }
+ -scalemode {
+ #backward compatibility
+ incr i
+ set scale(mode) [string tolower [lindex $argv $i]]
+ ChangeScaleMode
+ }
+ -scalescope {
+ #backward compatibility
+ incr i
+ set scale(scope) [string tolower [lindex $argv $i]]
+ ChangeScaleScope
+ }
+ -sfits {
+ # backward compatibility
+ set file(type) sfits
+ CommandSFitsCmd argv i
+ }
+ -sia {incr i; ProcessSIACmd argv i}
+ -shm {incr i; ProcessShmCmd argv i 1}
+ -single {ProcessSingleCmd argv i}
+ -sinh {set scale(type) sinh; ChangeScale}
+ -skyview {incr i; ProcessSkyViewCmd argv i}
+ -sleep {incr i; ProcessSleepCmd argv i}
+ -slice {set file(mode) slice}
+ -noslice {set file(mode) {}}
+ -smooth {incr i; ProcessSmoothCmd argv i}
+ -smosaic {
+ # backward compatibility
+ set file(type) smosaic
+ CommandMosaicCmd argv i
+ }
+ -smosaiciraf {
+ # backward compatibility
+ set file(type) smosaic
+ set file(mosaic) iraf
+ }
+ -smosaicwcs {
+ # backward compatibility
+ set file(type) smosaic
+ set file(mosaic) wcs
+ }
+ -squared {set scale(type) squared; ChangeScale}
+ -sqrt {set scale(type) sqrt; ChangeScale}
+ -source {incr i; ProcessSourceCmd argv i}
+ -tcl {incr i; ; ProcessTclCmd argv i {} {}}
+ -theme {
+ # backward compatibility
+ incr i; ProcessThemeCmd argv i
+ }
+ -threads {incr i; ProcessThreadsCmd argv i}
+ -tif -
+ -tiff {set file(type) tiff}
+ -tile {incr i; ProcessTileCmd argv i}
+ -title {
+ #already processed
+ incr i
+ }
+ -unix {incr i; set iis(unix) [lindex $argv $i]}
+ -unix_only {
+ set iis(ififo) none
+ set iis(ofifo) none
+ set iis(port) 0
+ }
+ -url {set file(type) url}
+ -update {incr i; ProcessUpdateCmd argv i}
+ -vertgraph {
+ #backward compatibility
+ set view(graph,vert) 1
+ UpdateView
+ }
+ -novertgraph {
+ #backward compatibility
+ set view(graph,vert) 0
+ UpdateView
+ }
+ -view {incr i; ProcessViewCmd argv i}
+ -visual {
+ #already processed
+ }
+ -vla -
+ -first {incr i; ProcessVLACmd argv i}
+ -vlss {incr i; ProcessVLSSCmd argv i}
+ -vo {incr i; ProcessVOCmd argv i}
+ -wcs {incr i; ProcessWCSCmd argv i {} {}}
+ -wcsformat {
+ #backward compatibility
+ incr i
+ set wcs(format,) [lindex $argv $i]
+ }
+ -web {incr i; ProcessWebCmd argv i}
+ -width {incr i; ProcessWidthCmd argv i}
+ -xpa {incr i; ProcessXPACmd argv i}
+ -z1 {
+ #backward compatibility
+ incr i
+ set scale(min) [lindex $argv $i]
+ ChangeScaleLimit
+ }
+ -z2 {
+ #backward compatibility
+ incr i
+ set scale(max) [lindex $argv $i]
+ ChangeScaleLimit
+ }
+ -zscale {incr i; ProcessZScaleCmd argv i}
+ -zmax {set scale(mode) zmax; ChangeScaleMode}
+ -zoom {incr i; ProcessZoomCmd argv i}
+
+ default {
+ # allow abc, -, and -[foo] but not -abc
+ if {!$noopts && [regexp -- {^-[a-zA-Z]+} $item]} {
+ puts stderr "[msgcat::mc {Unknown command}]: $item"
+ puts stderr "[msgcat::mc {For more information, use --help}]"
+ return
+ }
+
+ if {$load == 0} {
+ StartLoad
+ incr load
+ }
+
+ switch $ds9(wm) {
+ x11 -
+ aqua {CommandLineLoad $item argv i}
+ win32 {
+ # if win32 and envoked via DOS shell
+ # we must expand wildcards ourselves
+ if {[catch {glob $item} fns]} {
+ # cygwin/double click/DOS Shell no wildcards
+ CommandLineLoad $item argv i
+ } else {
+ # DOS Shell with wildcards
+ foreach fn $fns {
+ CommandLineLoad $fn argv i
+ }
+ }
+ }
+ }
+
+ FinishLoadPre
+ }
+ }
+ incr i
+ }
+
+ if {$load != 0} {
+ FinishLoadPost
+ }
+}
+
+proc CommandLineLoad {item argvname iname} {
+ upvar $argvname argv
+ upvar $iname i
+
+ global file
+ global current
+
+ if {$current(frame) != {}} {
+ switch -- [$current(frame) get type] {
+ base {CommandLineLoadBase $item $argvname $iname}
+ rgb {CommandLineLoadRGB $item $argvname $iname}
+ 3d {CommandLineLoad3D $item $argvname $iname}
+ }
+ } else {
+ CommandLineLoadBase $item $argvname $iname
+ }
+
+ SetFileLast $file(type) $item
+}
+
+proc CommandLineLoadBase {item argvname iname} {
+ upvar 2 $argvname argv
+ upvar 2 $iname i
+
+ global file
+ global ds9
+
+ switch -- $file(type) {
+ fits {
+ # under windows, a double click on a
+ # data file comes here
+ MultiLoad $file(layer) $file(mode)
+ LoadFitsFile $item $file(layer) $file(mode)
+ }
+ url {
+ MultiLoad $file(layer) $file(mode)
+ LoadURLFits $item $file(layer) $file(mode)
+ }
+
+
+ rgbimage {
+ CreateRGBFrame
+ LoadRGBImageFile $item
+ }
+ rgbcube {
+ CreateRGBFrame
+ LoadRGBCubeFile $item
+ }
+
+ mecube {
+ MultiLoad
+ LoadMECubeFile $item
+ }
+ multiframe {
+ MultiLoad
+ LoadMultiFrameFile $item
+ }
+
+ mosaicimage {
+ MultiLoad $file(layer)
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicImageIRAFFile $item $file(layer)}
+ wfpc2 {LoadMosaicImageWFPC2File $item}
+ default {LoadMosaicImageWCSFile $item $file(layer) $file(mosaic)}
+ }
+ }
+ mosaic {
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicIRAFFile $item $file(layer)}
+ default {LoadMosaicWCSFile $item $file(layer) $file(mosaic)}
+ }
+ }
+
+ sfits {
+ #backward compatibility
+ incr i
+ MultiLoad $file(layer) $file(mode)
+ LoadSFitsFile $item [lindex $argv $i] $file(layer) $file(mode)
+ }
+ srgbcube {
+ #backward compatibility
+ CreateRGBFrame
+ incr i
+ LoadSRGBCubeFile $item [lindex $argv $i]
+ }
+ smosaic {
+ #backward compatibility
+ incr i
+ switch -- $file(mosaic) {
+ iraf {LoadSMosaicIRAFFile $item [lindex $argv $i] $file(layer)}
+ default {LoadSMosaicWCSFile $item [lindex $argv $i] $file(layer) $file(mosaic)}
+ }
+ }
+
+ array {
+ MultiLoad $file(layer)
+ ImportArrayFile $item $file(layer)
+ }
+ rgbarray {
+ CreateRGBFrame
+ ImportRGBArrayFile $item
+ }
+ nrrd {
+ MultiLoad $file(layer)
+ ImportNRRDFile $item $file(layer)
+ }
+ envi {
+ MultiLoad
+ set fn $item
+ set fn2 [lindex $argv [expr $i+1]]
+ if {$fn2 == {} || [string range $fn2 0 0] == {-}} {
+ set fn2 [FindENVIDataFile $fn]
+ } else {
+ incr i
+ }
+ ImportENVIFile $fn $fn2
+ }
+ gif -
+ tiff -
+ jpeg -
+ png {
+ MultiLoad {} $file(mode)
+ ImportPhotoFile $item $file(mode)
+ }
+ }
+}
+
+proc CommandLineLoadRGB {item argvname iname} {
+ upvar 2 $argvname argv
+ upvar 2 $iname i
+
+ global file
+
+ switch -- $file(type) {
+ fits {LoadFitsFile $item {} $file(mode)}
+ url {LoadURLFits $item {} $file(mode)}
+
+ rgbimage {
+ MultiLoadRGB
+ LoadRGBImageFile $item
+ }
+ rgbcube {
+ MultiLoadRGB
+ LoadRGBCubeFile $item
+ }
+
+ mecube {LoadMECubeFile $item}
+ multiframe {
+ # not supported
+ }
+
+ mosaicimage {
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicImageIRAFFile $item {}}
+ wfpc2 {LoadMosaicImageWFPC2File $item}
+ default {LoadMosaicImageWCSFile $item {} $file(mosaic)}
+ }
+ }
+ mosaic {
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicIRAFFile $item {}}
+ default {LoadMosaicWCSFile $item {} $file(mosaic)}
+ }
+ }
+
+ sfits {
+ #backward compatibility
+ incr i
+ LoadSFitsFile $item [lindex $argv $i] {} $file(mode)
+ }
+ srgbcube {
+ #backward compatibility
+ MultiLoadRGB
+ incr i
+ LoadSRGBCubeFile $item [lindex $argv $i]
+ }
+ smosaic {
+ #backward compatibility
+ incr i
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicIRAFSFitsFile $item [lindex $argv $i] {}}
+ default {LoadMosaicWCSSFitsFile $item [lindex $argv $i] {} $file(mosaic)}
+ }
+ }
+
+ array {ImportArrayFile $item {}}
+ rgbarray {
+ MultiLoadRGB
+ ImportRGBArrayFile $item
+ }
+ nrrd {ImportNRRDFile $item {}}
+ envi {}
+ gif -
+ tiff -
+ jpeg -
+ png {
+ MultiLoadRGB
+ ImportPhotoFile $item $file(mode)
+ }
+
+ }
+}
+
+proc CommandLineLoad3D {item argvname iname} {
+ upvar 2 $argvname argv
+ upvar 2 $iname i
+
+ global file
+
+ switch -- $file(type) {
+ fits {
+ MultiLoad {} $file(mode)
+ LoadFitsFile $item {} $file(mode)
+ }
+ url {
+ MultiLoad {} $file(mode)
+ LoadURLFits $item {} $file(mode)
+ }
+
+ rgbimage {
+ CreateRGBFrame
+ LoadRGBImageFile $item
+ }
+ rgbcube {
+ CreateRGBFrame
+ LoadRGBCubeFile $item
+ }
+
+ mecube {
+ MultiLoad
+ LoadMECubeFile $item
+ }
+ multiframe {
+ MultiLoad
+ LoadMultiFrameFile $item
+ }
+
+ mosaicimage {
+ MultiLoad
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicImageIRAFFile $item {}}
+ wfpc2 {LoadMosaicImageWFPC2File $item}
+ default {LoadMosaicImageWCSFile $item {} $file(mosaic)}
+ }
+ }
+ mosaic {
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicIRAFFile $item {}}
+ default {LoadMosaicWCSFile $item {} $file(mosaic)}
+ }
+ }
+
+ sfits {
+ #backward compatibility
+ incr i
+ MultiLoad {} $file(mode)
+ LoadSFitsFile $item [lindex $argv $i] {} $file(mode)
+ }
+ srgbcube {
+ #backward compatibility
+ CreateRGBFrame
+ incr i
+ LoadSRGBCubeFile $item [lindex $argv $i]
+ }
+ smosaic {
+ #backward compatibility
+ incr i
+ switch -- $file(mosaic) {
+ iraf {LoadMosaicIRAFSFitsFile $item [lindex $argv $i] {}}
+ default {LoadMosaicWCSSFitsFile $item [lindex $argv $i] {} $file(mosaic)}
+ }
+ }
+
+ array {
+ MultiLoad
+ ImportArrayFile $item {}
+ }
+ rgbarray {
+ CreateRGBFrame
+ ImportRGBArrayFile $item
+ }
+ nrrd {
+ MultiLoad
+ ImportNRRDFile $item {}
+ }
+ envi {
+ set fn $item
+ set fn2 [lindex $argv [expr $i+1]]
+ if {$fn2 == {} || [string range $fn2 0 0] == {-}} {
+ set fn2 [FindENVIDataFile $fn]
+ } else {
+ incr i
+ }
+ ImportENVIFile $fn $fn2
+ }
+ gif -
+ tiff -
+ jpeg -
+ png {
+ MultiLoad {} $file(mode)
+ ImportPhotoFile $item $file(mode)
+ }
+ }
+}
+
+proc CommandFitsCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global file
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ switch -- $item {
+ mosaicimage -
+ mosaic {
+ set file(type) $item
+ incr i
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ switch -- $item {
+ wfpc2 {incr i; set file(mosaic) wfpc2}
+ default {CommandMosaicType $item $iname}
+ }
+ }
+ mecube -
+ multiframe -
+ rgbcube -
+ rgbimage {
+ set file(type) $item
+ incr i
+ }
+ }
+}
+
+proc CommandSFitsCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global file
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ switch -- $item {
+ mosaic {
+ set file(type) smosaic
+ incr i
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ switch -- $item {
+ wfpc2 {incr i; set file(mosaic) wfpc2}
+ default {CommandMosaicType $item $iname}
+ }
+ }
+ rgbcube {
+ set file(type) srgbcube
+ incr i
+ }
+ }
+}
+
+proc CommandMosaicImageCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global file
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ switch -- $item {
+ wfpc2 {incr i; set file(mosaic) wfpc2}
+ default {CommandMosaicType $item $iname}
+ }
+}
+
+proc CommandMosaicCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global file
+
+ set item [string tolower [lindex $var [expr $i+1]]]
+ CommandMosaicType $item $iname
+}
+
+proc CommandMosaicType {sys iname} {
+ upvar 2 $iname i
+
+ global file
+
+ switch $sys {
+ iraf -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {
+ incr i
+ set file(mosaic) $sys
+ }
+ default {set file(mosaic) wcs}
+ }
+}
diff --git a/ds9/library/compass.tcl b/ds9/library/compass.tcl
new file mode 100644
index 0000000..11dc5ab
--- /dev/null
+++ b/ds9/library/compass.tcl
@@ -0,0 +1,99 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CompassDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set arrows [$var(frame) get marker $var(id) compass arrow]
+ set var(narrow) [lindex $arrows 0]
+ set var(earrow) [lindex $arrows 1]
+
+ set labels [$var(frame) get marker $var(id) compass label]
+ set var(north) [lindex $labels 0]
+ set var(east) [lindex $labels 1]
+
+ set s [$var(frame) get marker $var(id) compass system]
+ set var(system) [lindex $s 0]
+ set var(sky) [lindex $s 1]
+ set var(skyformat) degrees
+
+ # procs
+ set var(which) compass
+ set var(proc,apply) CompassApply
+ set var(proc,close) CompassClose
+ set var(proc,coordCB) CompassCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ set f $var(top).param
+
+ # Labels
+ ttk::label $f.ntitle -text [msgcat::mc {North}]
+ ttk::entry $f.north -textvariable ${varname}(north) -width 13
+ ttk::checkbutton $f.narrow -variable ${varname}(narrow) \
+ -text [msgcat::mc {Arrow}] -command "CompassArrow $varname"
+ ttk::label $f.etitle -text [msgcat::mc {East}]
+ ttk::entry $f.east -textvariable ${varname}(east) -width 13
+ ttk::checkbutton $f.earrow -variable ${varname}(earrow) \
+ -text [msgcat::mc {Arrow}] -command "CompassArrow $varname"
+
+ grid $f.ntitle $f.north $f.narrow -padx 2 -pady 2 -sticky w
+ grid $f.etitle $f.east $f.earrow -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc CompassClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseCenterClose $varname
+}
+
+proc CompassApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) compass label "\{$var(north)\}" "\{$var(east)\}"
+
+ MarkerBaseCenterApply $varname
+}
+
+proc CompassArrow {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) compass arrow $var(narrow) $var(earrow)
+}
+
+# callbacks
+
+proc CompassCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "CompassCoordCB"
+ }
+
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+
+ $var(frame) marker $var(id) compass system $var(system) $var(sky)
+}
+
+
+
diff --git a/ds9/library/composite.tcl b/ds9/library/composite.tcl
new file mode 100644
index 0000000..7b3153f
--- /dev/null
+++ b/ds9/library/composite.tcl
@@ -0,0 +1,136 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CompositeDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set var(global) [$var(frame) get marker $var(id) composite global]
+
+ # procs
+ set var(proc,apply) CompositeApply
+ set var(proc,close) CompositeClose
+ set var(proc,coordCB) CompositeCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # init
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback rotate CompositeRotateCB $varname
+
+ set f $var(top).param
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+ ttk::label $f.tcomp -text [msgcat::mc {Angle Complement}]
+ ttk::label $f.comp -textvariable ${varname}(comp) -width 13 -anchor w
+ ttk::label $f.ucomp -text [msgcat::mc {Degrees}]
+
+ # Global
+ ttk::label $f.tglobal -text [msgcat::mc {Global Properties}]
+ ttk::checkbutton $f.global -variable ${varname}(global) \
+ -command "CompositeGlobal $varname"
+
+ grid $f.tangle $f.angle x $f.uangle -padx 2 -pady 2 -sticky w
+ grid $f.tcomp $f.comp x $f.ucomp -padx 2 -pady 2 -sticky w
+ grid $f.tglobal $f.global -padx 2 -pady 2 -sticky w
+
+ CompositeCompAngle $varname
+}
+
+# actions
+
+proc CompositeClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback rotate CompositeRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc CompositeApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ CompositeRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+proc CompositeRotate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) angle $var(angle) $var(system) $var(sky)
+
+ CompositeCompAngle $varname
+}
+
+proc CompositeCompAngle {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set comp [expr 360-$var(angle)]
+
+ if {[::math::fuzzy::tge $comp 360]} {
+ set comp [expr $comp - 360]
+ }
+ if {[::math::fuzzy::tlt $comp 0]} {
+ set comp [expr $comp + 360]
+ }
+
+ set var(comp) $comp
+}
+
+proc CompositeGlobal {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) composite global $var(global)
+}
+
+# callbacks
+
+proc CompositeCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "CompositeCoordCB"
+ }
+
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+proc CompositeRotateCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "CompositeRotateCB"
+ }
+
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+
+ CompositeCompAngle $varname
+}
diff --git a/ds9/library/contour.tcl b/ds9/library/contour.tcl
new file mode 100644
index 0000000..774ddb0
--- /dev/null
+++ b/ds9/library/contour.tcl
@@ -0,0 +1,1418 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ContourDef {} {
+ global contour
+ global icontour
+ global pcontour
+
+ set icontour(top) .ct
+ set icontour(mb) .ctmb
+
+ set contour(view) 0
+ set contour(copy) {}
+
+ set contour(color) green
+ set contour(width) 1
+ set contour(dash) 0
+
+ set contour(method) block
+ set contour(smooth) 4
+ set contour(numlevel) 5
+
+ set contour(scale) linear
+ set contour(mode) minmax
+ set contour(log) 1000
+ set contour(min) {}
+ set contour(max) {}
+
+ # used for command line options
+ # example % ds9 -contour log foo.fits -zscale -contour
+ # .. contour scale is log, not zscale
+ set contour(init,scale) 0
+ set contour(init,mode) 0
+ set contour(init,limits) 0
+
+ set pcontour(view) $contour(view)
+ set pcontour(method) $contour(method)
+ set pcontour(color) $contour(color)
+ set pcontour(width) $contour(width)
+ set pcontour(dash) $contour(dash)
+ set pcontour(smooth) $contour(smooth)
+ set pcontour(numlevel) $contour(numlevel)
+}
+
+proc ContourUpdate {} {
+ global contour
+ global icontour
+ global dcontour
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {!$contour(view)} {
+ $current(frame) contour delete
+ return
+ }
+
+ ContourCheckParams
+ if {[winfo exists $icontour(top)]} {
+ set levels [$dcontour(txt) get 1.0 end]
+ # remove endl and trim
+ regsub -all "\n" $levels " " levels
+ set levels [string trimright $levels " "]
+
+ if {$levels == {}} {
+ ContourGenerateDialog
+ set levels [$dcontour(txt) get 1.0 end]
+ # remove endl and trim
+ regsub -all "\n" $levels " " levels
+ set levels [string trimright $levels " "]
+ }
+
+ if {$levels != {} && [ContourCheckMinMax]} {
+ $current(frame) contour create \
+ $contour(color) $contour(width) $contour(dash) \
+ $contour(method) $contour(numlevel) $contour(smooth) \
+ $contour(scale) $contour(log) $contour(mode) \
+ $contour(min) $contour(max) \
+ "\"$levels\""
+ }
+ } else {
+ set contour(scale) [$current(frame) get colorscale]
+ set contour(log) [$current(frame) get colorscale log]
+ set contour(mode) [$current(frame) get clip mode]
+ set limits [$current(frame) get clip $contour(mode)]
+ set contour(min) [lindex $limits 0]
+ set contour(max) [lindex $limits 1]
+
+ if {[ContourCheckMinMax]} {
+ $current(frame) contour create \
+ $contour(color) $contour(width) $contour(dash) \
+ $contour(method) $contour(numlevel) $contour(smooth) \
+ $contour(scale) $contour(log) $contour(mode) \
+ $contour(min) $contour(max) \
+ "{}"
+ }
+ }
+}
+
+proc ContourCheckParams {} {
+ global contour
+
+ if {$contour(smooth) < 1} {
+ set contour(smooth) 1
+ }
+ if {$contour(numlevel) < 1} {
+ set contour(numlevel) 1
+ }
+}
+
+proc ContourCheckMinMax {} {
+ global contour
+
+ if {$contour(min) != {} &&
+ $contour(max) != {} &&
+ !($contour(min) eq "nan") &&
+ !($contour(max) eq "nan") &&
+ [string is double $contour(min)] &&
+ [string is double $contour(max)]
+ } {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+proc ContourDialog {} {
+ global contour
+ global icontour
+ global dcontour
+ global current
+ global ds9
+
+ # see if we already have a ctr window visible
+ if {[winfo exists $icontour(top)]} {
+ raise $icontour(top)
+ return
+ }
+
+ # create the contour window
+ set w $icontour(top)
+ set mb $icontour(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Contour Parameters}] ContourDestroyDialog
+
+ # local variables
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Color}] -menu $mb.color
+ $mb add cascade -label [msgcat::mc {Width}] -menu $mb.width
+ $mb add cascade -label [msgcat::mc {Scale}] -menu $mb.scale
+ $mb add cascade -label [msgcat::mc {Limits}] -menu $mb.limit
+ $mb add cascade -label [msgcat::mc {Method}] -menu $mb.method
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command ContourApplyDialog
+ $mb.file add command -label [msgcat::mc {Generate}] \
+ -command ContourGenerateDialog
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command ContourOffDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Copy Contours}] \
+ -command ContourCCopyDialog
+ $mb.file add command -label "[msgcat::mc {Paste Contours}]..." \
+ -command ContourCPasteDialog
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Contours}]..." \
+ -command ContourLoadDialog
+ $mb.file add command -label "[msgcat::mc {Save Contours}]..." \
+ -command ContourSaveDialog
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Contour Levels}]..." \
+ -command ContourLoadLevels
+ $mb.file add command -label "[msgcat::mc {Save Contour Levels}]..." \
+ -command ContourSaveLevels
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Convert to Polygons}] \
+ -command Contour2Polygons
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command ContourDestroyDialog
+
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -command ContourCutDialog -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command ContourCopyDialog -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -command ContourPasteDialog -accelerator "${ds9(ctrl)}V"
+
+ ColorMenu $mb.color contour color {}
+ WidthDashMenu $mb.width contour width dash {} {}
+
+ menu $mb.scale
+ $mb.scale add radiobutton -label [msgcat::mc {Linear}] \
+ -variable contour(scale) -value linear
+ $mb.scale add radiobutton -label [msgcat::mc {Log}] \
+ -variable contour(scale) -value log
+ $mb.scale add radiobutton -label [msgcat::mc {Power}] \
+ -variable contour(scale) -value pow
+ $mb.scale add radiobutton -label [msgcat::mc {Square Root}] \
+ -variable contour(scale) -value sqrt
+ $mb.scale add radiobutton -label [msgcat::mc {Squared}] \
+ -variable contour(scale) -value squared
+ $mb.scale add radiobutton -label {ASINH} \
+ -variable contour(scale) -value asinh
+ $mb.scale add radiobutton -label {SINH} \
+ -variable contour(scale) -value sinh
+ $mb.scale add radiobutton \
+ -label [msgcat::mc {Histogram Equalization}] \
+ -variable contour(scale) -value histequ
+ $mb.scale add separator
+ $mb.scale add command -label "[msgcat::mc {Log Exponent}]..." \
+ -command ContourLogDialog
+
+ menu $mb.limit
+ $mb.limit add radiobutton -label [msgcat::mc {Min Max}] \
+ -variable contour(mode) -value minmax -command ContourModeDialog
+ $mb.limit add separator
+ $mb.limit add radiobutton -label {99.5%} \
+ -variable contour(mode) -value 99.5 -command ContourModeDialog
+ $mb.limit add radiobutton -label {99%} \
+ -variable contour(mode) -value 99 -command ContourModeDialog
+ $mb.limit add radiobutton -label {98%} \
+ -variable contour(mode) -value 98 -command ContourModeDialog
+ $mb.limit add radiobutton -label {95%} \
+ -variable contour(mode) -value 95 -command ContourModeDialog
+ $mb.limit add radiobutton -label {90%} \
+ -variable contour(mode) -value 90 -command ContourModeDialog
+ $mb.limit add separator
+ $mb.limit add radiobutton -label {ZScale} \
+ -variable contour(mode) -value zscale -command ContourModeDialog
+ $mb.limit add radiobutton -label {ZMax} \
+ -variable contour(mode) -value zmax -command ContourModeDialog
+ $mb.limit add radiobutton -label [msgcat::mc {User}] \
+ -variable contour(mode) -value user -command ContourModeDialog
+
+ menu $mb.method
+ $mb.method add radiobutton -label [msgcat::mc {Block}] \
+ -variable contour(method) -value block
+ $mb.method add radiobutton -label [msgcat::mc {Smooth}] \
+ -variable contour(method) -value smooth
+
+ # Param
+ set f [ttk::labelframe $w.param -text [msgcat::mc {Contour}] -padding 2]
+
+ slider $f.nslider 0 50 [msgcat::mc {Levels}] contour(numlevel) {}
+ slider $f.rslider 0 32 [msgcat::mc {Smoothness}] contour(smooth) {}
+
+ ttk::label $f.title -text [msgcat::mc {Limits}]
+ ttk::label $f.ltitle -text [msgcat::mc {Low}]
+ ttk::entry $f.low -textvariable contour(min) -width 10
+ ttk::label $f.htitle -text [msgcat::mc {High}]
+ ttk::entry $f.high -textvariable contour(max) -width 10
+
+ grid $f.nslider -columnspan 6 -padx 2 -pady 2
+ grid $f.rslider -columnspan 6 -padx 2 -pady 2
+ grid $f.title $f.ltitle $f.low $f.htitle $f.high -padx 2 -pady 2
+
+ # Levels
+ set f [ttk::labelframe $w.levels -text [msgcat::mc {Levels}] -padding 2]
+
+ set dcontour(txt) [text $f.text \
+ -wrap none \
+ -width 15 \
+ -height 10 \
+ -font [font actual TkDefaultFont] \
+ -yscrollcommand [list $f.yscroll set] \
+ ]
+ ttk::scrollbar $f.yscroll -command [list $dcontour(txt) yview] \
+ -orient vertical
+
+ grid $f.text $f.yscroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command ContourApplyDialog
+ ttk::button $f.generate -text [msgcat::mc {Generate}] \
+ -command ContourGenerateDialog
+ ttk::button $f.clear -text [msgcat::mc {Clear}] \
+ -command ContourOffDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command ContourDestroyDialog
+ pack $f.apply $f.generate $f.clear $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ grid $w.param $w.levels -sticky news
+ grid $w.buttons - -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid columnconfigure $w 1 -weight 1
+
+ UpdateContourDialog
+}
+
+proc ContourApplyDialog {} {
+ global contour
+
+ set contour(view) 1
+ ContourUpdate
+}
+
+proc ContourDestroyDialog {} {
+ global contour
+ global icontour
+ global dcontour
+
+ if {[winfo exists $icontour(top)]} {
+ destroy $icontour(top)
+ destroy $icontour(mb)
+ }
+
+ unset dcontour
+}
+
+proc ContourGenerateDialog {} {
+ global contour
+ global dcontour
+ global current
+
+ ContourCheckParams
+
+ $dcontour(txt) delete 1.0 end
+ if {$current(frame) != {}} {
+ if {([$current(frame) has fits]) && [ContourCheckMinMax]} {
+ set ll [$current(frame) get colorscale level $contour(numlevel) \
+ $contour(min) $contour(max) \
+ $contour(scale) $contour(log)]
+ regsub -all " " "$ll" "\n" ll
+ $dcontour(txt) insert end "$ll"
+ }
+ }
+}
+
+proc ContourOffDialog {} {
+ global contour
+ global current
+
+ set contour(view) 0
+ if {$current(frame) != {}} {
+ $current(frame) contour delete
+ $current(frame) contour delete aux
+ }
+ UpdateContourScale
+ UpdateContourDialog
+}
+
+proc ContourCutDialog {} {
+ global icontour
+ global dcontour
+
+ if {[winfo exists $icontour(top)]} {
+ set w [focus -displayof $icontour(top)]
+ if {$w == $dcontour(txt)} {
+ tk_textCut $w
+ } else {
+ EntryCut $icontour(top)
+ }
+ }
+}
+
+proc ContourCopyDialog {} {
+ global icontour
+ global dcontour
+
+ if {[winfo exists $icontour(top)]} {
+ set w [focus -displayof $icontour(top)]
+ if {$w == $dcontour(txt)} {
+ tk_textCopy $w
+ } else {
+ EntryCopy $icontour(top)
+ }
+ }
+}
+
+proc ContourPasteDialog {} {
+ global icontour
+ global dcontour
+
+ if {[winfo exists $icontour(top)]} {
+ set w [focus -displayof $icontour(top)]
+ if {$w == $dcontour(txt)} {
+ tk_textPaste $w
+ } else {
+ EntryPaste $icontour(top)
+ }
+ }
+}
+
+proc ContourCCopyDialog {} {
+ global contour
+ global current
+
+ set contour(copy) $current(frame)
+ UpdateContourDialog
+}
+
+proc ContourCPasteDialog {} {
+ global ds9
+ global current
+ global contour
+ global ed
+
+ if {$current(frame) == {} || $contour(copy) == {}} {
+ return
+ }
+
+ set w {.ctld}
+
+ set ed(ok) 0
+ set ed(system) wcs
+ set ed(sky) fk5
+ set ed(color) green
+ set ed(width) 1
+ set ed(dash) 0
+ set ed(frame) $current(frame)
+ set ed(original) 0
+
+ SetCoordSystem ed system sky {}
+ AdjustCoordSystem ed system
+
+ DialogCreate $w [msgcat::mc {Contour Paste}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param1]
+
+ ttk::checkbutton $f.original -text [msgcat::mc {Use Original Color/Width}] -variable ed(original)
+ grid $f.original -padx 2 -pady 2 -sticky w
+
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.coordtitle -text [msgcat::mc {Coordinate System}]
+
+ CoordMenuButton $f.coordbutton ed system 1 {} {} {}
+ CoordMenuEnable $f.coordbutton.menu ed system 1 {} {}
+
+ ttk::label $f.colortitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.colorbutton ed color {}
+
+ ttk::label $f.widthtitle -text [msgcat::mc {Width}]
+ ttk::menubutton $f.widthbutton -textvariable ed(width) \
+ -menu $f.widthbutton.menu
+ WidthDashMenu $f.widthbutton.menu ed width dash {} {}
+
+ grid $f.coordtitle $f.coordbutton -padx 2 -pady 2 -sticky w
+ grid $f.colortitle $f.colorbutton -padx 2 -pady 2 -sticky w
+ grid $f.widthtitle $f.widthbutton -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.sep2 -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+# pack $w.param1 $w.sep2 $w.param2 -side top -fill both -expand true
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set ed(color) [string tolower $ed(color)]
+
+ if {$current(frame) == $contour(copy)} {
+ set ed(system) physical
+ }
+
+ set cc [$contour(copy) get contour $ed(system) fk5]
+ if {$ed(original)} {
+ $current(frame) contour paste cc
+ } else {
+ $current(frame) contour paste cc $ed(color) $ed(width) $ed(dash)
+ }
+ UpdateContourDialog
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc ContourModeDialog {} {
+ global current
+ global contour
+
+ if {$current(frame) != {}} {
+ set limits [$current(frame) get clip $contour(mode)]
+ set contour(min) [lindex $limits 0]
+ set contour(max) [lindex $limits 1]
+ }
+}
+
+proc ContourLoadLevels {} {
+ set fn [OpenFileDialog contourlevlfbox]
+
+ ContourLoadLevelsNow $fn
+}
+
+proc ContourLoadLevelsNow {fn} {
+ global dcontour
+
+ if {$fn == {}} {
+ return
+ }
+
+ $dcontour(txt) delete 1.0 end
+ set ch [open $fn r]
+ if {[file extension $fn] == {.lev}} {
+ $dcontour(txt) insert end [read $ch]
+ } else {
+ ContourLoadLevelsNew $ch
+ }
+ close $ch
+}
+
+proc ContourLoadLevelsNew {ch} {
+ global dcontour
+
+ while {[gets $ch line] != -1} {
+ set aa [split $line {= }]
+ regsub -all {[{}]} $aa {} aa
+ regsub -all { +} $aa { } aa
+ set aa [string trim $aa]
+
+ if {![string compare -nocase [lindex $aa 0] {level}]} {
+ set value [string trim [lindex $aa 1]]
+ if {[string is double $value]} {
+ $dcontour(txt) insert end "$value\n"
+ }
+ }
+ }
+}
+
+proc ContourSaveLevels {} {
+ set fn [SaveFileDialog contourlevsfbox]
+ ContourSaveLevelsNow $fn
+}
+
+proc ContourSaveLevelsNow {fn} {
+ global dcontour
+
+ if {$fn == {}} {
+ return
+ }
+
+ set id [open $fn w]
+ puts -nonewline $id "[$dcontour(txt) get 1.0 end]"
+ close $id
+}
+
+proc ContourSaveDialog {} {
+ global ds9
+ global current
+ global contour
+ global ed
+ global wcs
+
+ set fn [SaveFileDialog contoursfbox]
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ set w {.ctld}
+
+ set ed(ok) 0
+ set ed(system) wcs
+ set ed(sky) fk5
+ set ed(skyformat) degrees
+ set ed(frame) $current(frame)
+
+ SetCoordSystem ed system sky {}
+ AdjustCoordSystem ed system
+
+ DialogCreate $w [msgcat::mc {Contour Save}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.coordtitle -text [msgcat::mc {Coordinate System}]
+
+ CoordMenuButton $f.coordbutton ed system 1 sky skyformat {}
+ CoordMenuEnable $f.coordbutton.menu ed system 1 sky skyformat
+ grid $f.coordtitle $f.coordbutton -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ switch -- $ed(system) {
+ image -
+ physical -
+ detector -
+ amplifier {}
+ default {
+ if {![$current(frame) has wcs $ed(system)]} {
+ Error "[msgcat::mc {Invalid WCS}] $ed(system)"
+ return $ed(ok)
+ }
+ }
+ }
+
+ $current(frame) contour save "\{$fn\}" $ed(system) $ed(sky)
+ UpdateContourDialog
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc ContourLoadDialog {} {
+ global ds9
+ global current
+ global contour
+ global ed
+
+ set fn [OpenFileDialog contourlfbox]
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ set w {.ctld}
+
+ set ed(ok) 0
+ set ed(color) green
+ set ed(width) 1
+ set ed(dash) 0
+ set ed(frame) $current(frame)
+ set ed(original) 0
+ if {[file extension $fn] == {.con}} {
+ ContourLoadOldDialog $fn
+ } else {
+ ContourLoadNewDialog $fn
+ }
+}
+
+proc ContourLoadOldDialog {fn} {
+ global ds9
+ global current
+ global contour
+ global ed
+
+ set w {.ctld}
+
+ set ed(ok) 0
+ set ed(system) wcs
+ set ed(sky) fk5
+ set ed(color) green
+ set ed(width) 1
+ set ed(dash) 0
+ set ed(frame) $current(frame)
+
+ SetCoordSystem ed system sky {}
+ AdjustCoordSystem ed system
+
+ DialogCreate $w [msgcat::mc {Contour Paste}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.coordtitle -text [msgcat::mc {Coordinate System}]
+
+ CoordMenuButton $f.coordbutton ed system 1 {} {} {}
+ CoordMenuEnable $f.coordbutton.menu ed system 1 {} {}
+
+ ttk::label $f.colortitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.colorbutton ed color {}
+
+ ttk::label $f.widthtitle -text [msgcat::mc {Width}]
+ ttk::menubutton $f.widthbutton -textvariable ed(width) \
+ -menu $f.widthbutton.menu
+ WidthDashMenu $f.widthbutton.menu ed width dash {} {}
+
+ grid $f.coordtitle $f.coordbutton -padx 2 -pady 2 -sticky w
+ grid $f.colortitle $f.colorbutton -padx 2 -pady 2 -sticky w
+ grid $f.widthtitle $f.widthbutton -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set ed(color) [string tolower $ed(color)]
+ $current(frame) contour load $ed(color) $ed(width) $ed(dash) \
+ "\{$fn\}" $ed(system) $ed(sky)
+ UpdateContourDialog
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc ContourLoadNewDialog {fn} {
+ global ds9
+ global current
+ global contour
+ global ed
+
+ set w {.ctld}
+
+ set ed(ok) 0
+ set ed(color) green
+ set ed(width) 1
+ set ed(dash) 0
+ set ed(frame) $current(frame)
+ set ed(original) 0
+
+ DialogCreate $w [msgcat::mc {Contour Paste}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param1]
+
+ ttk::checkbutton $f.original -text [msgcat::mc {Use Original Color/Width}] \
+ -variable ed(original)
+
+ grid $f.original -padx 2 -pady 2 -sticky w
+
+ set f [ttk::frame $w.param2]
+
+ ttk::label $f.colortitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.colorbutton ed color {}
+
+ ttk::label $f.widthtitle -text [msgcat::mc {Width}]
+ ttk::menubutton $f.widthbutton -textvariable ed(width) \
+ -menu $f.widthbutton.menu
+ WidthDashMenu $f.widthbutton.menu ed width dash {} {}
+
+ grid $f.colortitle $f.colorbutton -padx 2 -pady 2 -sticky w
+ grid $f.widthtitle $f.widthbutton -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.sep2 -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param1 $w.sep2 $w.param2 -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set ed(color) [string tolower $ed(color)]
+
+ if {$ed(original)} {
+ $current(frame) contour load "\{$fn\}"
+ } else {
+ $current(frame) contour load "\{$fn\}" \
+ $ed(color) $ed(width) $ed(dash)
+ }
+ UpdateContourDialog
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc Contour2Polygons {} {
+ global current
+ global contour
+
+ if {$current(frame) != {}} {
+ $current(frame) contour create polygon
+ $current(frame) contour delete
+ }
+}
+
+proc UpdateContourMenu {} {
+ global contour
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateContourMenu"
+ }
+
+ if {($current(frame) == {})} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ set contour(view) [$current(frame) has contour]
+
+ if {[$current(frame) has contour]} {
+ set contour(color) [$current(frame) get contour color]
+ set contour(width) [$current(frame) get contour width]
+ set contour(dash) [$current(frame) get contour dash]
+ set contour(method) [$current(frame) get contour method]
+ set contour(smooth) [$current(frame) get contour smooth]
+ set contour(numlevel) [$current(frame) get contour number level]
+ }
+
+ UpdateContourScale
+}
+
+proc UpdateContourScale {} {
+ global contour
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateContourScale"
+ }
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {[$current(frame) has contour]} {
+ set contour(scale) [$current(frame) get contour colorscale]
+ set contour(mode) [$current(frame) get contour clip mode]
+ set contour(log) [$current(frame) get contour colorscale log]
+ set limits [$current(frame) get contour clip]
+ set contour(min) [lindex $limits 0]
+ set contour(max) [lindex $limits 1]
+ } else {
+ if {!($ds9(init) && $contour(init,scale))} {
+ set contour(scale) [$current(frame) get colorscale]
+ set contour(log) [$current(frame) get colorscale log]
+ }
+ if {!($ds9(init) && $contour(init,mode))} {
+ set contour(mode) [$current(frame) get clip mode]
+ }
+ if {!($ds9(init) && $contour(init,limits))} {
+ set limits [$current(frame) get clip $contour(mode)]
+ set contour(min) [lindex $limits 0]
+ set contour(max) [lindex $limits 1]
+ }
+ }
+}
+
+proc UpdateContourDialog {} {
+ global contour
+ global icontour
+ global dcontour
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateContourDialog"
+ }
+
+ if {![winfo exists $icontour(top)]} {
+ return
+ }
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {[$current(frame) has contour]} {
+ set levels [$current(frame) get contour level]
+ regsub -all "\n" "$levels" " " levels
+ set levels [join $levels "\n"]
+ if {$levels != {}} {
+ $dcontour(txt) delete 1.0 end
+ $dcontour(txt) insert end $levels
+ } else {
+ ContourGenerateDialog
+ }
+ } else {
+ ContourGenerateDialog
+ }
+}
+
+proc ContourLogDialog {} {
+ global contour
+
+ EntryDialog [msgcat::mc {Scale}] [msgcat::mc {Log Exponent}] 10 contour(log)
+}
+
+proc ContourBackup {ch which fdir rdir} {
+ switch [$which get type] {
+ base -
+ 3d {ContourBackupBase $ch $which $fdir $rdir}
+ rgb {ContourBackupRGB $ch $which $fdir $rdir}
+ }
+}
+
+proc ContourBackupBase {ch which fdir rdir} {
+ if {[$which has contour]} {
+ set color [$which get contour color]
+ set width [$which get contour width]
+ set dash [$which get contour dash]
+ set method [$which get contour method]
+ set numlevel [$which get contour number level]
+ set smooth [$which get contour smooth]
+ set scale [$which get contour colorscale]
+ set log [$which get contour colorscale log]
+ set mode [$which get contour clip mode]
+ set limits [$which get contour clip]
+ set levels [$which get contour level]
+
+ puts $ch "$which contour create $color $width $dash $method $numlevel $smooth $scale $log $mode $limits \{\"$levels\"\}"
+ }
+
+ # delete old contours
+ foreach ff [glob -directory $fdir -nocomplain "aux*.ctr"] {
+ catch {file delete -force $ff}
+ }
+
+ if {[$which has contour aux]} {
+ set fn $fdir/aux.ctr
+ set rfn $rdir/aux.ctr
+ $which contour save aux \"$fn\" physical fk5
+ puts $ch "$which contour load \{\"$rfn\"\}"
+ }
+}
+
+proc ContourBackupRGB {ch which fdir rdir} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ ContourBackupBase $ch $which $fdir $rdir
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+proc PrefsDialogContour {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Contours}]
+ lappend dprefs(tabs) [ttk::frame $w.contour]
+
+ set f [ttk::labelframe $w.contour.param -text [msgcat::mc {Contours}]]
+
+ ttk::label $f.mtitle -text [msgcat::mc {Method}]
+ ttk::menubutton $f.method -textvariable pcontour(method) \
+ -menu $f.method.menu
+
+ global pcontour
+ ttk::label $f.ctitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pcontour color {}
+
+ ttk::label $f.wtitle -text [msgcat::mc {Width}]
+ ttk::menubutton $f.width -textvariable pcontour(width) -menu $f.width.menu
+ WidthDashMenu $f.width.menu pcontour width dash {} {}
+
+ grid $f.mtitle $f.method -padx 2 -pady 2 -sticky w
+ grid $f.ctitle $f.color -padx 2 -pady 2 -sticky w
+ grid $f.wtitle $f.width -padx 2 -pady 2 -sticky w
+
+ set m $f.method.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {Block}] \
+ -variable pcontour(method) -value block
+ $m add radiobutton -label [msgcat::mc {Smooth}] \
+ -variable pcontour(method) -value smooth
+
+ pack $f -side top -fill both -expand true
+}
+
+proc ProcessContourCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global contour
+ global current
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {ContourDialog}
+ close {ContourDestroyDialog}
+ clear {ContourOffDialog}
+ load {
+ incr i
+ set fn [lindex $var $i]
+
+ # backward compatibility
+ incr i
+ set sys [lindex $var $i]
+ incr i
+ set sky [lindex $var $i]
+ incr i
+ set color [lindex $var $i]
+ incr i
+ set width [lindex $var $i]
+ incr i
+ set dash [lindex $var $i]
+ incr i [ProcessContourFix sys sky color width dash]
+
+ if {$fn != {}} {
+ if {[file extension $fn] == {.con}} {
+ $current(frame) contour load $color $width $dash "\{$fn\}" $sys $sky
+ } else {
+ $current(frame) contour load "\{$fn\}" $color $width $dash
+ }
+ }
+ FileLast contourlfbox $fn
+ UpdateContourDialog
+ }
+ save {
+ incr i
+ set fn [lindex $var $i]
+ incr i
+ set sys [lindex $var $i]
+ incr i
+ set sky [lindex $var $i]
+
+ # Backward compatibility
+ incr i
+ set color {}
+ incr i
+ set width {}
+ incr i
+ set dash {}
+ incr i [ProcessContourFix sys sky color width dash]
+
+ if {$fn != {}} {
+ $current(frame) contour save "\{$fn\}" $sys $sky
+ }
+ FileLast contoursfbox $fn
+ }
+ convert {Contour2Polygons}
+ loadlevels {
+ ContourDialog
+ incr i
+ ContourLoadLevelsNow [lindex $var $i]
+ ContourUpdate
+ }
+ savelevels {
+ ContourDialog
+ incr i
+ ContourSaveLevelsNow [lindex $var $i]
+ }
+
+ copy {ContourCCopyDialog}
+ paste {
+ incr i
+ set sys [lindex $var $i]
+ incr i
+ set sky [lindex $var $i]
+ incr i
+ # backward compatibility
+ set color [lindex $var $i]
+ incr i
+ set width [lindex $var $i]
+ incr i
+ set dash [lindex $var $i]
+ incr i [ProcessContourFix sys sky color width dash]
+
+ if {$current(frame) != {} && $contour(copy) != {}} {
+ set cc [$contour(copy) get contour $sys $sky]
+ $current(frame) contour paste cc $color $width $dash
+ }
+ }
+
+ color {
+ ContourDialog
+
+ incr i
+ set contour(color) [lindex $var $i]
+ ContourUpdate
+ }
+ width {
+ ContourDialog
+
+ incr i
+ set contour(width) [lindex $var $i]
+ ContourUpdate
+ }
+ dash {
+ ContourDialog
+
+ incr i
+ set contour(dash) [FromYesNo [lindex $var $i]]
+ ContourUpdate
+ }
+
+ smooth {
+ ContourDialog
+
+ incr i
+ set contour(smooth) [lindex $var $i]
+ ContourGenerateDialog
+ ContourUpdate
+ }
+ method {
+ ContourDialog
+
+ incr i
+ set contour(method) [lindex $var $i]
+ ContourGenerateDialog
+ ContourUpdate
+ }
+
+ nlevels {
+ ContourDialog
+
+ incr i
+ set contour(numlevel) [lindex $var $i]
+ ContourGenerateDialog
+ ContourUpdate
+ }
+ scale {
+ set contour(init,scale) 1
+ ContourDialog
+
+ incr i
+ set contour(scale) [string tolower [lindex $var $i]]
+ ContourGenerateDialog
+ ContourUpdate
+ }
+ log {
+ set contour(init,scale) 1
+ ContourDialog
+
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ exp {
+ incr i
+ set contour(log) [string tolower [lindex $var $i]]
+ }
+ default {
+ incr i -1
+ set contour(log) [string tolower [lindex $var $i]]
+ }
+ }
+ ContourGenerateDialog
+ ContourUpdate
+ }
+ mode {
+ set contour(init,mode) 1
+ ContourDialog
+
+ incr i
+ set contour(mode) [lindex $var $i]
+ ContourModeDialog
+ ContourGenerateDialog
+ ContourUpdate
+ }
+ limits {
+ set contour(init,limits) 1
+ ContourDialog
+
+ incr i
+ set contour(min) [lindex $var $i]
+ incr i
+ set contour(max) [lindex $var $i]
+ ContourGenerateDialog
+ ContourUpdate
+ }
+
+ levels {
+ ContourDialog
+
+ global dcontour
+ $dcontour(txt) delete 1.0 end
+ incr i
+ $dcontour(txt) insert end [lindex $var $i]
+ ContourUpdate
+ }
+
+ generate {
+ ContourDialog
+
+ ContourGenerateDialog
+ ContourUpdate
+ }
+
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ set contour(view) [FromYesNo [lindex $var $i]]
+ ContourUpdate
+ }
+
+ default {
+ set contour(view) 1
+ ContourUpdate
+ incr i -1
+ }
+ }
+}
+
+proc ProcessContourFix {sysname skyname colorname widthname dashname} {
+ upvar $sysname sys
+ upvar $skyname sky
+ upvar $colorname color
+ upvar $widthname width
+ upvar $dashname dash
+
+ global current
+
+ set rr 0
+
+ # sys
+ switch -- $sys {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {}
+ default {
+ set dash $width
+ set width $color
+ set color $sky
+ set sky $sys
+ if {[$current(frame) has wcs wcs]} {
+ set sys wcs
+ } else {
+ set sys physical
+ }
+ incr rr -1
+ }
+ }
+
+ # sky
+ switch -- $sky {
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {}
+ default {
+ set dash $width
+ set width $color
+ set color $sky
+ set sky fk5
+ incr rr -1
+ }
+ }
+
+ # color
+ if {[string range $color 0 0] == {-} || $color == {}} {
+ set color {}
+ set width {}
+ set dash {}
+ return -3
+ }
+ switch -- $color {
+ white -
+ black -
+ red -
+ green -
+ blue -
+ cyan -
+ magenta -
+ yellow {}
+ default {
+ if {[string range $color 0 0] != "#"} {
+ set dash $width
+ set width $color
+ set color green
+ incr rr -1
+ }
+ }
+ }
+
+ # width
+ if {![string is integer $width]} {
+ set dash $width
+ set width 1
+ incr rr -1
+ }
+
+ # dash
+ switch -- $dash {
+ yes -
+ no -
+ on -
+ off -
+ true -
+ false -
+ 0 -
+ 1 {set dash [FromYesNo $dash]}
+ default {
+ set dash 0
+ incr rr -1
+ }
+ }
+
+ return $rr
+}
+
+proc ProcessSendContourCmd {proc id param sock fn} {
+ global contour
+
+ switch -- [lindex $param 0] {
+ {} {$proc $id [ToYesNo $contour(view)]}
+ color {$proc $id "$contour(color)\n"}
+ width {$proc $id "$contour(width)\n"}
+ dash {$proc $id [ToYesNo $contour(dash)]}
+ smooth {$proc $id "$contour(smooth)\n"}
+ method {$proc $id "$contour(method)\n"}
+ nlevels {$proc $id "$contour(numlevel)\n"}
+ scale {$proc $id "$contour(scale)\n"}
+ log -
+ {log exp} {$proc $id "$contour(log)\n"}
+ mode {$proc $id "$contour(mode)\n"}
+ limits {$proc $id "$contour(min) $contour(max)\n"}
+ levels {
+ global dcontour
+ ContourDialog
+ $proc $id "[$dcontour(txt) get 1.0 end]"
+ }
+ default {
+ global current
+ if {$current(frame) != {}} {
+ ProcessSend $proc $id $sock $fn {.ctr} \
+ [$current(frame) get contour [lindex $param 0] [lindex $param 1]]
+ }
+ }
+ }
+}
diff --git a/ds9/library/convert.tcl b/ds9/library/convert.tcl
new file mode 100644
index 0000000..83884ed
--- /dev/null
+++ b/ds9/library/convert.tcl
@@ -0,0 +1,215 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+set M_PI 3.14159265358979323846
+
+# hours to degrees
+proc h2d {h} {
+ return [expr ($h + 0.0) * 15.0]
+}
+
+# degrees to hours
+proc d2h {d} {
+ return [expr ($d + 0.0) / 15.0]
+}
+
+# degrees to radians -- returns 0 <= r < PI
+proc d2r {d} {
+ global M_PI
+ while {[::math::fuzzy::tge $d 360.0]} {
+ set d [expr $d - 360.0]
+ }
+ return [expr ($d + 0.0) * ($M_PI / 360.0)]
+}
+
+# radians to degrees -- returns 0 <= d < PI
+proc r2d {r} {
+ global M_PI
+ while {[::math::fuzzy::tge $r $M_PI]} {
+ set r [expr $r - $M_PI]
+ }
+ return [expr ($r + 0.0) * (360.0 / $M_PI)]
+}
+
+#
+# strtod -- convert string to double
+#
+# Supports sexagesimal values:
+# 12:30:45.6 12h30m45.6s 12d30m45.6s "12 30 45.6"
+
+# Supports 12.5d (degrees) 12.5r (radians)
+#
+# A hidden global _strtod returns the number of arguments in the input.
+# if this value is 3 or 4, then hms or dms was input. This can be used
+# to determine that hms was input for ra so that you can convert hours
+# to degrees.
+#
+#
+set _strtod 0
+proc strtod {d} {
+ global _strtod
+
+ set d [string trim $d]
+ set d [string trimleft $d 0]
+ if { $d == {} } {
+ set d 0
+ }
+
+ if { [string first - $d] >= 0 } {
+ set sign "-"
+ regsub -all -- "-" $d {} d
+ } elseif { [string first + $d] >= 0 } {
+ set sign {}
+ regsub -all -- {\+} $d {} d
+ } else {
+ set sign {}
+ }
+
+ regsub -all {[ \t]*[hms][ \t]*} $d ":" d
+ set arglist [split $d ": "]
+
+ set _strtod 0
+ foreach arg $arglist {
+ set args($_strtod) [string trimleft $arg 0]
+ if { $args($_strtod) == {} } {
+ set args($_strtod) 0
+ }
+ incr _strtod
+ }
+
+ switch $_strtod {
+ 2 {
+ error "ERROR: strtod h:m:s|d:m:s|d"
+ }
+ 3 {
+ set d [expr double($args(0)) + 0.0];
+ set m [expr double($args(1)) + 0.0];
+ set s [expr double($args(2)) + 0.0];
+ }
+ 4 {
+ set d [expr double($args(0)) + 0.0];
+ set m [expr double($args(1)) + 0.0];
+ set s [expr double($args(2)) + 0.0];
+ }
+ default {
+ set c [string range $d end end]
+ if { $c == "r" } {
+ set d [string trimright $d r]
+ set d [r2d $d]
+ } elseif { $c == "d" } {
+ set d [string trimright $d d]
+ }
+ set m 0
+ set s 0
+ }
+ }
+ set val [expr $d + ($m / 60.0) + ($s / 3600.0)]
+ # we don't want this. it rounds off to a precision of 6, which can
+ # cause problems with h:m:s to degree convertions
+ # set val [format "%s%g" $sign $val]
+ set val "$sign$val"
+ return $val
+}
+
+#
+# _uformat -- primative unit format converter to convert a float to a string
+# output format can be:
+# # or : (output in sexagesimal) or d (output in decimal)
+#
+proc _uformat {oformat value} {
+
+ if { $value < 0.0 } {
+ set sign "-"
+ set d [expr -$value]
+ } else {
+ set sign {}
+ set d $value
+ }
+ switch $oformat {
+ {#} {
+ set m [expr ($d - (int($d))) * 60]
+ if { $m < 0 } {
+ set m 0.0
+ }
+ set s [expr ($m - (int($m))) * 60]
+ if { $s < 0 } {
+ set s 0.0
+ }
+ return [format "%s%d %d %.3f" \
+ $sign [expr int($d)] [expr int($m)] $s]
+ }
+ : {
+ set m [expr ($d - (int($d))) * 60]
+ if { $m < 0 } {
+ set m 0.0
+ }
+ set s [expr ($m - (int($m))) * 60]
+ if { $s < 0 } {
+ set s 0.0
+ }
+ return [format "%s%d:%d:%.3f" \
+ $sign [expr int($d)] [expr int($m)] $s]
+ }
+ d {
+ return [format "%s%f" $sign $d]
+ }
+ }
+}
+
+#
+# uformat -- unit format converter
+#
+# uformat input_format output_format value
+#
+# where input format can be:
+# h (hours) d (degrees) m (minutes) s (seconds)
+# and output format can be the same, with a suffix of:
+# # or : (output in sexagesimal) or d (output in decimal)
+#
+proc uformat {iformat oformat value} {
+ set itype [string index $iformat 0]
+ set otype [string index $oformat 0]
+ set oform [string index $oformat 1]
+ if { $oform == {} } {
+ set oform d
+ }
+ set value [strtod $value]
+
+ switch $itype {
+ h {
+ switch $otype {
+ h {return [_uformat $oform $value]}
+ d {return [_uformat $oform [h2d $value]]}
+ m {return [_uformat $oform [h2d $value]*60]}
+ s {return [_uformat $oform [h2d $value]*60*60]}
+ }
+ }
+ d {
+ switch $otype {
+ h {return [_uformat $oform [d2h $value]]}
+ d {return [_uformat $oform $value]}
+ m {return [_uformat $oform [expr $value*60]]}
+ s {return [_uformat $oform [expr $value*60*60]]}
+ }
+ }
+ m {
+ switch $otype {
+ h {return [_uformat $oform [d2h $value/60]]}
+ d {return [_uformat $oform [expr $value/60]]}
+ m {return [_uformat $oform $value]}
+ s {return [_uformat $oform [expr $value*60]]}
+ }
+ }
+ s {
+ switch $otype {
+ h {return [_uformat $oform [h2d $value/60/60]]}
+ d {return [_uformat $oform [expr $value/60/60]]}
+ m {return [_uformat $oform [expr $value/60]]}
+ s {return [_uformat $oform $value]}
+ }
+ }
+ }
+}
diff --git a/ds9/library/coord.tcl b/ds9/library/coord.tcl
new file mode 100644
index 0000000..3419721
--- /dev/null
+++ b/ds9/library/coord.tcl
@@ -0,0 +1,204 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CoordDef {} {
+ global pcoord
+
+ # prefs only
+ set pcoord(filename) 0
+ set pcoord(value) 1
+ set pcoord(image) 1
+ set pcoord(physical) 0
+ set pcoord(amplifier) 0
+ set pcoord(detector) 0
+ set pcoord(wcs) 1
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set "pcoord(wcs$l)" 0
+ }
+}
+
+proc SetCoordSystem {varname system sky skyformat} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+ switch $var(system) {
+ image -
+ physical -
+ detector -
+ amplifier {}
+ default {
+ if {$current(frame) != {}} {
+ set rr [$current(frame) get wcs]
+ set var($system) [lindex $rr 0]
+ if {$sky != {}} {
+ set var($sky) [lindex $rr 1]
+ }
+ if {$skyformat != {}} {
+ set var($skyformat) [lindex $rr 2]
+ }
+ }
+ }
+ }
+}
+
+proc AdjustCoordSystem {varname system} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+ switch -- $var($system) {
+ image -
+ physical -
+ amplifier -
+ detector {}
+ wcs {
+ if {$current(frame) != {}} {
+ if {![$current(frame) has wcs $var($system)]} {
+ set ${varname}($system) physical
+ }
+ }
+ }
+ default {
+ if {$current(frame) != {}} {
+ if {![$current(frame) has wcs $var($system)]} {
+ if {[$current(frame) has wcs wcs]} {
+ set ${varname}($system) wcs
+ } else {
+ set ${varname}($system) physical
+ }
+ }
+ }
+ }
+ }
+}
+
+proc AdjustCoordSystem3d {varname system} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+ switch -- $var($system) {
+ image {}
+ wcs {
+ if {$current(frame) != {}} {
+ if {![$current(frame) has wcs 3d $var($system)]} {
+ set ${varname}($system) image
+ }
+ }
+ }
+ default {
+ if {$current(frame) != {}} {
+ if {![$current(frame) has wcs 3d $var($system)]} {
+ if {[$current(frame) has wcs wcs]} {
+ set ${varname}($system) wcs
+ } else {
+ set ${varname}($system) image
+ }
+ }
+ }
+ }
+ }
+}
+
+proc DisplayCoordDialog {which x y} {
+ global pcoord
+ global wcs
+
+ set r {}
+
+ if {$pcoord(filename)} {
+ append r "[$which get fits file name full]"
+ }
+
+ foreach l {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ if {"$pcoord(wcs$l)" && [$which has wcs "wcs$l"]} {
+ set cd "[$which get coordinates $x $y wcs$l $wcs(sky) $wcs(skyformat)]"
+
+ if {[$which has wcs equatorial "wcs$l"]} {
+ append r " [lindex $cd 0] [lindex $cd 1] $wcs(sky)"
+ } else {
+ set name [$which get wcs name "wcs$l"]
+ if {$name != {}} {
+ append r " [lindex $cd 0] [lindex $cd 1] $name"
+ } else {
+ append r " [lindex $cd 0] [lindex $cd 1] [lindex $cd 3]"
+ }
+ }
+ }
+ }
+
+ if {$pcoord(detector) && [$which has detector]} {
+ append r " [$which get coordinates $x $y detector] detector"
+ }
+
+ if {$pcoord(amplifier) && [$which has amplifier]} {
+ append r " [$which get coordinates $x $y amplifier] amplifier"
+ }
+
+ if {$pcoord(physical) && [$which has physical]} {
+ append r " [$which get coordinates $x $y physical] physical"
+ }
+
+ if {$pcoord(image)} {
+ append r " [$which get coordinates $x $y image]"
+ }
+
+ if {$pcoord(value)} {
+ append r " [$which get value canvas $x $y]"
+ }
+
+ append r " \n"
+
+ SimpleTextDialog coordtxt [msgcat::mc {Coordinates}] \
+ 80 20 append bottom "$r"
+}
+
+proc PrefsDialogCoord {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Print Coordinates}]
+ lappend dprefs(tabs) [ttk::frame $w.coord]
+
+ # Print
+ set f [ttk::labelframe $w.coord.print -text [msgcat::mc {Print}]]
+
+ ttk::checkbutton $f.filename -text [msgcat::mc {Filename}] \
+ -variable pcoord(filename)
+ ttk::checkbutton $f.value -text [msgcat::mc {Value}] \
+ -variable pcoord(value)
+ ttk::checkbutton $f.wcs -text [msgcat::mc {WCS}] -variable pcoord(wcs)
+ ttk::menubutton $f.mwcs -text [msgcat::mc {Multiple WCS}] -menu $f.mwcs.menu
+
+ ttk::checkbutton $f.image -text [msgcat::mc {Image}] \
+ -variable pcoord(image)
+ ttk::checkbutton $f.physical -text [msgcat::mc {Physical}] \
+ -variable pcoord(physical)
+ ttk::checkbutton $f.amplifier -text [msgcat::mc {Amplifier}] \
+ -variable pcoord(amplifier)
+ ttk::checkbutton $f.detector -text [msgcat::mc {Detector}] \
+ -variable pcoord(detector)
+
+ set m $f.mwcs.menu
+ menu $m
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $m add checkbutton -label "[msgcat::mc {WCS}] $l" \
+ -variable "pcoord(wcs$l)"
+ }
+
+ grid $f.filename -padx 2 -pady 2 -sticky w
+ grid $f.value -padx 2 -pady 2 -sticky w
+ grid $f.wcs $f.mwcs -padx 2 -pady 2 -sticky w
+ grid $f.image -padx 2 -pady 2 -sticky w
+ grid $f.physical -padx 2 -pady 2 -sticky w
+ grid $f.amplifier -padx 2 -pady 2 -sticky w
+ grid $f.detector -padx 2 -pady 2 -sticky w
+
+ pack $w.coord.print -side top -fill both -expand true
+}
+
diff --git a/ds9/library/cpanda.tcl b/ds9/library/cpanda.tcl
new file mode 100644
index 0000000..02b1c1d
--- /dev/null
+++ b/ds9/library/cpanda.tcl
@@ -0,0 +1,132 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PandaDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(which) panda
+ set var(proc,apply) PandaApply
+ set var(proc,close) PandaClose
+ set var(proc,generate) PandaGenerate
+ set var(proc,coordCB) PandaCoordCB
+ set var(proc,editCB) PandaEditCB
+ set var(proc,distCB) PandaDistCB
+
+ # base panda dialog
+ MarkerBasePandaDialog $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.tinner -text [msgcat::mc {Inner}]
+ ttk::label $f.touter -text [msgcat::mc {Outer}]
+ ttk::label $f.tradius -text [msgcat::mc {Radius}]
+ ttk::entry $f.inner -textvariable ${varname}(inner) -width 13
+ ttk::entry $f.outer -textvariable ${varname}(outer) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list $var(proc,distCB) $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+
+ # Annuli
+ ttk::label $f.tannuli -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable ${varname}(annuli) -width 13
+
+ grid x $f.tinner $f.touter -padx 2 -pady 2 -sticky w
+ grid $f.tradius $f.inner $f.outer $f.uradius -padx 2 -pady 2 -sticky w
+ grid $f.tannuli $f.annuli -padx 2 -pady 2 -sticky w
+
+ # init - do this last
+ PandaDistCB $varname
+}
+
+# actions
+
+proc PandaClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBasePandaClose $varname
+}
+
+proc PandaApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBasePandaApply $varname
+}
+
+proc PandaGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseAnnulusGenerateCircle $varname
+ MarkerBasePandaGenerateAngles $varname
+}
+
+# callbacks
+
+proc PandaCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "PandaCoordCB"
+ }
+
+ MarkerBasePandaCoordCB $varname
+}
+
+proc PandaEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "PandaEditCB"
+ }
+
+ set t [$var(frame) get marker $var(id) panda radius \
+ $var(dcoord) $var(dformat)]
+
+ set last [expr [llength $t]-1]
+ set var(inner) [lindex $t 0]
+ set var(outer) [lindex $t $last]
+ set var(annuli) $last
+
+ $var(annulitxt) delete 1.0 end
+ $var(annulitxt) insert end "$t"
+
+ set a [$var(frame) get marker $var(id) panda angle $var(system) $var(sky)]
+
+ set last [expr [llength $a]-1]
+ set var(ang1) [lindex $a 0]
+ set var(ang2) [lindex $a $last]
+ set var(angnum) $last
+
+ $var(angtxt) delete 1.0 end
+ $var(angtxt) insert end "$a"
+}
+
+proc PandaDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "PandaDistCB"
+ }
+
+ MarkerBasePandaDistCB $varname
+}
diff --git a/ds9/library/crop.tcl b/ds9/library/crop.tcl
new file mode 100644
index 0000000..a4982d3
--- /dev/null
+++ b/ds9/library/crop.tcl
@@ -0,0 +1,467 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CropDef {} {
+ global crop
+ global icrop
+
+ set icrop(top) .cr
+ set icrop(mb) .crmb
+
+ set crop(lock) none
+
+ set crop(system) wcs
+ set crop(sky) fk5
+ set crop(skyformat) degrees
+ set crop(dcoord) wcs
+ set crop(dformat) degrees
+ set crop(rcoord) wcs
+}
+
+proc CropReset {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) crop
+ UpdateCrop $current(frame)
+ }
+}
+
+proc CropButton {which x y} {
+ global rgb
+ RGBEvalLock rgb(lock,crop) $which [list $which crop begin $x $y]
+}
+
+proc CropMotion {which x y} {
+ $which crop motion $x $y
+}
+
+proc CropRelease {which x y} {
+ global rgb
+
+ RGBEvalLock rgb(lock,crop) $which [list $which crop end $x $y]
+ UpdateCrop $which
+}
+
+proc Crop3dButton {which x y zz} {
+ $which crop 3d begin $x $y $zz
+}
+
+proc Crop3dMotion {which x y zz} {
+ $which crop 3d motion $x $y $zz
+}
+
+proc Crop3dRelease {which x y zz} {
+ $which crop 3d end $x $y $zz
+ UpdateCrop $which
+}
+
+proc UpdateCrop {which} {
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCrop"
+ }
+
+ LockCrop $which
+ UpdateCropDialog
+ UpdateCubeDialog
+ UpdateContourScale
+ UpdateContourDialog
+ UpdateScaleDialog
+ GridUpdateZoom
+ UpdateGraphXAxis $which
+ UpdateGraphYAxis $which
+ UpdateInfoBoxBase
+ UpdateMain
+}
+
+proc CropDialog {} {
+ global crop
+ global icrop
+ global dcrop
+ global ds9
+ global current
+
+ # see if we already have a window visible
+ if {[winfo exists $icrop(top)]} {
+ raise $icrop(top)
+ return
+ }
+
+ # create the window
+ set w $icrop(top)
+ set mb $icrop(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Crop Parameters}] \
+ CropDestroyDialog
+
+ # for CoordMenuButton
+ set crop(frame) $current(frame)
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command CropApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Reset}] -command CropReset
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command CropDestroyDialog
+
+ EditMenu $mb icrop
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.title -text [msgcat::mc {Center}]
+ ttk::entry $f.x -textvariable dcrop(x) -width 14
+ ttk::entry $f.y -textvariable dcrop(y) -width 14
+ set dcrop(cb) $f.center
+ CoordMenuButton $dcrop(cb) crop system 1 sky skyformat UpdateCropDialog
+
+ ttk::label $f.stitle -text [msgcat::mc {Size}]
+ ttk::entry $f.w -textvariable dcrop(w) -width 14
+ ttk::entry $f.h -textvariable dcrop(h) -width 14
+ set dcrop(db) $f.size
+ DistMenuButton $dcrop(db) crop dcoord 1 dformat UpdateCropDialog
+
+ ttk::label $f.rtitle -text [msgcat::mc {3D}]
+ ttk::entry $f.from -textvariable dcrop(zmin) -width 14
+ ttk::entry $f.to -textvariable dcrop(zmax) -width 14
+ set dcrop(rb) $f.range
+ CoordMenuButton $dcrop(rb) crop rcoord 2 {} {} UpdateCropDialog
+
+ grid $f.title $f.x $f.y $dcrop(cb) -padx 2 -pady 2
+ grid $f.stitle $f.w $f.h $dcrop(db) -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command CropApplyDialog
+ ttk::button $f.reset -text [msgcat::mc {Reset}] -command CropReset
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command CropDestroyDialog
+ pack $f.apply $f.reset $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ $w.param.x select range 0 end
+
+ UpdateCropDialog
+}
+
+proc CropApplyDialog {} {
+ global crop
+ global icrop
+ global dcrop
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) crop center $dcrop(x) $dcrop(y) \
+ $crop(system) $crop(sky) \
+ $dcrop(w) $dcrop(h) $crop(dcoord) $crop(dformat)
+
+ if {[$current(frame) has fits cube]} {
+ $current(frame) crop 3d $dcrop(zmin) $dcrop(zmax) $crop(rcoord)
+ }
+ UpdateCrop $current(frame)
+ }
+}
+
+proc CropDestroyDialog {} {
+ global icrop
+ global dcrop
+
+ if {[winfo exists $icrop(top)]} {
+ destroy $icrop(top)
+ destroy $icrop(mb)
+ }
+
+ unset dcrop
+}
+
+proc UpdateCropMenu {} {
+ # can be changed by wcs
+ SetCoordSystem crop system sky skyformat
+}
+
+proc UpdateCropDialog {} {
+ global crop
+ global icrop
+ global dcrop
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCropDialog"
+ }
+
+ if {![winfo exists $icrop(top)]} {
+ return
+ }
+
+ set w $icrop(top)
+
+ if {$current(frame) != {}} {
+ set crop(frame) $current(frame)
+
+ if {[$current(frame) has fits]} {
+ # now make sure we have the coord systems
+ AdjustCoordSystem crop system
+ CoordMenuEnable $dcrop(cb).menu crop system 1 sky skyformat
+ CoordMenuButtonCmd crop system sky {}
+
+ AdjustCoordSystem crop dcoord
+ DistMenuEnable $dcrop(db).menu crop dcoord 1 dformat
+ DistMenuButtonCmd crop dcoord dformat {}
+
+ AdjustCoordSystem3d crop rcoord
+ CoordMenuEnable $dcrop(rb).menu crop rcoord 2 {} {}
+ CoordMenuButtonCmd crop rcoord {} {}
+
+ set rr [$current(frame) get crop center \
+ $crop(system) $crop(sky) $crop(skyformat) \
+ $crop(dcoord) $crop(dformat)]
+ set dcrop(x) [lindex $rr 0]
+ set dcrop(y) [lindex $rr 1]
+ set dcrop(w) [lindex $rr 2]
+ set dcrop(h) [lindex $rr 3]
+
+ if {[$current(frame) has fits cube]} {
+ set ss [$current(frame) get crop 3d $crop(rcoord)]
+ set dcrop(zmin) [lindex $ss 0]
+ set dcrop(zmax) [lindex $ss 1]
+
+ grid $w.param.rtitle $w.param.from $w.param.to $dcrop(rb) \
+ -padx 2 -pady 2
+ } else {
+ set dcrop(zmin) {}
+ set dcrop(zmax) {}
+
+ grid forget $w.param.rtitle $w.param.from $w.param.to $dcrop(rb)
+ }
+
+ return
+ }
+ }
+
+ grid forget $w.param.rtitle $w.param.from $w.param.to $dcrop(rb)
+
+ CoordMenuReset $dcrop(cb).menu crop system 1 sky skyformat
+ DistMenuReset $dcrop(db).menu crop dcoord 1 dformat
+ CoordMenuReset $dcrop(rb).menu crop rcoord 2 {} {}
+
+ set dcrop(x) {}
+ set dcrop(y) {}
+ set dcrop(w) {}
+ set dcrop(h) {}
+ set dcrop(zmin) {}
+ set dcrop(zmax) {}
+}
+
+proc MatchCropCurrent {sys} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchCrop $current(frame) $sys
+ }
+}
+
+proc MatchCrop {which sys} {
+ global ds9
+ global rgb
+
+ # make sure matrices have been updated
+ RealizeDS9
+
+ set tt [$which has crop]
+ set datasec [$which get datasec]
+
+ if {$tt} {
+ switch -- $sys {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set rr [$which get crop center $sys fk5 degrees $sys degrees]
+ set r(x) [lindex $rr 0]
+ set r(y) [lindex $rr 1]
+ set r(w) [lindex $rr 2]
+ set r(h) [lindex $rr 3]
+ set qq [$which get crop 3d image]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,crop) $ff [list $ff datasec $datasec]
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop center $r(x) $r(y) $sys fk5 $r(w) $r(h) $sys degrees]
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop 3d $qq image]
+ }
+ }
+ }
+ wcs {
+ set ss [lindex [$which get wcs] 0]
+ if {[$which has wcs $ss]} {
+ set rr [$which get crop center $ss fk5 degrees $ss degrees]
+ set r(x) [lindex $rr 0]
+ set r(y) [lindex $rr 1]
+ set r(w) [lindex $rr 2]
+ set r(h) [lindex $rr 3]
+ set qq [$which get crop 3d $ss]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ if {[$ff has wcs $ss]} {
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop center $r(x) $r(y) $ss fk5 $r(w) $r(h) $ss degrees]
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop 3d $qq $ss]
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop]
+ RGBEvalLock rgb(lock,crop) $ff [list $ff crop 3d]
+ }
+ }
+ }
+}
+
+proc LockCropCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockCrop $current(frame)
+ }
+}
+
+proc LockCrop {which} {
+ global crop
+
+ switch -- $crop(lock) {
+ none {}
+ default {MatchCrop $which $crop(lock)}
+ }
+}
+
+proc CropBackup {ch which} {
+ switch [$which get type] {
+ base -
+ 3d {CropBackupBase $ch $which}
+ rgb {CropBackupRGB $ch $which}
+ }
+}
+
+proc CropBackupBase {ch which} {
+ if {[$which has crop]} {
+ if {[$which has fits]} {
+ set rr [$which get crop physical fk5 degrees]
+ puts $ch "$which crop $rr physical fk5"
+
+ if {[$which has fits cube]} {
+ set ss [$which get crop 3d image]
+ puts $ch "$which crop 3d $ss image"
+ }
+ }
+ }
+}
+
+proc CropBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ CropBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+# Process Cmds
+
+proc ProcessCropCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global crop
+ global current
+ switch -- [string tolower [lindex $var $i]] {
+ match {
+ incr i
+ MatchCropCurrent [lindex $var $i]
+ }
+ lock {
+ incr i
+ set crop(lock) [lindex $var $i]
+ LockCropCurrent
+ }
+ open {CropDialog}
+ close {CropDestroyDialog}
+ reset {CropReset}
+ 3d {
+ incr i 1
+ set zmin [lindex $var [expr $i+0]]
+ set zmax [lindex $var [expr $i+1]]
+ set sys [lindex $var [expr $i+2]]
+
+ incr i 1
+ incr i [FixSpecSystem sys physical]
+
+ $current(frame) crop 3d $zmin $zmax $sys
+ }
+ default {
+ set x [lindex $var [expr $i+0]]
+ set y [lindex $var [expr $i+1]]
+ set w [lindex $var [expr $i+2]]
+ set h [lindex $var [expr $i+3]]
+ set sys [lindex $var [expr $i+4]]
+ set sky [lindex $var [expr $i+5]]
+ set dformat [lindex $var [expr $i+6]]
+
+ incr i 3
+ incr i [FixSpec sys sky dformat physical fk5 degrees]
+
+ $current(frame) crop center $x $y $sys $sky $w $h $sys $dformat
+ }
+ }
+}
+
+proc ProcessSendCropCmd {proc id param} {
+ global crop
+ global current
+
+ switch -- [string tolower [lindex $param 0]] {
+ lock {$proc $id "$crop(lock)\n"}
+ 3d {
+ set sys [lindex $param 1]
+ FixSpecSystem sys physical
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get crop 3d $sys]\n"
+ }
+ }
+ default {
+ set sys [lindex $param 0]
+ set sky [lindex $param 1]
+ set format [lindex $param 2]
+ set dformat [lindex $param 3]
+ FixSpec sys sky format physical fk5 degrees
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get crop center $sys $sky $format $sys $dformat]\n"
+ }
+ }
+ }
+}
diff --git a/ds9/library/crosshair.tcl b/ds9/library/crosshair.tcl
new file mode 100644
index 0000000..512e461
--- /dev/null
+++ b/ds9/library/crosshair.tcl
@@ -0,0 +1,310 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CrosshairDef {} {
+ global crosshair
+ global icrosshair
+
+ set icrosshair(top) .ch
+ set icrosshair(mb) .chmb
+
+ set crosshair(lock) none
+
+ # set via wcs()
+ set crosshair(system) wcs
+ set crosshair(sky) fk5
+ set crosshair(skyformat) degrees
+}
+
+proc CrosshairButton {which x y} {
+ global ds9
+ global crosshair
+
+ $which crosshair canvas $x $y
+ UpdateCrosshairDialog
+ LockCrosshair $which
+}
+
+proc CrosshairArrowKey {which x y} {
+ global ds9
+ global crosshair
+
+ $which crosshair warp $x $y
+ UpdateCrosshairDialog
+ LockCrosshair $which
+
+ set coord [$which get crosshair canvas]
+ set X [lindex $coord 0]
+ set Y [lindex $coord 1]
+
+ UpdateColormapLevelMosaic $which $X $Y canvas
+ UpdateInfoBox $which $X $Y canvas
+ UpdatePixelTableDialog $which $X $Y canvas
+ UpdateGraph $which $X $Y canvas
+}
+
+proc CrosshairTo {x y sys sky} {
+ global crosshair
+ global current
+ global ds9
+
+ set current(mode) crosshair
+ ChangeMode
+
+ if {$current(frame) != {}} {
+ $current(frame) crosshair $sys $sky $x $y
+ set coord [$current(frame) get crosshair canvas]
+ UpdateColormapLevelMosaic $current(frame) \
+ [lindex $coord 0] [lindex $coord 1] canvas
+ UpdateInfoBox $current(frame) \
+ [lindex $coord 0] [lindex $coord 1] canvas
+
+ if {$crosshair(lock) != "none"} {
+ set coord [$current(frame) get crosshair $crosshair(lock)]
+ foreach f $ds9(frames) {
+ if {$f != $current(frame) && [$f has system $crosshair(lock)]} {
+ $f crosshair $crosshair(lock) $coord
+ }
+ }
+ }
+ }
+}
+
+proc MatchCrosshairCurrent {sys} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchCrosshair $current(frame) $sys
+ }
+}
+
+proc MatchCrosshair {which sys} {
+ global crosshair
+ global ds9
+ global current
+
+ if {$current(mode) != {crosshair}} {
+ return
+ }
+
+ switch -- $sys {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set coord [$which get crosshair $sys]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ $ff crosshair $sys $coord
+ }
+ }
+ }
+ wcs {
+ set ss [lindex [$which get wcs] 0]
+ if {[$which has wcs $ss]} {
+ set coord [$which get crosshair $ss]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ if {[$ff has wcs $ss]} {
+ $ff crosshair $ss $coord
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+proc LockCrosshairCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockCrosshair $current(frame)
+ }
+}
+
+proc LockCrosshair {which} {
+ global crosshair
+
+ switch -- $crosshair(lock) {
+ none {}
+ default {MatchCrosshair $which $crosshair(lock)}
+ }
+}
+
+proc CrosshairDialog {} {
+ global crosshair
+ global icrosshair
+ global dcrosshair
+ global current
+
+ # see if we already have a window visible
+ if {[winfo exists $icrosshair(top)]} {
+ raise $icrosshair(top)
+ return
+ }
+
+ # create the window
+ set w $icrosshair(top)
+ set mb $icrosshair(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Crosshair Parameters}] \
+ CrosshairDestroyDialog
+
+ # for CoordMenuButton
+ set crosshair(frame) $current(frame)
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command CrosshairApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command CrosshairDestroyDialog
+
+ EditMenu $mb icrosshair
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.title -text [msgcat::mc {Crosshair}]
+ ttk::entry $f.x -textvariable dcrosshair(x) -width 14
+ ttk::entry $f.y -textvariable dcrosshair(y) -width 14
+ set dcrosshair(cb) $f.system
+ CoordMenuButton $dcrosshair(cb) crosshair system 1 sky skyformat \
+ UpdateCrosshairDialog
+
+ grid $f.title $f.x $f.y $f.system -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command CrosshairApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command CrosshairDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ $w.param.x select range 0 end
+
+ UpdateCrosshairDialog
+}
+
+proc CrosshairApplyDialog {} {
+ global crosshair
+ global dcrosshair
+
+ CrosshairTo $dcrosshair(x) $dcrosshair(y) $crosshair(system) $crosshair(sky)
+}
+
+proc CrosshairDestroyDialog {} {
+ global icrosshair
+ global dcrosshair
+
+ if {[winfo exists $icrosshair(top)]} {
+ destroy $icrosshair(top)
+ destroy $icrosshair(mb)
+ }
+
+ unset dcrosshair
+}
+
+proc UpdateCrosshairDialog {} {
+ global crosshair
+ global icrosshair
+ global dcrosshair
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCrosshairDialog"
+ }
+
+ if {![winfo exists $icrosshair(top)]} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ set crosshair(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ # now make sure we have the coord systems
+ AdjustCoordSystem crosshair system
+ CoordMenuEnable $dcrosshair(cb).menu crosshair system 1 sky skyformat
+ CoordMenuButtonCmd crosshair system sky {}
+ } else {
+ CoordMenuReset $dcrosshair(cb).menu crosshair system 1 sky skyformat
+ }
+ }
+
+ if {$current(frame) != {}} {
+ set coord [$current(frame) get crosshair $crosshair(system) \
+ $crosshair(sky) $crosshair(skyformat)]
+ set dcrosshair(x) [lindex $coord 0]
+ set dcrosshair(y) [lindex $coord 1]
+ } else {
+ set dcrosshair(x) {}
+ set dcrosshair(y) {}
+ }
+}
+
+proc ProcessCrosshairCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ match {
+ incr i
+ MatchCrosshairCurrent [lindex $var $i]
+ }
+ lock {
+ incr i
+ set crosshair(lock) [lindex $var $i]
+ LockCrosshairCurrent
+ }
+ default {
+ set x [lindex $var [expr $i+0]]
+ set y [lindex $var [expr $i+1]]
+ set sys [lindex $var [expr $i+2]]
+ set sky [lindex $var [expr $i+3]]
+ set format {}
+
+ incr i 1
+ incr i [FixSpec sys sky format physical fk5 degrees]
+
+ CrosshairTo $x $y $sys $sky
+ UpdateCrosshairDialog
+ }
+ }
+}
+
+proc ProcessSendCrosshairCmd {proc id param} {
+ global crosshair
+ global current
+
+ switch -- [string tolower $param] {
+ lock {$proc $id "$crosshair(lock)\n"}
+ default {
+ set sys [lindex $param 0]
+ set sky [lindex $param 1]
+ set format [lindex $param 2]
+ FixSpec sys sky format physical fk5 degrees
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get crosshair $sys $sky $format]\n"
+ }
+ }
+ }
+}
+
diff --git a/ds9/library/cube.tcl b/ds9/library/cube.tcl
new file mode 100644
index 0000000..68ecf25
--- /dev/null
+++ b/ds9/library/cube.tcl
@@ -0,0 +1,843 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CubeDef {} {
+ global icube
+ global cube
+
+ set icube(top) .cube
+ set icube(mb) .cubemb
+ set icube(id) 0
+
+ set cube(lock) none
+ set cube(lock,axes) 0
+# needs work, at high values, but cropped, causes problems
+# set cube(format) {%.5g}
+# axes cnt starts at 0
+ set cube(axis) 2
+ set cube(system) wcs
+ set cube(axes) 123
+}
+
+proc MatchCubeCurrent {sys} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchCube $current(frame) $sys
+ }
+}
+
+proc MatchCube {which sys} {
+ global cube
+ global ds9
+ global rgb
+
+ set naxes [$which get fits naxes]
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ set slice($ii) [$which get fits slice $ii $sys]
+ }
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ RGBEvalLock rgb(lock,slice) $ff "$ff update fits slice $ii $slice($ii) $sys"
+ }
+ }
+ }
+}
+
+proc LockCubeCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockCube $current(frame)
+ }
+}
+
+proc LockCube {which} {
+ global cube
+
+ switch -- $cube(lock) {
+ none {}
+ default {MatchCube $which $cube(lock)}
+ }
+}
+
+proc CubeSlice {slice} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ RGBEvalLockCurrent rgb(lock,slice) "$current(frame) update fits slice $cube(axis) $slice"
+ set dcube(image,$cube(axis)) $slice
+ set dcube(wcs,$cube(axis)) [$current(frame) get coordinates $slice image $cube(system) $cube(axis)]
+
+ UpdateCube
+}
+
+proc CubeStop {} {
+ global icube
+
+ if {$icube(id)>0} {
+ after cancel $icube(id)
+ set icube(id) 0
+ }
+}
+
+proc CubePlay {} {
+ global icube
+
+ if {$icube(id) == 0} {
+ CubeTimer
+ }
+}
+
+proc CubeTimer {} {
+ global icube
+ global dcube
+ global cube
+
+ global current
+ global blink
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ set slice [$current(frame) get fits slice $cube(axis)]
+ if {$cube(axis)==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d image]
+ set first [lindex $ss 0]
+ set last [lindex $ss 1]
+ } else {
+ set first 1
+ set last [$current(frame) get fits depth $cube(axis)]
+ }
+
+ if {$slice == $last} {
+ set slice $first
+ } else {
+ set slice [expr $slice+1]
+ }
+
+ CubeSlice $slice
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+
+ set icube(id) [after $blink(interval) CubeTimer]
+}
+
+proc CubeFirst {} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ CubeStop
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ if {$cube(axis)==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d image]
+ set first [lindex $ss 0]
+ } else {
+ set first 1
+ }
+ CubeSlice $first
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+}
+
+proc CubePrev {} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ CubeStop
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ set slice [$current(frame) get fits slice $cube(axis)]
+ if {$cube(axis)==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d image]
+ set first [lindex $ss 0]
+ set last [lindex $ss 1]
+ } else {
+ set first 1
+ set last [$current(frame) get fits depth $cube(axis)]
+ }
+
+ if {$slice == $first} {
+ set slice $last
+ } else {
+ set slice [expr $slice-1]
+ }
+
+ CubeSlice $slice
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+}
+
+proc CubeNext {} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ CubeStop
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ set slice [$current(frame) get fits slice $cube(axis)]
+ if {$cube(axis)==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d image]
+ set first [lindex $ss 0]
+ set last [lindex $ss 1]
+ } else {
+ set first 1
+ set last [$current(frame) get fits depth $cube(axis)]
+ }
+
+ if {$slice == $last} {
+ set slice $first
+ } else {
+ set slice [expr $slice+1]
+ }
+
+ CubeSlice $slice
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+}
+
+proc CubeLast {} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ CubeStop
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ if {$cube(axis)==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d image]
+ set last [lindex $ss 1]
+ } else {
+ set last [$current(frame) get fits depth $cube(axis)]
+ }
+
+ CubeSlice $last
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+}
+
+proc CubeApply {ii} {
+ global dcube
+ global cube
+
+ global current
+ global rgb
+
+ CubeStop
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ set ss [expr int([$current(frame) get coordinates $dcube(wcs,$ii) $cube(system) image $cube(axis)])]
+
+ if {$ss<1} {
+ set ss 1
+ }
+ set depth [$current(frame) get fits depth $ii]
+ if {$ss>$depth} {
+ set ss $depth
+ }
+ set dcube(image,$ii) $ss
+ set dcube(wcs,$ii) [$current(frame) get coordinates $dcube(image,$ii) image $cube(system) $cube(axis)]
+ RGBEvalLockCurrent rgb(lock,slice) "$current(frame) update fits slice $ii $ss"
+ } else {
+ set dcube(image,$cube(axis)) 1
+ set dcube(wcs,$cube(axis)) 1
+ }
+ UpdateCube
+ }
+}
+
+proc UpdateCube {} {
+ global current
+
+ LockCubeCurrent
+ UpdateScaleDialog
+ UpdateContourScale
+ UpdateContourDialog
+ UpdateGraphYAxis $current(frame)
+ UpdateInfoBoxBase
+ UpdateMain
+}
+
+# used by backup
+proc CubeDialog {} {
+ global icube
+ global dcube
+ global cube
+
+ global current
+ global ds9
+ global blink
+
+ # see if we already have a window visible
+ if {[winfo exists $icube(top)]} {
+ raise $icube(top)
+ return
+ }
+
+ # create the cube window
+ set w $icube(top)
+ set mb $icube(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Cube}] CubeDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Interval}] -menu $mb.blink
+ $mb add cascade -label [msgcat::mc {Coordinate}] -menu $mb.coord
+ $mb add cascade -label [msgcat::mc {Axes Order}] -menu $mb.axes
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {First}] -command CubeFirst
+ $mb.file add command -label [msgcat::mc {Previous}] -command CubePrev
+ $mb.file add command -label [msgcat::mc {Stop}] -command CubeStop
+ $mb.file add command -label [msgcat::mc {Play}] -command CubePlay
+ $mb.file add command -label [msgcat::mc {Next}] -command CubeNext
+ $mb.file add command -label [msgcat::mc {Last}] -command CubeLast
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command CubeDestroyDialog
+
+ EditMenu $mb icube
+
+ menu $mb.blink
+ $mb.blink add radiobutton -label ".125 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 125
+ $mb.blink add radiobutton -label ".25 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 250
+ $mb.blink add radiobutton -label ".5 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 500
+ $mb.blink add radiobutton -label "1 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 1000
+ $mb.blink add radiobutton -label "2 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 2000
+ $mb.blink add radiobutton -label "4 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 4000
+ $mb.blink add radiobutton -label "8 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 8000
+
+ CoordMenu $mb.coord cube system 2 {} {} UpdateCubeDialog
+
+ menu $mb.axes
+ $mb.axes add radiobutton -label {1 2 3} -variable cube(axes) \
+ -value 123 -command CubeAxes
+ $mb.axes add radiobutton -label {1 3 2} -variable cube(axes) \
+ -value 132 -command CubeAxes
+ $mb.axes add radiobutton -label {2 1 3} -variable cube(axes) \
+ -value 213 -command CubeAxes
+ $mb.axes add radiobutton -label {2 3 1} -variable cube(axes) \
+ -value 231 -command CubeAxes
+ $mb.axes add radiobutton -label {3 1 2} -variable cube(axes) \
+ -value 312 -command CubeAxes
+ $mb.axes add radiobutton -label {3 2 1} -variable cube(axes) \
+ -value 321 -command CubeAxes
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ set dcube(taxis) [ttk::label $f.taxis -text [msgcat::mc {Axis}]]
+ set dcube(tslice) [ttk::label $f.tslice -text [msgcat::mc {Slice}]]
+ set dcube(twcs) [ttk::label $f.twcs -textvariable dcube(vcoord) \
+ -anchor center]
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ set dcube(chk,$ii) [ttk::radiobutton $f.chk$ii \
+ -text [expr $ii+1] \
+ -variable cube(axis) \
+ -value $ii]
+ set dcube(lslice,$ii) [ttk::label $f.slice$ii \
+ -textvariable dcube(image,$ii) \
+ -width 5 -anchor center]
+ set dcube(sslice,$ii) [slider $f.scale$ii 0 100 {} \
+ dcube(wcs,$ii) [list CubeApply $ii] 4 10]
+ }
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.first -text [msgcat::mc {First}] -width -6 -command CubeFirst
+ ttk::button $f.prev -text [msgcat::mc {Previous}] -width -6 \
+ -command CubePrev
+ ttk::button $f.stop -text [msgcat::mc {Stop}] -width -6 -command CubeStop
+ ttk::button $f.play -text [msgcat::mc {Play}] -width -6 -command CubePlay
+ ttk::button $f.next -text [msgcat::mc {Next}] -width -6 -command CubeNext
+ ttk::button $f.last -text [msgcat::mc {Last}] -width -6 -command CubeLast
+ pack $f.first $f.prev $f.stop $f.play $f.next $f.last \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ UpdateCubeDialog
+}
+
+proc CubeDestroyDialog {} {
+ global icube
+ global dcube
+
+ CubeStop
+
+ if {[winfo exists $icube(top)]} {
+ destroy $icube(top)
+ destroy $icube(mb)
+ }
+
+ unset dcube
+}
+
+proc UpdateCubeMenu {} {
+ global cube
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCubeMenu"
+ }
+
+ if {$current(frame) != {}} {
+ set cube(axes) [$current(frame) get cube axes]
+ }
+
+ # can be changed by wcs
+ SetCoordSystem cube system {} {}
+}
+
+proc UpdateCubeDialog {} {
+ global icube
+ global dcube
+ global cube
+
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateCubeDialog"
+ }
+
+ CubeStop
+
+ if {![winfo exists $icube(top)]} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ # now make sure we have the coord systems
+ AdjustCoordSystem3d cube system
+ CoordMenuEnable $icube(mb).coord cube system 2 {} {}
+ } else {
+ CoordMenuReset $icube(mb).coord cube system 2 {} {}
+ }
+ }
+
+ # get number of axes
+ if {$current(frame) != {}} {
+ set naxes [$current(frame) get fits naxes]
+ } else {
+ set naxes 2
+ }
+
+ # set from/to
+ set depth 1
+ if {$naxes == 2} {
+ set dcube(from,2) 1
+ set dcube(to,2) 1
+ } else {
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ set dcube(from,$ii) 1
+ set dcube(to,$ii) 1
+
+ if {$ii==2} {
+ # get cropped version
+ set ss [$current(frame) get crop 3d $cube(system)]
+ set dcube(from,$ii) [lindex $ss 0]
+ set dcube(to,$ii) [lindex $ss 1]
+ } else {
+ set depth [$current(frame) get fits depth $ii]
+ set dcube(from,$ii) [$current(frame) get coordinates 1 image $cube(system) $ii]
+ set dcube(to,$ii) [$current(frame) get coordinates $depth image $cube(system) $ii]
+ }
+ }
+ }
+
+ # forget everything
+ grid forget $dcube(tslice) $dcube(taxis) $dcube(twcs)
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ grid forget $dcube(chk,$ii) $dcube(sslice,$ii) $dcube(lslice,$ii)
+ }
+
+ # show it
+ if {$naxes <= 3} {
+ # special chase, no checkbox
+ grid columnconfigure $icube(top).param 1 -weight 1
+ grid columnconfigure $icube(top).param 2 -weight 0
+ grid $dcube(tslice) $dcube(twcs) -padx 2 -pady 2 -sticky ew
+ grid $dcube(lslice,2) $dcube(sslice,2) -padx 2 -pady 2 -sticky ew
+ } else {
+ grid columnconfigure $icube(top).param 1 -weight 0
+ grid columnconfigure $icube(top).param 2 -weight 1
+ grid $dcube(taxis) $dcube(tslice) $dcube(twcs) \
+ -padx 2 -pady 2 -sticky ew
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ grid $dcube(chk,$ii) $dcube(lslice,$ii) \
+ $dcube(sslice,$ii) -padx 2 -pady 2 -sticky ew
+ }
+ }
+
+ # set intervals
+ if {$naxes == 2} {
+ SliderMinMax $dcube(sslice,2) $dcube(from,2) $dcube(to,2) 4
+ set dcube(vcoord) $cube(system)
+ } else {
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ set dcube(vcoord) $cube(system)
+ switch $cube(system) {
+ image {
+ set dcube(from,$ii) [expr int($dcube(from,$ii))]
+ set dcube(to,$ii) [expr int($dcube(to,$ii))]
+ }
+ default {
+ set w [string range $cube(system) 3 3]
+ set key "CTYPE[expr $cube(axis)+1]$w"
+ set tt [string trim [$current(frame) get fits header keyword \{$key\}]]
+ if {$tt != {}} {
+ set dcube(vcoord) $tt
+ }
+ }
+ }
+ SliderMinMax $dcube(sslice,$ii) $dcube(from,$ii) $dcube(to,$ii) 4
+ }
+ }
+
+ # reset cube(axis) if needed
+ if {$cube(axis) > [expr $naxes-1]} {
+ set cube(axis) [expr $naxes-1]
+ if {$cube(axis) < 2} {
+ set cube(axis) 2
+ }
+ }
+
+ # we must do this after the scale has been configured
+ if {$naxes == 2} {
+ set dcube(image,2) 1
+ set dcube(wcs,2) 1
+ } else {
+ for {set ii 2} {$ii<$naxes} {incr ii} {
+ set slice [$current(frame) get fits slice $ii]
+ set dcube(image,$ii) $slice
+ set dcube(wcs,$ii) [$current(frame) get coordinates $slice image $cube(system) $ii]
+ }
+ }
+}
+
+proc CubeBackup {ch which} {
+ switch [$which get type] {
+ base -
+ 3d {CubeBackupBase $ch $which}
+ rgb {CubeBackupRGB $ch $which}
+ }
+}
+
+proc CubeBackupBase {ch which} {
+ global ds9
+
+ set axes [$which get cube axes]
+ puts $ch "$which cube axes $axes"
+
+ if {[$which has fits cube]} {
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ set depth [$which get fits depth $ii]
+ if {$depth>1} {
+ puts $ch "$which update fits slice $ii [$which get fits slice $ii]"
+ } else {
+ break
+ }
+ }
+
+ puts $ch "CubeDialog"
+ }
+}
+
+proc CubeBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ CubeBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+proc MatchAxesCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchAxes $current(frame)
+ }
+}
+
+proc MatchAxes {which} {
+ global cube
+ global ds9
+ global rgb
+ global grid
+
+ set axes [$which get cube axes]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,axes) $ff "$ff cube axes $axes"
+
+ # grid
+ if {[$ff has grid]} {
+ array set ogrid [array get grid]
+ array set grid [$ff get grid var]
+
+ GridUpdate $ff
+
+ array set grid [array get ogrid]
+ }
+ }
+ }
+}
+
+proc LockAxesCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockAxes $current(frame)
+ }
+}
+
+proc LockAxes {which} {
+ global cube
+
+ if {$cube(lock,axes)} {
+ MatchAxes $which
+ }
+}
+
+proc CubeAxes {} {
+ global cube
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,axes) \
+ "$current(frame) cube axes $cube(axes)"
+ ResetWatchCursor
+
+ LockAxesCurrent
+ UpdateHeaderDialog
+ UpdateWCS
+ UpdateDS9
+ UpdateMain
+ }
+}
+
+# Process Cmds
+
+proc ProcessCubeCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global cube
+ global dcube
+
+ global blink
+ global current
+ global rgb
+
+ CubeDialog
+
+ switch -- [string tolower [lindex $var $i]] {
+ match {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ switch -- [lindex $var $i] {
+ {} {MatchCubeCurrent image}
+ default {MatchCubeCurrent [lindex $var $i]}
+ }
+ } else {
+ MatchCubeCurrent image
+ incr i -1
+ }
+ }
+ lock {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ switch -- [lindex $var $i] {
+ {} -
+ yes -
+ 1 {set cube(lock) image}
+ no -
+ 0 {set cube(lock) none}
+ default {set cube(lock) [lindex $var $i]}
+ }
+ } else {
+ set cube(lock) image
+ incr i -1
+ }
+ LockCubeCurrent
+ }
+ open {}
+ close {CubeDestroyDialog}
+ play {CubePlay}
+ stop {CubeStop}
+ next {CubeNext}
+ prev {CubePrev}
+ first {CubeFirst}
+ last {CubeLast}
+ interval {
+ incr i
+ set blink(interval) [expr int([lindex $var $i]*1000)]
+ }
+ axis {
+ incr i;
+ set item [lindex $var $i]
+ if {[string is integer $item]} {
+ set cube(axis) [expr $item-1]
+ if {$cube(axis) < 2} {
+ set cube(axis) 2
+ }
+ }
+ }
+ axes -
+ order {
+ incr i;
+ switch -- [string tolower [lindex $var $i]] {
+ lock {
+ incr i;
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set cube(lock,axes) [FromYesNo [lindex $var $i]]
+ } else {
+ set cube(lock,axes) 1
+ incr i -1
+ }
+ LockAxesCurrent
+ }
+ default {
+ set cube(axes) [lindex $var $i]
+ CubeAxes
+ }
+ }
+ }
+ default {
+ # defaults
+ set ss [lindex $var $i]
+ set sys image
+ set axis 2
+
+ # sys
+ set item [lindex $var [expr $i+1]]
+ if {$item != {}} {
+ if {!([string range $item 0 0] == "-")} {
+ incr i
+ if {[string is integer $item]} {
+ set axis [expr $item-1]
+ } else {
+ set sys $item
+ }
+
+ # axis
+ set item [lindex $var [expr $i+1]]
+ if {$item != {}} {
+ if {!([string range $item 0 0] == "-")} {
+ incr i
+ if {[string is integer $item]} {
+ set axis [expr $item-1]
+ }
+ }
+ }
+ }
+ }
+
+ if {[string is double $ss]} {
+ set dcube(wcs,$axis) $ss
+ set cube(system) $sys
+ set cube(axis) $axis
+ if {$cube(axis) < 2} {
+ set cube(axis) 2
+ }
+ CubeApply $cube(axis)
+ }
+ }
+ }
+}
+
+proc ProcessSendCubeCmd {proc id param} {
+ global cube
+ global current
+ global blink
+
+ switch -- [string tolower [lindex $param 0]] {
+ lock {$proc $id "$cube(lock)\n"}
+ axes -
+ order {
+ switch -- [string tolower [lindex $param 1]] {
+ lock {$proc $id [ToYesNo $cube(lock,axes)]}
+ default {$proc $id "$cube(axes)\n"}
+ }
+ }
+ interval {$proc $id "[expr $blink(interval)/1000.]\n"}
+ axis {$proc $id "$cube(axis)\n"}
+ default {
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get fits slice $cube(axis)]\n"
+ } else {
+ $proc $id "1\n"
+ }
+ }
+ }
+}
diff --git a/ds9/library/debug.tcl b/ds9/library/debug.tcl
new file mode 100644
index 0000000..32188dc
--- /dev/null
+++ b/ds9/library/debug.tcl
@@ -0,0 +1,285 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc DebugDef {} {
+ global debug
+
+ set debug(tcl,events) 0
+ set debug(tcl,update) 0
+ set debug(tcl,idletasks) 0
+ set debug(tcl,layout) 0
+ set debug(tcl,info) 0
+ set debug(tcl,marker) 0
+ set debug(tcl,hv) 0
+ set debug(tcl,cat) 0
+ set debug(tcl,sia) 0
+ set debug(tcl,ime) 0
+ set debug(tcl,samp) 0
+ set debug(tcl,grid) 0
+ set debug(tcl,restore) 0
+ set debug(tcl,http) 0
+ set debug(tcl,ftp) 0
+ set debug(tcl,xpa) 0
+ set debug(tcl,image) 0
+
+ set debug(tksao,ast) 0
+ set debug(tksao,mosaic) 0
+ set debug(tksao,parser) 0
+ set debug(tksao,perf) 0
+ set debug(tksao,wcs) 0
+ set debug(tksao,bin) 0
+ set debug(tksao,block) 0
+ set debug(tksao,compress) 0
+ set debug(tksao,gz) 0
+ set debug(tksao,rgb) 0
+ set debug(tksao,crop) 0
+
+ set debug(iis) 0
+}
+
+proc Debug {which varname} {
+ upvar $varname var
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) debug $which $var
+ }
+}
+
+proc DebugMenu {} {
+ global ds9
+ global debug
+
+ if {[winfo exists $ds9(mb).debug]} {
+ return
+ }
+
+ $ds9(mb) add cascade -label {Debug} -menu $ds9(mb).debug
+
+ menu $ds9(mb).debug
+ $ds9(mb).debug add cascade -label {Tcl} -menu $ds9(mb).debug.tcl
+ $ds9(mb).debug add cascade -label {TKSAO} -menu $ds9(mb).debug.tksao
+ $ds9(mb).debug add cascade -label {IIS} -menu $ds9(mb).debug.iis
+
+ menu $ds9(mb).debug.tcl
+ $ds9(mb).debug.tcl add checkbutton -label {Events} \
+ -variable debug(tcl,events)
+ $ds9(mb).debug.tcl add checkbutton -label {Update} \
+ -variable debug(tcl,update)
+ $ds9(mb).debug.tcl add checkbutton -label {Idletasks} \
+ -variable debug(tcl,idletasks)
+ $ds9(mb).debug.tcl add checkbutton -label {Layout} \
+ -variable debug(tcl,layout)
+ $ds9(mb).debug.tcl add checkbutton -label {Info} \
+ -variable debug(tcl,info)
+ $ds9(mb).debug.tcl add checkbutton -label {Marker} \
+ -variable debug(tcl,marker)
+ $ds9(mb).debug.tcl add checkbutton -label {HV} \
+ -variable debug(tcl,hv)
+ $ds9(mb).debug.tcl add checkbutton -label {Catalog} \
+ -variable debug(tcl,cat)
+ $ds9(mb).debug.tcl add checkbutton -label {SIA} \
+ -variable debug(tcl,sia)
+ $ds9(mb).debug.tcl add checkbutton -label {IME} \
+ -variable debug(tcl,ime)
+ $ds9(mb).debug.tcl add checkbutton -label {SAMP} \
+ -variable debug(tcl,samp)
+ $ds9(mb).debug.tcl add checkbutton -label {Grid} \
+ -variable debug(tcl,grid)
+ $ds9(mb).debug.tcl add checkbutton -label {Restore} \
+ -variable debug(tcl,restore)
+ $ds9(mb).debug.tcl add checkbutton -label {HTTP} \
+ -variable debug(tcl,http)
+ $ds9(mb).debug.tcl add checkbutton -label {FTP} \
+ -variable debug(tcl,ftp)
+ $ds9(mb).debug.tcl add checkbutton -label {XPA} \
+ -variable debug(tcl,xpa)
+ $ds9(mb).debug.tcl add checkbutton -label {IMAGE} \
+ -variable debug(tcl,image)
+
+ menu $ds9(mb).debug.tksao
+ $ds9(mb).debug.tksao add checkbutton -label {AST} \
+ -variable debug(tksao,ast) \
+ -command "Debug ast debug(tksao,ast)"
+ $ds9(mb).debug.tksao add checkbutton -label {Mosaic} \
+ -variable debug(tksao,mosaic) \
+ -command "Debug mosaic debug(tksao,mosaic)"
+ $ds9(mb).debug.tksao add checkbutton -label {Parser} \
+ -variable debug(tksao,parser) \
+ -command "Debug parser debug(tksao,parser)"
+ $ds9(mb).debug.tksao add checkbutton -label {Perf} \
+ -variable debug(tksao,perf) \
+ -command "Debug perf debug(tksao,perf)"
+ $ds9(mb).debug.tksao add checkbutton -label {WCS} \
+ -variable debug(tksao,wcs) \
+ -command "Debug wcs debug(tksao,wcs)"
+ $ds9(mb).debug.tksao add checkbutton -label {Bin} \
+ -variable debug(tksao,bin) \
+ -command "Debug bin debug(tksao,bin)"
+ $ds9(mb).debug.tksao add checkbutton -label {Block} \
+ -variable debug(tksao,block) \
+ -command "Debug block debug(tksao,block)"
+ $ds9(mb).debug.tksao add checkbutton -label {Compress} \
+ -variable debug(tksao,compress) \
+ -command "Debug compress debug(tksao,compress)"
+ $ds9(mb).debug.tksao add checkbutton -label {GZ} \
+ -variable debug(tksao,gz) \
+ -command "Debug gz debug(tksao,gz)"
+ $ds9(mb).debug.tksao add checkbutton -label {RGB} \
+ -variable debug(tksao,rgb) \
+ -command "Debug rgb debug(tksao,rgb)"
+ $ds9(mb).debug.tksao add checkbutton -label {Crop} \
+ -variable debug(tksao,crop) \
+ -command "Debug crop debug(tksao,crop)"
+
+ menu $ds9(mb).debug.iis
+ $ds9(mb).debug.iis add checkbutton -label {IIS} \
+ -variable debug(iis) -command IISDebug
+}
+
+proc DumpURL {varname} {
+ upvar $varname r
+
+ puts stderr "r(scheme)=$r(scheme)"
+ puts stderr "r(authority)=$r(authority)"
+ puts stderr "r(path)=$r(path)"
+ puts stderr "r(query)=$r(query)"
+ puts stderr "r(fragment)=$r(fragment)"
+}
+
+proc DumpCallStack {} {
+ for {set x [expr [info level]-1]} {$x>0} {incr x -1} {
+ puts stderr "$x: [info level $x]"
+ }
+}
+
+proc DumpArray {varname} {
+ upvar $varname var
+ global $varname
+ foreach f [array names $varname] {
+ puts stderr "${varname}($f) = $var($f)"
+ }
+}
+
+# Process Cmds
+
+proc ProcessDebugTclCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # default debug dialog
+ if {[info proc bgerror] != {}} {
+ rename bgerror {}
+ }
+
+ global debug
+ switch -- [string tolower [lindex $var $i]] {
+ events {set debug(tcl,events) 1}
+ update {set debug(tcl,update) 1}
+ idletasks {set debug(tcl,idletasks) 1}
+ layout {set debug(tcl,layout) 1}
+ info {set debug(tcl,info) 1}
+ marker {set debug(tcl,marker) 1}
+ hv {set debug(tcl,hv) 1}
+ cat {set debug(tcl,cat) 1}
+ sia {set debug(tcl,sia) 1}
+ ime {set debug(tcl,ime) 1}
+ samp {set debug(tcl,samp) 1}
+ grid {set debug(tcl,grid) 1}
+ restore {set debug(tcl,restore) 1}
+ http {set debug(tcl,http) 1}
+ ftp {set debug(tcl,ftp) 1}
+ xpa {set debug(tcl,xpa) 1}
+ image {
+ set debug(tcl,hv) 1
+ set debug(tcl,http) 1
+ set debug(tcl,image) 1
+ }
+ }
+}
+
+proc ProcessDebugCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ DebugMenu
+
+ global debug
+ switch -- [string tolower [lindex $var $i]] {
+ ast {
+ set debug(tksao,ast) 1
+ Debug ast debug(tksao,ast)
+ }
+ mosaic {
+ set debug(tksao,mosaic) 1
+ Debug mosaic debug(tksao,mosaic)
+ }
+ parser {
+ set debug(tksao,parser) 1
+ Debug parser debug(tksao,parser)
+ }
+ perf {
+ set debug(tksao,perf) 1
+ Debug perf debug(tksao,perf)
+ }
+ wcs {
+ set debug(tksao,wcs) 1
+ Debug wcs debug(tksao,wcs)
+ }
+ bin {
+ set debug(tksao,bin) 1
+ Debug bin debug(tksao,bin)
+ }
+ block {
+ set debug(tksao,block) 1
+ Debug block debug(tksao,block)
+ }
+ compress {
+ set debug(tksao,compress) 1
+ Debug compress debug(tksao,compress)
+ }
+ gz {
+ set debug(tksao,gz) 1
+ Debug gz debug(tksao,gz)
+ }
+ iis {
+ set debug(iis) 1
+ IISDebug
+ }
+ rgb {
+ set debug(tksao,rgb) 1
+ Debug rgb debug(tksao,rgb)
+ }
+ crop {
+ set debug(tksao,crop) 1
+ Debug crop debug(tksao,crop)
+ }
+
+ events -
+ update -
+ idletasks -
+ layout -
+ info -
+ marker -
+ watch -
+ hv -
+ cat -
+ sia -
+ ime -
+ samp -
+ grid -
+ restore -
+ http -
+ ftp -
+ xpa -
+ image {}
+
+ default {
+ incr ${iname} -1
+ }
+ }
+}
+
diff --git a/ds9/library/dialog.tcl b/ds9/library/dialog.tcl
new file mode 100644
index 0000000..1936fd2
--- /dev/null
+++ b/ds9/library/dialog.tcl
@@ -0,0 +1,585 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc DialogCreate {top title varname} {
+ global ds9
+
+ eval {toplevel $top}
+ switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ ::tk::unsupported::MacWindowStyle style $top document "closeBox fullZoom collapseBox resizable"
+ }
+ }
+
+ wm title $top "$title"
+ wm iconname $top "$title"
+
+ upvar #0 varname var
+ wm protocol $top WM_DELETE_WINDOW "set $varname 1"
+}
+
+proc DialogCenter {w} {
+ global ds9
+ ::tk::PlaceWindow $w widget $ds9(top)
+}
+
+proc DialogWait {top varname {focus {}}} {
+ upvar $varname var
+
+ if {[string length $focus] == 0} {
+ set focus $top
+ }
+ set old [focus -displayof $top]
+ focus $focus
+ catch {tkwait visibility $top}
+ catch {grab $top}
+ tkwait variable $varname
+ catch {grab release $top}
+ focus $old
+
+ # reset errorInfo
+ global errorInfo
+ set errorInfo {}
+}
+
+proc DialogDismiss {w} {
+ destroy $w
+}
+
+# Simple List Box
+
+proc SLBDialog {varname title width} {
+ upvar $varname var
+ global ed
+
+ set w {.slb}
+
+ set ed(ok) 0
+
+ DialogCreate $w $title ed(ok)
+
+ # Lists
+ set f [ttk::frame $w.ed]
+
+ ttk::scrollbar $f.scroll -command "$f.box yview"
+ set ed(listbox) [listbox $f.box \
+ -yscroll "$f.scroll set" \
+ -setgrid 1 \
+ -selectmode single]
+ grid $f.box $f.scroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] \
+ -command {set ed(ok) 1}
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] \
+ -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.ed -side top -fill both -expand true
+
+ # init
+ for {set i 1} {$i <= $var(count)} {incr i} {
+ $w.ed.box insert end $var($i,item)
+ }
+ $w.ed.box selection set 0
+
+ bind $w <Double-1> {set ed(ok) 1}
+ bind $w <Return> {set ed(ok) 1}
+
+ bind $w <Up> "SLBArrow $ed(listbox) -1"
+ bind $w <Down> "SLBArrow $ed(listbox) 1"
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+
+ if {$ed(ok)} {
+ set i [expr [$ed(listbox) curselection]+1]
+ if {$i > 0 && $i <= $var(count)} {
+ set var(item) $var($i,item)
+ set var(value) $var($i,value)
+ }
+ }
+
+ DialogDismiss $w
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc SLBArrow {lb dir} {
+ set which [$lb curselection]
+ if {$which == {}} {
+ set which 0
+ }
+ set end [$lb index end]
+
+ $lb selection clear 0 end
+ incr which $dir
+ if {$which < 0} {
+ set which 0
+ }
+ if {$which >= $end} {
+ set which [expr $end -1]
+ }
+ $lb selection set $which
+}
+
+# Entry Dialog
+
+proc EntryDialog {title message size varname} {
+ upvar $varname var
+ global ds9
+ global ed
+
+ set w {.entry}
+ set mb {.entrymb}
+
+ set ed(top) $w
+ set ed(ok) 0
+ set ed(text) $var
+
+ DialogCreate $w $title ed(ok)
+
+ $w configure -menu $mb
+ menu $mb
+
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ EditMenu $mb ed
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.title -text $message
+ ttk::entry $f.txt -textvariable ed(text) -width $size
+ if {$size < 30} {
+ grid $f.title $f.txt -padx 2 -pady 2
+ } else {
+ grid $f.title -padx 2 -pady 2 -sticky w
+ grid $f.txt -padx 2 -pady 2
+ }
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ $w.param.txt select range 0 end
+ DialogWait $w ed(ok) $w.param.txt
+
+ if {$ed(ok)} {
+ set var $ed(text)
+ }
+
+ DialogDismiss $w
+ destroy $mb
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+# Entry Cut/Copy/Paste
+
+proc EntryCut {top} {
+ set w [focus -displayof $top]
+
+ if {![catch {set data [string range [$w get] [$w index sel.first] [expr {[$w index sel.last] - 1}]]}]} {
+ clipboard clear -displayof $w
+ clipboard append -displayof $w $data
+ $w delete sel.first sel.last
+ }
+}
+
+proc EntryCopy {top} {
+ set w [focus -displayof $top]
+
+ if {![catch {set data [string range [$w get] [$w index sel.first] [expr {[$w index sel.last] - 1}]]}]} {
+ clipboard clear -displayof $w
+ clipboard append -displayof $w $data
+ }
+}
+
+proc EntryPaste {top} {
+ set w [focus -displayof $top]
+
+ catch {$w delete sel.first sel.last}
+ if {![catch {$w insert insert [GetSelection $w]}]} {
+ tk::EntrySeeInsert $w
+ }
+}
+
+proc GetSelection {w} {
+ if {
+ ![catch {selection get -displayof $w -type UTF8_STRING} txt] ||
+ ![catch {selection get -displayof $w} txt] ||
+ ![catch {selection get -displayof $w -selection CLIPBOARD} txt]
+ } {
+ return $txt
+ }
+}
+
+# Simple Text Dialog
+
+proc SimpleTextDef {} {
+ global istxt
+
+ set istxt(dialogs) {}
+}
+
+proc SimpleTextDialog {varname title width height action pos txt
+ {destroyCB {}} {destroyParam {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global istxt
+ global ds9
+ global pds9
+
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ } else {
+ # create window
+ Toplevel $var(top) $var(mb) 7 $title "SimpleTextDestroy $varname"
+
+ lappend istxt(dialogs) $varname
+
+ set var(search) {}
+ set var(destroyCB) $destroyCB
+ set var(destroyParam) $destroyParam
+ set var(font) $pds9(text,font)
+ set var(font,size) $pds9(text,font,size)
+ set var(font,weight) $pds9(text,font,weight)
+ set var(font,slant) $pds9(text,font,slant)
+
+ $var(mb) add cascade -label [msgcat::mc {File}] -menu $var(mb).file
+ menu $var(mb).file
+ $var(mb).file add command -label "[msgcat::mc {Save}]..." \
+ -command "SimpleTextSave $varname"
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {
+ $var(mb).file add separator
+ $var(mb).file add command -label "[msgcat::mc {Print}]..." \
+ -command "SimpleTextPrint $varname"
+ }
+ }
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Close}] \
+ -command "SimpleTextDestroy $varname"
+
+ $var(mb) add cascade -label [msgcat::mc {Edit}] -menu $var(mb).edit
+ menu $var(mb).edit
+ $var(mb).edit add command -label [msgcat::mc {Cut}] \
+ -command "SimpleTextCut $varname" -accelerator "${ds9(ctrl)}X"
+ $var(mb).edit add command -label [msgcat::mc {Copy}] \
+ -command "SimpleTextCopy $varname" -accelerator "${ds9(ctrl)}C"
+ $var(mb).edit add command -label [msgcat::mc {Paste}] \
+ -state disabled -accelerator "${ds9(ctrl)}V"
+ $var(mb).edit add command -label [msgcat::mc {Clear}] \
+ -command "SimpleTextClear $varname"
+ $var(mb).edit add separator
+ $var(mb).edit add command -label [msgcat::mc {Select All}] \
+ -command "SimpleTextSelectAll $varname"
+ $var(mb).edit add command -label [msgcat::mc {Select None}] \
+ -command "SimpleTextSelectNone $varname"
+ $var(mb).edit add separator
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $var(mb).edit add command -label "[msgcat::mc {Find}]..." \
+ -command "SimpleTextFind $varname" \
+ -accelerator "${ds9(ctrl)}F"
+ }
+ aqua {
+ # Known bug in Tk, can't have dialogs invoked by accelerator
+ $var(mb).edit add command -label "[msgcat::mc {Find}]..." \
+ -command "SimpleTextFind $varname"
+ }
+ }
+ $var(mb).edit add command -label [msgcat::mc {Find Next}] \
+ -command "SimpleTextFindNext $varname" -accelerator "${ds9(ctrl)}G"
+
+ $var(mb) add cascade -label [msgcat::mc {Font}] -menu $var(mb).font
+ FontMenu $var(mb).font $varname font font,size font,weight font,slant \
+ [list SimpleTextFont $varname]
+
+ # create the text and scroll widgets
+
+ set var(text) [text $var(top).text -height $height -width $width \
+ -wrap none \
+ -yscrollcommand [list $var(top).yscroll set] \
+ -xscrollcommand [list $var(top).xscroll set] \
+ ]
+
+ ttk::scrollbar $var(top).yscroll -command [list $var(text) yview] \
+ -orient vertical
+ ttk::scrollbar $var(top).xscroll -command [list $var(text) xview] \
+ -orient horizontal
+
+ grid $var(text) $var(top).yscroll -sticky news
+ grid $var(top).xscroll -stick news
+ grid rowconfigure $var(top) 0 -weight 1
+ grid columnconfigure $var(top) 0 -weight 1
+
+ # Bindings
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ bind $var(top) <<Find>> [list SimpleTextFind $varname]
+ }
+ aqua {
+ # Known bug in Tk, can't have dialogs invoked by accelerator
+ }
+ }
+ bind $var(top) <<FindNext>> [list SimpleTextFindNext $varname]
+
+ # some window managers need a hint
+ raise $var(top)
+ }
+
+ $var(text) configure -state normal
+ if {$action != {append}} {
+ $var(text) delete 1.0 end
+ }
+ $var(text) insert end "$txt"
+ switch -- $pos {
+ top {$var(text) see 1.0}
+ bottom {$var(text) see end}
+ }
+
+ SimpleTextFont $varname
+}
+
+proc SimpleTextDestroy {varname} {
+ global istxt
+
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(destroyCB) != {}} {
+ eval $var(destroyCB) $var(destroyParam)
+ }
+
+ if {[winfo exists $var(top)]} {
+ destroy $var(top)
+ destroy $var(mb)
+ }
+
+ set ii [lsearch $istxt(dialogs) $varname]
+ if {$ii>=0} {
+ set istxt(dialogs) [lreplace $istxt(dialogs) $ii $ii]
+ }
+
+ unset $varname
+}
+
+proc SimpleTextFont {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ $var(text) configure -font \
+ "{$ds9($var(font))} $var(font,size) $var(font,weight) $var(font,slant)"
+}
+
+proc SimpleTextUpdateFont {} {
+ global istxt
+ global pds9
+
+ foreach varname $istxt(dialogs) {
+ upvar #0 $varname var
+ global $varname
+
+ set var(font) $pds9(text,font)
+ set var(font,size) $pds9(text,font,size)
+ set var(font,weight) $pds9(text,font,weight)
+ set var(font,slant) $pds9(text,font,slant)
+
+ SimpleTextFont $varname
+ }
+}
+
+proc SimpleTextCut {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ tk_textCut $var(text)
+}
+
+proc SimpleTextCopy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ tk_textCopy $var(text)
+}
+
+proc SimpleTextClear {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(text) configure -state normal
+ $var(text) delete 1.0 end
+ $var(text) configure -state disabled
+}
+
+proc SimpleTextSelectAll {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(text) tag add sel 1.0 end
+}
+
+proc SimpleTextSelectNone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(text) tag remove sel 1.0 end
+}
+
+proc SimpleTextFind {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(text) tag remove sel 1.0 end
+ set result "$var(search)"
+ if {[EntryDialog [msgcat::mc {Search}] [msgcat::mc {Enter Search Expression}] 40 result]} {
+ set var(search) "$result"
+ set start [$var(text) search -nocase -count cnt \
+ -regexp -- $result 1.0 end]
+ if {$start != {}} {
+ $var(text) tag add sel $start "$start + $cnt chars"
+ $var(text) see $start
+ } else {
+ Error "$var(search) [msgcat::mc {Not Found}]"
+ }
+ }
+}
+
+proc SimpleTextFindNext {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(search) != {}} {
+ if {[$var(text) tag ranges sel] != {}} {
+ set ss {sel.last}
+ } else {
+ set ss {1.0}
+ }
+
+ set start [$var(text) search -nocase -count cnt \
+ -regexp -- $var(search) $ss end]
+ if {$start != {}} {
+ $var(text) tag remove sel 1.0 end
+ $var(text) tag add sel $start "$start + $cnt chars"
+ $var(text) see $start
+ } else {
+ # wrap
+ set start [$var(text) search -nocase -count cnt \
+ -regexp -- $var(search) 1.0 end]
+ if {$start != {}} {
+ $var(text) tag remove sel 1.0 end
+ $var(text) tag add sel $start "$start + $cnt chars"
+ $var(text) see $start
+ } else {
+ Error "$var(search) [msgcat::mc {Not Found}]"
+ }
+ }
+ }
+}
+
+proc SimpleTextPrint {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {SimpleTextPSPrint $varname}
+ wwin32 {win32 pm print text [$var(text) get 1.0 end]}
+ }
+}
+
+proc SimpleTextPSPrint {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[PRPrintDialog]} {
+ if {[catch {SimpleTextPostScript $varname} printError]} {
+ Error "[msgcat::mc {An error has occurred while printing}] $printError"
+ }
+ }
+}
+
+proc SimpleTextPostScript {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ps
+
+ if {$ps(dest) == "file"} {
+ set ch [open "| cat > $ps(filename,txt)" w]
+ } else {
+ set ch [open "| $ps(cmd)" w]
+ }
+
+ puts -nonewline $ch [$var(text) get 1.0 end]
+ close $ch
+}
+
+proc SimpleTextPageSetup {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {}
+ wwin32 {win32 pm pagesetup}
+ }
+}
+
+proc SimpleTextSave {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set filename [SaveFileDialog textfbox]
+ if {$filename != {}} {
+ if {[catch {set ch [open "| cat > \"$filename\"" w]}]} {
+ Error [msgcat::mc {An error has occurred while saving}]
+ return
+ }
+ puts -nonewline $ch [$var(text) get 1.0 end]
+ close $ch
+ }
+}
+
diff --git a/ds9/library/ds9.tcl b/ds9/library/ds9.tcl
new file mode 100755
index 0000000..f1405df
--- /dev/null
+++ b/ds9/library/ds9.tcl
@@ -0,0 +1,603 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+proc DS9Def {} {
+ global ds9
+ global pds9
+
+ set ds9(title) "$ds9(app)"
+ # for beta version, MUST have space
+ set ds9(version) {7.5 rc2}
+
+ set ds9(top) .
+ set ds9(mb) .mb
+
+ set ds9(visual) {}
+ set ds9(depth) 8
+ set ds9(FTY_MAXAXES) 10
+ set ds9(threads) [GetNumCores]
+
+ set ds9(helvetica) [font configure TkDefaultFont -family]
+ set ds9(courier) [font configure TkFixedFont -family]
+ switch $ds9(wm) {
+ x11 {
+ set ds9(times) serif
+
+ # These look better if normal weight
+ font configure TkCaptionFont -weight normal
+ font configure TkHeadingFont -weight normal
+ }
+ aqua {set ds9(times) times}
+ win32 {set ds9(times) times}
+ }
+
+ set ds9(main) {}
+ set ds9(image) {}
+ set ds9(canvas) {}
+ set ds9(panel) {}
+ set ds9(info) {}
+ set ds9(panner) {}
+ set ds9(magnifier) {}
+ set ds9(buttons) {}
+ set ds9(graph,sp) {}
+ set ds9(graph,horz) {}
+ set ds9(graph,vert) {}
+
+ set ds9(frames) {}
+ set ds9(active) {}
+ set ds9(active,num) 0
+ set ds9(lock) 0
+ set ds9(next) {}
+ set ds9(next,num) 1
+ set ds9(last) {}
+
+ set ds9(event,opendoc) {}
+ set ds9(event,printdoc) {}
+
+ set ds9(tmpdir) {}
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {set ds9(menu,start) 1}
+ aqua {set ds9(menu,start) 0}
+ }
+ set ds9(menu,size,frame,goto) [expr $ds9(menu,start)+0]
+ set ds9(menu,size,frame,active) [expr $ds9(menu,start)+3]
+ set ds9(menu,size,analysis) [expr $ds9(menu,start)+35]
+ set ds9(menu,size,wrap) 20
+
+ set ds9(display) single
+ set ds9(bg) white
+
+ set ds9(array,x) 512
+ set ds9(array,y) 512
+ set ds9(array,bitpix) -32
+ set ds9(array,skip) 0
+ set ds9(array,arch) bigendian
+
+ set ds9(row) -1
+ set ds9(freeze) 0
+
+ set ds9(b1) 0
+ set ds9(b2) 0
+ set ds9(b3) 0
+
+ set ds9(sb1) 0
+ set ds9(sb2) 0
+ set ds9(sb3) 0
+
+ set ds9(cb1) 0
+ set ds9(cb2) 0
+ set ds9(cb3) 0
+
+ set ds9(csb1) 0
+ set ds9(csb2) 0
+ set ds9(csb3) 0
+
+ set ds9(modifier) 0
+
+ set ds9(ext,file) ".$ds9(app).fil"
+ set ds9(ext,alt) ".$ds9(app).file"
+
+ set ds9(msg) {}
+ set ds9(msg,level) info
+ set ds9(msg,src) {}
+ set ds9(msg,timeout) 1000
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ set ds9(ctrl) "Control-"
+ set ds9(shiftctrl) "Shift-Control-"
+ }
+ aqua {
+ set ds9(ctrl) "Command-"
+ set ds9(shiftctrl) "Shift-Command-"
+ }
+ }
+
+ # prefs only
+ InitDefaultFont
+ InitDefaultTextFont
+
+ set pds9(backup) 1
+ set pds9(automarker) 1
+ set pds9(xpa) 1
+ set pds9(samp) 1
+ set pds9(confirm) 1
+ set pds9(bg) white
+ set pds9(nan) white
+ set pds9(iraf) 1
+ switch $ds9(wm) {
+ x11 {set pds9(dialog) motif}
+ aqua -
+ win32 {set pds9(dialog) native}
+ }
+ set pds9(dialog,center) 0
+ set pds9(dialog,all) 0
+ set pds9(language) locale
+ set pds9(language,name) [LanguageToName $pds9(language)]
+ set pds9(language,dir) {}
+}
+
+# if we have a problem at this point, dump simple message and exit
+if {[catch {tk windowingsystem} ds9(wm)]} {
+ puts stderr "Unable to initialize window system."
+ exit
+}
+
+# who are we?
+set ds9(app) [file tail [info nameofexecutable]]
+
+# Themes are now hardcoded
+switch $ds9(wm) {
+ x11 {
+ # set bg for non ttk widgets
+ set bg [ttk::style lookup "." -background]
+
+ # standard widgets
+ option add {*Text.Background} $bg
+ option add {*Listbox.Background} $bg
+ option add {*PlotBackground} $bg
+
+ # ttk widgets
+ ttk::style configure TLabel -borderwidth 2 -padding 1
+ ttk::style configure TEntry -fieldbackground $bg -padding 1
+ }
+ aqua {
+ # set bg for non ttk widgets
+ set bg [ttk::style lookup "." -background]
+
+ # standard widgets
+ option add {*PlotBackground} $bg
+ }
+ win32 {ttk::style theme use xpnative}
+}
+
+switch $ds9(wm) {
+ x11 {
+ # set to absolute path so that if -cd command is used,
+ # so we can still find our files
+ set ds9(root) [file normalize [file join [pwd] zvfsmntpt]]
+
+ if {![namespace exists msgcat]} {
+ source $ds9(root)/tcl8/8.5/msgcat-1.5.2.tm
+ }
+ if {![namespace exists http]} {
+ source $ds9(root)/tcl8/8.6/http-2.8.9.tm
+ source $ds9(root)/library/htp.tcl
+ }
+
+ source $ds9(root)/tk8.6/tearoff.tcl
+ source $ds9(root)/tk8.6/comdlg.tcl
+ source $ds9(root)/tk8.6/focus.tcl
+ source $ds9(root)/tk8.6/mkpsenc.tcl
+ source $ds9(root)/tk8.6/msgbox.tcl
+ source $ds9(root)/tk8.6/optMenu.tcl
+ source $ds9(root)/tk8.6/unsupported.tcl
+
+ source $ds9(root)/tcllib/base64/base64.tcl
+ source $ds9(root)/tcllib/log/log.tcl
+ source $ds9(root)/tcllib/ftp/ftp.tcl
+ source $ds9(root)/tcllib/textutil/repeat.tcl
+ source $ds9(root)/tcllib/textutil/tabify.tcl
+ source $ds9(root)/tcllib/math/fuzzy.tcl
+
+ source $ds9(root)/tkcon/tkcon.tcl
+ source $ds9(root)/tkblt/graph.tcl
+
+ source $ds9(root)/library/source.tcl
+
+ # fix ::tk and msgcat
+ rename ::tk::msgcat::mc {}
+ rename ::tk::msgcat::mcmax {}
+
+ namespace import ::msgcat::mc
+ namespace import ::msgcat::mcmax
+ ::msgcat::mcload [file join $::tk_library msgs]
+
+ # fix ::tk::dialog::file
+ set ::tk::dialog::file::showHiddenVar 0
+ set ::tk::dialog::file::showHiddenBtn 1
+ }
+ aqua {
+ # set to absolute path
+ set ds9(root) [file normalize [file dirname [file dirname $argv0]]]
+ set bb [file dirname [file dirname $ds9(root)]]
+ set auto_path [list $ds9(root) $bb/Tcl.framework/Resources $bb/Tcl.framework/Resources/Scripts $bb/Tk.framework/Resources $bb/Tk.framework/Resources/Scripts $bb/Tk.framework/Resources/Scripts/ttk]
+
+ package require msgcat
+ package require http
+ source $ds9(root)/library/htp.tcl
+
+ package require base64
+ package require log
+ package require ftp
+ package require textutil
+ package require math
+
+ package require tkcon
+ package require Tkblt
+
+ package require DS9
+
+ proc ::tk::mac::ShowPreferences {} {
+ PrefsDialog
+ }
+
+ proc ::tk::mac::ReopenApplication {} {
+ if {[wm state .] eq "withdrawn"} {
+ wm state . normal
+ } else {
+ wm deiconify .
+ }
+ raise .
+ }
+
+ proc ::tk::mac::OpenDocument {args} {
+ global ds9
+
+ set ds9(event,opendoc) $args
+ if {!$ds9(init)} {
+ MacOSXOpenDocEvent 1
+ }
+ }
+
+ proc ::tk::mac::PrintDocument {args} {
+ global ds9
+
+ set ds9(event,printdoc) $args
+ if {!$ds9(init)} {
+ MacOSXPrintDocEvent 0
+ }
+ }
+
+ proc ::tk::mac::Quit {args} {
+ QuitDS9
+ }
+
+ proc ::tk::mac::ShowHelp {args} {
+ HelpRef
+ }
+ }
+ win32 {
+ set ds9(root) [file dirname [file dirname $argv0]]
+ set auto_path [list $ds9(root) $ds9(root)/tcl8.6 $ds9(root)/tk8.6 $ds9(root)/tk8.6/ttk]
+
+ package require msgcat
+ package require http
+ source $ds9(root)/library/htp.tcl
+
+ package require base64
+ package require log
+ package require ftp
+ package require textutil
+ package require math
+
+ package require tkcon
+ package require Tkblt
+
+ package require DS9
+
+ proc checkdns {a b {c {}}} {
+ return 0
+ }
+ }
+}
+
+# Define Variables
+DS9Def
+2MASSDef
+3DDef
+AnalysisDef
+BinDef
+BlinkDef
+BlockDef
+ButtonsDef
+CanvasDef
+CATDef
+CATSymDef
+CATCDSSrchDef
+CentroidDef
+ColorbarDef
+ContourDef
+CoordDef
+CrosshairDef
+CubeDef
+CurrentDef
+CursorDef
+DebugDef
+ESODef
+ExamineDef
+ExportDef
+GraphDef
+GridDef
+GroupDef
+HelpDef
+HTTPDef
+HVDef
+IExamDef
+IISDef
+IMEDef
+MagnifierDef
+MarkerDef
+MaskDef
+MinMaxDef
+MovieDef
+NRESDef
+NVSSDef
+PannerDef
+PanZoomDef
+CropDef
+PixelDef
+PlotDef
+PrefsDef
+PSDef
+RGBDef
+SAMPDef
+SAODef
+SaveDef
+SaveImageDef
+ScaleDef
+SIADef
+SimpleTextDef
+SkyViewDef
+SmoothDef
+STSCIDef
+TemplateDef
+TileDef
+ViewDef
+VLADef
+VLSSDef
+VODef
+WCSDef
+ZScaleDef
+
+# let's start
+set ds9(init) 1
+
+# set up signal trap
+# not supported under windows
+switch $tcl_platform(platform) {
+ unix {signal add SIGINT QuitDS9}
+ windows {}
+}
+
+# environment vars
+# we don't want to see any error messages if xpa is not available
+if { [info exists env(XPA_VERBOSITY)] == 0 } {
+ set env(XPA_VERBOSITY) 0
+}
+# set filter ptype to contained (default is process)
+set env(FILTER_PTYPE) c
+# set filter error proc so it will not kill ds9
+set env(GERROR) 0
+
+# Events
+event add <<Open>> <${ds9(ctrl)}o>
+event add <<Save>> <${ds9(ctrl)}s>
+event add <<PageSetup>> <${ds9(ctrl)}P>
+event add <<Print>> <${ds9(ctrl)}p>
+event add <<SelectAll>> <${ds9(ctrl)}a>
+event add <<Find>> <${ds9(ctrl)}f>
+event add <<FindNext>> <${ds9(ctrl)}g>
+
+# Init Temporary Dir before prefs
+InitTempDir
+
+# Init the filter compiler
+InitFilterCompiler
+
+# Load any preferences here, before we do any real work
+LoadPrefs
+
+# set fonts
+SetDefaultFont false
+SetDefaultTextFont false
+
+switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ ::tk::unsupported::MacWindowStyle style $ds9(top) document "closeBox fullZoom collapseBox resizable"
+ # we need to map the top window so we can get the proper truecolor masks
+ update idletasks
+ }
+}
+
+# We want to withdraw the window til everything is ready to go
+wm withdraw $ds9(top)
+
+wm title $ds9(top) "SAOImage $ds9(title)"
+wm iconname $ds9(top) "SAOImage $ds9(title)"
+wm protocol $ds9(top) WM_DELETE_WINDOW QuitDS9
+
+# we need to set certain variables before anything else
+# such as color, title, language
+ProcessCommandLineFirst
+
+# initialize language
+switch $pds9(language) {
+ locale {
+ switch $ds9(wm) {
+ x11 {
+ foreach ee {LC_MESSAGES LC_ALL LANG} {
+ if {[info exists env($ee)]} {
+ set ll [string tolower [string range $env($ee) 0 1]]
+ if {[SetLanguage $ll]} {
+ break
+ }
+ }
+ }
+ }
+ aqua {
+ foreach ll [MacOSXGetLocale] {
+ if {[SetLanguage $ll]} {
+ break
+ }
+ }
+ }
+ win32 {}
+ }
+ }
+ default {SetLanguage $pds9(language)}
+}
+
+# set the visual
+set ds9(visual) [winfo visual .]
+set ds9(depth) [winfo depth .]
+
+switch $ds9(wm) {
+ x11 {
+ if {$ds9(depth)==15} {
+ set ds9(depth) 16
+ }
+ if {$ds9(depth)==32} {
+ set ds9(depth) 24
+ }
+ }
+ aqua {
+ if {$ds9(depth)==15} {
+ set ds9(depth) 16
+ }
+ }
+ win32 {
+ if {$ds9(depth)==32} {
+ set ds9(depth) 24
+ }
+ }
+}
+
+switch -- $ds9(visual)$ds9(depth) {
+ truecolor8 {}
+ truecolor16 {}
+ truecolor24 {}
+ default {BadVisualError}
+}
+
+# create our main frame
+set ds9(main) [ttk::frame ${ds9(top)}ds9]
+pack $ds9(main) -fill both -expand true
+
+# Create image canvas
+CreateCanvas
+
+# Create Colorbar-- Create this first, so in case of a private colormap,
+# gui colors will be allocated in the new colormap, not the default colormap
+CreateColorbar
+
+# Create other parts of the display
+CreateMenuBar
+CreateInfoPanel
+CreatePanner
+CreateMagnifier
+CreateButtons
+CreateGraphs
+
+# Make sure that the wm knows when to swap in the colormap (if needed)
+wm colormapwindows . "$ds9(main) $ds9(canvas)"
+
+# Initialize the display
+InitColorbar
+InitPanner
+InitDialogBox
+
+# Set our current state of things
+ChangeMode
+
+# force a update, then layout
+update
+ConfigureView
+
+# our first frame
+CreateFrame
+
+# do this last so we don't get an ConfigureView event
+InitCanvas
+
+# ok, ready to show the window
+wm deiconify $ds9(top)
+update
+
+# Init external File Formats
+# we want this before processing the command line
+InitExternalFile
+
+# Init analysis file formats
+InitAnalysisFile
+
+# Configure HTTP
+ConfigHTTP
+
+# SAMP
+InitSAMP
+
+# XPA
+# don't start xpa for windows
+switch $ds9(wm) {
+ x11 -
+ aqua {InitXPA}
+ win32 {}
+}
+
+# and process any command line items
+# we want to see something before any fits files are loaded
+ProcessCommandLine
+
+# Initialize IIS
+# after command line options to set port/fifo/unix...
+catch {IISInit}
+
+# any os events received?
+switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ MacOSXOpenDocEvent 0
+ MacOSXPrintDocEvent 1
+ }
+}
+
+# Load any initalization tcl code
+SourceInitFileDir {.ini}
+
+# do we have the correct prefs file?
+CheckPrefs
+
+# kludge for aqua. We need to trigger the trap to update buttons vars
+switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ set current(display) $current(display)
+ set colorbar(map) $colorbar(map)
+ }
+}
+
+# start error monitor
+after $ds9(msg,timeout) [list ErrorTimer]
+
+# ok, we're done
+set ds9(init) 0
+
diff --git a/ds9/library/ellipse.tcl b/ds9/library/ellipse.tcl
new file mode 100644
index 0000000..de25b7e
--- /dev/null
+++ b/ds9/library/ellipse.tcl
@@ -0,0 +1,126 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc EllipseDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ # procs
+ set var(proc,apply) EllipseApply
+ set var(proc,close) EllipseClose
+ set var(proc,coordCB) EllipseCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisHistogramDialog $varname
+ MarkerAnalysisPlot3dDialog $varname
+
+ # init
+ EllipseEditCB $varname
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback edit EllipseEditCB $varname
+ $var(frame) marker $var(id) callback rotate \
+ MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.tradius -text Radius
+ ttk::entry $f.radius1 -textvariable ${varname}(radius1) -width 13
+ ttk::entry $f.radius2 -textvariable ${varname}(radius2) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list EllipseEditCB $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.tradius $f.radius1 $f.radius2 $f.uradius -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc EllipseClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback edit EllipseEditCB
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc EllipseApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(radius1) != {} &&
+ $var(radius2) !={}} {
+ $var(frame) marker $var(id) ellipse radius \
+ $var(radius1) $var(radius2) $var(dcoord) $var(dformat)
+ }
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc EllipseCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "EllipseCoordCB"
+ }
+
+ MarkerAnalysisStatsSystem $varname
+ MarkerAnalysisPlot3dSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+proc EllipseEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "EllipseEditCB"
+ }
+
+ set r [$var(frame) get marker $var(id) ellipse radius \
+ $var(dcoord) $var(dformat)]
+ set var(radius1) [lindex $r 0]
+ set var(radius2) [lindex $r 1]
+}
diff --git a/ds9/library/ellipseannulus.tcl b/ds9/library/ellipseannulus.tcl
new file mode 100644
index 0000000..b550a86
--- /dev/null
+++ b/ds9/library/ellipseannulus.tcl
@@ -0,0 +1,28 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc EllipseAnnulusDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(which) ellipseannulus
+ set var(proc,apply) MarkerBaseAnnulusRectApply
+ set var(proc,close) MarkerBaseAnnulusRectClose
+ set var(proc,generate) MarkerBaseAnnulusGenerateEllipse
+ set var(proc,coordCB) MarkerBaseAnnulusRectCoordCB
+ set var(proc,editCB) MarkerBaseAnnulusRectEditCB
+ set var(proc,distCB) MarkerBaseAnnulusRectDistCB
+
+ # base
+ MarkerBaseAnnulusRectDialog $varname radius Major Minor
+}
diff --git a/ds9/library/envi.tcl b/ds9/library/envi.tcl
new file mode 100644
index 0000000..a510c51
--- /dev/null
+++ b/ds9/library/envi.tcl
@@ -0,0 +1,96 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ImportENVIFile {hdr fn} {
+ global loadParam
+
+ set loadParam(file,type) envi
+ set loadParam(file,mode) {}
+ set loadParam(load,type) smmap
+ set loadParam(file,name) $fn
+ set loadParam(file,header) $hdr
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc ExportENVIFile {hdr fn opt} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save envi file "\{$hdr\}" "\{$fn\}" $opt
+}
+
+proc ProcessENVICmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {0} {
+ # not supported
+ } else {
+ set fn [lindex $var $i]
+ set fn2 [lindex $var [expr $i+1]]
+ if {$fn2 == {}} {
+ set fn2 [FindENVIDataFile $fn]
+ }
+ ImportENVIFile $fn $fn2
+ }
+ } else {
+ # comm
+ if {0} {
+ # not supported
+ } else {
+ set fn [lindex $var $i]
+ set fn2 [lindex $var [expr $i+1]]
+ if {$fn2 == {}} {
+ set fn2 [FindENVIDataFile $fn]
+ }
+ ImportENVIFile $fn $fn2
+ }
+ }
+ FinishLoad
+}
+
+proc FindENVIDataFile {fn} {
+ set rn [file rootname $fn]
+ foreach ff {{bil} {bip} {bsq} {raw} {cube}} {
+ set fn2 "$rn.$ff"
+ if {[file exists $fn2]} {
+ return $fn2
+ }
+ }
+ return {}
+}
diff --git a/ds9/library/epanda.tcl b/ds9/library/epanda.tcl
new file mode 100644
index 0000000..93072d0
--- /dev/null
+++ b/ds9/library/epanda.tcl
@@ -0,0 +1,38 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc EpandaDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(which) epanda
+ set var(proc,apply) MarkerBasePandaRectApply
+ set var(proc,close) MarkerBasePandaRectClose
+ set var(proc,generate) EpandaGenerate
+ set var(proc,coordCB) MarkerBasePandaRectCoordCB
+ set var(proc,editCB) MarkerBasePandaRectEditCB
+ set var(proc,distCB) MarkerBasePandaRectDistCB
+
+ # base panda rect dialog
+ MarkerBasePandaRectDialog $varname
+}
+
+# actions
+
+proc EpandaGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseAnnulusGenerateEllipse $varname
+ MarkerBasePandaGenerateAngles $varname
+}
diff --git a/ds9/library/error.tcl b/ds9/library/error.tcl
new file mode 100644
index 0000000..b1f570d
--- /dev/null
+++ b/ds9/library/error.tcl
@@ -0,0 +1,73 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# capture general errors
+# this only captures gui errors, not xpa errors
+proc bgerror {err} {
+ tk_messageBox -type ok -icon error \
+ -message "[msgcat::mc {An internal error has been detected}] $err"
+}
+
+# force capture xpa/samp/hv/interactive errors
+proc InitError {which} {
+ global ds9
+ set ds9(msg) {}
+ set ds9(msg,level) info
+ set ds9(msg,src) $which
+
+ global errorInfo
+ set errorInfo {}
+}
+
+proc Info {message} {
+ ProcessMessage info $message
+}
+
+proc Warning {message} {
+ ProcessMessage warning $message
+}
+
+# used by backup
+proc Error {message} {
+ ProcessMessage error $message
+}
+
+proc ProcessMessage {level message} {
+ global ds9
+ global pds9
+
+ set ds9(msg,level) $level
+ switch -- $ds9(msg,src) {
+ xpa -
+ hv -
+ samp {set ds9(msg) $message}
+ default {
+ if {$pds9(confirm)} {
+ tk_messageBox -message $message -type ok -icon $level
+ }
+ }
+ }
+}
+
+# here is where errors from within the canvas widgets
+# will try to get our attention.
+# XPA, HV, and SAMP will have already seen any problems
+proc ErrorTimer {} {
+ global ds9
+ global pds9
+
+ if {$ds9(msg) != {}} {
+ if {$pds9(confirm)} {
+ tk_messageBox -message $ds9(msg) -type ok -icon $ds9(msg,level)
+ }
+ InitError tcl
+ }
+
+ # set again
+ after $ds9(msg,timeout) ErrorTimer
+}
+
+
diff --git a/ds9/library/eso.tcl b/ds9/library/eso.tcl
new file mode 100644
index 0000000..8b314bf
--- /dev/null
+++ b/ds9/library/eso.tcl
@@ -0,0 +1,170 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ESODef {} {
+ global eso
+ global ieso
+
+ set ieso(top) .eso
+ set ieso(mb) .esomb
+
+ set eso(sky) fk5
+ set eso(rformat) arcmin
+ set eso(width) 15
+ set eso(height) 15
+ set eso(mode) new
+ set eso(save) 0
+ set eso(survey) {DSS1}
+}
+
+proc ESODialog {} {
+ global eso
+ global ieso
+ global wcs
+
+ if {[winfo exists $ieso(top)]} {
+ raise $ieso(top)
+ return
+ }
+
+ set varname deso
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $ieso(top)
+ set var(mb) $ieso(mb)
+ set var(sky) $eso(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $eso(rformat)
+ set var(width) $eso(width)
+ set var(height) $eso(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(survey) $eso(survey)
+ set var(mode) $eso(mode)
+ set var(save) $eso(save)
+
+ set w $var(top)
+ IMGSVRInit $varname "ESO-DSS [msgcat::mc {Server}]" \
+ ESOExec ESOAck ARDone ARError
+
+ $var(mb) add cascade -label Survey -menu $var(mb).survey
+ menu $var(mb).survey
+ # these must be Caps, the server will not accept lower case
+ $var(mb).survey add radiobutton -label {DSS1} \
+ -variable ${varname}(survey) -value DSS1
+ $var(mb).survey add radiobutton -label {DSS2-red} \
+ -variable ${varname}(survey) -value DSS2-red
+ $var(mb).survey add radiobutton -label {DSS2-blue} \
+ -variable ${varname}(survey) -value DSS2-blue
+ $var(mb).survey add radiobutton -label {DSS2-infrared} \
+ -variable ${varname}(survey) -value DSS2-infrared
+
+ IMGSVRUpdate $varname
+}
+
+proc ESOExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set mime "application/x-fits"
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set mime "display/gz-fits"
+ set var(fn) [tmpnam {.fits.gz}]
+ }
+
+ # size - convert to arcmin
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+ if {$ww>60} {
+ set ww 60
+ }
+ if {$hh>60} {
+ set hh 60
+ }
+
+ # query
+ set query [http::formatQuery ra $var(x) dec $var(y) equinox J2000 x $ww y $hh mime-type $mime Sky-Survey $var(survey)]
+ # Load image
+ # we can't use -query because eso needs a GET not a POST
+ set var(query) {}
+ set url "http://archive.eso.org/dss/dss?$query"
+ IMGSVRGetURL $varname $url
+}
+
+proc ESOAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the ESO
+
+The Digitized Sky Surveys were produced at the Space Telescope Science
+Institute under U.S. Government grant NAG W-2166. The images of these
+surveys are based on photographic data obtained using the Oschin
+Schmidt Telescope on Palomar Mountain and the UK Schmidt Telescope.
+The plates were processed into the present compressed digital form
+with the permission of these institutions.
+
+The National Geographic Society - Palomar Observatory Sky Atlas
+(POSS-I) was made by the California Institute of Technology with
+grants from the National Geographic Society.
+
+The Second Palomar Observatory Sky Survey (POSS-II) was made by the
+California Institute of Technology with funds from the National
+Science Foundation, the National Geographic Society, the Sloan
+Foundation, the Samuel Oschin Foundation, and the Eastman Kodak
+Corporation.
+
+The Oschin Schmidt Telescope is operated by the California Institute
+of Technology and Palomar Observatory.
+
+The UK Schmidt Telescope was operated by the Royal Observatory
+Edinburgh, with funding from the UK Science and Engineering Research
+Council (later the UK Particle Physics and Astronomy Research Council),
+until 1988 June, and thereafter by the Anglo-Australian
+Observatory. The blue plates of the southern Sky Atlas and its
+Equatorial Extension (together known as the SERC-J), as well as the
+Equatorial Red (ER), and the Second Epoch [red] Survey (SES) were all
+taken with the UK Schmidt.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessESOCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ ESODialog
+ IMGSVRProcessCmd $varname $iname deso
+}
+
+proc ProcessSendESOCmd {proc id param} {
+ ESODialog
+ IMGSVRProcessSendCmd $proc $id $param deso
+}
diff --git a/ds9/library/examine.tcl b/ds9/library/examine.tcl
new file mode 100644
index 0000000..5cc82dc
--- /dev/null
+++ b/ds9/library/examine.tcl
@@ -0,0 +1,319 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ExamineDef {} {
+ global pexamine
+
+ # prefs only
+ set pexamine(mode) new
+ set pexamine(zoom) 4
+}
+
+proc ExamineButton {which x y} {
+ if {![$which has fits]} {
+ return
+ }
+
+ switch -- [$which get type] {
+ base {ExamineButtonBase $which $x $y}
+ rgb {ExamineButtonRGB $which $x $y}
+ 3d {ExamineButton3D $which $x $y}
+ }
+}
+
+proc ExamineButtonBase {which x y} {
+ global current
+ global ds9
+ global pexamine
+
+ # this code will not handle mosaics.
+
+ # current coord
+ set coord [$which get coordinates $x $y physical]
+
+ # find filename/slice
+ set fn [$which get fits file name full canvas $x $y]
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ set slice($ii) [$which get fits slice $ii]
+ }
+
+ # so the new frame will have all of the parent frame when created
+ set ds9(next) $which
+ GotoFrame
+
+ # create frame if needed
+ switch -- $pexamine(mode) {
+ new {CreateFrame}
+ one {
+ if {[info exists pexamine(one)]} {
+ if {$which == $pexamine(one)} {
+ # do nothing, we clicked in the examine frame
+ return
+ }
+ DeleteSingleFrame $pexamine(one)
+ CreateFrame
+ set pexamine(one) $current(frame)
+ } else {
+ CreateFrame
+ set pexamine(one) $current(frame)
+ }
+ }
+ }
+
+ # go to tile mode in case
+ set current(display) tile
+ DisplayMode
+
+ # load data
+ LoadFitsFile $fn {} {}
+
+ RealizeDS9
+
+ # set slice
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ $current(frame) update fits slice $ii $slice($ii)
+ }
+
+ # zoom to about
+ if {[$current(frame) has fits bin]} {
+ set bf "[$current(frame) get bin factor]"
+ set bx [expr [lindex $bf 0]/$pexamine(zoom)]
+ set by [expr [lindex $bf 1]/$pexamine(zoom)]
+ $current(frame) bin factor to $bx $by about \
+ [lindex $coord 0] [lindex $coord 1]
+ } else {
+ $current(frame) zoom $pexamine(zoom) $pexamine(zoom) \
+ about physical [lindex $coord 0] [lindex $coord 1]
+ }
+
+ # back to original frame
+ set ds9(next) $which
+ GotoFrame
+
+ # update any dialogs
+ UpdateDS9
+}
+
+proc ExamineButtonRGB {which x y} {
+ global current
+ global ds9
+ global pexamine
+
+ # this code is far from perfect. It assumes data is loaded into the red
+ # and it is the keychannel. Furthermore, it assumes either images or bin
+ # tables are loaded into each channel, but not both.
+ # this code will not handle mosaics.
+
+ # save current channel
+ set channel [$which get rgb channel]
+
+ # current coord
+ $which rgb channel red
+ set coord [$which get coordinates $x $y physical]
+
+ # find filename/slice
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ set fn($cc) [$which get fits file name full canvas $x $y]
+
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ set slice($cc,$ii) [$which get fits slice $ii]
+ }
+ }
+
+ # so the new frame will have all of the parent frame when created
+ set ds9(next) $which
+ GotoFrame
+
+ # create frame if needed
+ switch -- $pexamine(mode) {
+ new {CreateRGBFrame}
+ one {
+ if {[info exists pexamine(one)]} {
+ if {$which == $pexamine(one)} {
+ # do nothing, we clicked in the examine frame
+ return
+ }
+ DeleteSingleFrame $pexamine(one)
+ CreateRGBFrame
+ set pexamine(one) $current(frame)
+ } else {
+ CreateRGBFrame
+ set pexamine(one) $current(frame)
+ }
+ }
+ }
+
+ # go to tile mode in case
+ set current(display) tile
+ DisplayMode
+
+ # load data
+ foreach cc {red green blue} {
+ $current(frame) rgb channel $cc
+
+ if {$fn($cc) != {}} {
+ LoadFitsFile $fn($cc) {} {}
+ }
+ }
+
+ RealizeDS9
+
+ # set slice
+ foreach cc {red green blue} {
+ $current(frame) rgb channel $cc
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ $current(frame) update fits slice $ii $slice($cc,$ii)
+ }
+ }
+
+ # zoom to about
+ $current(frame) rgb channel red
+ if {[$current(frame) has fits bin]} {
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ $current(frame) rgb channel $cc
+
+ set bf "[$current(frame) get bin factor]"
+ set bx [expr [lindex $bf 0]/$pexamine(zoom)]
+ set by [expr [lindex $bf 1]/$pexamine(zoom)]
+ $current(frame) bin factor to $bx $by about \
+ [lindex $coord 0] [lindex $coord 1]
+ }
+ } else {
+ $current(frame) zoom $pexamine(zoom) $pexamine(zoom) \
+ about image [lindex $coord 0] [lindex $coord 1]
+ }
+
+ # set channel
+ $current(frame) rgb channel $channel
+
+ # back to original frame
+ set ds9(next) $which
+ GotoFrame
+ $current(frame) rgb channel $channel
+
+ # update any dialogs
+ UpdateDS9
+}
+
+proc ExamineButton3D {which x y} {
+ global current
+ global ds9
+ global pexamine
+
+ # this code will not handle mosaics.
+
+ # current coord
+ set coord [$which get coordinates $x $y physical]
+
+ # find filename/slice
+ set fn [$which get fits file name full canvas $x $y]
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ set slice($ii) [$which get fits slice $ii]
+ }
+
+ # and 3d info
+ set rr [$current(frame) get 3d view]
+ set az [lindex $rr 0]
+ set el [lindex $rr 1]
+ set method [$current(frame) get 3d method]
+
+ # so the new frame will have all of the parent frame when created
+ set ds9(next) $which
+ GotoFrame
+
+ # create frame if needed
+ switch -- $pexamine(mode) {
+ new {Create3DFrame}
+ one {
+ if {[info exists pexamine(one)]} {
+ if {$which == $pexamine(one)} {
+ # do nothing, we clicked in the examine frame
+ return
+ }
+ DeleteSingleFrame $pexamine(one)
+ Create3DFrame
+ set pexamine(one) $current(frame)
+ } else {
+ Create3DFrame
+ set pexamine(one) $current(frame)
+ }
+ }
+ }
+
+ # go to tile mode in case
+ set current(display) tile
+ DisplayMode
+
+ # load data
+ LoadFitsFile $fn {} {}
+
+ RealizeDS9
+
+ # set slice
+ for {set ii 2} {$ii<$ds9(FTY_MAXAXES)} {incr ii} {
+ $current(frame) update fits slice $ii $slice($ii)
+ }
+
+ # zoom to about
+ if {[$current(frame) has fits bin]} {
+ set bf "[$current(frame) get bin factor]"
+ set bx [expr [lindex $bf 0]/$pexamine(zoom)]
+ set by [expr [lindex $bf 1]/$pexamine(zoom)]
+ $current(frame) bin factor to $bx $by about \
+ [lindex $coord 0] [lindex $coord 1]
+ } else {
+ $current(frame) zoom $pexamine(zoom) $pexamine(zoom) \
+ about physical [lindex $coord 0] [lindex $coord 1]
+ }
+
+ # set 3d
+ $current(frame) 3d view $az $el
+ $current(frame) 3d method $method
+
+ # back to original frame
+ set ds9(next) $which
+ GotoFrame
+
+ # update any dialogs
+ UpdateDS9
+}
+
+# Prefs
+
+proc PrefsDialogExamine {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Examine}]
+ lappend dprefs(tabs) [ttk::frame $w.examine]
+
+ # Examine
+ set f [ttk::labelframe $w.examine.mode -text [msgcat::mc {Mode}]]
+
+ ttk::radiobutton $f.new -text [msgcat::mc {New Frame each Time}] \
+ -variable pexamine(mode) -value new
+ ttk::radiobutton $f.one -text [msgcat::mc {Examine Frame}] \
+ -variable pexamine(mode) -value one
+
+ grid $f.new -padx 2 -pady 2 -sticky w
+ grid $f.one -padx 2 -pady 2 -sticky w
+
+ set f [ttk::labelframe $w.examine.mag -text [msgcat::mc {Magnification}]]
+
+ ttk::radiobutton $f.x1 -text {1x} -variable pexamine(zoom) -value 1
+ ttk::radiobutton $f.x2 -text {2x} -variable pexamine(zoom) -value 2
+ ttk::radiobutton $f.x4 -text {4x} -variable pexamine(zoom) -value 4
+ ttk::radiobutton $f.x8 -text {8x} -variable pexamine(zoom) -value 8
+ ttk::radiobutton $f.x16 -text {16x} -variable pexamine(zoom) -value 16
+
+ grid $f.x1 $f.x2 $f.x4 $f.x8 $f.x16 -padx 2 -pady 2 -sticky w
+
+ pack $w.examine.mode $w.examine.mag -side top -fill both -expand true
+}
+
diff --git a/ds9/library/export.tcl b/ds9/library/export.tcl
new file mode 100644
index 0000000..f9b0cc4
--- /dev/null
+++ b/ds9/library/export.tcl
@@ -0,0 +1,398 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ExportDef {} {
+ global export
+
+ set export(array,endian) native
+ set export(nrrd,endian) native
+ set export(envi,endian) native
+ set export(jpeg,quality) 75
+ set export(tiff,compress) none
+}
+
+proc Export {fn format fn2} {
+ global export
+
+ switch $format {
+ array {ExportArrayFile $fn $export(array,endian)}
+ rgbarray {ExportRGBArrayFile $fn $export(array,endian)}
+ nrrd {ExportNRRDFile $fn $export(nrrd,endian)}
+ envi {ExportENVIFile $fn $fn2 $export(envi,endian)}
+ gif {ExportPhotoFile $fn $format {}}
+ tiff {ExportPhotoFile $fn $format $export(tiff,compress)}
+ jpeg {ExportPhotoFile $fn $format $export(jpeg,quality)}
+ png {ExportPhotoFile $fn $format {}}
+ }
+}
+
+# Process Cmds
+
+proc ProcessExportCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ set format {}
+ set fn [lindex $var $i]
+ set fn2 {}
+ if {$fn == {}} {
+ return
+ }
+
+ switch -- $fn {
+ array -
+ rgbarray -
+ nrrd -
+ envi -
+ gif -
+ tiff -
+ jpeg -
+ png {
+ set format $fn
+ set fn {}
+ incr i
+ }
+ jpg {
+ set format jpeg
+ set fn {}
+ incr i
+ }
+ tif {
+ set format tiff
+ set fn {}
+ incr i
+ }
+ }
+
+ # one last time
+ if {$fn == {}} {
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+ }
+
+ if {$format == {}} {
+ set format [ExtToFormat $fn]
+ }
+
+ global export
+ set param [string tolower [lindex $var [expr $i+1]]]
+ switch $format {
+ array -
+ rgbarray {
+ switch $param {
+ native -
+ big -
+ bigendian -
+ little -
+ littleendian {
+ set export(array,endian) $param
+ incr i
+ }
+ }
+ }
+ nrrd {
+ switch $param {
+ native -
+ big -
+ bigendian -
+ little -
+ littleendian {
+ set export(nrrd,endian) $param
+ incr i
+ }
+ }
+ }
+ envi {
+ switch $param {
+ {} {set fn2 "[file rootname $fn].bsq"}
+ native -
+ big -
+ bigendian -
+ little -
+ littleendian {
+ set fn2 "[file rootname $fn].bsq"
+ set export(envi,endian) $param
+ incr i
+ }
+ default {
+ if {[string range $param 0 0] == {-}} {
+ set fn2 "[file rootname $fn].bsq"
+ } else {
+ set fn2 $param
+ incr i
+ set param [string tolower [lindex $var [expr $i+1]]]
+ switch $param {
+ native -
+ big -
+ bigendian -
+ little -
+ littleendian {
+ set export(envi,endian) $param
+ incr i
+ }
+ }
+ }
+ }
+ }
+ }
+ gif {}
+ jpeg {
+ if {$param != {} && [string is integer $param]} {
+ set export(jpeg,quality) $param
+ incr i
+ }
+ }
+ tiff {
+ switch $param {
+ none -
+ jpeg -
+ packbits -
+ deflate {
+ set export(tiff,compress) $param
+ incr i
+ }
+ }
+ }
+ png {}
+ }
+
+ global arrayfbox
+ global rgbarrayfbox
+ global giffbox
+ global jpegfbox
+ global tifffbox
+ global pngfbox
+ global nrrdfbox
+ global envifbox
+ global envi2fbox
+ switch -- $format {
+ array {FileLast arrayfbox $fn}
+ rgbarray {FileLast rgbarrayfbox $fn}
+ nrrd {FileLast nrrdfbox $fn}
+ envi {
+ FileLast envifbox $fn
+ FileLast envi2fbox $fn2
+ }
+ gif {FileLast giffbox $fn}
+ jpeg {FileLast jpegfbox $fn}
+ tiff {FileLast tifffbox $fn}
+ png {FileLast pngfbox $fn}
+ }
+ Export $fn $format $fn2
+}
+
+# Support
+
+proc ExportDialog {format} {
+ global export
+ global arrayfbox
+ global rgbarrayfbox
+ global nrrdfbox
+ global envifbox
+ global envi2fbox
+ global giffbox
+ global jpegfbox
+ global tifffbox
+ global pngfbox
+
+ switch -- $format {
+ array {set fn [SaveFileDialog arrayfbox]}
+ rgbarray {set fn [SaveFileDialog rgbarrayfbox]}
+ nrrd {set fn [SaveFileDialog nrrdfbox]}
+ envi {set fn [SaveFileDialog envifbox]}
+ gif {set fn [SaveFileDialog giffbox]}
+ jpeg {set fn [SaveFileDialog jpegfbox]}
+ tiff {set fn [SaveFileDialog tifffbox]}
+ png {set fn [SaveFileDialog pngfbox]}
+ }
+ set fn2 {}
+
+ if {$fn != {}} {
+ set ok 1
+ switch -- $format {
+ array {set ok [ArrayExportDialog export(array,endian)]}
+ rgbarray {}
+ nrrd {set ok [ArrayExportDialog export(nrrd,endian)]}
+ envi {
+ set fn2 "[file rootname $fn].bsq"
+ SetFileLast envi2 $fn2
+# set fn2 [SaveFileDialog envi2fbox]
+# if {$fn2 == {}} {
+# set ok 0
+# }
+ if {$ok} {
+ set ok [ArrayExportDialog export(envi,endian)]
+ }
+ }
+ gif {}
+ jpeg {set ok [JPEGExportDialog export(jpeg,quality)]}
+ tiff {set ok [TIFFExportDialog export(tiff,compress)]}
+ png {}
+ }
+
+ if {$ok} {
+ Export $fn $format $fn2
+ }
+ }
+}
+
+proc ArrayExportDialog {varname} {
+ upvar $varname var
+ global ed2
+
+ set w {.arr}
+
+ set ed2(ok) 0
+ set ed2(arch) $var
+
+ DialogCreate $w [msgcat::mc {Export Array}] ed2(ok)
+
+ # Arch
+ set f [ttk::labelframe $w.arch -text [msgcat::mc {Architecture}] -padding 2]
+ ttk::radiobutton $f.native -text {Native} -variable ed2(arch) \
+ -value native
+ ttk::radiobutton $f.big -text {Big-Endian} -variable ed2(arch) \
+ -value big
+ ttk::radiobutton $f.little -text {Little-Endian} -variable ed2(arch) \
+ -value little
+ grid $f.native -padx 2 -pady 2 -sticky w
+ grid $f.big -padx 2 -pady 2 -sticky w
+ grid $f.little -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ grid $w.arch -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set var $ed2(arch)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc TIFFExportDialog {varname} {
+ upvar $varname var
+ global ed2
+
+ set w {.savetiff}
+
+ set ed2(ok) 0
+ set ed2(compress) $var
+
+ DialogCreate $w {TIFF} ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.title -text [msgcat::mc {Compression}]
+ ttk::radiobutton $f.none -text [msgcat::mc {None}] \
+ -variable ed2(compress) -value none
+ ttk::radiobutton $f.jpeg -text {JPEG} \
+ -variable ed2(compress) -value jpeg
+ ttk::radiobutton $f.packbits -text {Packbits} \
+ -variable ed2(compress) -value packbits
+ ttk::radiobutton $f.deflate -text {Deflate} \
+ -variable ed2(compress) -value deflate
+ grid $f.title -padx 2 -pady 2 -sticky w
+ grid $f.none -padx 2 -pady 2 -sticky w
+ grid $f.jpeg -padx 2 -pady 2 -sticky w
+ grid $f.packbits -padx 2 -pady 2 -sticky w
+ grid $f.deflate -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set var $ed2(compress)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc JPEGExportDialog {varname} {
+ upvar $varname var
+ global ed2
+
+ set w {.savejpeg}
+
+ set ed2(ok) 0
+ set ed2(quality) $var
+
+ DialogCreate $w {JPEG} ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ slider $f.squality 0 100 [msgcat::mc {JPEG Quality Factor}] \
+ ed2(quality) {}
+
+ grid $f.squality -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set var $ed2(quality)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
diff --git a/ds9/library/external.tcl b/ds9/library/external.tcl
new file mode 100644
index 0000000..49f5dfa
--- /dev/null
+++ b/ds9/library/external.tcl
@@ -0,0 +1,61 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc InitExternalFile {} {
+ global ds9
+
+ if {[file exists "./$ds9(ext,file)"]} {
+ ProcessExternalFile "./$ds9(ext,file)"
+ } elseif {[file exists "./$ds9(ext,alt)"]} {
+ ProcessExternalFile "./$ds9(ext,alt)"
+ } elseif {[file exists "~/$ds9(ext,file)"]} {
+ ProcessExternalFile "~/$ds9(ext,file)"
+ } elseif {[file exists "~/$ds9(ext,alt)"]} {
+ ProcessExternalFile "~/$ds9(ext,alt)"
+ }
+}
+
+proc ProcessExternalFile {fn} {
+ global extFits
+
+ set status 1
+ if {[file exists "$fn"]} {
+ set id [open $fn r]
+ while {[gets $id line] >= 0} {
+ # empty line
+ if {[string length $line] == 0} continue
+ # comments
+ if {[string range $line 0 0] == "\#"} continue
+ # else
+ switch -- $status {
+ 1 {
+ # eat the line
+ set template {}
+ set status 2
+ }
+ 2 {
+ set template "$line"
+ set status 3
+ }
+ 3 {
+ # eat the line
+ set status 4
+ }
+ 4 {
+ if {"$template" != {} && "$line" != {}} {
+ foreach t $template {
+ set extFits($t) "$line"
+ }
+ }
+
+ set status 1
+ }
+ }
+ }
+ close $id
+ }
+}
+
diff --git a/ds9/library/file.tcl b/ds9/library/file.tcl
new file mode 100644
index 0000000..f9acff7
--- /dev/null
+++ b/ds9/library/file.tcl
@@ -0,0 +1,307 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# backward compatibility
+proc ProcessFileCmd {varname iname sock ch fn} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvar $var
+ set ii $i
+
+ set zero $i
+ set one [expr $i+1]
+ set two [expr $i+2]
+ set three [expr $i+3]
+
+ switch -- [string tolower [lindex $var $zero]] {
+ new {
+ switch -- [string tolower [lindex $var $one]] {
+ slice {ProcessFitsCmd vvar ii $sock $fn}
+ fits {
+ set vvar [lreplace $var $one $one]
+ ProcessFitsCmd vvar ii $sock $fn
+ }
+ sfits {
+ set vvar [lreplace $var $one $one]
+ ProcessSFitsCmd vvar ii $sock $fn
+ }
+
+ rgbimage {
+ set vvar [lreplace $var $one $one]
+ ProcessRGBImageCmd vvar ii $sock $fn
+ }
+ rgbcube {
+ set vvar [lreplace $var $one $one]
+ ProcessRGBCubeCmd vvar ii $sock $fn
+ }
+ srgbcube {
+ set vvar [lreplace $var $one $one]
+ ProcessSRGBCubeCmd vvar ii $sock $fn
+ }
+
+ mecube {
+ set vvar [lreplace $var $one $one]
+ ProcessMECubeCmd vvar ii $sock $fn
+ }
+ memf -
+ multiframe {
+ set vvar [lreplace $var $one $one]
+ ProcessMultiFrameCmd vvar ii $sock $fn
+ }
+
+ mosaicimage {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ }
+
+ mosaic {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicCmd vvar ii $sock $fn
+ }
+ mosaicwcs {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ }
+ mosaiciraf {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ }
+
+ smosaic {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicCmd vvar ii $sock $fn
+ }
+ smosaicwcs {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicWCSCmd vvar ii $sock $fn
+ }
+ smosaiciraf {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicIRAFCmd vvar ii $sock $fn
+ }
+
+ url {
+ set vvar [lreplace $var $one $one]
+ ProcessURLFitsCmd vvar ii
+ }
+
+ array {
+ set vvar [lreplace $var $one $one]
+ ProcessArrayCmd vvar ii $sock $fn
+ }
+ rgbarray {
+ set vvar [lreplace $var $one $one]
+ ProcessRGBArrayCmd vvar ii $sock $fn
+ }
+ photo {
+ set vvar [lreplace $var $one $one]
+ ProcessTIFFCmd vvar ii $ch $fn
+ }
+ default {ProcessFitsCmd vvar ii $sock $fn}
+ }
+ }
+ mask {
+ switch -- [string tolower [lindex $var $one]] {
+ fits {
+ set vvar [lreplace $var $one $one]
+ ProcessFitsCmd vvar ii $sock $fn
+ }
+ sfits {
+ set vvar [lreplace $var $one $one]
+ ProcessSFitsCmd vvar ii $sock $fn
+ }
+ mosaicimage {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ }
+ mosaic {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicCmd vvar ii $sock $fn
+ }
+ mosaicwcs {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ }
+ mosaiciraf {
+ set vvar [lreplace $var $one $one]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ }
+ smosaic {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicCmd vvar ii $sock $fn
+ }
+ smosaicwcs {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicWCSCmd vvar ii $sock $fn
+ }
+ smosaiciraf {
+ set vvar [lreplace $var $one $one]
+ ProcessSMosaicIRAFCmd vvar ii $sock $fn
+ }
+ array {
+ set vvar [lreplace $var $one $one]
+ ProcessArrayCmd vvar ii $sock $fn
+ }
+ default {ProcessFitsCmd vvar ii $sock $fn}
+ }
+ }
+ slice {ProcessFitsCmd vvar ii $sock $fn}
+
+ fits {
+ set vvar [lreplace $var $zero $zero]
+ ProcessFitsCmd vvar ii $sock $fn
+ }
+ sfits {
+ set vvar [lreplace $var $zero $zero]
+ ProcessSFitsCmd vvar ii $sock $fn
+ }
+
+ rgbimage {
+ set vvar [lreplace $var $zero $zero]
+ ProcessRGBImageCmd vvar ii $sock $fn
+ }
+ rgbcube {
+ set vvar [lreplace $var $zero $zero]
+ ProcessRGBCubeCmd vvar ii $sock $fn
+ }
+ srgbcube {
+ set vvar [lreplace $var $zero $zero]
+ ProcessSRGBCubeCmd vvar ii $sock $fn
+ }
+
+ mecube {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMECubeCmd vvar ii $sock $fn
+ }
+ memf -
+ multiframe {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMultiFrameCmd vvar ii $sock $fn
+ }
+
+ mosaicimage {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ }
+
+ mosaic {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicCmd vvar ii $sock $fn
+ }
+ mosaicwcs {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ }
+ mosaiciraf {
+ set vvar [lreplace $var $zero $zero]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ }
+
+ smosaic {
+ set vvar [lreplace $var $zero $zero]
+ ProcessSMosaicCmd vvar ii $sock $fn
+ }
+ smosaicwcs {
+ set vvar [lreplace $var $zero $zero]
+ ProcessSMosaicWCSCmd vvar ii $sock $fn
+ }
+ smosaiciraf {
+ set vvar [lreplace $var $zero $zero]
+ ProcessSMosaicIRAFCmd vvar ii $sock $fn
+ }
+
+ url {
+ set vvar [lreplace $var $zero $zero]
+ ProcessURLFitsCmd vvar ii
+ }
+
+ array {
+ set vvar [lreplace $var $zero $zero]
+ ProcessArrayCmd vvar ii $sock $fn
+ }
+ rgbarray {
+ set vvar [lreplace $var $zero $zero]
+ ProcessRGBArrayCmd vvar ii $sock $fn
+ }
+ photo {
+ set vvar [lreplace $var $zero $zero]
+ ProcessTIFFCmd vvar ii $ch $fn
+ }
+
+ save {
+ set which image
+ set fn {}
+ switch -- [string tolower [lindex $var $one]] {
+ resample {
+ set which resample
+ switch -- [string tolower [lindex $var $two]] {
+ gz {
+ # ignore
+ set fn [lindex $var $three]
+ }
+ default {set fn [lindex $var $two]}
+ }
+ }
+ gz {
+ # ignore
+ set fn [lindex $var $two]
+ }
+ default {set fn [lindex $var $one]}
+ }
+
+ SaveFitsFile $which $fn
+ }
+
+ default {ProcessFitsCmd vvar ii $sock $fn}
+ }
+}
+
+proc ProcessSendFileCmd {proc id param} {
+ global current
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get fits file name full]\n"
+ }
+}
+
+
diff --git a/ds9/library/fits.tcl b/ds9/library/fits.tcl
new file mode 100644
index 0000000..f5f00de
--- /dev/null
+++ b/ds9/library/fits.tcl
@@ -0,0 +1,408 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadFitsFile {fn layer mode} {
+ global loadParam
+ global current
+ global pds9
+ global marker
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ ConvertFitsFile
+ # save load type, since ProcessLoad will clear loadParam
+ if {$loadParam(load,type) == "mmapincr"} {
+ set mmap 1
+ } else {
+ set mmap 0
+ }
+ ProcessLoad
+
+ # now autoload markers
+ if {$pds9(automarker) && $mmap} {
+ # now, load fits[REGION] if present
+ set id [string first "\[" $fn]
+ if {$id > 0} {
+ set base [string range $fn 0 [expr $id-1]]
+ } else {
+ set base $fn
+ }
+
+ set reg "${base}\[REGION\]"
+ if {[$current(frame) fitsy has ext "\"$reg\""]} {
+ RealizeDS9
+ catch {
+ $current(frame) marker load fits "\"$reg\"" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"
+ }
+ }
+ }
+}
+
+proc LoadFitsAlloc {path fn layer mode} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadFitsSocket {sock fn layer mode} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc SaveFitsFile {which fn} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits $which file "\{$fn\}"
+}
+
+proc SaveFitsSocket {which sock} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits $which socket $sock
+}
+
+proc ProcessFitsCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ if {[ProcessFitsBackwardCmd $varname $iname $sock $fn]} {
+ return
+ }
+
+ global loadParam
+ global current
+
+ set layer {}
+ set mode {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ set mode slice
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadFitsSocket $sock $param $layer $mode]} {
+ InitError xpa
+ LoadFitsFile $param $layer $mode
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadFitsAlloc $fn $param $layer $mode
+ } else {
+ LoadFitsFile $param $layer $mode
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendFitsCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set which image
+
+ switch -- [string tolower [lindex $param 0]] {
+ width {
+ $proc $id "[$current(frame) get fits width]\n"
+ return
+ }
+ height {
+ $proc $id "[$current(frame) get fits height]\n"
+ return
+ }
+ depth {
+ $proc $id "[$current(frame) get fits depth 2]\n"
+ return
+ }
+ bitpix {
+ $proc $id "[$current(frame) get fits bitpix]\n"
+ return
+ }
+ size {
+ set sys [lindex $param 1]
+ set sky [lindex $param 2]
+ set format [lindex $param 3]
+ if {$sys == {} && $sky == {} && $format == {}} {
+ $proc $id "[$current(frame) get fits size]\n"
+ } else {
+ FixSpec sys sky format image fk5 degrees
+ $proc $id "[$current(frame) get fits size $sys $sky $format]\n"
+ }
+ return
+ }
+ header {
+ switch -- [llength $param] {
+ 1 {ProcessSend $proc $id {} $fn {.txt} "[$current(frame) get fits header 1]\n"}
+ 2 {ProcessSend $proc $id {} $fn {.txt} "[$current(frame) get fits header [lindex $param 1]]\n"}
+ 3 {
+ set key [lindex $param 2]
+ set key [string trim $key \']
+ set key [string trim $key \{]
+ set key [string trim $key \}]
+ $proc $id "[string trim [$current(frame) get fits header keyword \{$key\}]]\n"
+ }
+ 4 {
+ set key [lindex $param 3]
+ set key [string trim $key \']
+ set key [string trim $key \{]
+ set key [string trim $key \}]
+ $proc $id "[string trim [$current(frame) get fits header [lindex $param 1] keyword \{$key\}]]\n"
+ }
+ }
+ return
+ }
+ type {
+ if {[$current(frame) has fits bin]} {
+ $proc $id "table\n"
+ } else {
+ $proc $id "image\n"
+ }
+ return
+ }
+ table {set which table}
+ image {}
+ slice {set which slice}
+ resample {set which resample}
+ }
+
+ if {$sock != {}} {
+ # xpa
+ SaveFitsSocket $which $sock
+ } elseif {$fn != {}} {
+ # comm
+ SaveFitsFile $which $fn
+ $proc $id {} $fn
+ }
+}
+
+# backward compatibility
+proc ProcessFitsBackwardCmd {varname iname sock fn} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ set vvar $var
+ set ii $i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ switch -- [string tolower [lindex $var [expr $i+1]]] {
+ rgbimage {
+ set vvar [lreplace $var 1 1]
+ ProcessRGBImageCmd vvar ii $sock $fn
+ return 1
+ }
+ rgbcube {
+ set vvar [lreplace $var 1 1]
+ ProcessRGBCubeCmd vvar ii $sock $fn
+ return 1
+ }
+
+ datacube -
+ mecube -
+ medatacube {
+ set vvar [lreplace $var 1 1]
+ ProcessMECubeCmd vvar ii $sock $fn
+ return 1
+ }
+
+ mosaicimage {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ return 1
+ }
+
+ mosaic {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicwcs {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaiciraf {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ }
+ }
+
+ mask {
+ switch -- [string tolower [lindex $var [expr $i+1]]] {
+ mosaicimage {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ return 1
+ }
+
+ mosaic {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicwcs {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaiciraf {
+ set vvar [lreplace $var 1 1]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ }
+ }
+
+ datacube -
+ mecube -
+ medatacube {
+ set vvar [lreplace $var 0 0]
+ ProcessMECubeCmd vvar ii $sock $fn
+ return 1
+ }
+ memf -
+ multiframe {
+ set vvar [lreplace $var 0 0]
+ ProcessMultiFrameCmd vvar ii $sock $fn
+ return 1
+ }
+
+ rgbimage {
+ set vvar [lreplace $var 0 0]
+ ProcessRGBImageCmd vvar ii $sock $fn
+ return 1
+ }
+ rgbcube {
+ set vvar [lreplace $var 0 0]
+ ProcessRGBCubeCmd vvar ii $sock $fn
+ return 1
+ }
+
+ mosaicimage {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicImageCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewcs {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicImageWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimageiraf {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicimagewfpc2 {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ return 1
+ }
+
+ mosaic {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaicwcs {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicWCSCmd vvar ii $sock $fn
+ return 1
+ }
+ mosaiciraf {
+ set vvar [lreplace $var 0 0]
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ return 1
+ }
+ }
+
+ return 0
+}
+
diff --git a/ds9/library/frame.tcl b/ds9/library/frame.tcl
new file mode 100644
index 0000000..8c13c87
--- /dev/null
+++ b/ds9/library/frame.tcl
@@ -0,0 +1,2667 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Public Procedures
+
+proc CreateFrame {} {
+ CreateNamedFrame base
+}
+
+proc CreateRGBFrame {} {
+ CreateNamedFrame rgb
+ RGBDialog
+}
+
+proc Create3DFrame {} {
+ CreateNamedFrame 3d
+ 3DDialog
+}
+
+proc CreateNamedFrame {type} {
+ global ds9
+
+ # find the first open slot
+ set num $ds9(next,num)
+ while {1} {
+ set which "Frame$num"
+ if {[lsearch $ds9(frames) $which]==-1} {
+ CreateNameNumberFrame $which $type
+ set ds9(next,num) [expr $num+1]
+ return
+ }
+ incr num
+ }
+}
+
+proc CreateGotoFrame {num type} {
+ global ds9
+ global active
+
+ set which "Frame$num"
+ if {[lsearch $ds9(frames) $which]==-1} {
+ CreateNameNumberFrame $which $type
+ set ds9(next,num) [expr $num+1]
+ } else {
+ if {$active($which)==0} {
+ set active($which) 1
+ UpdateActiveFrames
+ }
+ set ds9(next) $which
+ GotoFrame
+ }
+}
+
+# used by backup
+proc CreateNameNumberFrame {which type} {
+ global ds9
+ global pds9
+ global active
+ global current
+ global ipanner
+ global ppanner
+ global imagnifier
+ global pmagnifier
+ global bin
+ global wcs
+ global colorbar
+ global scale
+ global minmax
+ global zscale
+ global marker
+ global pmarker
+ global centroid
+ global panzoom
+ global block
+ global smooth
+ global pthreed
+ global threed
+ global cube
+
+ set ds9(next) $which
+
+ # update frame lists
+ lappend ds9(frames) $ds9(next)
+ lappend ds9(active) $ds9(next)
+ set ds9(active,num) [llength $ds9(active)]
+ set active($ds9(next)) 1
+
+ # and create the frame
+ switch -- $type {
+ base {
+ $ds9(canvas) create frame$ds9(visual)$ds9(depth) \
+ -command $ds9(next)
+ $ds9(next) colormap [colorbar get colormap]
+ }
+ rgb {
+ $ds9(canvas) create framergb$ds9(visual)$ds9(depth) \
+ -command $ds9(next)
+ $ds9(next) colormap [colorbarrgb get colormap]
+ }
+ 3d {
+ $ds9(canvas) create frame3d$ds9(visual)$ds9(depth) \
+ -command $ds9(next)
+ $ds9(next) colormap [colorbar get colormap]
+ }
+ }
+
+ $ds9(next) configure -x 0 -y 0 \
+ -anchor nw \
+ -tag $ds9(next) \
+ -helvetica $ds9(helvetica) \
+ -courier $ds9(courier) \
+ -times $ds9(times)
+
+ $ds9(next) threads $ds9(threads)
+
+ $ds9(next) panner 'panner' $ipanner(size) $ipanner(size)
+ $ds9(next) magnifier 'magnifier' $imagnifier(size) $imagnifier(size)
+ $ds9(next) magnifier zoom $pmagnifier(zoom)
+ $ds9(next) magnifier graphics $pmagnifier(region)
+ $ds9(next) magnifier cursor $pmagnifier(cursor)
+
+ $ds9(next) zoom to $current(zoom)
+ $ds9(next) rotate to $current(rotate)
+ $ds9(next) orient $current(orient)
+ $ds9(next) wcs align $current(align)
+
+ $ds9(next) pan preserve $panzoom(preserve)
+
+ # set so prefs (pwcs) will work
+ # may cause other problems, but can't remember why
+ $ds9(next) wcs $wcs(system) $wcs(sky) $wcs(skyformat)
+
+ $ds9(next) datasec $scale(datasec)
+
+ $ds9(next) bg color $pds9(bg)
+ $ds9(next) nan color $pds9(nan)
+ $ds9(next) iraf align $pds9(iraf)
+
+ $ds9(next) marker epsilon $pmarker(epsilon)
+ $ds9(next) marker show $marker(show)
+ $ds9(next) marker show text $marker(show,text)
+ $ds9(next) marker centroid auto $marker(centroid,auto)
+ $ds9(next) marker centroid radius $marker(centroid,radius)
+ $ds9(next) marker centroid iteration $marker(centroid,iteration)
+ $ds9(next) marker preserve $marker(preserve)
+
+ # Frame type items
+ switch -- [$ds9(next) get type] {
+ base -
+ rgb {}
+ 3d {
+ $ds9(next) 3d method $pthreed(method)
+ $ds9(next) 3d background $pthreed(background)
+ $ds9(next) 3d border $pthreed(border)
+ $ds9(next) 3d border color $pthreed(border,color)
+ $ds9(next) 3d compass $pthreed(compass)
+ $ds9(next) 3d compass color $pthreed(compass,color)
+ $ds9(next) 3d highlite $pthreed(highlite)
+ $ds9(next) 3d highlite color $pthreed(highlite,color)
+ }
+ }
+
+ # channel dependent items
+ switch -- [$ds9(next) get type] {
+ base -
+ 3d {
+ $ds9(next) colorscale $scale(type)
+ $ds9(next) colorscale log $scale(log)
+
+ $ds9(next) clip scope $scale(scope)
+ $ds9(next) clip mode $scale(mode)
+ $ds9(next) clip minmax $minmax(sample) $minmax(mode)
+ $ds9(next) clip user $scale(min) $scale(max)
+ $ds9(next) clip zscale \
+ $zscale(contrast) $zscale(sample) $zscale(line)
+
+ $ds9(next) datasec $scale(datasec)
+
+ $ds9(next) bin function $bin(function)
+ $ds9(next) bin factor to $bin(factor)
+ $ds9(next) bin depth $bin(depth)
+ $ds9(next) bin buffer size $bin(buffersize)
+
+ $ds9(next) block to $block(factor)
+
+ $ds9(next) cube axes $cube(axes)
+
+ if {$smooth(view)} {
+ $ds9(next) smooth $smooth(function) $smooth(radius)
+ }
+ }
+ rgb {
+ foreach c {red green blue} {
+ $ds9(next) rgb channel $c
+
+ $ds9(next) colorscale $scale(type)
+ $ds9(next) colorscale log $scale(log)
+
+ $ds9(next) clip scope $scale(scope)
+ $ds9(next) clip mode $scale(mode)
+ $ds9(next) clip minmax $minmax(sample) $minmax(mode)
+ $ds9(next) clip user $scale(min) $scale(max)
+ $ds9(next) clip zscale \
+ $zscale(contrast) $zscale(sample) $zscale(line)
+
+ $ds9(next) datasec $scale(datasec)
+
+ $ds9(next) bin function $bin(function)
+ $ds9(next) bin factor to $bin(factor)
+ $ds9(next) bin depth $bin(depth)
+ $ds9(next) bin buffer size $bin(buffersize)
+
+ $ds9(next) block to $block(factor)
+
+ $ds9(next) cube axes $cube(axes)
+
+ if {$smooth(view)} {
+ $ds9(next) smooth $smooth(function) $smooth(radius)
+ }
+ }
+ $ds9(next) rgb channel red
+ }
+ }
+
+ switch $current(mode) {
+ crosshair -
+ analysis {
+ $ds9(next) crosshair on
+ }
+ }
+
+ UpdateFrameMenuItems
+ UpdateDS9Static
+
+ if {$current(frame) != {}} {
+ $current(frame) colorbar tag "\{[$current(colorbar) get tag]\}"
+ }
+ set current(frame) $ds9(next)
+ set ds9(next) {}
+ DisplayMode
+}
+
+proc DeleteAllFramesMenu {} {
+ global pds9
+
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message [msgcat::mc {Delete All Frames?}]] != {ok}} {
+ return
+ }
+ }
+ DeleteAllFrames
+}
+
+proc DeleteCurrentFrame {} {
+ global current
+
+ if {$current(frame) != {}} {
+ DeleteSingleFrame $current(frame)
+ }
+}
+
+proc DeleteAllFrames {} {
+ global ds9
+
+ foreach ff $ds9(frames) {
+ DeleteFrame $ff
+ }
+
+ set ds9(next,num) 1
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+ UpdateDS9Static
+
+ ClearInfoBox
+ PixelTableClearDialog
+ ClearGraphData
+}
+
+proc DeleteSingleFrame {which} {
+ DeleteFrame $which
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+ UpdateDS9Static
+
+ PixelTableClearDialog
+ ClearGraphData
+}
+
+proc DeleteFrame {which} {
+ global ds9
+ global active
+ global current
+ global contour
+ global marker
+
+ # clear any loaded images
+ ClearFrame $which
+
+ # contour copy
+ if {$contour(copy) == $which} {
+ set contour(copy) {}
+ }
+ # marker copy
+ if {$marker(copy) == $which} {
+ set marker(copy) {}
+ }
+
+ # delete canvas widget
+ $ds9(canvas) delete $which
+
+ # setup for next frame
+ set ii [lsearch $ds9(active) $which]
+ if {$ii>0} {
+ set ds9(next) [lindex $ds9(active) [expr $ii-1]]
+ set ds9(active) [lreplace $ds9(active) $ii $ii]
+ set ds9(active,num) [llength $ds9(active)]
+ unset active($which)
+ } else {
+ set ds9(next) {}
+ }
+
+ # delete it from the frame list
+ set ii [lsearch $ds9(frames) $which]
+ set ds9(frames) [lreplace $ds9(frames) $ii $ii]
+}
+
+proc UpdateCurrentFrame {} {
+ global current
+
+ UpdateFrame $current(frame)
+}
+
+proc UpdateAllFrame {} {
+ global ds9
+
+ foreach f $ds9(frames) {
+ UpdateFrame $f
+ }
+}
+
+proc UpdateFrame {which} {
+ if {$which != {}} {
+ $which update
+ }
+}
+
+# Event Processing
+
+proc BindEventsFrame {which} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "BindEventsFrame $which"
+ }
+
+ $ds9(canvas) bind $which <Motion> [list MotionFrame $which %x %y]
+ $ds9(canvas) bind $which <Shift-Motion> \
+ [list ShiftMotionFrame $which %x %y]
+ $ds9(canvas) bind $which <Control-Motion> \
+ [list ControlMotionFrame $which %x %y]
+
+ $ds9(canvas) bind $which <Enter> [list EnterFrame $which %x %y]
+ $ds9(canvas) bind $which <Leave> [list LeaveFrame $which]
+
+ $ds9(canvas) bind $which <Button-1> [list Button1Frame $which %x %y]
+ $ds9(canvas) bind $which <Shift-Button-1> \
+ [list ShiftButton1Frame $which %x %y]
+ $ds9(canvas) bind $which <Control-Button-1> \
+ [list ControlButton1Frame $which %x %y]
+ $ds9(canvas) bind $which <Control-Shift-Button-1> \
+ [list ControlShiftButton1Frame $which %x %y]
+ $ds9(canvas) bind $which <B1-Motion> [list Motion1Frame $which %x %y]
+ $ds9(canvas) bind $which <ButtonRelease-1> \
+ [list Release1Frame $which %x %y]
+
+ $ds9(canvas) bind $which <Double-1> [list Double1Frame $which %x %y]
+ $ds9(canvas) bind $which <Double-ButtonRelease-1> \
+ [list DoubleRelease1Frame $which %x %y]
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(canvas) bind $which <Button-2> \
+ [list Button2Frame $which %x %y]
+ $ds9(canvas) bind $which <Shift-Button-2> \
+ [list ShiftButton2Frame $which %x %y]
+ $ds9(canvas) bind $which <B2-Motion> \
+ [list Motion2Frame $which %x %y]
+ $ds9(canvas) bind $which <ButtonRelease-2> \
+ [list Release2Frame $which %x %y]
+ }
+ aqua {
+ # swap button-2 and button-3 on the mighty mouse
+ $ds9(canvas) bind $which <Button-3> \
+ [list Button2Frame $which %x %y]
+ $ds9(canvas) bind $which <Shift-Button-3> \
+ [list ShiftButton2Frame $which %x %y]
+ $ds9(canvas) bind $which <B3-Motion> \
+ [list Motion2Frame $which %x %y]
+ $ds9(canvas) bind $which <ButtonRelease-3> \
+ [list Release2Frame $which %x %y]
+
+ # x11 option key emulation
+ $ds9(canvas) bind $which <Option-Button-1> \
+ [list Button2Frame $which %x %y]
+ $ds9(canvas) bind $which <Option-B1-Motion> \
+ [list Motion2Frame $which %x %y]
+ $ds9(canvas) bind $which <Option-ButtonRelease-1> \
+ [list Release2Frame $which %x %y]
+
+ # x11 command key emulation
+ # we need this to eat the Button-1 events
+ # so it passes to the canvas
+ $ds9(canvas) bind $which <Command-Button-1> {set foo bar}
+ $ds9(canvas) bind $which <Command-B1-Motion> {set foo bar}
+ $ds9(canvas) bind $which <Command-ButtonRelease-1> {set foo bar}
+ }
+ }
+
+ switch $ds9(wm) {
+ x11 {
+ $ds9(canvas) bind $which <Button-4> \
+ [list Button4Frame $which %x %y]
+ $ds9(canvas) bind $which <Button-5> \
+ [list Button5Frame $which %x %y]
+ }
+ aqua -
+ win32 {}
+ }
+
+ BindEventsFrameKey $which
+}
+
+proc BindEventsFrameKey {which} {
+ global ds9
+ global ianalysis
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "BindEventsFrameKey $which"
+ }
+
+ $ds9(canvas) bind $which <Key> [list KeyFrame $which %K %A %x %y]
+ $ds9(canvas) bind $which <KeyRelease> \
+ [list KeyReleaseFrame $which %K %A %x %y]
+
+ for {set i 0} {$i<$ianalysis(bind,count)} {incr i} {
+ $ds9(canvas) bind $which "$ianalysis(bind,$i,item)" \
+ [list AnalysisTask $i bind $which %x %y]
+ }
+}
+
+proc UnBindEventsFrame {which} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "UnBindEventsFrame $which"
+ }
+
+ $ds9(canvas) bind $which <Button-4> {}
+ $ds9(canvas) bind $which <Button-5> {}
+
+ $ds9(canvas) bind $which <Motion> {}
+ $ds9(canvas) bind $which <Shift-Motion> {}
+ $ds9(canvas) bind $which <Control-Motion> {}
+
+ $ds9(canvas) bind $which <Enter> {}
+ $ds9(canvas) bind $which <Leave> {}
+
+ $ds9(canvas) bind $which <Button-1> {}
+ $ds9(canvas) bind $which <Shift-Button-1> {}
+ $ds9(canvas) bind $which <Control-Button-1> {}
+ $ds9(canvas) bind $which <Control-Shift-Button-1> {}
+ $ds9(canvas) bind $which <B1-Motion> {}
+ $ds9(canvas) bind $which <ButtonRelease-1> {}
+
+ $ds9(canvas) bind $which <Double-1> {}
+ $ds9(canvas) bind $which <Double-ButtonRelease-1> {}
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(canvas) bind $which <Button-2> {}
+ $ds9(canvas) bind $which <Shift-Button-2> {}
+ $ds9(canvas) bind $which <B2-Motion> {}
+ $ds9(canvas) bind $which <ButtonRelease-2> {}
+ }
+ aqua {
+ $ds9(canvas) bind $which <Command-Button-1> {}
+ $ds9(canvas) bind $which <Command-B1-Motion> {}
+ $ds9(canvas) bind $which <Command-ButtonRelease-1> {}
+
+ $ds9(canvas) bind $which <Button-3> {}
+ $ds9(canvas) bind $which <Shift-Button-3> {}
+ $ds9(canvas) bind $which <B3-Motion> {}
+ $ds9(canvas) bind $which <ButtonRelease-3> {}
+
+ $ds9(canvas) bind $which <Option-Button-1> {}
+ $ds9(canvas) bind $which <Option-B1-Motion> {}
+ $ds9(canvas) bind $which <Option-ButtonRelease-1> {}
+ }
+ }
+
+ switch $ds9(wm) {
+ x11 {
+ $ds9(canvas) bind $which <Button-4> {}
+ $ds9(canvas) bind $which <Button-5> {}
+ }
+ aqua -
+ win32 {}
+ }
+
+ UnBindEventsFrameKey $which
+}
+
+proc UnBindEventsFrameKey {which} {
+ global ds9
+ global ianalysis
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "UnBindEventsFrameKey $which"
+ }
+
+ $ds9(canvas) bind $which <Key> {}
+ $ds9(canvas) bind $which <KeyRelease> {}
+
+ for {set i 0} {$i<$ianalysis(bind,count)} {incr i} {
+ $ds9(canvas) bind $which "$ianalysis(bind,$i,item)" {}
+ }
+}
+
+proc EnterFrame {which x y} {
+ global ds9
+ global current
+ global view
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "EnterFrame $which"
+ }
+
+ # check to see if this event was generated while processing other events
+ if {$ds9(b1) || $ds9(sb1) || $ds9(cb1) ||
+ $ds9(csb1) || $ds9(b2) || $ds9(b3)} {
+ return
+ }
+
+ $ds9(canvas) focus $which
+
+ switch -- $current(mode) {
+ crosshair -
+ analysis {
+ set coord [$which get crosshair canvas]
+ set x [lindex $coord 0]
+ set y [lindex $coord 1]
+ }
+ none -
+ pointer -
+ region -
+ catalog -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ colorbar -
+ examine -
+ iexam {}
+ }
+
+ EnterInfoBox $which
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateGraphXAxis $which
+ UpdateGraphYAxis $which
+ UpdateMagnifier $which $x $y
+
+ if {$view(magnifier)} {
+ # don't turn on the magnifier until we've finished the init process
+ # this a real problem with 3d frames
+ if {!$ds9(init)} {
+ $which magnifier on
+ }
+ }
+
+ UpdateEditMenu
+}
+
+proc LeaveFrame {which} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "LeaveFrame $which"
+ }
+
+ # check to see if this event was generated while processing other events
+ if {$ds9(b1) || $ds9(sb1) || $ds9(cb1) ||
+ $ds9(csb1) || $ds9(b2) || $ds9(b3)} {
+ return
+ }
+
+ $ds9(canvas) focus {}
+
+ switch -- $current(mode) {
+ crosshair -
+ analysis {}
+
+ none -
+ pointer -
+ region -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ catalog -
+ examine -
+ iexam {
+ LeaveInfoBox
+ PixelTableClearDialog
+ ClearGraphData
+ }
+ }
+
+ $which magnifier off
+ magnifier clear
+}
+
+proc MotionFrame {which x y} {
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "MotionFrame $which"
+ }
+
+ DoMotion $which $x $y sizing fleur
+}
+
+proc ShiftMotionFrame {which x y} {
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ShiftMotionFrame $which"
+ }
+
+ DoMotion $which $x $y exchange fleur
+}
+
+proc ControlMotionFrame {which x y} {
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ControlMotionFrame $which"
+ }
+
+ DoMotion $which $x $y sizing draped_box
+}
+
+proc DoMotion {which x y cursor1 cursor2} {
+ global ds9
+ global current
+
+ # if button 3 is down, ignore this event, we are doing something already
+
+ if {$ds9(b3) || $ds9(b2)} {
+ return
+ }
+
+ switch -- $current(mode) {
+ pointer -
+ region -
+ catalog -
+ analysis {
+ if {$which == $current(frame)} {
+ MarkerCursor $which $x $y $cursor1 $cursor2
+ }
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ }
+ none -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ examine -
+ iexam {
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ }
+ crosshair {}
+ }
+
+ UpdateMagnifier $which $x $y
+}
+
+proc Button1Frame {which x y} {
+ global ds9
+ global current
+ global imarker
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button1Frame $which"
+ }
+
+ # let others know that the mouse is down
+ set ds9(b1) 1
+
+ switch -- $current(mode) {
+ none {
+ if {$which == $current(frame)} {
+ } else {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set ds9(next) $which
+ GotoFrame
+ }
+ UpdateMagnifier $which $x $y
+ }
+ pointer -
+ region {
+ if {$which == $current(frame)} {
+ MarkerButton $which $x $y
+ } else {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set ds9(next) $which
+ GotoFrame
+ }
+ UpdateMagnifier $which $x $y
+ }
+ crosshair {
+ CrosshairButton $which $x $y
+
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ colorbar {
+ ColorbarButton3 $x $y
+ }
+ pan {
+ PanButton $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ zoom {
+ ZoomButton $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ rotate {RotateButton $which $x $y}
+ crop {
+ CropButton $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ catalog {
+ if {$which == $current(frame)} {
+ CATButton $which $x $y
+ } else {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set ds9(next) $which
+ GotoFrame
+ }
+ UpdateMagnifier $which $x $y
+ }
+ analysis {
+ IMEButton $which $x $y
+
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ examine {ExamineButton $which $x $y}
+ iexam {IExamButton $which $x $y}
+ }
+}
+
+proc ShiftButton1Frame {which x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ShiftButton1Frame $which"
+ }
+
+ # let others know that the mouse is down
+ set ds9(sb1) 1
+
+ switch -- $current(mode) {
+ none {}
+ pointer -
+ region {
+ if {$which == $current(frame)} {
+ MarkerShift $which $x $y
+ }
+ UpdateMagnifier $which $x $y
+ }
+ crosshair {}
+ colorbar {}
+ pan {}
+ zoom {ZoomShift $which}
+ rotate -
+ crop {
+ Crop3dButton $which $x $y 0
+ UpdateMagnifier $which $x $y
+ }
+ catalog {
+ if {$which == $current(frame)} {
+ CATShift $which $x $y
+ }
+ UpdateMagnifier $which $x $y
+ }
+ analysis {
+ IMEShift $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ examine -
+ iexam {}
+ }
+}
+
+proc ControlButton1Frame {which x y} {
+ global ds9
+ global current
+ global imarker
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ControlButton1Frame $which"
+ }
+
+ # let others know that the mouse is down
+
+ set ds9(cb1) 1
+
+ switch -- $current(mode) {
+ none {}
+ pointer -
+ region -
+ catalog {
+ if {$which == $current(frame)} {
+ MarkerControl $which $x $y
+ } else {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+ }
+ UpdateMagnifier $which $x $y
+ }
+ crosshair -
+ colorbar -
+ pan -
+ zoom -
+ rotate {}
+ crop {
+ Crop3dButton $which $x $y 1
+ UpdateMagnifier $which $x $y
+ }
+ analysis {}
+ examine -
+ iexam {}
+ }
+}
+
+proc ControlShiftButton1Frame {which x y} {
+ global ds9
+ global current
+ global imarker
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ControlShiftButton1Frame $which"
+ }
+
+ # let others know that the mouse is down
+
+ set ds9(csb1) 1
+
+ switch -- $current(mode) {
+ none {}
+ pointer -
+ region -
+ catalog {
+ if {$which == $current(frame)} {
+ MarkerControlShift $which $x $y
+ } else {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+ }
+ UpdateMagnifier $which $x $y
+ }
+ crosshair -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ analysis {}
+ examine -
+ iexam {}
+ }
+}
+
+proc Motion1Frame {which x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Motion1Frame $which $x $y $ds9(b1) $ds9(sb1) $ds9(cb1)"
+ }
+
+ # abort if we are here by accident (such as a double click)
+ if {($ds9(b1) == 0) && ($ds9(sb1) == 0) &&
+ ($ds9(cb1) == 0) && ($ds9(csb1) == 0)} {
+ return
+ }
+
+ switch -- $current(mode) {
+ none {UpdateMagnifier $which $x $y}
+ pointer -
+ region {
+ if {$which == $current(frame)} {
+ MarkerMotion $which $x $y
+ }
+
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ crosshair {
+ if {$ds9(b1)} {
+ CrosshairButton $which $x $y
+
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ }
+ colorbar {
+ if {$ds9(b1)} {
+ ColorbarMotion3 $x $y
+ }
+ }
+ pan {
+ if {$ds9(b1)} {
+ PanMotion $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ }
+ zoom {UpdateMagnifier $which $x $y}
+ rotate {
+ if {$ds9(b1)} {
+ RotateMotion $which $x $y
+ }
+ }
+ crop {
+ if {$ds9(b1)} {
+ CropMotion $which $x $y
+ }
+ if {$ds9(sb1)} {
+ Crop3dMotion $which $x $y 0
+ }
+ if {$ds9(cb1)} {
+ Crop3dMotion $which $x $y 1
+ }
+
+ UpdateMagnifier $which $x $y
+ }
+ catalog {
+ if {$which == $current(frame)} {
+ CATMotion $which $x $y
+ }
+
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ analysis {
+ IMEMotion $which $x $y
+
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ UpdateMagnifier $which $x $y
+ }
+ examine -
+ iexam {}
+ }
+}
+
+proc Release1Frame {which x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Release1Frame $which"
+ }
+
+ # abort if we are here by accident (such as a double click)
+ if {($ds9(b1) == 0) && ($ds9(sb1) == 0) &&
+ ($ds9(cb1) == 0) && ($ds9(csb1) == 0)} {
+ return
+ }
+
+ switch -- $current(mode) {
+ pointer -
+ region {
+ if {$which == $current(frame)} {
+ MarkerRelease $which $x $y
+ }
+ }
+ crosshair {
+ if {$ds9(b1)} {
+ CrosshairButton $which $x $y
+
+ UpdateColormapLevelMosaic $which $x $y canvas
+ UpdateInfoBox $which $x $y canvas
+ UpdatePixelTableDialog $which $x $y canvas
+ UpdateGraph $which $x $y canvas
+ }
+ }
+ colorbar {
+ if {$ds9(b1)} {
+ ColorbarRelease3 $x $y
+ }
+ }
+ pan {
+ if {$ds9(b1)} {
+ PanRelease $which $x $y
+ }
+ }
+ zoom {}
+ rotate {
+ if {$ds9(b1)} {
+ RotateRelease $which $x $y
+ }
+ }
+ crop {
+ if {$ds9(b1)} {
+ CropRelease $which $x $y
+ }
+ if {$ds9(sb1)} {
+ Crop3dRelease $which $x $y 0
+ }
+ if {$ds9(cb1)} {
+ Crop3dRelease $which $x $y 1
+ }
+ }
+ catalog {
+ if {$which == $current(frame)} {
+ CATRelease $which $x $y
+ }
+ }
+ none {}
+ analysis {
+ IMERelease $which $x $y
+ }
+ examine -
+ iexam {}
+ }
+
+ # let others know that the mouse is up
+ set ds9(b1) 0
+ set ds9(sb1) 0
+ set ds9(cb1) 0
+ set ds9(csb1) 0
+
+ UpdateEditMenu
+ UpdateMagnifier $which $x $y
+}
+
+proc Double1Frame {which x y} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Double1Frame $which"
+ }
+
+ switch -- $current(mode) {
+ pointer -
+ region {
+ if {$which == $current(frame)} {
+ MarkerDouble $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ }
+ none -
+ crosshair -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ catalog {}
+ analysis {
+ IMEDouble $which $x $y
+ UpdateMagnifier $which $x $y
+ }
+ examine -
+ iexam {}
+ }
+}
+
+proc DoubleRelease1Frame {which x y} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "DoubleRelease1Frame $which"
+ }
+
+ switch -- $current(mode) {
+ none -
+ pointer -
+ region -
+ crosshair -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ catalog -
+ analysis -
+ examine -
+ iexam {}
+ }
+
+ UpdateEditMenu
+ UpdateMagnifier $which $x $y
+}
+
+proc Button2Frame {which x y} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button2Frame"
+ }
+
+ set ds9(b2) 1
+ PanButton $which $x $y
+}
+
+proc ShiftButton2Frame {which x y} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "ShiftButton2Frame $which"
+ }
+
+ set ds9(sb2) 1
+}
+
+proc Motion2Frame {which x y} {
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Motion2Frame $which"
+ }
+
+ PanMotion $which $x $y
+}
+
+proc Release2Frame {which x y} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Release2Frame $which"
+ }
+
+ PanRelease $which $x $y
+
+ # let others know that the mouse is up
+
+ set ds9(b2) 0
+ set ds9(sb2) 0
+}
+
+proc Button4Frame {which x y} {
+ global ppanzoom
+ global pbin
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button4Frame $which $x $y"
+ }
+
+ if {[$which has fits bin]} {
+ if {$pbin(wheel)} {
+ set zz $pbin(wheel,factor)
+ BinFrame $which $zz $zz
+ return
+ }
+ }
+
+ if {$ppanzoom(wheel)} {
+ set zz [expr 1./$ppanzoom(wheel,factor)]
+ ZoomFrame $which $zz $zz
+ }
+}
+
+proc Button5Frame {which x y} {
+ global ppanzoom
+ global pbin
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button5Frame $which $x $y"
+ }
+
+ if {[$which has fits bin]} {
+ if {$pbin(wheel)} {
+ set zz [expr 1./$pbin(wheel,factor)]
+ BinFrame $which $zz $zz
+ return
+ }
+ }
+
+ if {$ppanzoom(wheel)} {
+ set zz $ppanzoom(wheel,factor)
+ ZoomFrame $which $zz $zz
+ }
+}
+
+# used by aqua and win32
+proc MouseWheelFrame {X Y dd} {
+ global ds9
+ global view
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "MouseWheel $X $Y $dd"
+ }
+
+ # macosx returns main window coords in X,Y
+ switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ switch $view(layout) {
+ horizontal {
+ set aa [winfo height $ds9(main)]
+ set bb [winfo height $ds9(image)]
+ set Y [expr $Y-$aa+$bb]
+ }
+ vertical {
+ set aa [winfo width $ds9(main)]
+ set bb [winfo width $ds9(image)]
+ set X [expr $X-$aa+$bb]
+ }
+ }
+
+ }
+ }
+
+ set id [$ds9(canvas) find closest $X $Y]
+ set which [lindex [$ds9(canvas) gettags $id] 0]
+ if {[string equal -length 5 {Frame} $which]} {
+ set orig [$ds9(canvas) coords $which]
+ set x [expr $X-int([lindex $orig 0])]
+ set y [expr $Y-int([lindex $orig 1])]
+
+ if {$dd>0} {
+ Button5Frame $which $x $y
+ } else {
+ Button4Frame $which $x $y
+ }
+ }
+}
+
+proc KeyFrame {which K A xx yy} {
+ global ds9
+ global current
+
+ # MacOSX and Ubuntu returns bogus values in xx,yy
+ # calculate our own values
+ set xx [expr {[winfo pointerx $ds9(canvas)] - [winfo rootx $ds9(canvas)]}]
+ set yy [expr {[winfo pointery $ds9(canvas)] - [winfo rooty $ds9(canvas)]}]
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "KeyFrame $which $K $A $xx $yy"
+ }
+
+ if {$K == {Control_R} ||
+ $K == {Control_L} ||
+ $K == {Meta_R} ||
+ $K == {Meta_L} ||
+ $K == {Alt_R} ||
+ $K == {Alt_L} ||
+ $K == {Super_R} ||
+ $K == {Super_L} ||
+ $K == {??}} {
+ set ds9(modifier) 1
+ return
+ }
+
+ # modal bindings
+ switch -- $current(mode) {
+ none {
+ switch -- $K {
+ c {
+ if {!$ds9(modifier)} {
+ DisplayCoordDialog $which $xx $yy
+ }
+ }
+
+ plus {CubeNext}
+ minus {CubePrev}
+
+ Up -
+ k {$which warp 0 -1}
+ Down -
+ j {$which warp 0 1}
+ Left -
+ h {$which warp -1 0}
+ Right -
+ l {$which warp 1 0}
+ }
+ }
+ pointer -
+ region {
+ switch -- $K {
+ c {
+ if {!$ds9(modifier)} {
+ DisplayCoordDialog $which $xx $yy
+ }
+ }
+
+ plus {CubeNext}
+ minus {CubePrev}
+
+ Delete -
+ BackSpace {MarkerDeleteKey $which $xx $yy}
+
+ Up -
+ k {MarkerArrowKey $which 0 -1}
+ Down -
+ j {MarkerArrowKey $which 0 1}
+ Left -
+ h {MarkerArrowKey $which -1 0}
+ Right -
+ l {MarkerArrowKey $which 1 0}
+
+ i {$which marker property include 1 $xx $yy}
+ e {$which marker property include 0 $xx $yy}
+ s {$which marker property source 1 $xx $yy}
+ b {$which marker property source 0 $xx $yy}
+ g {GroupCreate}
+ G {GroupCreateSilent}
+ }
+ }
+ crosshair {
+ switch -- $K {
+ c {
+ if {!$ds9(modifier)} {
+ DisplayCoordDialog $which $xx $yy
+ }
+ }
+
+ plus {CubeNext}
+ minus {CubePrev}
+
+ Up -
+ k {CrosshairArrowKey $which 0 -1}
+ Down -
+ j {CrosshairArrowKey $which 0 1}
+ Left -
+ h {CrosshairArrowKey $which -1 0}
+ Right -
+ l {CrosshairArrowKey $which 1 0}
+ }
+ }
+ pan {
+ switch -- $K {
+ Up -
+ k {Pan 0 1 canvas}
+ Down -
+ j {Pan 0 -1 canvas}
+ Left -
+ h {Pan 1 0 canvas}
+ Right -
+ l {Pan -1 0 canvas}
+ }
+ UpdateMagnifier $which $xx $yy
+ }
+ catalog {
+ switch -- $K {
+ Up -
+ k {MarkerArrowKey $which 0 -1}
+ Down -
+ j {MarkerArrowKey $which 0 1}
+ Left -
+ h {MarkerArrowKey $which -1 0}
+ Right -
+ l {MarkerArrowKey $which 1 0}
+ }
+ CATKey $which $K
+ }
+ analysis {
+ switch -- $K {
+ plus {CubeNext}
+ minus {CubePrev}
+
+ Up {IMEArrowKey $which 0 -1}
+ Down {IMEArrowKey $which 0 1}
+ Left {IMEArrowKey $which -1 0}
+ Right {IMEArrowKey $which 1 0}
+
+ default {IMEKey $which $K $xx $yy}
+ }
+ }
+ iexam {IExamKey $which $K $xx $yy}
+ colorbar -
+ zoom -
+ rotate -
+ crop -
+ examine {}
+ }
+
+ UpdateEditMenu
+}
+
+proc KeyReleaseFrame {which K A xx yy} {
+ global ds9
+
+ # MacOSX and Ubuntu returns bogus values in xx,yy
+ # calculate our own values
+ set xx [expr {[winfo pointerx $ds9(canvas)] - [winfo rootx $ds9(canvas)]}]
+ set yy [expr {[winfo pointery $ds9(canvas)] - [winfo rooty $ds9(canvas)]}]
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "KeyReleaseFrame $which $K $A $xx $yy"
+ }
+
+ if {$K == {Control_R} ||
+ $K == {Control_L} ||
+ $K == {Meta_R} ||
+ $K == {Meta_L} ||
+ $K == {Alt_R} ||
+ $K == {Alt_L} ||
+ $K == {Super_R} ||
+ $K == {Super_L}} {
+ set ds9(modifier) 0
+ }
+}
+
+# Other Public Routines
+
+proc CopyFrame {} {
+ global current
+
+ switch -- $current(mode) {
+ pointer -
+ region {MarkerCopy}
+ }
+}
+
+proc CutFrame {} {
+ global current
+
+ switch -- $current(mode) {
+ pointer -
+ region {MarkerCut}
+ }
+}
+
+proc PasteFrame {} {
+ global current
+
+ switch -- $current(mode) {
+ pointer -
+ region {MarkerPaste}
+ }
+}
+
+proc UndoFrame {} {
+ global current
+
+ switch -- $current(mode) {
+ pointer -
+ region {MarkerUndo}
+ }
+}
+
+proc FirstFrame {} {
+ global ds9
+ set ds9(next) [lindex $ds9(active) 0]
+ GotoFrame
+}
+
+proc PrevFrame {} {
+ global ds9
+ global current
+
+ set ii [lsearch $ds9(active) $current(frame)]
+ if {$ii>0} {
+ set ds9(next) [lindex $ds9(active) [expr $ii-1]]
+ } else {
+ set ds9(next) [lindex $ds9(active) [expr $ds9(active,num)-1]]
+ }
+ GotoFrame
+}
+
+proc NextFrame {} {
+ global ds9
+ global current
+
+ set ii [lsearch $ds9(active) $current(frame)]
+ if {$ii < [expr $ds9(active,num)-1]} {
+ set ds9(next) [lindex $ds9(active) [expr $ii+1]]
+ } else {
+ set ds9(next) [lindex $ds9(active) 0]
+ }
+ GotoFrame
+}
+
+proc LastFrame {} {
+ global ds9
+
+ set ds9(next) [lindex $ds9(active) [expr $ds9(active,num)-1]]
+ GotoFrame
+}
+
+proc MoveFirstFrame {} {
+ global ds9
+ global current
+
+ set i [lsearch $ds9(frames) $current(frame)]
+ set ds9(frames) [lreplace $ds9(frames) $i $i]
+ set ds9(frames) [linsert $ds9(frames) 0 $current(frame)]
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+}
+
+proc MovePrevFrame {} {
+ global ds9
+ global current
+
+ set i [lsearch $ds9(frames) $current(frame)]
+ set ds9(frames) [lreplace $ds9(frames) $i $i]
+ if {$i>0} {
+ set ds9(frames) [linsert $ds9(frames) [expr $i-1] $current(frame)]
+ } else {
+ set ds9(frames) [linsert $ds9(frames) end $current(frame)]
+ }
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+}
+
+proc MoveNextFrame {} {
+ global ds9
+ global current
+
+ set i [lsearch $ds9(frames) $current(frame)]
+ set ds9(frames) [lreplace $ds9(frames) $i $i]
+ set last [llength $ds9(frames)]
+ if {$i<$last} {
+ set ds9(frames) [linsert $ds9(frames) [expr $i+1] $current(frame)]
+ } else {
+ set ds9(frames) [linsert $ds9(frames) 0 $current(frame)]
+ }
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+}
+
+proc MoveLastFrame {} {
+ global ds9
+ global current
+
+ set i [lsearch $ds9(frames) $current(frame)]
+ set ds9(frames) [lreplace $ds9(frames) $i $i]
+ set ds9(frames) [linsert $ds9(frames) end $current(frame)]
+
+ UpdateFrameMenuItems
+ UpdateActiveFrames
+}
+
+proc UpdateActiveFrames {} {
+ global ds9
+ global active
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateActiveFrames"
+ }
+
+ # reset active list
+ set ds9(active) {}
+ set ds9(active,num) 0
+
+ foreach f $ds9(frames) {
+ if {$active($f)} {
+ lappend ds9(active) $f
+ $ds9(mb).frame.goto entryconfig \
+ "[msgcat::mc {Frame}] [string range $f 5 end]" -state normal
+ } else {
+ $ds9(mb).frame.goto entryconfig \
+ "[msgcat::mc {Frame}] [string range $f 5 end]" -state disabled
+ }
+
+ }
+ set ds9(active,num) [llength $ds9(active)]
+
+ # New layout if needed
+ if {$ds9(active,num) > 0} {
+ if {[lsearch $ds9(active) $current(frame)] == -1} {
+ if {$ds9(next) != {}} {
+ set current(frame) $ds9(next)
+ } else {
+ set current(frame) [lindex $ds9(active) 0]
+ set ds9(next) $current(frame)
+ }
+ }
+ }
+
+ DisplayMode
+}
+
+proc ActiveFrameAll {} {
+ global ds9
+ global active
+
+ foreach f $ds9(frames) {
+ set active($f) 1
+ }
+ UpdateActiveFrames
+}
+
+proc ActiveFrameNone {} {
+ global ds9
+ global active
+
+ foreach f $ds9(frames) {
+ set active($f) 0
+ }
+ UpdateActiveFrames
+}
+
+proc GotoFrame {} {
+ global ds9
+ global current
+ global active
+
+ if {$current(frame) != {} && $current(frame) != $ds9(next)} {
+ $current(frame) highlite off
+ $current(frame) panner off
+
+ switch -- $ds9(display) {
+ blink -
+ single {
+ $current(frame) hide
+ UnBindEventsFrame $current(frame)
+ }
+ tile {}
+ }
+ }
+
+ if {$current(frame) != $ds9(next)} {
+ if {$current(frame) != {}} {
+ $current(frame) colorbar tag "\{[$current(colorbar) get tag]\}"
+ }
+ set current(frame) $ds9(next)
+ set ds9(next) {}
+ FrameToFront
+ }
+}
+
+proc DisplayMode {} {
+ global ds9
+ global current
+ global tile
+ global blink
+ global iblink
+
+ switch -- $current(display) {
+ single {set ds9(display) $current(display)}
+ tile {
+ if {$ds9(active,num) > 1} {
+ set ds9(display) $current(display)
+ } else {
+ switch -- $tile(grid,mode) {
+ automatic {set ds9(display) single}
+ manual {set ds9(display) $current(display)}
+ }
+ }
+ }
+ blink {
+ if {$ds9(active,num) > 1} {
+ set ds9(display) $current(display)
+ } else {
+ set ds9(display) single
+ }
+ }
+ }
+
+ switch -- $ds9(display) {
+ single -
+ tile {
+ # turn off blink if on
+ if {$iblink(id)>0} {
+ after cancel $iblink(id)
+ set iblink(id) 0
+ set iblink(index) -1
+ }
+
+ LayoutFrames
+ }
+ blink {
+ # ignore if we are already blinking
+ if {$iblink(id)==0} {
+ LayoutFrames
+ BlinkTimer
+ }
+ }
+ }
+}
+
+proc BlinkTimer {} {
+ global blink
+ global iblink
+ global ds9
+
+ if {$ds9(active,num) > 0} {
+ incr iblink(index)
+ if {$iblink(index) >= $ds9(active,num)} {
+ set iblink(index) 0
+ }
+ set ds9(next) [lindex $ds9(active) $iblink(index)]
+ GotoFrame
+ }
+
+ set iblink(id) [after $blink(interval) BlinkTimer]
+}
+
+proc ResetCurrentFrame {} {
+ global current
+
+ ResetFrame $current(frame)
+}
+
+proc ResetAllFrame {} {
+ global ds9
+
+ foreach f $ds9(frames) {
+ ResetFrame $f
+ }
+}
+
+proc ResetFrame {which} {
+ if {$which != {}} {
+ if {[$which has iis]} {
+ IISCursorModeCmd 0
+ }
+
+ $which reset
+
+ RefreshInfoBox $which
+ PixelTableClearDialog
+ ClearGraphData
+
+ LockFrame $which
+ UpdatePanZoomDialog
+ UpdateCrosshairDialog
+ UpdateCropDialog
+ GridUpdateZoom
+ UpdateZoomMenu
+ UpdateScaleMenu
+ UpdateScaleDialog
+ UpdateGraphXAxis $which
+ UpdateGraphYAxis $which
+
+ SAMPSendCoordPointAtSkyCmd $which
+ }
+}
+
+proc ClearCurrentFrame {} {
+ global current
+
+ ClearFrame $current(frame)
+
+ ClearInfoBox
+ PixelTableClearDialog
+ ClearGraphData
+
+ UpdateDS9
+}
+
+proc ClearAllFrame {} {
+ global ds9
+
+ foreach f $ds9(frames) {
+ ClearFrame $f
+ }
+
+ ClearInfoBox
+ PixelTableClearDialog
+ ClearGraphData
+
+ UpdateDS9
+}
+
+proc ClearFrame {which} {
+ if {$which == {}} {
+ return
+ }
+
+ DestroyHeader $which
+ $which clear
+
+ # delete saved loadParams
+ foreach cc {{} red green blue} {
+ set varname $which$cc
+ global $varname
+ if {[info exists $varname]} {
+ unset $varname
+ }
+ }
+}
+
+# Private Procedures
+
+proc FrameToFront {} {
+ global ds9
+ global current
+ global view
+ global colorbar
+ global blink
+
+ set which $current(frame)
+
+ # process proper colorbar
+ switch -- [$which get type] {
+ base -
+ 3d {
+ if {$view(colorbar)} {
+ colorbar show
+ } else {
+ colorbar hide
+ }
+ colorbarrgb hide
+ set current(colorbar) colorbar
+
+ colorbar colorbar [$which get colorbar]
+ colorbar tag "\{[$which get colorbar tag]\}"
+ set colorbar(map) [colorbar get name]
+
+ $ds9(canvas) raise colorbar colorbarrgb
+ }
+ rgb {
+ colorbar hide
+ if {$view(colorbar)} {
+ colorbarrgb show
+ } else {
+ colorbarrgb hide
+ }
+ set current(colorbar) colorbarrgb
+
+ colorbarrgb colorbar [$which get colorbar]
+ colorbarrgb rgb channel [$which get rgb channel]
+
+ $ds9(canvas) raise colorbarrgb colorbar
+ }
+ }
+ set colorbar(invert) [$current(colorbar) get invert]
+
+ $ds9(canvas) raise $which
+
+ $which show
+ switch -- $ds9(display) {
+ single -
+ blink {
+ if {!$ds9(freeze)} {
+ BindEventsFrame $which
+ }
+ }
+ tile {$which highlite on}
+ }
+
+ if {$view(panner)} {
+ $which panner on
+ }
+
+ UpdateDS9
+}
+
+proc TileDialog {} {
+ global tile
+ global itile
+ global dtile
+ global ds9
+
+ # see if we already have a window visible
+ if {[winfo exists $itile(top)]} {
+ raise $itile(top)
+ return
+ }
+
+ # create window
+ set w $itile(top)
+ set mb $itile(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Tile Parameters}] TileDestroyDialog
+
+ set dtile(mode) $tile(grid,mode)
+ set dtile(dir) $tile(grid,dir)
+ set dtile(row) $tile(grid,row)
+ set dtile(col) $tile(grid,col)
+ set dtile(gap) $tile(grid,gap)
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command TileApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command TileDestroyDialog
+
+ EditMenu $mb itile
+
+ # Grid
+ set f [ttk::labelframe $w.grid -text [msgcat::mc {Grid}] -padding 2]
+ ttk::radiobutton $f.auto -text [msgcat::mc {Automatic}] \
+ -variable dtile(mode) -value automatic
+ ttk::radiobutton $f.manual -text [msgcat::mc {Manual}] \
+ -variable dtile(mode) -value manual
+ grid $f.auto $f.manual -padx 2 -pady 2 -sticky w
+
+ # Grid Direction
+ set f [ttk::labelframe $w.dir -text [msgcat::mc {Direction}] -padding 2]
+ ttk::radiobutton $f.x -text [msgcat::mc {X}] \
+ -variable dtile(dir) -value x
+ ttk::radiobutton $f.y -text [msgcat::mc {Y}] \
+ -variable dtile(dir) -value y
+ grid $f.x $f.y -padx 2 -pady 2 -sticky w
+
+ # Layout
+ set f [ttk::labelframe $w.layout -text [msgcat::mc {Layout}] -padding 2]
+ ttk::label $f.tcol -text [msgcat::mc {Columns}]
+ ttk::label $f.trow -text [msgcat::mc {Rows}]
+ ttk::entry $f.col -textvariable dtile(col) -width 6
+ ttk::label $f.tx -text {x}
+ ttk::entry $f.row -textvariable dtile(row) -width 6
+ grid $f.tcol x $f.trow -padx 2 -pady 2 -sticky w
+ grid $f.col $f.tx $f.row -padx 2 -pady 2 -sticky w
+
+ # Gap
+ set f [ttk::labelframe $w.gap -text [msgcat::mc {Gap}] -padding 2]
+ ttk::entry $f.gap -textvariable dtile(gap) -width 6
+ ttk::label $f.ugap -text [msgcat::mc {Pixels}]
+ grid $f.gap - $f.ugap -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command TileApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command TileDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ grid $w.grid -sticky news
+ grid $w.dir -sticky news
+ grid $w.layout -sticky news
+ grid $w.gap -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid rowconfigure $w 2 -weight 1
+ grid rowconfigure $w 3 -weight 1
+ grid columnconfigure $w 0 -weight 1
+}
+
+proc TileDestroyDialog {} {
+ global itile
+ global dtile
+
+ if {[winfo exists $itile(top)]} {
+ destroy $itile(top)
+ destroy $itile(mb)
+ }
+
+ unset dtile
+}
+
+proc TileApplyDialog {} {
+ global tile
+ global dtile
+
+ set tile(mode) grid
+ set tile(grid,mode) $dtile(mode)
+ set tile(grid,dir) $dtile(dir)
+ set tile(grid,row) $dtile(row)
+ set tile(grid,col) $dtile(col)
+ set tile(grid,gap) $dtile(gap)
+
+ DisplayMode
+}
+
+# Process Cmds
+
+proc ProcessFrameCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ global active
+ global panzoom
+
+ catch {
+ switch -- [string tolower [lindex $var $i]] {
+ match {
+ incr i
+ MatchFrameCurrent [lindex $var $i]
+ }
+ lock {
+ incr i
+ set panzoom(lock) [lindex $var $i]
+ LockFrameCurrent
+ }
+ center {
+ incr i
+ switch -- [lindex $var $i] {
+ all {CenterAllFrame}
+ {} {CenterCurrentFrame; incr i -1}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ CenterFrame $f
+ } else {
+ CenterCurrentFrame; incr i -1
+ }
+ }
+ }
+ }
+ clear {
+ incr i
+ switch -- [lindex $var $i] {
+ all {ClearAllFrame}
+ {} {ClearCurrentFrame; incr i -1}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ ClearFrame $f
+ } else {
+ ClearCurrentFrame; incr i -1
+ }
+ }
+ }
+ }
+ delete {
+ incr i
+ switch -- [lindex $var $i] {
+ all {DeleteAllFrames}
+ {} {DeleteCurrentFrame; incr i -1}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ DeleteSingleFrame $f
+ } else {
+ DeleteCurrentFrame; incr i -1
+ }
+ }
+ }
+ }
+ new {
+ incr i
+ switch -- [lindex $var $i] {
+ rgb {CreateRGBFrame}
+ 3d {Create3DFrame}
+ default {CreateFrame; incr i -1}
+ }
+ }
+ reset {
+ incr i
+ switch -- [lindex $var $i] {
+ all {ResetAllFrame}
+ {} {ResetCurrentFrame; incr i -1}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ ResetFrame $f
+ } else {
+ ResetCurrentFrame; incr i -1
+ }
+ }
+ }
+ }
+ refresh {
+ incr i
+ switch -- [lindex $var $i] {
+ all {UpdateAllFrame}
+ {} {UpdateCurrentFrame; incr i -1}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ UpdateFrame $f
+ } else {
+ UpdateCurrentFrame; incr i -1
+ }
+ }
+ }
+ }
+ hide {
+ incr i
+ switch -- [lindex $var $i] {
+ all {ActiveFrameNone}
+ {} {
+ set active($current(frame)) 0
+ UpdateActiveFrames
+ incr i -1
+ }
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ set active($f) 0
+ UpdateActiveFrames
+ } else {
+ set active($current(frame)) 0
+ UpdateActiveFrames
+ incr i -1
+ }
+ }
+ }
+ }
+ show {
+ incr i
+ switch -- [lindex $var $i] {
+ all {ActiveFrameAll}
+ default {
+ if {[string is integer [lindex $var $i]]} {
+ set f "Frame[lindex $var $i]"
+ set active($f) 1
+ UpdateActiveFrames
+ } else {
+ incr i -1
+ }
+ }
+ }
+ }
+ move {
+ incr i
+ switch -- [lindex $var $i] {
+ first {MoveFirstFrame}
+ back {MovePrevFrame}
+ forward {MoveNextFrame}
+ last {MoveLastFrame}
+ }
+ }
+ first {FirstFrame}
+ prev {PrevFrame}
+ next {NextFrame}
+ last {LastFrame}
+ frameno {incr i; CreateGotoFrame [lindex $var $i] base}
+ default {CreateGotoFrame [lindex $var $i] base}
+ }
+ }
+}
+
+proc ProcessSendFrameCmd {proc id param} {
+ global ds9
+ global current
+ global rgb
+ global panzoom
+
+ switch -- [lindex $param 0] {
+ lock {$proc $id "$panzoom(lock)\n"}
+ active {
+ set r {}
+ foreach f $ds9(active) {
+ append r "[string range $f 5 end] "
+ }
+ $proc $id "$r\n"
+ }
+ all {
+ set r {}
+ foreach f $ds9(frames) {
+ append r "[string range $f 5 end] "
+ }
+ $proc $id "$r\n"
+ }
+ has {
+ if {$current(frame) == {}} {
+ Error [msgcat::mc {No current frame}]
+ return
+ }
+
+ switch [lindex $param 1] {
+ amplifier -
+ datamin -
+ datasec -
+ detector -
+ grid -
+ iis -
+ irafmin -
+ physical -
+ smooth {$proc $id [ToYesNo [$current(frame) has [lindex $param 1]]]}
+ contour {
+ switch [lindex $param 2] {
+ aux {$proc $id [ToYesNo [$current(frame) has contour aux]]}
+ default {$proc $id [ToYesNo [$current(frame) has contour]]}
+ }
+ }
+ fits {
+ switch [lindex $param 2] {
+ bin -
+ cube -
+ mosaic {$proc $id [ToYesNo [$current(frame) has fits [lindex $param 2]]]}
+ default {$proc $id [ToYesNo [$current(frame) has fits]]}
+ }
+ }
+ marker {
+ switch [lindex $param 2] {
+ highlite -
+ paste -
+ select -
+ undo {$proc $id [ToYesNo [$current(frame) has marker [lindex $param 2]]]}
+ }
+ }
+ system {$proc $id [ToYesNo [$current(frame) has system [lindex $param 2]]]}
+ wcs {
+ switch [lindex $param 2] {
+ equatorial -
+ linear {$proc $id [ToYesNo [$current(frame) has wcs [lindex $param 2] [lindex $param 3]]]}
+ default {$proc $id [ToYesNo [$current(frame) has wcs [lindex $param 2]]]}
+ }
+ }
+ }
+ }
+ default {$proc $id "[string range $current(frame) 5 end]\n"}
+ }
+}
+
+proc ProcessSingleCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global current
+ set current(display) single
+ DisplayMode
+}
+
+proc ProcessSendSingleCmd {proc id param} {
+ global current
+
+ if {$current(display) == "single"} {
+ $proc $id [ToYesNo 1]
+ } else {
+ $proc $id [ToYesNo 0]
+ }
+}
+
+proc ProcessTileCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ global tile
+
+ switch -- [string tolower [lindex $var $i]] {
+ mode {
+ incr i
+ set tile(mode) [lindex $var $i]
+ }
+ grid {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ mode {
+ incr i
+ set tile(grid,mode) [lindex $var $i]
+ }
+ direction {
+ incr i
+ set tile(grid,dir) [lindex $var $i]
+ }
+ layout {
+ incr i
+ set tile(grid,col) [lindex $var $i]
+ incr i
+ set tile(grid,row) [lindex $var $i]
+ set tile(grid,mode) {manual}
+ }
+ gap {
+ incr i
+ set tile(grid,gap) [lindex $var $i]
+ }
+ default {
+ if {[string range [lindex $var $i] 0 0] != {-}} {
+ set tile(mode) grid
+ } else {
+ incr i -1
+ }
+ }
+ }
+ }
+ column {
+ set tile(mode) column
+ }
+ row {
+ set tile(mode) row
+ }
+
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ if {[FromYesNo [lindex $var $i]]} {
+ set current(display) tile
+ } else {
+ set current(display) single
+ }
+ }
+ default {
+ set current(display) tile
+ incr i -1
+ }
+ }
+ DisplayMode
+}
+
+proc ProcessSendTileCmd {proc id param} {
+ global current
+ global tile
+
+ switch -- [lindex $param 0] {
+ mode {$proc $id "$tile(mode)\n"}
+ grid {
+ switch -- [lindex $param 1] {
+ mode {$proc $id "$tile(grid,mode)\n"}
+ direction {$proc $id "$tile(grid,dir)\n"}
+ layout {$proc $id "$tile(grid,col) $tile(grid,row)\n"}
+ gap {$proc $id "$tile(grid,gap)\n"}
+ }
+ }
+ default {
+ if {$current(display)=="tile"} {
+ $proc $id [ToYesNo 1]
+ } else {
+ $proc $id [ToYesNo 0]
+ }
+ }
+ }
+}
+
+proc ProcessBlinkCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ global blink
+
+ switch -- [string tolower [lindex $var $i]] {
+ interval {
+ incr i
+ set blink(interval) [expr int([lindex $var $i]*1000)]
+ }
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ if {[FromYesNo [lindex $var $i]]} {
+ set current(display) blink
+ } else {
+ set current(display) single
+ }
+ }
+ default {
+ set current(display) blink
+ incr i -1
+ }
+ }
+ DisplayMode
+}
+
+proc ProcessSendBlinkCmd {proc id param} {
+ global current
+ global blink
+
+ switch -- [lindex $param 0] {
+ interval {$proc $id "[expr $blink(interval)/1000.]\n"}
+ default {
+ if {$current(display) == {blink}} {
+ $proc $id [ToYesNo 1]
+ } else {
+ $proc $id [ToYesNo 0]
+ }
+ }
+ }
+}
+
+proc ProcessLockCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global panzoom
+ global crop
+ global crosshair
+ global cube
+ global ime
+ global bin
+ global scale
+ global colorbar
+ global block
+ global smooth
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ frame -
+ frames {
+ incr i
+ set panzoom(lock) [lindex $var $i]
+ LockFrameCurrent
+ }
+ crosshair -
+ crosshairs {
+ incr i
+ set crosshair(lock) [lindex $var $i]
+ LockCrosshairCurrent
+ }
+ crop {
+ incr i
+ set crop(lock) [lindex $var $i]
+ LockCropCurrent
+ }
+ slice -
+ cube -
+ datacube {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ switch -- [lindex $var $i] {
+ {} -
+ yes -
+ 1 {set cube(lock) image}
+ no -
+ 0 {set cube(lock) none}
+ default {set cube(lock) [lindex $var $i]}
+ }
+ } else {
+ set cube(lock) image
+ incr i -1
+ }
+ LockCubeCurrent
+ }
+ bin {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set bin(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set bin(lock) 1
+ incr i -1
+ }
+ LockBinCurrent
+ }
+ axes -
+ order {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set cube(lock,axes) [FromYesNo [lindex $var $i]]
+ } else {
+ set cube(lock,axes) 1
+ incr i -1
+ }
+ LockAxesCurrent
+ }
+ scale -
+ scales {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set scale(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set scale(lock) 1
+ incr i -1
+ }
+ LockScaleCurrent
+ }
+ limits -
+ scalelimits {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set scale(lock,limits) [FromYesNo [lindex $var $i]]
+ } else {
+ set scale(lock,limits) 1
+ incr i -1
+ }
+ LockScaleLimitsCurrent
+ }
+ color -
+ colormap -
+ colorbar -
+ colorbars {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set colorbar(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set colorbar(lock) 1
+ incr i -1
+ }
+ LockColorCurrent
+ }
+ block {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set block(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set block(lock) 1
+ incr i -1
+ }
+ LockBlockCurrent
+ }
+ smooth {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set smooth(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set smooth(lock) 1
+ incr i -1
+ }
+ LockSmoothCurrent
+ }
+ }
+}
+
+proc ProcessSendLockCmd {proc id param} {
+ global panzoom
+ global crop
+ global crosshair
+ global cube
+ global ime
+ global bin
+ global scale
+ global colorbar
+ global block
+ global smooth
+
+ switch -- [lindex $param 0] {
+ frame -
+ frames {$proc $id "$panzoom(lock)\n"}
+ crosshair -
+ crosshairs {$proc $id "$crosshair(lock)\n"}
+ crop {$proc $id "$crop(lock)\n"}
+ slice -
+ cube -
+ datacube {$proc $id "$cube(lock)\n"}
+ analysis {$proc $id "$ime(lock)\n"}
+ bin {$proc $id [ToYesNo $bin(lock)]}
+ axes -
+ order {$proc $id [ToYesNo $cube(lock,axes)]}
+ scale -
+ scales {$proc $id [ToYesNo $scale(lock)]}
+ limits -
+ scalelimits {$proc $id [ToYesNo $scale(lock,limits)]}
+ color -
+ colormap -
+ colorbar -
+ colorbars {$proc $id [ToYesNo $colorbar(lock)]}
+ block {$proc $id [ToYesNo $block(lock)]}
+ smooth {$proc $id [ToYesNo $smooth(lock)]}
+ }
+}
+
+proc ProcessMatchCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+ global current
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ frame -
+ frames {
+ incr i
+ MatchFrameCurrent [lindex $var $i]
+ }
+ crosshair -
+ crosshairs {
+ incr i
+ MatchCrosshairCurrent [lindex $var $i]
+ }
+ crop {
+ incr i
+ MatchCropCurrent [lindex $var $i]
+ }
+ slice -
+ cube -
+ datacube {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ switch -- [lindex $var $i] {
+ {} {MatchCubeCurrent image}
+ default {MatchCubeCurrent [lindex $var $i]}
+ }
+ } else {
+ MatchCubeCurrent image
+ incr i -1
+ }
+ }
+ bin {MatchBinCurrent}
+ axes -
+ order {MatchAxesCurrent}
+ scale -
+ scales {MatchScaleCurrent}
+ limits -
+ scalelimits {MatchScaleLimitsCurrent}
+ color -
+ colormap -
+ colorbar -
+ colorbars {MatchColorCurrent}
+ block {MatchBlockCurrent}
+ smooth {MatchSmoothCurrent}
+ }
+}
+
diff --git a/ds9/library/graph.tcl b/ds9/library/graph.tcl
new file mode 100644
index 0000000..4e42610
--- /dev/null
+++ b/ds9/library/graph.tcl
@@ -0,0 +1,419 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc GraphDef {} {
+ global igraph
+ global pgraph
+
+ set igraph(horz,id) 0
+ set igraph(vert,id) 0
+
+ set igraph(size) 150
+ set igraph(gap,x) 50
+ set igraph(gap,y) 25
+
+ set igraph(x,min) 0
+ set igraph(x,max) 10
+ set igraph(y,min) 1
+ set igraph(y,max) 100
+
+ global graphHorzX graphHorzY
+ global graphVertX graphVertY
+ global histX histY
+
+ blt::vector create graphHorzX graphHorzY
+ blt::vector create graphVertX graphVertY
+ blt::vector create histX histY
+
+ # prefs only
+ set pgraph(horz,grid) 1
+ set pgraph(horz,log) false
+ set pgraph(vert,grid) 1
+ set pgraph(vert,log) false
+}
+
+proc CreateGraphs {} {
+ global igraph
+
+ global ds9
+ global canvas
+
+ # Horizontal Graph
+ set ds9(graph,horz) [blt::graph $ds9(main).horz \
+ -width $canvas(width) -height $igraph(size) \
+ -takefocus 0 \
+ -background $ds9(bg) \
+ -highlightthickness 0 \
+ -plotborderwidth 2 \
+ -plotrelief groove \
+ -plotbackground $ds9(bg) \
+ -font [font actual TkDefaultFont] \
+ ]
+ # we need to manually set the element foreground color, i.e. use graph fg
+ set fgcolor [$ds9(graph,horz) cget -foreground]
+
+ $ds9(graph,horz) legend configure -hide yes
+ $ds9(graph,horz) crosshairs configure -color green
+
+ $ds9(graph,horz) xaxis configure -hide no -showticks no -bg $ds9(bg)
+ $ds9(graph,horz) x2axis configure -hide yes
+ $ds9(graph,horz) yaxis configure -hide yes
+ $ds9(graph,horz) y2axis configure -hide no -bg $ds9(bg) \
+ -tickfont [font actual TkDefaultFont]
+
+ $ds9(graph,horz) element create line1 -xdata graphHorzX -ydata graphHorzY \
+ -color $fgcolor -symbol none
+
+ bind $ds9(graph,horz) <Enter> [list EnterGraph $ds9(graph,horz) 1]
+ bind $ds9(graph,horz) <Leave> [list LeaveGraph $ds9(graph,horz)]
+ bind $ds9(graph,horz) <Button-1> \
+ [list MotionGraph $ds9(graph,horz) %x %y 1]
+ bind $ds9(graph,horz) <B1-Motion> \
+ [list MotionGraph $ds9(graph,horz) %x %y 1]
+ bind $ds9(graph,horz) <Up> [list ArrowKeyGraph $ds9(graph,horz) 0 -1 1]
+ bind $ds9(graph,horz) <Down> [list ArrowKeyGraph $ds9(graph,horz) 0 1 1]
+ bind $ds9(graph,horz) <Left> [list ArrowKeyGraph $ds9(graph,horz) -1 0 1]
+ bind $ds9(graph,horz) <Right> [list ArrowKeyGraph $ds9(graph,horz) 1 0 1]
+
+ # Vertical Graph
+ set ds9(graph,vert) [blt::graph $ds9(main).vert \
+ -width $igraph(size) -height $canvas(height) \
+ -invertxy yes \
+ -takefocus 0 \
+ -background $ds9(bg) \
+ -highlightthickness 0 \
+ -plotrelief groove \
+ -plotborderwidth 2 \
+ -plotbackground $ds9(bg)
+ ]
+ $ds9(graph,vert) legend configure -hide yes
+ $ds9(graph,vert) crosshairs configure -color green
+
+ $ds9(graph,vert) xaxis configure -hide yes -descending yes
+ $ds9(graph,vert) x2axis configure -hide no -descending yes \
+ -showticks no -bg $ds9(bg)
+ $ds9(graph,vert) yaxis configure -hide no -descending yes \
+ -bg $ds9(bg) -tickfont [font actual TkDefaultFont]
+ $ds9(graph,vert) y2axis configure -hide yes -descending yes
+
+ $ds9(graph,vert) element create line1 -xdata graphVertX -ydata graphVertY \
+ -color $fgcolor -symbol none
+
+ bind $ds9(graph,vert) <Enter> [list EnterGraph $ds9(graph,vert) 0]
+ bind $ds9(graph,vert) <Leave> [list LeaveGraph $ds9(graph,vert)]
+ bind $ds9(graph,vert) <Button-1> \
+ [list MotionGraph $ds9(graph,vert) %x %y 0]
+ bind $ds9(graph,vert) <B1-Motion> \
+ [list MotionGraph $ds9(graph,vert) %x %y 0]
+ bind $ds9(graph,vert) <Up> [list ArrowKeyGraph $ds9(graph,vert) 0 -1 0]
+ bind $ds9(graph,vert) <Down> [list ArrowKeyGraph $ds9(graph,vert) 0 1 0]
+ bind $ds9(graph,vert) <Left> [list ArrowKeyGraph $ds9(graph,vert) -1 0 0]
+ bind $ds9(graph,vert) <Right> [list ArrowKeyGraph $ds9(graph,vert) 1 0 0]
+
+ UpdateGraphGrid
+}
+
+proc UpdateGraphFont {} {
+ global ds9
+
+ $ds9(graph,horz) y2axis configure -tickfont [font actual TkDefaultFont]
+ $ds9(graph,vert) yaxis configure -tickfont [font actual TkDefaultFont]
+}
+
+proc UpdateGraphGrid {} {
+ global pgraph
+ global ds9
+
+ $ds9(graph,horz) xaxis configure -grid $pgraph(horz,grid) -tickdefault 4
+ $ds9(graph,horz) y2axis configure -grid $pgraph(horz,grid)
+
+ $ds9(graph,vert) x2axis configure -grid $pgraph(vert,grid)
+ $ds9(graph,vert) yaxis configure -grid $pgraph(vert,grid) -tickdefault 4
+}
+
+proc UpdateGraphXAxis {which} {
+ global ds9
+ global view
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateGraphXAxis"
+ }
+
+ if {$view(graph,horz)} {
+ UpdateGraphXAxisHV $which $ds9(graph,horz) graphHorzX graphHorzY 1
+ }
+
+ if {$view(graph,vert)} {
+ UpdateGraphXAxisHV $which $ds9(graph,vert) graphVertX graphVertY 0
+ }
+}
+
+proc UpdateGraphXAxisHV {which what vectorX vectorY cut} {
+ global igraph
+
+ global graphHorzX graphHorzY
+ global graphVertX graphVertY
+
+ if {$which != {}} {
+ set xMin [expr "$$vectorX\(min\)"]
+ set xMax [expr "$$vectorX\(max\)"]
+
+ $what xaxis configure -min $xMin -max $xMax
+ $what x2axis configure -min $xMin -max $xMax
+ } else {
+ $what xaxis configure -min $igraph(x,min) -max $igraph(x,max)
+ $what x2axis configure -min $igraph(x,min) -max $igraph(x,max)
+ }
+}
+
+proc UpdateGraphYAxis {which} {
+ global pgraph
+
+ global ds9
+ global view
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateGraphYAxis"
+ }
+
+ if {$view(graph,horz)} {
+ UpdateGraphYAxisHV $which $ds9(graph,horz) $pgraph(horz,log)
+ }
+
+ if {$view(graph,vert)} {
+ UpdateGraphYAxisHV $which $ds9(graph,vert) $pgraph(vert,log)
+ }
+}
+
+proc UpdateGraphYAxisHV {which what log} {
+ global igraph
+
+ if {$which != {}} {
+ set minmax [$which get clip]
+ set yMin [lindex $minmax 0]
+ set yMax [lindex $minmax 1]
+
+ # must use .eq. since "nan" is a legal double value
+ if {$yMin eq "nan" || $yMax eq "nan"} {
+ set yMin 0
+ set yMax 1
+ }
+
+ if {$yMin >= $yMax} {
+ set yMax [expr $yMin + 1]
+ }
+
+ $what yaxis configure -min $yMin -max $yMax -logscale $log -tickdefault 4
+ $what y2axis configure -min $yMin -max $yMax -logscale $log -tickdefault 4
+ } else {
+ $what yaxis configure -min $igraph(y,min) -max $igraph(y,max) \
+ -logscale $log -tickdefault 4
+ $what y2axis configure -min $igraph(y,min) -max $igraph(y,max) \
+ -logscale $log -tickdefault 4
+ }
+}
+
+proc ShowGraphData {which} {
+ global ds9
+ global view
+
+ if {$view(graph,horz)} {
+ ShowGraphDataHV $which $ds9(graph,horz)
+ }
+ if {$view(graph,vert)} {
+ ShowGraphDataHV $which $ds9(graph,vert)
+ }
+}
+
+proc ShowGraphDataHV {which what} {
+ if {$which != {}} {
+ if {[$which has fits]} {
+ $what element configure line1 -hide no
+ } else {
+ $what element configure line1 -hide yes
+ }
+ } else {
+ $what element configure line1 -hide yes
+ }
+}
+
+proc ClearGraphData {} {
+ global ds9
+ global view
+
+ if {$view(graph,horz)} {
+ $ds9(graph,horz) element configure line1 -hide yes
+ }
+
+ if {$view(graph,vert)} {
+ $ds9(graph,vert) element configure line1 -hide yes
+ }
+}
+
+proc UpdateGraph {which x y sys} {
+ global ds9
+ global view
+
+ if {[$which has fits]} {
+ if {$view(graph,horz)} {
+ $which get horizontal cut graphHorzX graphHorzY $x $y $sys
+ $ds9(graph,horz) element configure line1 -hide no
+ }
+
+ if {$view(graph,vert)} {
+ $which get vertical cut graphVertX graphVertY $x $y $sys
+ $ds9(graph,vert) element configure line1 -hide no
+ }
+ }
+}
+
+proc EnterGraph {which horz} {
+ global current
+
+ focus $which
+ $which crosshairs on
+
+ if {$current(frame) != {}} {
+ switch $current(mode) {
+ crosshair -
+ analysis {
+
+ set x [$which crosshairs cget -x]
+ set y [$which crosshairs cget -y]
+
+ set coord [$current(frame) get crosshair canvas]
+ set X [lindex $coord 0]
+ set Y [lindex $coord 1]
+
+ if {$horz} {
+ EnterInfoBox $current(frame)
+ UpdateInfoBox $current(frame) $x $Y canvas
+ UpdatePixelTableDialog $current(frame) $x $Y canvas
+ } else {
+ EnterInfoBox $current(frame)
+ UpdateInfoBox $current(frame) $X $y canvas
+ UpdatePixelTableDialog $current(frame) $X $y canvas
+ }
+ }
+ }
+ }
+}
+
+proc LeaveGraph {which} {
+ focus {}
+ $which crosshairs off
+
+ LeaveInfoBox
+ PixelTableClearDialog
+}
+
+proc MotionGraph {which x y horz} {
+ global current
+
+ $which crosshairs configure -x $x -y $y
+
+ if {$current(frame) != {}} {
+ switch $current(mode) {
+ crosshair -
+ analysis {
+ set coord [$current(frame) get crosshair canvas]
+ set X [lindex $coord 0]
+ set Y [lindex $coord 1]
+
+ if {$horz} {
+ UpdateInfoBox $current(frame) $x $Y canvas
+ UpdatePixelTableDialog $current(frame) $x $Y canvas
+ } else {
+ UpdateInfoBox $current(frame) $X $y canvas
+ UpdatePixelTableDialog $current(frame) $X $y canvas
+ }
+ }
+ }
+ }
+}
+
+proc ArrowKeyGraph {which x y horz} {
+ set cx [$which crosshairs cget -x]
+ set cy [$which crosshairs cget -y]
+
+ set cx [expr $cx+$x]
+ set cy [expr $cy+$y]
+
+ MotionGraph $which $cx $cy $horz
+}
+
+proc LayoutGraphs {} {
+ global igraph
+
+ global ds9
+ global canvas
+ global view
+ global colorbar
+ global icolorbar
+
+ set cbh [expr $view(colorbar) && \
+ [string equal $colorbar(orientation) {horizontal}]]
+ set cbv [expr $view(colorbar) && \
+ [string equal $colorbar(orientation) {vertical}]]
+ set grh [expr $view(graph,horz)]
+ set grv [expr $view(graph,vert)]
+
+ if {$grh} {
+ set xx 0
+ set yy [expr $canvas(height) + $canvas(gap)]
+ if {$cbh} {
+ incr yy $icolorbar(horizontal,height)
+ }
+ if {$grv && !$cbh} {
+ incr yy $igraph(gap,y)
+ }
+
+ if {$igraph(horz,id) == 0} {
+ set igraph(horz,id) [$ds9(canvas) create window $xx $yy \
+ -window $ds9(graph,horz) -anchor nw]
+ } else {
+ $ds9(canvas) coords $igraph(horz,id) $xx $yy
+ }
+
+ set ww [expr $canvas(width)+$igraph(gap,x)]
+ $ds9(graph,horz) configure -width $ww
+
+ } else {
+ if {$igraph(horz,id)>0} {
+ $ds9(canvas) delete $igraph(horz,id)
+ set igraph(horz,id) 0
+ }
+ }
+
+ if {$grv} {
+ set yy 0
+ set xx [expr $canvas(width) + $canvas(gap)]
+ if {$cbv} {
+ incr xx $icolorbar(vertical,width)
+ }
+ if {$grh && !$cbv} {
+ incr xx $igraph(gap,x)
+ }
+
+ if {$igraph(vert,id) == 0} {
+ set igraph(vert,id) [$ds9(canvas) create window $xx $yy \
+ -window $ds9(graph,vert) -anchor nw]
+ } else {
+ $ds9(canvas) coords $igraph(vert,id) $xx $yy
+ }
+
+ set hh [expr $canvas(height)+$igraph(gap,y)]
+ $ds9(graph,vert) configure -height $hh
+
+ } else {
+ if {$igraph(vert,id)>0} {
+ $ds9(canvas) delete $igraph(vert,id)
+ set igraph(vert,id) 0
+ }
+ }
+}
diff --git a/ds9/library/grid.tcl b/ds9/library/grid.tcl
new file mode 100644
index 0000000..dfdc4b0
--- /dev/null
+++ b/ds9/library/grid.tcl
@@ -0,0 +1,1550 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc GridDef {} {
+ global igrid
+ global grid
+ global pgrid
+
+ set igrid(top) .grid
+ set igrid(mb) .gridmb
+
+ set grid(view) 0
+
+ array set pgrid [array get grid]
+
+ GridDefault
+}
+
+proc GridDefault {} {
+ global grid
+
+ set grid(type) analysis
+ set grid(system) wcs
+ set grid(sky) fk5
+ set grid(skyformat) sexagesimal
+
+ set grid(grid) 1
+ set grid(grid,color) blue
+ set grid(grid,width) 1
+ set grid(grid,style) 0
+ set grid(grid,gap1) {}
+ set grid(grid,gap2) {}
+ set grid(grid,gap3) {}
+ set grid(grid,gapunit1) {}
+ set grid(grid,gapunit2) {}
+ set grid(grid,gapunit3) {}
+
+ set grid(axes) 1
+ set grid(axes,color) red
+ set grid(axes,width) 1
+ set grid(axes,style) 0
+ set grid(axes,type) interior
+ set grid(axes,origin) lll
+
+ set grid(tick) 1
+ set grid(tick,color) white
+ set grid(tick,width) 1
+ set grid(tick,style) 0
+
+ set grid(border) 1
+ set grid(border,color) blue
+ set grid(border,width) 1
+ set grid(border,style) 0
+
+ set grid(format1) {}
+ set grid(format2) {}
+
+ set grid(numlab) 1
+ set grid(numlab,font) helvetica
+ set grid(numlab,size) 10
+ set grid(numlab,weight) normal
+ set grid(numlab,slant) roman
+ set grid(numlab,color) green
+ set grid(numlab,gap1) {}
+ set grid(numlab,gap2) {}
+ set grid(numlab,gap3) {}
+ set grid(numlab,type) interior
+ set grid(numlab,vertical) 0
+
+ set grid(title) 1
+ set grid(title,text) {}
+ set grid(title,def) 1
+ set grid(title,gap) {}
+ set grid(title,font) helvetica
+ set grid(title,size) 12
+ set grid(title,weight) normal
+ set grid(title,slant) roman
+ set grid(title,color) black
+
+ set grid(textlab) 1
+ set grid(textlab,text1) {}
+ set grid(textlab,text2) {}
+ set grid(textlab,def1) 1
+ set grid(textlab,def2) 1
+ set grid(textlab,gap1) {}
+ set grid(textlab,gap2) {}
+ set grid(textlab,font) helvetica
+ set grid(textlab,size) 10
+ set grid(textlab,weight) normal
+ set grid(textlab,slant) roman
+ set grid(textlab,color) black
+}
+
+proc GridUpdateCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ GridUpdate $current(frame)
+ }
+}
+
+proc GridUpdate {which} {
+ global grid
+
+ GridAdjustOptions $which
+
+ if {$grid(view) && [$which has fits]} {
+ $which grid create $grid(system) $grid(sky) \
+ $grid(skyformat) $grid(type) \
+ [GridBuildOptions $which] "\"[array get grid]\""
+ } else {
+ $which grid delete
+ }
+}
+
+proc GridUpdateZoom {} {
+ global grid
+
+ if {$grid(type) == "publication"} {
+ GridUpdateCurrent
+ }
+}
+
+proc GridAdjustOptions {which} {
+ global grid
+
+ if {$which != {}} {
+ if {[$which has fits]} {
+ # change values if needed for coordmenu
+ AdjustCoordSystem grid system
+ }
+ }
+
+ set grid(grid,gapunit1) pixels
+ set grid(grid,gapunit2) pixels
+ set grid(grid,gapunit3) pixels
+
+ # adjust units
+ switch -- $grid(system) {
+ image -
+ physical -
+ amplifier -
+ detector {}
+ default {
+ if {$which != {}} {
+ if {[$which has wcs celestrial $grid(system)]} {
+ set grid(grid,gapunit1) degrees
+ set grid(grid,gapunit2) degrees
+ }
+ if {[$which has wcs 3d $grid(system)]} {
+ set tt [string trim [$which get fits header keyword CTYPE3]]
+ if {$tt != {}} {
+ set grid(grid,gapunit3) $tt
+ }
+ }
+ }
+ }
+ }
+}
+
+proc GridBuildOptions {which} {
+ global grid
+ global current
+
+ set opt "\""
+
+ # Grid
+ append opt " Grid=$grid(grid),"
+ append opt " Colour(grid)=[GridColor2Ast $grid(grid,color)],"
+ append opt " Width(grid)=$grid(grid,width),"
+ append opt " Style(grid)=$grid(grid,style),"
+
+ # Axes
+ append opt " DrawAxes=$grid(axes),"
+ append opt " Colour(axes)=[GridColor2Ast $grid(axes,color)],"
+ append opt " Width(axes)=$grid(axes,width),"
+ append opt " Style(axes)=$grid(axes,style),"
+
+ # Format
+ if {$grid(format1) != {}} {
+ append opt " Format(1)=$grid(format1),"
+ } else {
+ set ff [GridDefaultFormat1]
+ if {$ff != {}} {
+ append opt " Format(1)=$ff,"
+ }
+ }
+
+ if {$grid(format2) != {}} {
+ append opt " Format(2)=$grid(format2),"
+ } else {
+ set ff [GridDefaultFormat2]
+ if {$ff != {}} {
+ append opt " Format(2)=$ff,"
+ }
+ }
+
+ # Ticks
+ if {!$grid(tick)} {
+ append opt " MajTickLen=0,"
+ append opt " MinTick(1)=0,"
+ append opt " MinTick(2)=0,"
+ switch -- $grid(type) {
+ analysis {}
+ publication {
+ switch -- [$which get type] {
+ base -
+ rgb {}
+ 3d {append opt " MinTick(3)=0,"}
+ }
+ }
+ }
+ }
+ append opt " Colour(ticks)=[GridColor2Ast $grid(tick,color)],"
+ append opt " Width(ticks)=$grid(tick,width),"
+ append opt " Style(ticks)=$grid(tick,style),"
+
+ # Border
+ append opt " Border=$grid(border),"
+ append opt " Colour(border)=[GridColor2Ast $grid(border,color)],"
+ append opt " Width(border)=$grid(border,width),"
+ append opt " Style(border)=$grid(border,style),"
+
+ # Labels
+ append opt " Labelling=$grid(axes,type),"
+ switch -- [$which get type] {
+ base -
+ rgb {append opt " LabelUp=$grid(numlab,vertical),"}
+ 3d {append opt " LabelUp=1,"}
+ }
+
+ # NumLab
+ append opt " NumLab=$grid(numlab),"
+ set opt "$opt Font(numlab)=[GridFont2Ast $grid(numlab,font) $grid(numlab,weight) $grid(numlab,slant)],"
+ append opt " Size(numlab)=$grid(numlab,size),"
+ append opt " Colour(numlab)=[GridColor2Ast $grid(numlab,color)],"
+
+ # TextLab
+ switch -- $grid(type) {
+ analysis {append opt " TextLab=0,"}
+ publication {
+ switch -- [$which get type] {
+ base -
+ rgb {append opt " TextLab=$grid(textlab),"}
+ 3d {append opt " TextLab=0,"}
+ }
+ }
+ }
+ if {!$grid(textlab,def1)} {
+ append opt " Label(1)=[GridStripComma $grid(textlab,text1)] ,"
+ }
+ if {!$grid(textlab,def2)} {
+ append opt " Label(2)=[GridStripComma $grid(textlab,text2)] ,"
+ }
+
+ set opt "$opt Font(textlab)=[GridFont2Ast $grid(textlab,font) $grid(textlab,weight) $grid(textlab,slant)],"
+ append opt " Size(textlab)=$grid(textlab,size),"
+ append opt " Colour(textlab)=[GridColor2Ast $grid(textlab,color)],"
+
+ # Title
+ switch -- $grid(type) {
+ analysis {append opt " DrawTitle=0,"}
+ publication {
+ switch -- [$which get type] {
+ base -
+ rgb {append opt " DrawTitle=$grid(title),"}
+ 3d {append opt " DrawTitle=0,"}
+ }
+ }
+ }
+
+ if {$grid(title,def)} {
+ set t [GridStripComma "[$which get fits object name]"]
+ if {$t != {}} {
+ append opt " Title=$t ,"
+ }
+ } else {
+ set t [GridStripComma "$grid(title,text)"]
+ if {$t != {}} {
+ append opt " Title=$t ,"
+ }
+ }
+
+ set opt "$opt Font(title)=[GridFont2Ast $grid(title,font) $grid(title,weight) $grid(title,slant)],"
+ append opt " Size(title)=$grid(title,size),"
+ append opt " Colour(title)=[GridColor2Ast $grid(title,color)],"
+
+ # Grid Spacing
+ if {$grid(grid,gap1) != {}} {
+ if {$grid(grid,gapunit1) == "degrees"} {
+ append opt " Gap(1)=[expr 3.14159/180.*$grid(grid,gap1)],"
+ } else {
+ append opt " Gap(1)=$grid(grid,gap1),"
+ }
+ }
+
+ if {$grid(grid,gap2) != {}} {
+ if {$grid(grid,gapunit2) == "degrees"} {
+ append opt " Gap(2)=[expr 3.14159/180.*$grid(grid,gap2)],"
+ } else {
+ append opt " Gap(2)=$grid(grid,gap2),"
+ }
+ }
+
+ switch -- [$which get type] {
+ base -
+ rgb {}
+ 3d {
+ if {$grid(grid,gap3) != {}} {
+ if {$grid(grid,gapunit3) == "degrees"} {
+ append opt " Gap(3)=[expr 3.14159/180.*$grid(grid,gap3)],"
+ } else {
+ append opt " Gap(3)=$grid(grid,gap3),"
+ }
+ }
+ }
+ }
+
+ # axes numerics
+ set flip 0
+ set numx 0
+ set numy 0
+ switch -- $grid(type) {
+ analysis {
+ switch -- [$which get type] {
+ base -
+ rgb {
+ set numx -.03
+ set numy -.03
+ }
+ 3d {}
+ }
+ }
+ publication {
+ switch -- [$which get type] {
+ base -
+ rgb {
+ set numx -.02
+ set numy -.01
+ switch -- $grid(axes,type) {
+ interior {}
+ exterior {
+ switch -- $grid(numlab,type) {
+ interior {}
+ exterior {set flip 1}
+ }
+ }
+ }
+ }
+ 3d {}
+ }
+ }
+ }
+
+ # override
+ if {$grid(numlab,gap1) != {}} {
+ set numx [expr -$grid(numlab,gap1)/100.]
+ }
+ if {$grid(numlab,gap2) != {}} {
+ set numy [expr -$grid(numlab,gap2)/100.]
+ }
+ if {$grid(numlab,gap3) != {}} {
+ set numy [expr -$grid(numlab,gap3)/100.]
+ }
+ if {$flip} {
+ set numx [expr -$numx]
+ set numy [expr -$numy]
+ }
+ append opt " NumLabGap(1)=$numx,"
+ append opt " NumLabGap(2)=$numy,"
+
+ # Label gaps
+ switch -- $grid(type) {
+ analysis {
+ set axisx 0
+ set axisy 0
+ set title 0
+ }
+ publication {
+ if {$grid(textlab,gap1) != {}} {
+ set axisx [expr $grid(textlab,gap1)/100.]
+ } else {
+ set axisx 0
+ }
+ if {$grid(textlab,gap2) != {}} {
+ set axisy [expr $grid(textlab,gap2)/100.]
+ } else {
+ set axisy .1
+ }
+
+ if {$grid(title,gap) != {}} {
+ set title [expr $grid(title,gap)/100.]
+ } else {
+ set title .30
+ }
+ }
+ }
+
+ append opt " TextLabGap(1)=$axisx,"
+ append opt " TextLabGap(2)=$axisy,"
+ append opt " TitleGap=[expr -1-$title],"
+
+ # Orientation
+ switch -- [$which get type] {
+ base -
+ rgb {
+ append opt " Edge(1)=top,"
+ append opt " Edge(2)=left,"
+ }
+ 3d {
+ switch -- $grid(type) {
+ analysis {
+ append opt " Edge(1)=bottom,"
+ append opt " Edge(2)=left,"
+ }
+ publication {
+ append opt " RootCorner=$grid(axes,origin),"
+ }
+ }
+ }
+ }
+
+ # 3D Normal
+ switch -- $grid(type) {
+ analysis {}
+ publication {
+ switch -- [$which get type] {
+ base -
+ rgb {}
+ 3d {append opt " Norm(1)=0, Norm(2)=0, Norm(3)=-1,"}
+ }
+ }
+ }
+
+ # The End
+ append opt " \""
+
+ global debug
+
+ if {$debug(tcl,grid)} {
+ puts stderr "GridBuildOptions"
+ puts stderr "$opt"
+ }
+
+ return $opt
+}
+
+proc GridAst2Color {ast} {
+ switch -- $ast {
+ 0 {return {black}}
+ 1 {return white}
+ 2 {return red}
+ 3 {return green}
+ 4 {return blue}
+ 5 {return cyan}
+ 6 {return magenta}
+ 7 {return yellow}
+
+ 16777215 {return {white}}
+ 16711680 {return {red}}
+ 65280 {return {green}}
+ 255 {return {blue}}
+ 65535 {return {cyan}}
+ 16711935 {return {magenta}}
+ 16776960 {return {yellow}}
+
+ default {return "#[format %x $ast]"}
+ }
+}
+
+proc GridColor2Ast {which} {
+ switch -- $which {
+ black {return [expr 0x000000]}
+ white {return [expr 0xffffff]}
+ red {return [expr 0xff0000]}
+ green {return [expr 0x00ff00]}
+ blue {return [expr 0x0000ff]}
+ cyan {return [expr 0x00ffff]}
+ magenta {return [expr 0xff00ff]}
+ yellow {return [expr 0xffff00]}
+
+ default {
+ if {[string range $which 0 0] == "#"} {
+ return [expr 0x[string range $which 1 end]]
+ } else {
+ return [expr $which]
+ }
+ }
+ }
+}
+
+proc GridAst2Font {ast fnvar fwvar fsvar} {
+ upvar $fnvar fn
+ upvar $fwvar fw
+ upvar $fsvar fs
+
+ switch -- $ast {
+ 0 -
+ 2 -
+ 3 {set fn "helvetica"; set fw "normal"; set fs "roman"}
+ 1 {set fn "times"; set fw "normal"; set fs "roman"}
+ 4 {set fn "courier"; set fw "normal"; set fs "roman"}
+ 10 -
+ 12 -
+ 13 {set fn "helvetica"; set fw "bold"; set fs "roman"}
+ 11 {set fn "times"; set fw "bold"; set fs "roman"}
+ 14 {set fn "courier"; set fw "bold"; set fs "roman"}
+ 20 -
+ 22 -
+ 23 {set fn "helvetica"; set fw "normal"; set fs "italic"}
+ 21 {set fn "times"; set fw "normal"; set fs "italic"}
+ 24 {set fn "courier"; set fw "normal"; set fs "italic"}
+ 30 -
+ 32 -
+ 33 {set fn "helvetica"; set fw "bold"; set fs "italic"}
+ 31 {set fn "times"; set fw "bold"; set fs "italic"}
+ 34 {set fn "courier"; set fw "bold"; set fs "italic"}
+
+ default {set fn "helvetica"; set fw "normal"; set fs "roman"}
+ }
+}
+
+proc GridFont2Ast {fn fw fs} {
+ if {$fn == "times" && $fw == "normal" && $fs == "roman"} {
+ return 1;
+ } elseif {$fn == "helvetica" && $fw == "normal" && $fs == "roman"} {
+ return 2;
+ } elseif {$fn == "courier" && $fw == "normal" && $fs == "roman"} {
+ return 4;
+ } elseif {$fn == "times" && $fw == "bold" && $fs == "roman"} {
+ return 11;
+ } elseif {$fn == "helvetica" && $fw == "bold" && $fs == "roman"} {
+ return 12;
+ } elseif {$fn == "courier" && $fw == "bold" && $fs == "roman"} {
+ return 14;
+ } elseif {$fn == "times" && $fw == "normal" && $fs == "italic"} {
+ return 21;
+ } elseif {$fn == "helvetica" && $fw == "normal" && $fs == "italic"} {
+ return 22;
+ } elseif {$fn == "courier" && $fw == "normal" && $fs == "italic"} {
+ return 24;
+ } elseif {$fn == "times" && $fw == "bold" && $fs == "italic"} {
+ return 31;
+ } elseif {$fn == "helvetica" && $fw == "bold" && $fs == "italic"} {
+ return 32;
+ } elseif {$fn == "courier" && $fw == "bold" && $fs == "italic"} {
+ return 34;
+ } else {
+ return 2;
+ }
+}
+
+proc GridDialog {} {
+ global igrid
+ global grid
+ global current
+ global ds9
+
+ # see if we already have a window visible
+
+ if {[winfo exists $igrid(top)]} {
+ raise $igrid(top)
+ return
+ }
+
+ # create the window
+ set w $igrid(top)
+ set mb $igrid(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Coordinate Grid Parameters}] \
+ GridDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Type}] -menu $mb.type
+ $mb add cascade -label [msgcat::mc {Coordinate}] -menu $mb.coord
+ $mb add cascade -label [msgcat::mc {Grid}] -menu $mb.grid
+ $mb add cascade -label [msgcat::mc {Axes}] -menu $mb.axes
+ $mb add cascade -label [msgcat::mc {Numerics}] -menu $mb.numlab
+ $mb add cascade -label [msgcat::mc {Labels}] -menu $mb.textlab
+ $mb add cascade -label [msgcat::mc {Tickmarks}] -menu $mb.tick
+ $mb add cascade -label [msgcat::mc {Title}] -menu $mb.title
+ $mb add cascade -label [msgcat::mc {Border}] -menu $mb.border
+
+ # File
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command GridApplyDialog
+ $mb.file add command -label [msgcat::mc {Reset}] -command GridResetDialog
+ $mb.file add command -label [msgcat::mc {Clear}] -command GridClearDialog
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load Configuration}]..." \
+ -command GridLoadDialog
+ $mb.file add command -label "[msgcat::mc {Save Configuration}]..." \
+ -command GridSaveDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command GridDestroyDialog
+
+ # Edit
+ EditMenu $mb igrid
+
+ # Type
+ menu $mb.type
+ $mb.type add radiobutton -label [msgcat::mc {Analysis}] \
+ -variable grid(type) -value analysis -command GridApplyDialog
+ $mb.type add radiobutton -label [msgcat::mc {Publication}] \
+ -variable grid(type) -value publication -command GridApplyDialog
+ $mb.type add separator
+ $mb.type add radiobutton -label [msgcat::mc {Interior Axes}] \
+ -variable grid(axes,type) -value interior -command GridApplyDialog
+ $mb.type add radiobutton -label [msgcat::mc {Exterior Axes}] \
+ -variable grid(axes,type) -value exterior -command GridApplyDialog
+ $mb.type add separator
+ $mb.type add radiobutton -label [msgcat::mc {Interior Numerics}] \
+ -variable grid(numlab,type) -value interior -command GridApplyDialog
+ $mb.type add radiobutton -label [msgcat::mc {Exterior Numerics}] \
+ -variable grid(numlab,type) -value exterior -command GridApplyDialog
+ $mb.type add separator
+ $mb.type add checkbutton -label [msgcat::mc {Vertical Text}] \
+ -variable grid(numlab,vertical) -command GridApplyDialog
+
+ # Coordinate
+ CoordMenu $mb.coord grid system 1 sky skyformat GridApplyDialog
+
+ # Grid
+ menu $mb.grid
+ $mb.grid add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(grid) -command GridApplyDialog
+ $mb.grid add separator
+ $mb.grid add cascade -label [msgcat::mc {Color}] -menu $mb.grid.color
+ $mb.grid add cascade -label [msgcat::mc {Line}] -menu $mb.grid.line
+
+ ColorMenu $mb.grid.color grid grid,color GridApplyDialog
+ GridCreateLineMenu $mb.grid.line grid,width grid,style
+
+ # Axes
+ menu $mb.axes
+ $mb.axes add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(axes) -command GridApplyDialog
+ $mb.axes add separator
+ $mb.axes add cascade -label [msgcat::mc {Color}] -menu $mb.axes.color
+ $mb.axes add cascade -label [msgcat::mc {Line}] -menu $mb.axes.line
+ $mb.axes add separator
+ $mb.axes add cascade -label [msgcat::mc {Origin}] -menu $mb.axes.origin
+
+ ColorMenu $mb.axes.color grid axes,color GridApplyDialog
+ GridCreateLineMenu $mb.axes.line axes,width axes,style
+
+ menu $mb.axes.origin
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Lower Left Front}] \
+ -variable grid(axes,origin) -value lll -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Lower Right Front}] \
+ -variable grid(axes,origin) -value ull -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Upper Right Front}] \
+ -variable grid(axes,origin) -value uul -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Upper Left Front}] \
+ -variable grid(axes,origin) -value lul -command GridApplyDialog
+ $mb.axes.origin add separator
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Lower Left Back}] \
+ -variable grid(axes,origin) -value llu -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Lower Right Back}] \
+ -variable grid(axes,origin) -value ulu -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Upper Right Back}] \
+ -variable grid(axes,origin) -value uuu -command GridApplyDialog
+ $mb.axes.origin add radiobutton -label [msgcat::mc {Upper Left Back}] \
+ -variable grid(axes,origin) -value luu -command GridApplyDialog
+
+ # Numerics
+ menu $mb.numlab
+ $mb.numlab add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(numlab) -command GridApplyDialog
+ $mb.numlab add separator
+ $mb.numlab add cascade -label [msgcat::mc {Color}] \
+ -menu $mb.numlab.color
+ $mb.numlab add cascade -label [msgcat::mc {Font}] \
+ -menu $mb.numlab.font
+
+ ColorMenu $mb.numlab.color grid numlab,color GridApplyDialog
+ FontMenu $mb.numlab.font \
+ grid numlab,font numlab,size numlab,weight numlab,slant \
+ GridApplyDialog
+
+ # Labels
+ menu $mb.textlab
+ $mb.textlab add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(textlab) -command GridApplyDialog
+ $mb.textlab add separator
+ $mb.textlab add cascade -label [msgcat::mc {Color}] \
+ -menu $mb.textlab.color
+ $mb.textlab add cascade -label [msgcat::mc {Font}] \
+ -menu $mb.textlab.font
+
+ ColorMenu $mb.textlab.color grid textlab,color GridApplyDialog
+ FontMenu $mb.textlab.font \
+ grid textlab,font textlab,size textlab,weight textlab,slant \
+ GridApplyDialog
+
+ # Tickmarks
+ menu $mb.tick
+ $mb.tick add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(tick) -command GridApplyDialog
+ $mb.tick add separator
+ $mb.tick add cascade -label [msgcat::mc {Color}] \
+ -menu $mb.tick.color
+ $mb.tick add cascade -label [msgcat::mc {Line}] \
+ -menu $mb.tick.line
+
+ ColorMenu $mb.tick.color grid tick,color GridApplyDialog
+ GridCreateLineMenu $mb.tick.line tick,width tick,style
+
+ # Title
+ menu $mb.title
+ $mb.title add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(title) -command GridApplyDialog
+ $mb.title add separator
+ $mb.title add cascade -label [msgcat::mc {Color}] -menu $mb.title.color
+ $mb.title add cascade -label [msgcat::mc {Font}] -menu $mb.title.font
+
+ ColorMenu $mb.title.color grid title,color GridApplyDialog
+ FontMenu $mb.title.font \
+ grid title,font title,size title,weight title,slant \
+ GridApplyDialog
+
+ # Border
+ menu $mb.border
+ $mb.border add checkbutton -label [msgcat::mc {Show}] \
+ -variable grid(border) -command GridApplyDialog
+ $mb.border add separator
+ $mb.border add cascade -label [msgcat::mc {Color}] -menu $mb.border.color
+ $mb.border add cascade -label [msgcat::mc {Line}] -menu $mb.border.line
+
+ ColorMenu $mb.border.color grid border,color GridApplyDialog
+ GridCreateLineMenu $mb.border.line border,width border,style
+
+ # Labels
+ set f [ttk::labelframe $w.label -text [msgcat::mc {Labels}] -padding 2]
+ ttk::label $f.label -text [msgcat::mc {Title}]
+ ttk::entry $f.title -textvariable grid(title,text) \
+ -width 60
+ ttk::checkbutton $f.default -text [msgcat::mc {Default}] \
+ -variable grid(title,def) -command GridApplyDialog
+ ttk::label $f.label1 -text "[msgcat::mc {Axis}] 1"
+ ttk::entry $f.title1 -textvariable grid(textlab,text1) \
+ -width 60
+ ttk::checkbutton $f.default1 -text [msgcat::mc {Default}] \
+ -variable grid(textlab,def1) -command GridApplyDialog
+ ttk::label $f.label2 -text "[msgcat::mc {Axis}] 2"
+ ttk::entry $f.title2 -textvariable grid(textlab,text2) \
+ -width 60
+ ttk::checkbutton $f.default2 -text [msgcat::mc {Default}] \
+ -variable grid(textlab,def2) -command GridApplyDialog
+
+ grid $f.label $f.title $f.default -padx 2 -pady 2 -sticky ew
+ grid $f.label1 $f.title1 $f.default1 -padx 2 -pady 2 -sticky ew
+ grid $f.label2 $f.title2 $f.default2 -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 1 -weight 1
+
+ # Params
+ set f [ttk::labelframe $w.param -text [msgcat::mc {Spacing}] -padding 2]
+ ttk::label $f.lspace -text "[msgcat::mc {Label}] %"
+ ttk::label $f.ngap -text "[msgcat::mc {Numerics}] %"
+ ttk::label $f.lformat -text [msgcat::mc {Format}]
+ ttk::label $f.lgap -text [msgcat::mc {Grid Gap}]
+
+ ttk::label $f.titlet -text [msgcat::mc {Title}]
+ ttk::entry $f.spacet -textvariable grid(title,gap) \
+ -width 8
+
+ ttk::label $f.title1 -text "[msgcat::mc {Axis}] 1"
+ ttk::entry $f.tspace1 -textvariable grid(textlab,gap1) -width 8
+ ttk::entry $f.nspace1 -textvariable grid(numlab,gap1) -width 8
+ ttk::entry $f.format1 -textvariable grid(format1) -width 8
+ ttk::entry $f.gap1 -textvariable grid(grid,gap1) -width 8
+ ttk::label $f.gapunit1 -textvariable grid(grid,gapunit1)
+
+ ttk::label $f.title2 -text "[msgcat::mc {Axis}] 2"
+ ttk::entry $f.tspace2 -textvariable grid(textlab,gap2) -width 8
+ ttk::entry $f.nspace2 -textvariable grid(numlab,gap2) -width 8
+ ttk::entry $f.format2 -textvariable grid(format2) -width 8
+ ttk::entry $f.gap2 -textvariable grid(grid,gap2) -width 8
+ ttk::label $f.gapunit2 -textvariable grid(grid,gapunit2)
+
+ ttk::label $f.title3 -text "[msgcat::mc {Axis}] 3"
+ ttk::entry $f.nspace3 -textvariable grid(numlab,gap3) -width 8
+ ttk::entry $f.format3 -textvariable grid(format3) -width 8
+ ttk::entry $f.gap3 -textvariable grid(grid,gap3) -width 8
+ ttk::label $f.gapunit3 -textvariable grid(grid,gapunit3)
+
+ grid x $f.lspace $f.ngap $f.lformat $f.lgap -padx 2 -pady 2 -sticky w
+ grid $f.titlet $f.spacet -padx 2 -pady 2 -sticky w
+ grid $f.title1 $f.tspace1 $f.nspace1 $f.format1 $f.gap1 $f.gapunit1 \
+ -padx 2 -pady 2 -sticky w
+ grid $f.title2 $f.tspace2 $f.nspace2 $f.format2 $f.gap2 $f.gapunit2 \
+ -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command GridApplyDialog
+ ttk::button $f.reset -text [msgcat::mc {Reset}] -command GridResetDialog
+ ttk::button $f.clear -text [msgcat::mc {Clear}] -command GridClearDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command GridDestroyDialog
+ pack $f.apply $f.reset $f.clear $f.close -side left -expand true \
+ -padx 2 -pady 4
+
+ bind $w <Return> "GridApplyDialog"
+
+ # Fini
+ grid $w.label -sticky news
+ grid $w.param -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ # some window managers need a hint
+ raise $w
+
+ UpdateGridDialog
+}
+
+proc GridApplyDialog {} {
+ global grid
+
+ set grid(view) 1
+ GridUpdateCurrent
+}
+
+proc GridResetDialog {} {
+ GridDefault
+ GridUpdateCurrent
+}
+
+proc GridClearDialog {} {
+ global grid
+
+ set grid(view) 0
+ GridUpdateCurrent
+}
+
+proc GridDestroyDialog {} {
+ global igrid
+
+ if {[winfo exists $igrid(top)]} {
+ destroy $igrid(top)
+ destroy $igrid(mb)
+ }
+}
+
+proc UpdateGridMenu {} {
+ global grid
+ global current
+ global wcs
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateGridMenu"
+ }
+
+ if {($current(frame) == {})} {
+ return
+ }
+
+ # set menu
+ if {[$current(frame) has fits]} {
+ set grid(view) [$current(frame) has grid]
+ }
+
+ # reassign system and format
+ if {[$current(frame) has fits] && [$current(frame) has grid]} {
+ set ll [$current(frame) get grid]
+ set grid(system) [lindex $ll 0]
+ set grid(sky) [lindex $ll 1]
+ set grid(skyformat) [lindex $ll 2]
+ set grid(type) [lindex $ll 3]
+
+ # fix for grids create with old backup command
+ if {[$current(frame) get grid var] == {}} {
+ $current(frame) grid delete
+ $current(frame) grid create $grid(system) $grid(sky) \
+ $grid(skyformat) $grid(type) \
+ [GridBuildOptions $current(frame)] "\"[array get grid]\""
+ }
+ array set grid [$current(frame) get grid var]
+ } else {
+ # can be changed by wcs
+ SetCoordSystem grid system sky skyformat
+ }
+}
+
+proc UpdateGridDialog {} {
+ global current
+ global igrid
+ global grid
+
+ set mb $igrid(mb)
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateGridDialog"
+ }
+
+ GridAdjustOptions $current(frame)
+
+ if {[winfo exists $igrid(top)]} {
+ set f $igrid(top).label
+ set g $igrid(top).param
+
+ if {$current(frame) != {}} {
+ switch -- [$current(frame) get type] {
+ base -
+ rgb {
+ $mb entryconfig [msgcat::mc {Labels}] -state normal
+ $mb entryconfig [msgcat::mc {Title}] -state normal
+ $mb.type entryconfig [msgcat::mc {Interior Numerics}] \
+ -state normal
+ $mb.type entryconfig [msgcat::mc {Exterior Numerics}] \
+ -state normal
+ $mb.type entryconfig [msgcat::mc {Vertical Text}] \
+ -state normal
+ $mb.axes entryconfig [msgcat::mc {Origin}] \
+ -state disable
+
+ $f.label configure -state normal
+ $f.title configure -state normal
+ $f.default configure -state normal
+ $f.label1 configure -state normal
+ $f.title1 configure -state normal
+ $f.default1 configure -state normal
+ $f.label2 configure -state normal
+ $f.title2 configure -state normal
+ $f.default2 configure -state normal
+
+ $g.lspace configure -state normal
+ $g.spacet configure -state normal
+ $g.tspace1 configure -state normal
+ $g.tspace2 configure -state normal
+
+ grid forget $g.title3 $g.nspace3 $g.format3 $g.gap3 \
+ $g.gapunit3
+ }
+ 3d {
+ $mb entryconfig [msgcat::mc {Labels}] -state disabled
+ $mb entryconfig [msgcat::mc {Title}] -state disabled
+ $mb.type entryconfig [msgcat::mc {Interior Numerics}] \
+ -state disabled
+ $mb.type entryconfig [msgcat::mc {Exterior Numerics}] \
+ -state disabled
+ $mb.type entryconfig [msgcat::mc {Vertical Text}] \
+ -state disabled
+ $mb.axes entryconfig [msgcat::mc {Origin}] -state normal
+
+ $f.label configure -state disabled
+ $f.title configure -state disabled
+ $f.default configure -state disabled
+ $f.label1 configure -state disabled
+ $f.title1 configure -state disabled
+ $f.default1 configure -state disabled
+ $f.label2 configure -state disabled
+ $f.title2 configure -state disabled
+ $f.default2 configure -state disabled
+
+ $g.lspace configure -state disabled
+ $g.spacet configure -state disabled
+ $g.tspace1 configure -state disabled
+ $g.tspace2 configure -state disabled
+
+ grid $g.title3 x $g.nspace3 $g.format3 $g.gap3 $g.gapunit3 \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+
+ set grid(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ CoordMenuEnable $igrid(mb).coord grid system 1 sky skyformat
+ } else {
+ CoordMenuReset $igrid(mb).coord grid system 1 sky skyformat
+ }
+ }
+ }
+}
+
+proc GridCreateLineMenu {which width dash} {
+ global igrid
+ global grid
+
+ WidthDashMenu $which grid $width $dash GridApplyDialog GridApplyDialog
+}
+
+proc GridLoadDialog {} {
+ GridLoad [OpenFileDialog gridfbox]
+}
+
+proc GridLoad {filename} {
+ global grid
+
+ if {$filename != {}} {
+ source $filename
+ }
+
+ # backward compatibility
+ FixFontVar grid(numlab,weight) grid(numlab,slant) grid(numlab,style)
+ FixFontVar grid(textlab,weight) grid(textlab,slant) grid(textlab,style)
+ FixFontVar grid(title,weight) grid(title,slant) grid(title,style)
+
+ set grid(view) 1
+ GridUpdateCurrent
+}
+
+proc GridSaveDialog {} {
+ GridSave [SaveFileDialog gridfbox]
+}
+
+proc GridSave {filename} {
+ global grid
+
+ if {$filename != {}} {
+ set file [open $filename w]
+ puts $file "global grid"
+ puts $file "array set grid \{ [array get grid] \}"
+ close $file
+ }
+}
+
+proc GridStripComma {str} {
+ # strip ','
+ set t {}
+ regsub -all "," "$str" " " t
+ return $t
+}
+
+proc GridDefaultFormat1 {} {
+ global grid
+ global current
+
+ switch $grid(system) {
+ image -
+ physical -
+ detector -
+ amplifier {return {}}
+ default {
+ if {[$current(frame) has wcs equatorial $grid(system)]} {
+ switch $grid(sky) {
+ fk4 -
+ fk5 -
+ icrs {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {hms.1}}
+ hms {return {lhms.1}}
+ }
+ }
+ galactic -
+ ecliptic {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {dms.1}}
+ hms {return {ldms}}
+ }
+ }
+ }
+ return {}
+ }
+ if {[$current(frame) has wcs celestrial $grid(system)]} {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {dms.1}}
+ hms {return {ldms}}
+ }
+ return {}
+ }
+ }
+ }
+}
+
+proc GridDefaultFormat2 {} {
+ global grid
+ global current
+
+ switch $grid(system) {
+ image -
+ physical -
+ detector -
+ amplifier {return {}}
+ default {
+ if {[$current(frame) has wcs equatorial $grid(system)]} {
+ switch $grid(sky) {
+ fk4 -
+ fk5 -
+ icrs {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {dms.1}}
+ hms {return {ldms.1}}
+ }
+ }
+ galactic -
+ ecliptic {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {dms.1}}
+ hms {return {ldms}}
+ }
+ }
+ }
+ return {}
+ }
+ if {[$current(frame) has wcs celestrial $grid(system)]} {
+ switch $grid(skyformat) {
+ degrees {return {d.3}}
+ sexagesimal {return {dms.1}}
+ hms {return {ldms}}
+ }
+ return {}
+ }
+ }
+ }
+}
+
+proc GridBackup {ch which} {
+ global grid
+
+ if {[$which has grid]} {
+ set ll [$which get grid]
+ set system [lindex $ll 0]
+ set sky [lindex $ll 1]
+ set skyformat [lindex $ll 2]
+ set type [lindex $ll 3]
+ set opts [$which get grid option]
+ set vars [array get grid]
+
+ puts $ch "$which grid create $system $sky $skyformat $type \{\"$opts\"\} \{\"$vars\"\}"
+ }
+}
+
+# Process Cmds
+
+proc ProcessGridCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global grid
+ switch -- [string tolower [lindex $var $i]] {
+ open {GridDialog}
+ close {GridDestroyDialog}
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ set grid(view) [FromYesNo [lindex $var $i]]
+ GridUpdateCurrent
+ }
+
+ type {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ axes {
+ # backward compatible
+ incr i; set grid(axes,type) [lindex $var $i]
+ }
+ numerics {
+ # backward compatible
+ incr i; set grid(numlab,type) [lindex $var $i]
+ }
+ default {set grid(type) [lindex $var $i]}
+ }
+ GridUpdateCurrent
+ }
+
+ system {incr i; set grid(system) [lindex $var $i]; GridUpdateCurrent}
+ sky {incr i
+ set grid(sky) [string tolower [lindex $var $i]]
+ GridUpdateCurrent
+ }
+ skyformat {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ deg -
+ degree -
+ degrees {set grid(skyformat) degrees}
+ default {set grid(skyformat) [string tolower [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ grid {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ color {incr i; set grid(grid,color) [lindex $var $i]}
+ width {incr i; set grid(grid,width) [lindex $var $i]}
+ style {incr i; set grid(grid,style) [lindex $var $i]}
+ gap1 {incr i; set grid(grid,gap1) [lindex $var $i]}
+ gap2 {incr i; set grid(grid,gap2) [lindex $var $i]}
+ gap3 {incr i; set grid(grid,gap3) [lindex $var $i]}
+ default {set grid(grid) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ axes {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ color {incr i; set grid(axes,color) [lindex $var $i]}
+ width {incr i; set grid(axes,width) [lindex $var $i]}
+ style {incr i; set grid(axes,style) [lindex $var $i]}
+ type {incr i; set grid(axes,type) [lindex $var $i]}
+ origin {incr i; set grid(axes,origin) [lindex $var $i]}
+ default {set grid(axes) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ format1 {
+ incr i; set grid(format1) [lindex $var $i]
+ GridUpdateCurrent
+ }
+ format2 {
+ incr i; set grid(format2) [lindex $var $i]
+ GridUpdateCurrent
+ }
+
+ tickmark -
+ tickmarks -
+ tick {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ color {incr i; set grid(tick,color) [lindex $var $i]}
+ width {incr i; set grid(tick,width) [lindex $var $i]}
+ style {incr i; set grid(tick,style) [lindex $var $i]}
+ default {set grid(tick) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ border {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ color {incr i; set grid(border,color) [lindex $var $i]}
+ width {incr i; set grid(border,width) [lindex $var $i]}
+ style {incr i; set grid(border,style) [lindex $var $i]}
+ default {set grid(border) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ numeric -
+ numerics -
+ numlab {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ font {incr i; set grid(numlab,font) [lindex $var $i]}
+ fontsize {incr i; set grid(numlab,size) [lindex $var $i]}
+ fontweight {incr i; set grid(numlab,weight) [lindex $var $i]}
+ fontslant {incr i; set grid(numlab,slant) [lindex $var $i]}
+ fontstyle {
+ incr i
+ switch [lindex $var $i] {
+ normal {
+ set grid(numlab,weight) normal
+ set grid(numlab,slant) roman
+ }
+ bold {
+ set grid(numlab,weight) bold
+ set grid(numlab,slant) roman
+ }
+ italic {
+ set grid(numlab,weight) normal
+ set grid(numlab,slant) italic
+ }
+ }
+ }
+ color {incr i; set grid(numlab,color) [lindex $var $i]}
+ gap1 {incr i; set grid(numlab,gap1) [lindex $var $i]}
+ gap2 {incr i; set grid(numlab,gap2) [lindex $var $i]}
+ gap3 {incr i; set grid(numlab,gap3) [lindex $var $i]}
+ type {incr i; set grid(numlab,type) [lindex $var $i]}
+ vertical {incr i; set grid(numlab,vertical) [FromYesNo [lindex $var $i]]}
+ default {set grid(numlab) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ title {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ text {incr i; set grid(title,text) [lindex $var $i]}
+ def {incr i; set grid(title,def) [FromYesNo [lindex $var $i]]}
+ gap {incr i; set grid(title,gap) [lindex $var $i]}
+ font {incr i; set grid(title,font) [lindex $var $i]}
+ fontsize {incr i; set grid(title,size) [lindex $var $i]}
+ fontweight {incr i; set grid(title,weight) [lindex $var $i]}
+ fontslant {incr i; set grid(title,slant) [lindex $var $i]}
+ fontstyle {
+ incr i
+ switch [lindex $var $i] {
+ normal {
+ set grid(title,weight) normal
+ set grid(title,slant) roman
+ }
+ bold {
+ set grid(title,weight) bold
+ set grid(title,slant) roman
+ }
+ italic {
+ set grid(title,weight) normal
+ set grid(title,slant) italic
+ }
+ }
+ }
+ color {incr i; set grid(title,color) [lindex $var $i]}
+ default {set grid(title) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ label -
+ labels -
+ textlab {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ text1 {incr i; set grid(textlab,text1) [lindex $var $i]}
+ text2 {incr i; set grid(textlab,text2) [lindex $var $i]}
+ def1 {incr i; set grid(textlab,def1) [FromYesNo [lindex $var $i]]}
+ def2 {incr i; set grid(textlab,def2) [FromYesNo [lindex $var $i]]}
+ gap1 {incr i; set grid(textlab,gap1) [lindex $var $i]}
+ gap2 {incr i; set grid(textlab,gap2) [lindex $var $i]}
+ font {incr i; set grid(textlab,font) [lindex $var $i]}
+ fontsize {incr i; set grid(textlab,size) [lindex $var $i]}
+ fontweight {incr i; set grid(textlab,weight) [lindex $var $i]}
+ fontslant {incr i; set grid(textlab,slant) [lindex $var $i]}
+ fontstyle {
+ incr i
+ switch [lindex $var $i] {
+ normal {
+ set grid(textlab,weight) normal
+ set grid(textlab,slant) roman
+ }
+ bold {
+ set grid(textlab,weight) bold
+ set grid(textlab,slant) roman
+ }
+ italic {
+ set grid(textlab,weight) normal
+ set grid(textlab,slant) italic
+ }
+ }
+ }
+ color {incr i; set grid(textlab,color) [lindex $var $i]}
+ default {set grid(textlab) [FromYesNo [lindex $var $i]]}
+ }
+ GridUpdateCurrent
+ }
+
+ view {
+ # backward compatable
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ grid {incr i; set grid(grid) [FromYesNo [lindex $var $i]]}
+ axes {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ numbers {incr i; set grid(numlab) \
+ [FromYesNo [lindex $var $i]]}
+ tickmarks {incr i; set grid(tick) \
+ [FromYesNo [lindex $var $i]]}
+ label {incr i; set grid(textlab) \
+ [FromYesNo [lindex $var $i]]}
+ default {set grid(axes) [FromYesNo [lindex $var $i]]}
+ }
+ }
+ title {incr i; set grid(title) [FromYesNo [lindex $var $i]]}
+ border {incr i; set grid(border) [FromYesNo [lindex $var $i]]}
+ vertical {
+ incr i
+ set grid(numlab,vertical) [FromYesNo [lindex $var $i]]
+ }
+ }
+ GridUpdateCurrent
+ }
+
+ reset {GridResetDialog}
+ load {
+ incr i
+ set fn [lindex $var $i]
+ FileLast gridfbox $fn
+
+ GridLoad $fn
+ }
+ save {
+ incr i
+ set fn [lindex $var $i]
+ FileLast gridfbox $fn
+
+ GridSave $fn
+ }
+ default {
+ set grid(view) 1
+ GridUpdateCurrent
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendGridCmd {proc id param} {
+ global grid
+
+ switch -- [lindex $param 0] {
+ type {
+ switch -- [lindex $param 1] {
+ axes {
+ # backward compatible
+ $proc $id "$grid(axes,type)\n"
+ }
+ numerics {
+ # backward compatible
+ $proc $id "$grid(numlab,type)\n"
+ }
+ default {$proc $id "$grid(type)\n"}
+ }
+ }
+
+ system {$proc $id "$grid(system)\n"}
+ sky {$proc $id "$grid(sky)\n"}
+ skyformat {$proc $id "$grid(skyformat)\n"}
+
+ grid {
+ switch -- [lindex $param 1] {
+ color {$proc $id "$grid(grid,color)\n"}
+ width {$proc $id "$grid(grid,width)\n"}
+ style {$proc $id "$grid(grid,style)\n"}
+ gap1 {$proc $id "$grid(grid,gap1)\n"}
+ gap2 {$proc $id "$grid(grid,gap2)\n"}
+ gap3 {$proc $id "$grid(grid,gap3)\n"}
+ default {$proc $id [ToYesNo $grid(grid)]}
+ }
+ }
+
+ axes {
+ switch -- [lindex $param 1] {
+ color {$proc $id "$grid(axes,color)\n"}
+ width {$proc $id "$grid(axes,width)\n"}
+ style {$proc $id "$grid(axes,style)\n"}
+ type {$proc $id "$grid(axes,type)\n"}
+ origin {$proc $id "$grid(axes,origin)\n"}
+ default {$proc $id [ToYesNo $grid(axes)]}
+ }
+ }
+
+ format1 {$proc $id "$grid(format1)\n"}
+ format2 {$proc $id "$grid(format2)\n"}
+
+ tickmark -
+ tickmarks -
+ tick {
+ switch -- [lindex $param 1] {
+ color {$proc $id "$grid(tick,color)\n"}
+ width {$proc $id "$grid(tick,width)\n"}
+ style {$proc $id "$grid(tick,style)\n"}
+ default {$proc $id [ToYesNo $grid(tick)]}
+ }
+ }
+
+ border {
+ switch -- [lindex $param 1] {
+ color {$proc $id "$grid(border,color)\n"}
+ width {$proc $id "$grid(border,width)\n"}
+ style {$proc $id "$grid(border,style)\n"}
+ default {$proc $id [ToYesNo $grid(border)]}
+ }
+ }
+
+ numeric -
+ numerics -
+ numlab {
+ switch -- [lindex $param 1] {
+ font {$proc $id "$grid(numlab,font)\n"}
+ fontsize {$proc $id "$grid(numlab,size)\n"}
+ fontstyle -
+ fontweight {$proc $id "$grid(numlab,weight)\n"}
+ fontslant {$proc $id "$grid(numlab,slant)\n"}
+ color {$proc $id "$grid(numlab,color)\n"}
+ gap1 {$proc $id "$grid(numlab,gap1)\n"}
+ gap2 {$proc $id "$grid(numlab,gap2)\n"}
+ gap3 {$proc $id "$grid(numlab,gap3)\n"}
+ type {$proc $id "$grid(numlab,type)\n"}
+ vertical {$proc $id "$grid(numlab,vertical)\n"}
+ default {$proc $id [ToYesNo $grid(numlab)]}
+ }
+ }
+
+ title {
+ switch -- [lindex $param 1] {
+ text {$proc $id "$grid(title,text)\n"}
+ def {$proc $id [ToYesNo $grid(title,def)]}
+ gap {$proc $id "$grid(title,gap)\n"}
+ font {$proc $id "$grid(title,font)\n"}
+ fontsize {$proc $id "$grid(title,size)\n"}
+ fontstyle -
+ fontweight {$proc $id "$grid(title,weight)\n"}
+ fontslant {$proc $id "$grid(title,slant)\n"}
+ color {$proc $id "$grid(title,color)\n"}
+ default {$proc $id [ToYesNo $grid(title)]}
+ }
+ }
+
+ label -
+ labels -
+ textlab {
+ switch -- [lindex $param 1] {
+ text1 {$proc $id "$grid(textlab,text1)\n"}
+ text2 {$proc $id "$grid(textlab,text2)\n"}
+ def1 {$proc $id [ToYesNo $grid(textlab,def1)]}
+ def2 {$proc $id [ToYesNo $grid(textlab,def2)]}
+ gap1 {$proc $id "$grid(textlab,gap1)\n"}
+ gap2 {$proc $id "$grid(textlab,gap2)\n"}
+ font {$proc $id "$grid(textlab,font)\n"}
+ fontsize {$proc $id "$grid(textlab,size)\n"}
+ fontstyle -
+ fontweight {$proc $id "$grid(textlab,weight)\n"}
+ fontslant {$proc $id "$grid(textlab,slant)\n"}
+ color {$proc $id "$grid(textlab,color)\n"}
+ default {$proc $id [ToYesNo $grid(textlab)]}
+ }
+ }
+
+ view {
+ # backward compatible
+ switch -- [lindex $param 1] {
+ grid {$proc $id [ToYesNo $grid(grid)]}
+ axes {
+ switch -- [lindex $param 2] {
+ numbers {$proc $id [ToYesNo $grid(numlab)]}
+ tickmarks {$proc $id [ToYesNo $grid(tick)]}
+ label {$proc $id [ToYesNo $grid(textlab)]}
+ default {$proc $id [ToYesNo $grid(axes)]}
+ }
+ }
+ title {$proc $id [ToYesNo $grid(title)]}
+ border {$proc $id [ToYesNo $grid(border)]}
+ vertical {$proc $id [ToYesNo $grid(numlab,vertical)]}
+ }
+ }
+ default {$proc $id [ToYesNo $grid(view)]}
+ }
+}
diff --git a/ds9/library/group.tcl b/ds9/library/group.tcl
new file mode 100644
index 0000000..95bb524
--- /dev/null
+++ b/ds9/library/group.tcl
@@ -0,0 +1,208 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc GroupDef {} {
+ global igroup
+ global dgroup
+
+ set igroup(top) .grp
+ set igroup(mb) .grpmb
+
+ set dgroup(list) {}
+}
+
+proc GroupCreate {} {
+ global current
+
+ if {$current(frame) != {}} {
+ set name [$current(frame) get marker tag default name]
+ if {[EntryDialog [msgcat::mc {New Group}] [msgcat::mc {Enter Group Name}] 30 name]} {
+ $current(frame) marker tag "\{$name\}"
+ UpdateGroupDialog
+ }
+ }
+}
+
+proc GroupCreateSilent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ set name [$current(frame) get marker tag default name]
+ $current(frame) marker tag "\{$name\}"
+ UpdateGroupDialog
+ }
+}
+
+proc GroupDialog {} {
+ global ds9
+ global igroup
+ global dgroup
+
+ # see if we already have a window visible
+ if {[winfo exists $igroup(top)]} {
+ raise $igroup(top)
+ return
+ }
+
+ # create the window
+ set w $igroup(top)
+ set mb $igroup(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Groups}] GroupDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Update Group}] \
+ -command GroupUpdateDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {New Group}] \
+ -command GroupCreate
+ $mb.file add command -label [msgcat::mc {Edit Group Name}] \
+ -command GroupEditDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Delete Group}] \
+ -command GroupDeleteDialog
+ $mb.file add command -label [msgcat::mc {Delete All Groups}] \
+ -command GroupDeleteAllDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command GroupDestroyDialog
+
+ # List
+ set f [ttk::frame $w.param]
+
+ ttk::scrollbar $f.scroll -command [list $f.box yview] -orient vertical
+ set dgroup(list) [listbox $f.box \
+ -yscroll [list $f.scroll set] \
+ -setgrid true \
+ -selectmode multiple \
+ ]
+ grid $f.box $f.scroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ bind $dgroup(list) <<ListboxSelect>> GroupButtonDialog
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.update -text [msgcat::mc {Update}] \
+ -command GroupUpdateDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command GroupDestroyDialog
+ pack $f.update $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -fill both -expand true
+
+ UpdateGroupDialog
+}
+
+proc GroupButtonDialog {} {
+ global dgroup
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker unselect all
+ set rr [$dgroup(list) curselection]
+ foreach ii $rr {
+ if {[string length $ii] != 0} {
+ $current(frame) marker "\{[$dgroup(list) get $ii]\}" select
+ }
+ }
+ }
+}
+
+proc GroupDestroyDialog {} {
+ global igroup
+
+ if {[winfo exists $igroup(top)]} {
+ destroy $igroup(top)
+ destroy $igroup(mb)
+ }
+}
+
+proc GroupUpdateDialog {} {
+ global dgroup
+ global current
+
+ if {$current(frame) != {}} {
+ set ll [$dgroup(list) curselection]
+ if {[string length $ll] != 0} {
+ $current(frame) marker tag update "\{[$dgroup(list) get $ll]\}"
+ }
+ }
+}
+
+proc GroupEditDialog {} {
+ global dgroup
+ global current
+
+ if {$current(frame) != {}} {
+ set i [$dgroup(list) curselection]
+ if {[string length $i] != 0} {
+ set which [$dgroup(list) get $i]
+ if {[EntryDialog [msgcat::mc {Group Name}] [msgcat::mc {Enter Group Name}] 40 which]} {
+ $current(frame) marker tag edit "\{[$dgroup(list) get $i]\}" "\{$which\}"
+ UpdateGroupDialog
+ }
+ }
+ }
+}
+
+proc GroupDeleteDialog {} {
+ global dgroup
+ global current
+
+ if {$current(frame) != {}} {
+ set i [$dgroup(list) curselection]
+ if {[string length $i] != 0} {
+ set which [$dgroup(list) get $i]
+ $current(frame) marker tag delete "\{$which\}"
+ UpdateGroupDialog
+ }
+ }
+}
+
+proc GroupDeleteAllDialog {} {
+ global current
+ global pds9
+
+ if {$current(frame) != {}} {
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message \
+ [msgcat::mc {Delete All Groups?}]] != {ok}} {
+ return
+ }
+ }
+ $current(frame) marker tag delete all
+ UpdateGroupDialog
+ }
+}
+
+proc UpdateGroupDialog {} {
+ global igroup
+ global dgroup
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateGroupDialog"
+ }
+
+ if {[winfo exists $igroup(top)]} {
+ # clear the list
+ $dgroup(list) delete 0 end
+
+ if {$current(frame) != {}} {
+ set grps [lsort [$current(frame) get marker tag all]]
+ foreach f $grps {
+ $dgroup(list) insert end $f
+ }
+ }
+ }
+}
diff --git a/ds9/library/header.tcl b/ds9/library/header.tcl
new file mode 100644
index 0000000..e07b3d8
--- /dev/null
+++ b/ds9/library/header.tcl
@@ -0,0 +1,195 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc DisplayHeaderMenu {} {
+ global current
+
+ # possible cases
+ # image primary
+ # image xtension
+ # compressed primary
+ # compressed xtension
+ # bin table xtension
+ # hpx xtension
+ # cube primary
+ # cube xtension
+ # multiple xtension cube
+ # multiple file cube
+ # mosaic extension
+ # mosaic image xtension
+ # mosaic cube xtension
+ # mosaic image cube xtension
+
+ set cnt [$current(frame) get fits count]
+
+ if {$cnt > 0} {
+ set slb(count) 0
+
+ # check for primary
+ set fn [$current(frame) get fits file name 1]
+ set xten \
+ [string trim [$current(frame) get fits header 1 keyword {XTENSION}]]
+ if {$xten != {}} {
+ set bb [string first {[} $fn]
+ if {$bb>0} {
+ set pn [string range $fn 0 [expr $bb-1]]
+ } else {
+ set pn "primary"
+ }
+ incr slb(count)
+ set slb($slb(count),item) $pn
+ set slb($slb(count),value) -1
+ }
+
+ set last {}
+ for {set ii 1} {$ii <= $cnt} {incr ii} {
+ set fn [$current(frame) get fits file name $ii]
+ set bb [string first {[} $fn]
+ if {$bb<0} {
+ set nn [$current(frame) get fits ext $ii]
+ if {$nn > 0} {
+ set fn "$fn\[\]"
+ }
+ }
+
+ if {$fn != $last} {
+ incr slb(count)
+ set slb($slb(count),item) $fn
+ set slb($slb(count),value) $ii
+ set last $fn
+ }
+ }
+
+ if {$slb(count) <= 1} {
+ DisplayHeader $current(frame) 1 $fn
+ } else {
+ if {[SLBDialog slb {Select Header} 40]} {
+ DisplayHeader $current(frame) $slb(value) $slb(item)
+ }
+ }
+ }
+}
+
+proc DisplayHeader {frame id title} {
+ global current
+
+ set varname "hd-$frame-$id"
+ upvar #0 $varname var
+ global $varname
+
+ SimpleTextDialog $varname $title 80 40 insert top \
+ [$current(frame) get fits header $id]
+
+ # create a special text tag for keywords
+ $var(text) tag configure keyword -foreground blue
+
+ # color tag keywords
+ set stop [$var(text) index end]
+ for {set ii 1.0} {$ii<$stop} {set ii [expr $ii+1]} {
+ $var(text) tag add keyword $ii "$ii +8 chars"
+ }
+}
+
+proc UpdateHeaderDialog {} {
+ global current
+
+ set frame $current(frame)
+ set cnt 1
+ if {[$frame has fits mosaic]} {
+ set cnt [$frame get fits count]
+ }
+
+ for {set id 1} {$id <= $cnt} {incr id} {
+ set varname "hd-$frame-$id"
+ upvar #0 $varname var
+ global $varname
+ if {![info exists var(top)]} {
+ continue
+ }
+ if {![winfo exists $var(top)]} {
+ continue
+ }
+
+ $var(text) delete 1.0 end
+ $var(text) insert end [$frame get fits header $id]
+
+ # color tag keywords
+ set stop [$var(text) index end]
+ for {set ii 1.0} {$ii<$stop} {set ii [expr $ii+1]} {
+ $var(text) tag add keyword $ii "$ii +8 chars"
+ }
+ }
+}
+
+proc DestroyHeader {frame} {
+ set cnt 1
+ if {[$frame has fits mosaic]} {
+ set cnt [$frame get fits count]
+ }
+
+ for {set id 1} {$id <= $cnt} {incr id} {
+ set varname "hd-$frame-$id"
+ upvar #0 $varname var
+ global $varname
+
+ if {[info exists $varname]} {
+ if {[winfo exists $var(top)]} {
+ SimpleTextDestroy $varname
+ }
+ }
+ }
+}
+
+proc ProcessHeaderCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ close -
+ save {incr i}
+ }
+
+ if {[lindex $var $i] != {} && [string is integer [lindex $var $i]]} {
+ set jj [lindex $var $i]
+ incr i
+ } else {
+ set jj 1
+ }
+
+ global current
+ if {$current(frame) != {}} {
+ switch -- $item {
+ close {
+ set vvarname "hd[string range $current(frame) end end]-$jj"
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists vvar(top)]} {
+ SimpleTextDestroy $vvarname
+ }
+ incr i -1
+ }
+ save {
+ set fn [lindex $var $i]
+ if {$fn != {}} {
+ if {[catch {set ch [open "| cat > \"$fn\"" w]}]} {
+ Error [msgcat::mc {An error has occurred while saving}]
+ return
+ }
+ puts -nonewline $ch [$current(frame) get fits header $jj]
+ close $ch
+ }
+ }
+ default {
+ catch {DisplayHeader $current(frame) $jj \
+ [$current(frame) get fits file name $jj]}
+ incr i -1
+ }
+ }
+ }
+}
+
diff --git a/ds9/library/help.tcl b/ds9/library/help.tcl
new file mode 100644
index 0000000..8705678
--- /dev/null
+++ b/ds9/library/help.tcl
@@ -0,0 +1,85 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc HelpDef {} {
+ global help
+ global ds9
+
+ set help(refman) "$ds9(root)/doc/ref/index.html"
+ set help(command) "$ds9(root)/doc/ref/command.html"
+ set help(userman) "$ds9(root)/doc/user/index.html"
+ set help(keyboard) "$ds9(root)/doc/ref/keyboard.html"
+ set help(faq) "$ds9(root)/doc/faq.html"
+ set help(new) "$ds9(root)/doc/new.html"
+ set help(release) "$ds9(root)/doc/release/r7.0.html"
+ set help(helpdesk) "$ds9(root)/doc/helpdesk.html"
+ set help(story) "$ds9(root)/doc/story.html"
+ set help(ack) "$ds9(root)/doc/acknowledgment.html"
+ set help(vo) "$ds9(root)/doc/ref/vo.html"
+
+ set help(authors) "William Joye (Smithsonian Astrophysical Observatory)\nEric Mandel (Smithsonian Astrophysical Observatory)\nSteve Murray (Smithsonian Astrophysical Observatory)\n"
+ set help(about) "SAOImage DS9\nVersion $ds9(version)\n\nAuthors\n$help(authors)\nSAOImage DS9 development has been made possible by funding from NASA's Applied Information Systems Research Program, Chandra X-ray Science Center (CXC), and the High Energy Astrophysics Science Archive Center (HEASARC). Additional funding was provided by the JWST Mission office at Space Telescope Science Institute to improve capabilities for 3D data visualization.\n\nColormaps\nh5utils: Steven Johnson (MIT)\nViridis: Eric Firing (UW)\nCubehelix: Dave Green (Cavendish)\nGist: David Munro (LLNL)\nTopographic: Tom Patterson (US National Park Service) "
+}
+
+proc HelpRef {} {
+ global help
+ HV hlpref [msgcat::mc {Reference Manual}] $help(refman)
+}
+
+proc HelpCommand {} {
+ global help
+ HV hlpcmd [msgcat::mc {Command}] $help(command)
+}
+
+proc HelpUser {} {
+ global help
+ HV hlpuser [msgcat::mc {User Manual}] $help(userman)
+}
+
+proc HelpKeyboard {} {
+ global help
+ HV hlpkeyboard [msgcat::mc {Keyboard Shortcuts}] $help(keyboard)
+}
+
+proc HelpFAQ {} {
+ global help
+ HV hlpfaq [msgcat::mc {FAQ}] $help(faq)
+}
+
+proc HelpNew {} {
+ global help
+ HV hlpnew [msgcat::mc {New Features}] $help(new)
+}
+
+proc HelpRelease {} {
+ global help
+ HV hlprelease [msgcat::mc {Release Notes}] $help(release)
+}
+
+proc HelpDesk {} {
+ global help
+ HV hlpdsk [msgcat::mc {Help Desk}] $help(helpdesk)
+}
+
+proc HelpStory {} {
+ global help
+ HV hlpstory [msgcat::mc {Story of SAOImage DS9}] $help(story)
+}
+
+proc HelpAck {} {
+ global help
+ HV hlpack [msgcat::mc {Acknowledgment}] $help(ack)
+}
+
+proc HelpVO {} {
+ global help
+ HV hlvo [msgcat::mc {Virtual Observatory}] $help(vo)
+}
+
+proc ProcessSendAboutCmd {proc id param sock fn} {
+ global help
+ ProcessSend $proc $id $sock $fn {.txt} "$help(about)\n"
+}
diff --git a/ds9/library/htp.tcl b/ds9/library/htp.tcl
new file mode 100644
index 0000000..42fd919
--- /dev/null
+++ b/ds9/library/htp.tcl
@@ -0,0 +1,22 @@
+# Needed because some sites return 'x-fits' (CADC) in Content-Encoding
+proc http::ContentEncoding {token} {
+ upvar 0 $token state
+ set r {}
+ if {[info exists state(coding)]} {
+ foreach coding [split $state(coding) ,] {
+ switch -exact -- $coding {
+ deflate { lappend r inflate }
+ gzip - x-gzip { lappend r gunzip }
+ compress - x-compress { lappend r decompress }
+ identity {}
+ x-fits {}
+ default {
+# just do nothing
+# return -code error "unsupported content-encoding \"$coding\""
+ }
+ }
+ }
+ }
+ return $r
+}
+
diff --git a/ds9/library/http.tcl b/ds9/library/http.tcl
new file mode 100644
index 0000000..adb162c
--- /dev/null
+++ b/ds9/library/http.tcl
@@ -0,0 +1,54 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc HTTPDef {} {
+ global ihttp
+ global phttp
+
+ # 1 minute
+ set ihttp(timeout) 60000
+
+ # prefs only
+ set phttp(proxy) 0
+ set phttp(proxy,host) {}
+ set phttp(proxy,port) {}
+ set phttp(auth) 0
+ set phttp(auth,user) {}
+ set phttp(auth,passwd) {}
+}
+
+proc PrefsDialogHTTP {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {HTTP}]
+ lappend dprefs(tabs) [ttk::frame $w.http]
+
+ set f [ttk::labelframe $w.http.params -text [msgcat::mc {HTTP}]]
+
+ ttk::label $f.tproxy -text [msgcat::mc {Use Proxy}]
+ ttk::checkbutton $f.proxy -variable phttp(proxy)
+ ttk::label $f.thost -text [msgcat::mc {Proxy Host}]
+ ttk::entry $f.host -textvariable phttp(proxy,host) -width 50
+ ttk::label $f.tport -text [msgcat::mc {Proxy Port}]
+ ttk::entry $f.port -textvariable phttp(proxy,port) -width 10
+ ttk::label $f.tauth -text [msgcat::mc {Use Authentication}]
+ ttk::checkbutton $f.auth -variable phttp(auth)
+ ttk::label $f.tuser -text [msgcat::mc {Username}]
+ ttk::entry $f.user -textvariable phttp(auth,user) -width 30
+ ttk::label $f.tpasswd -text [msgcat::mc {Password}]
+ ttk::entry $f.passwd -textvariable phttp(auth,passwd) -show "*" -width 10
+
+ grid $f.tproxy $f.proxy -padx 2 -pady 2 -sticky w
+ grid $f.thost $f.host -padx 2 -pady 2 -sticky w
+ grid $f.tport $f.port -padx 2 -pady 2 -sticky w
+ grid $f.tauth $f.auth -padx 2 -pady 2 -sticky w
+ grid $f.tuser $f.user -padx 2 -pady 2 -sticky w
+ grid $f.tpasswd $f.passwd -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
diff --git a/ds9/library/hv.tcl b/ds9/library/hv.tcl
new file mode 100644
index 0000000..b4d5307
--- /dev/null
+++ b/ds9/library/hv.tcl
@@ -0,0 +1,931 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc HVDef {} {
+ global ihv
+
+ set ihv(unique) 0
+ set ihv(windows) {}
+}
+
+# Public
+
+proc HV {varname title url {init {}} {sync 0}} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global ihv
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HV $varname $title $url $init $sync"
+ }
+
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ set w $var(top)
+ set mb $var(mb)
+
+ # see if we already have a window visible
+
+ if {[winfo exists $w]} {
+ raise $w
+ } else {
+ # add it to our xpa list
+ lappend ihv(windows) $varname
+
+ set var(widget) {}
+ set var(status) {}
+ set var(sync) $sync
+ set var(frame) new
+ set var(save) 0
+ set var(title) "$title"
+ set var(copy) {}
+ set var(search) {}
+ set var(search,start) 0
+
+ set var(active) 0
+ set var(index) 0
+ set var(font) $ds9(times)
+ switch $ds9(wm) {
+ x11 {set var(font,size) 10}
+ aqua {set var(font,size) 16}
+ win32 {set var(font,size) 14}
+ }
+ set var(font,weight) normal
+ set var(font,slant) roman
+ set var(init) $init
+ set var(cookies) {}
+
+ set var(images,forward) ${varname}forward
+ set var(images,back) ${varname}back
+ set var(images,reload) ${varname}reload
+ set var(images,stop) ${varname}stop
+ set var(images,gray) ${varname}gray
+
+ # init some vars
+ HVClearAll $varname
+ set var(delete) 0
+
+ # create window
+ Toplevel $w $mb 7 $title "HVDestroy $varname"
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {View}] -menu $mb.view
+ $mb add cascade -label [msgcat::mc {Frame}] -menu $mb.frame
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Open URL}] \
+ -command "HVURLDialogCmd $varname"
+ $mb.file add command -label [msgcat::mc {Open File}] \
+ -command "HVFileDialogCmd $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command "HVClearCmd $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "HVDestroy $varname"
+
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -state disabled -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command "HVCopyCmd $varname" -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -state disabled -accelerator "${ds9(ctrl)}V"
+ $mb.edit add separator
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $mb.edit add command -label "[msgcat::mc {Find}]..." \
+ -command "HVFindCmd $varname" -accelerator "${ds9(ctrl)}F"
+ }
+ aqua {
+ # Known bug in Tk, can't have dialogs invoked by accelerator
+ $mb.edit add command -label "[msgcat::mc {Find}]..." \
+ -command "HVFindCmd $varname"
+ }
+ }
+ $mb.edit add command -label [msgcat::mc {Find Next}] \
+ -command "HVFindNextCmd $varname" -accelerator "${ds9(ctrl)}G"
+ $mb.edit add separator
+ $mb.edit add command -label [msgcat::mc {Clear Cache}] \
+ -command "HVClearCache $varname"
+
+ menu $mb.view
+ $mb.view add command -label [msgcat::mc {Back}] \
+ -command "HVBackCmd $varname"
+ $mb.view add command -label [msgcat::mc {Forward}] \
+ -command "HVForwardCmd $varname"
+ $mb.view add separator
+ $mb.view add command -label [msgcat::mc {Stop}] \
+ -command "HVStopCmd $varname"
+ $mb.view add command -label [msgcat::mc {Reload}] \
+ -command "HVReloadCmd $varname"
+ $mb.view add separator
+ $mb.view add command -label [msgcat::mc {Page Source}] \
+ -command "HVPageSourceCmd $varname"
+
+ menu $mb.frame
+ $mb.frame add checkbutton \
+ -label [msgcat::mc {Save Image on Download}] \
+ -variable ${varname}(save)
+ $mb.frame add separator
+ $mb.frame add radiobutton \
+ -label [msgcat::mc {Create New Frame on Download}] \
+ -variable ${varname}(frame) -value new
+ $mb.frame add radiobutton \
+ -label [msgcat::mc {Use Current Frame on Download}] \
+ -variable ${varname}(frame) -value current
+
+ image create photo $var(images,back) -data {R0lGODlhDwANAKL/AM///8DAwJD//y/I/y+X/y9n/wAAAAAAACH5BAEAAAEALAAAAAAPAA0AAAM0GLq2/qE0+AqYVFmB6eZFKEoRIAyCaaYCYWxDLM9uYBAxoe/7dA8ug3AoZOg6mRsyuUxmEgA7}
+ image create photo $var(images,forward) -data {R0lGODlhDwANAKL/AM///8DAwJD//y/I/y+X/y9n/wAAAAAAACH5BAEAAAEALAAAAAAPAA0AAAM3GLpa/K8YSMuYlBVwV/kgCAhdsAFoig7ktA1wLA9SQdw4DkuB4f8/Ag2TMRB4GYUBmewRm09FAgA7}
+ image create photo $var(images,stop) -data {R0lGODlhDQANALP/AP///1Lq81I5Of+EhCEAAHsAAMYAAP+UQv9zCHuMjP8AMf8AKf+MnK1CSv8QIQAAACH5BAEAAAEALAAAAAANAA0AAARWMMjUTC1J6ubOQYdiCBuIIMuiiCT1OWu6Ys05AMPC4ItBGB8dYMdI+RoHR4qY6v1CwlvRcEQ4brndwFAgJAwIRdPIzVTEYiqXJBEU1FQCW5Mg2O0ZSQQAOw==}
+ image create photo $var(images,reload) -data {R0lGODlhDAANALP/AP///zk5OVJSUoSEhKWlpcDAwP//1v//xr3erZTOezGcEFKtSimce3NzezkxOQAAACH5BAEAAAUALAAAAAAMAA0AAARRcJBJyRilEMC5AcjQaB1wHMYkCFuXLKDQONsBLIuynEBAGAcJAnYy0AyGBOLENPg4qGUISTMdEIoEg4A6ohK6BND4YyqBqCdyve453vB44BEBADs=}
+
+ image create photo $var(images,gray) -data {R0lGODdhPAA+APAAALi4uAAAACwAAAAAPAA+AAACQISPqcvtD6OctNqLs968+w+G4kiW5omm6sq27gvH8kzX9o3n+s73/g8MCofEovGITCqXzKbzCY1Kp9Sq9YrNFgsAO}
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.back -image $var(images,back) -takefocus 0 \
+ -command "HVBackCmd $varname"
+ ttk::button $f.forward -image $var(images,forward) -takefocus 0 \
+ -command "HVForwardCmd $varname"
+ ttk::button $f.stop -image $var(images,stop) -takefocus 0 \
+ -command "HVStopCmd $varname"
+ ttk::button $f.reload -image $var(images,reload) -takefocus 0 \
+ -command "HVReloadCmd $varname"
+ pack $f.back $f.forward $f.stop $f.reload -side left
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ set var(widget) [html $f.html \
+ -yscrollcommand "$f.yscroll set" \
+ -xscrollcommand "$f.xscroll set" \
+ -padx 5 \
+ -pady 9 \
+ -formcommand "HVFormCB $varname" \
+ -imagecommand "HVImageCB $varname" \
+ -scriptcommand "HVScriptCB $varname"\
+ -appletcommand "HVAppletCB $varname" \
+ -framecommand "HVFrameCB $varname" \
+ -underlinehyperlinks 1 \
+ -bg white \
+ -width 640 \
+ -height 512 \
+ -fontcommand "HVFontCB $varname" \
+ -tablerelief raised \
+ ]
+
+ $var(widget) token handler {NOSCRIPT} "HVNoScriptCB $varname"
+ $var(widget) token handler {/NOSCRIPT} "HVNoScriptCB $varname"
+
+ ttk::scrollbar $f.yscroll -orient vertical \
+ -command "$f.html yview"
+ ttk::scrollbar $f.xscroll -orient horizontal \
+ -command "$f.html xview"
+
+ grid $f.html $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ bind $var(widget).x <Motion> "HVMotion $varname %x %y"
+ bind $var(widget).x <Button-1> "HVButton1 $varname %x %y"
+ bind $var(widget).x <B1-Motion> "HVMotion1 $varname %x %y"
+ bind $var(widget).x <ButtonRelease-1> "HVRelease1 $varname %x %y"
+
+ bind $w <Up> "$f.html yview scroll -1 units"
+ bind $w <Down> "$f.html yview scroll 1 units"
+ bind $w <Right> "$f.html xview scroll 1 units"
+ bind $w <Left> "$f.html xview scroll -1 units"
+ bind $w <<Copy>> "HVCopyCmd $varname"
+ switch $ds9(wm) {
+ x11 {
+ bind $w <Button-4> "HVMouseWheel $varname 1"
+ bind $w <Button-5> "HVMouseWheel $varname -1"
+ bind $w <<Find>> [list HVFindCmd $varname]
+ }
+ aqua {
+ bind $w <MouseWheel> "HVMouseWheel $varname %D"
+ # Known bug in Tk, can't have dialogs invoked by accelerator
+ }
+ win32 {
+ bind $w <MouseWheel> "HVMouseWheel $varname %D"
+ bind $w <<Find>> [list HVFindCmd $varname]
+ }
+ }
+ bind $w <<FindNext>> [list HVFindNextCmd $varname]
+
+ # Status
+ set f [ttk::frame $w.status]
+ ttk::label $f.status -textvariable ${varname}(status) \
+ -width 120 -anchor w
+ pack $f.status -side left
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.status $w.sep -side bottom -fill x
+ pack $w.buttons -side top -fill x
+ pack $w.param -side top -fill both -expand true
+
+ # we have a problem with the html widget. first time thur, some
+ # structures are not allocated/initialized. if we first display
+ # a blank page, all seems ok
+ $var(widget) clear
+ $var(widget) parse "<html>\n<body>\n<form method=\"get\" action=\"foo\">\n</form>\n</body>\n</html>"
+
+ global debug
+ if {$debug(tcl,idletasks)} {
+ puts stderr "HV"
+ }
+ update idletasks
+ }
+
+ selection handle $w [list HVExportSelection $varname]
+
+ if {$url != {}} {
+ # no need to resolve
+ HVLoadURL $varname $url {} $var(sync)
+ }
+}
+
+# Bindings
+
+proc HVMotion {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ set url [$var(widget) href $x $y]
+
+ if {[string length $url] > 0} {
+ switch $ds9(wm) {
+ x11 -
+ win32 {$var(widget) configure -cursor hand2}
+ aqua {$var(widget) configure -cursor pointinghand}
+ }
+ } else {
+ $var(widget) configure -cursor {}
+ }
+
+ HVStatus $varname $url
+}
+
+proc HVButton1 {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVButton1"
+ }
+
+ $var(widget) selection clear
+ set var(sel,x) -1
+ set var(sel,y) -1
+
+ HVClearIndex $varname $var(index)
+
+ set url [$var(widget) href $x $y]
+ if {[string length $url] != 0} {
+ HVResolveURL $varname $url
+ } else {
+ set var(sel,x) $x
+ set var(sel,y) $y
+ }
+}
+
+proc HVMotion1 {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVMotion1"
+ }
+
+ if {$var(sel,x) != -1 && $var(sel,y) != -1} {
+ $var(widget) selection set @$var(sel,x),$var(sel,y) @$x,$y
+ }
+}
+
+proc HVRelease1 {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVRelease1"
+ }
+
+ if {$var(sel,x) != -1 && $var(sel,y) != -1} {
+ set var(copy) [$var(widget) text ascii @$var(sel,x),$var(sel,y) @$x,$y]
+ selection own -command [list HVLostSelection $varname] $var(top)
+ }
+}
+
+proc HVMouseWheel {varname cnt} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVMouseWheel"
+ }
+
+ $var(widget) yview scroll [expr -$cnt] units
+}
+
+# Commands
+
+proc HVClearCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # clear the widge and all images
+ $var(widget) clear
+
+ HVClearCache $varname
+ HVClearAll $varname
+}
+
+proc HVCopyCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ clipboard clear -displayof $var(top)
+ clipboard append -displayof $var(top) $var(copy)
+}
+
+proc HVExportSelection {varname offset bytes} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(copy) != {}} {
+ return [string range $var(copy) $offset [expr $offset+$bytes]]
+ }
+}
+
+proc HVLostSelection {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(widget) selection clear
+ set var(copy) {}
+}
+
+proc HVURLDialogCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+
+ set url "$var(url)"
+ if {[EntryDialog [msgcat::mc {URL}] [msgcat::mc {Enter URL}] 80 url]} {
+ if {[string length $url] == 0} {
+ return
+ }
+
+ ParseURL $url r
+ switch -- $r(scheme) {
+ {} {
+ # append 'http://' if needed
+ if {[string range $r(path) 0 0] == "/"} {
+ set url "http:/$url"
+ } else {
+ set url "http://$url"
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVURLDialogCmd new $url"
+ }
+ }
+ }
+
+ # clear the base
+ $var(widget) config -base {}
+
+ HVClearIndex $varname 0
+ HVClearAll $varname
+ # no need to resolve
+ HVLoadURL $varname $url {}
+ }
+}
+
+proc HVFileDialogCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+
+ set fn [OpenFileDialog hvhtmlfbox]
+ if {"$fn" != {}} {
+ HVFileDialog $varname "$fn"
+ }
+}
+
+proc HVFileDialog {varname fn} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+
+ # clear the base
+ $var(widget) config -base {}
+
+ HVClearIndex $varname 0
+ HVClearAll $varname
+ # no need to resolve
+ HVLoadURL $varname "$fn" {}
+}
+
+proc HVBackCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVBackCmd index $var(index)"
+ }
+
+ incr ${varname}(index) -1
+ if {[info exists ${varname}(index,$var(index))]} {
+ set url [lindex $var(index,$var(index)) 0]
+ set query [lindex $var(index,$var(index)) 1]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVBackCmd :$var(index):$url:$query:"
+ }
+ # clear the base
+ $var(widget) config -base {}
+
+ # HVGotoHTML will incr the index again
+ incr ${varname}(index) -1
+ # no need to resolve
+ HVLoadURL $varname $url $query $var(sync)
+ } else {
+ incr ${varname}(index)
+ }
+}
+
+proc HVFind {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set toks [$var(widget) token list 1.0 end]
+
+ set aa -1
+ set bb 0
+ set cc -1
+ set dd 0
+ set id -1
+ set ss $var(search,start)
+
+ while {$ss<[llength $toks] && $cc==-1} {
+ set pat [lindex $var(search) 0]
+ set id [lsearch -glob -start $ss $toks "Text *$pat*"]
+
+ if {$id != -1} {
+ set ok 1
+
+ set aa $id
+ set ss $id
+ set tt [string first $pat [lindex [lindex $toks $aa] 1]]
+ if {$tt != -1} {
+ set bb $tt
+ }
+
+ for {set ii 1} {$ii<[llength $var(search)]} {incr ii} {
+ set pat [lindex $var(search) $ii]
+ set str [lindex [lindex $toks [expr $id+$ii*2]] 1]
+ if {[string compare -length [string length $pat] $pat $str]} {
+ incr ss
+ set ok 0
+ break
+ }
+ }
+
+ if {$ok} {
+ set cc [expr $aa+([llength $var(search)]-1)*2]
+ set tt [string last $pat [lindex [lindex $toks $cc] 1]]
+ if {$tt != -1} {
+ set dd [expr $tt+[string length $pat]]
+ }
+ }
+ } else {
+ break
+ }
+ }
+
+ if {$aa == -1 || $cc == -1} {
+ return 0
+ } else {
+ set var(search,start) [expr $cc+1]
+ $var(widget) selection set "[expr $aa+1].$bb" "[expr $cc+1].$dd"
+ $var(widget) yview text "[expr $aa+1].$bb"
+ return 1
+ }
+}
+
+proc HVFindCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set result "$var(search)"
+ if {[EntryDialog [msgcat::mc {Search}] [msgcat::mc {Enter Search Expression}] 40 result]} {
+ set var(search) "$result"
+ set var(search,start) 0
+ $var(widget) selection clear
+
+ if {![HVFind $varname]} {
+ Error "$var(search) [msgcat::mc {Not Found}]"
+ }
+ }
+}
+
+proc HVFindNextCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(search,start) == 0} {
+ HVFindCmd $varname
+ } else {
+ if {![HVFind $varname]} {
+ # wrap
+ set var(search,start) 0
+ if {![HVFind $varname]} {
+ Error "$var(search) [msgcat::mc {Not Found}]"
+ }
+ }
+ }
+}
+
+proc HVForwardCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVForwardCmd $var(index)"
+ }
+
+ incr ${varname}(index)
+ if {[info exists ${varname}(index,$var(index))]} {
+ set url [lindex $var(index,$var(index)) 0]
+ set query [lindex $var(index,$var(index)) 1]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVForwardCmd :$var(index):$url:$query:"
+ }
+ # clear the base
+ $var(widget) config -base {}
+
+ # HVGotoHTML will incr the index again
+ incr ${varname}(index) -1
+ # no need to resolve
+ HVLoadURL $varname $url $query $var(sync)
+ } else {
+ incr ${varname}(index) -1
+ }
+}
+
+proc HVGotoCmd {varname nn} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVGotoCmd $nn"
+ }
+
+ set var(index) $nn
+ if {[info exists ${varname}(index,$var(index))]} {
+ set url [lindex $var(index,$var(index)) 0]
+ set query [lindex $var(index,$var(index)) 1]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVGotoCmd :$var(index):$url:$query:"
+ }
+ # clear the base
+ $var(widget) config -base {}
+
+ # HVGotoHTML will incr the index again
+ incr ${varname}(index) -1
+ # no need to resolve
+ HVLoadURL $varname $url $query $var(sync)
+ } else {
+ incr ${varname}(index)
+ }
+}
+
+proc HVReloadCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVReloadCmd"
+ }
+
+ # clear the base
+ $var(widget) config -base {}
+
+ # HVGotoHTML will incr the index again
+ incr ${varname}(index) -1
+ # no need to resolve
+ HVLoadURL $varname $var(url) $var(query) $var(sync)
+}
+
+proc HVStopCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "\n*** HVStopCmd ***\n"
+ }
+
+ HVCancel $varname
+}
+
+proc HVPageSourceCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVPageSourceCmd"
+ }
+
+ SimpleTextDialog ${varname}txt $var(url) 80 20 insert top $var(data)
+}
+
+proc HVArchUserCmd {varname title url} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVArchUserCmd"
+ }
+
+ if {[string length $url] == 0} {
+ return
+ }
+
+ ParseURL $url r
+ switch -- $r(scheme) {
+ {} {
+ # append 'http://' if needed
+ if {[string range $r(path) 0 0] == "/"} {
+ set url "http:/$url"
+ } else {
+ set url "http://$url"
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVArchUserCmd new $url"
+ }
+ }
+ }
+ HV $varname $title $url
+}
+
+proc HVAnalysisCmd {varname title url sync} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVAnalysisCmd $varname $title $url $sync"
+ }
+
+ if {[string length $url] == 0} {
+ HV $varname "$title" {} {} $sync
+ } else {
+ ParseURL $url r
+ switch -- $r(scheme) {
+ {} {
+ # append 'http://' if needed
+ if {[string range $r(path) 0 0] == "/"} {
+ set url "http:/$url"
+ } else {
+ set url "http://$url"
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVAnalysisCmd new $url"
+ }
+ }
+ }
+ HV $varname "$title" $url {} $sync
+ }
+}
+
+proc HVAnalysisURL {which i url sync} {
+ set varname "at${which}${i}"
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVAnalysisURL $which $i $url"
+ }
+
+ set ${varname}(cookies) {}
+ set ${varname}(sync) $sync
+ HVClearAll $varname
+ HVSetAnalysis $varname 1 $which $i
+ HVLoadURL $varname $url {} $sync
+}
+
+proc HVAnalysisCancel {which i} {
+ set varname "at${which}${i}"
+ global $varname
+
+ HVCancel $varname
+}
+
+# Archive Servers
+
+proc HVArchChandraChaser {} {
+ global current
+
+ set coord {}
+ if {$current(frame) != {}} {
+ if {[$current(frame) has wcs equatorial wcs]} {
+ set coord [$current(frame) get fits center wcs fk5 degrees]
+ set size \
+ [expr [lindex [$current(frame) get fits size wcs fk5 arcmin] 0]/2.]
+ }
+ }
+
+ set l {}
+ if {[string length $coord] != 0} {
+ lappend l "1 lon [lindex $coord 0]"
+ lappend l "1 lat [lindex $coord 1]"
+ lappend l "1 radius $size"
+ }
+
+ global hvchandrachaser
+ HV hvchandrachaser {Chandra Chaser} http://cda.harvard.edu/chaser/mainEntry.do $l
+}
+
+proc HVArchChandraPop {} {
+ global current
+
+ set coord {}
+ if {$current(frame) != {}} {
+ if {[$current(frame) has wcs equatorial wcs]} {
+ set coord [$current(frame) get fits center wcs fk5 degrees]
+ set size \
+ [expr [lindex [$current(frame) get fits size wcs fk5 arcmin] 0]/2.]
+ }
+ }
+
+ set l {}
+ if {[string length $coord] != 0} {
+ lappend l "1 lon [lindex $coord 0]"
+ lappend l "1 lat [lindex $coord 1]"
+ lappend l "1 radius $size"
+ lappend l "1 searchBy position"
+ }
+
+ global hvchandrapop
+ HV hvchandrapop {Chandra Popular} http://cda.harvard.edu/pop/mainEntry.do $l
+}
+
+proc HVArchChandraFTP {} {
+ global current
+
+ set ra {}
+ set dec {}
+ set wid {}
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has wcs equatorial wcs]} {
+ set coord [$current(frame) get fits center wcs fk5 sexagesimal]
+ set ra [lindex $coord 0]
+ set dec [lindex $coord 1]
+
+ set wid [lindex [$current(frame) get fits size wcs fk5 degrees] 0]
+ }
+ }
+
+ set l {}
+ if {[string length $ra] != 0} {
+ lappend l "1 ra \{$ra\}"
+ lappend l "1 dec \{$dec\}"
+ lappend l "1 wid \{$wid\}"
+ }
+
+ global hvchandraftp
+ HV hvchandraftp {Chandra FTP} \
+ http://www.cfa.harvard.edu/archive/chandra/search $l
+}
+
+# Other
+
+# Process Cmds
+
+proc ProcessWebCmd {varname iname} {
+ global ihv
+
+ set w {hvweb}
+
+ upvar $varname var
+ upvar $iname i
+
+ # determine which web browser window
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ set ii [lsearch $ihv(windows) $w]
+ if {$ii>=0} {
+ append w $ihv(unique)
+ incr ihv(unique)
+ }
+ }
+ close -
+ clear -
+ click {set w [lindex $ihv(windows) end]}
+
+ default {
+ set ii [lsearch $ihv(windows) [lindex $var $i]]
+ if {$ii>=0} {
+ set w [lindex $var $i]
+ incr i
+ }
+ }
+ }
+
+ switch -- [string tolower [lindex $var $i]] {
+ close {HVDestroy $w}
+ clear {HVClearCmd $w}
+ click {
+ set vvarname $w
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ back {HVBackCmd $vvarname}
+ forward {HVForwardCmd $vvarname}
+ stop {HVStopCmd $vvarname}
+ reload {HVReloadCmd $vvarname}
+ default {
+ set id [lindex $var $i]
+
+ if {![info exists vvar(widget)]} {
+ return
+ }
+
+ set tokens [$vvar(widget) token list 1.0 end]
+ set cnt 0
+ for {set ii 0} {$ii<[llength $tokens]} {incr ii} {
+ set tok [lindex $tokens $ii]
+ if {[string tolower [lindex $tok 0]] == "markup" &&
+ [string tolower [lindex $tok 2]] == "href"} {
+ set url [lindex $tok 3]
+ incr cnt
+ if {$cnt == $id} {
+ HVResolveURL $vvarname [$vvar(widget) resolve $url]
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ default {
+ set url [lindex $var $i]
+ if {[string length $url] == 0} {
+ HV $w Web {} {} 1
+ } else {
+ ParseURL $url r
+ switch -- $r(scheme) {
+ {} {
+ # append 'http://' if needed
+ if {[string range $r(path) 0 0] == "/"} {
+ set url "http:/$url"
+ } else {
+ set url "http://$url"
+ }
+ }
+ }
+ HV $w Web $url {} 1
+ }
+ }
+ }
+}
+
+proc ProcessSendWebCmd {proc id param} {
+ global ihv
+ $proc $id "$ihv(windows)\n"
+}
+
diff --git a/ds9/library/hvform.tcl b/ds9/library/hvform.tcl
new file mode 100644
index 0000000..b7109cf
--- /dev/null
+++ b/ds9/library/hvform.tcl
@@ -0,0 +1,525 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc HVFormCB {varname n cmd args} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormCB $varname $n $cmd $args"
+ }
+
+ switch -- [string tolower $cmd] {
+ form {HVFormForm $varname $n args}
+ flush {HVFormFlush $varname $n args}
+ input {HVFormInput $varname $n args}
+ select {HVFormSelect $varname $n args}
+ textarea {HVFormTextArea $varname $n args}
+ }
+}
+
+proc HVFormForm {varname n a} {
+ upvar #0 $varname var
+ global $varname
+ upvar $a args
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormForm $n $args"
+ }
+
+ # try to clean up lose vars from previous forms
+ HVFormFlush $varname $n {}
+
+ set aa [lindex $args 2]
+ set var(form,$n,action) [lindex $args 0]
+ set var(form,$n,method) [HVattrs method $aa get]
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormForm method $var(form,$n,method)"
+ puts stderr "HVFormForm action $var(form,$n,action)"
+ }
+}
+
+proc HVFormFlush {varname n a} {
+ upvar #0 $varname var
+ global $varname
+ upvar $a args
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormFlush $n"
+ }
+
+ # unset all var(form,$n,*)
+ foreach x [array names $varname "form,$n,*"] {
+ unset ${varname}($x)
+ }
+
+ bind $var(top) <Return> {}
+}
+
+proc HVFormInput {varname n a} {
+ upvar #0 $varname var
+ global $varname
+ upvar $a args
+
+ global debug
+
+ set path [lindex $args 0]
+ set attrs [lindex $args 1]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormInput $n $path $attrs"
+ }
+
+ set id [lindex [split $path .] end]
+ set type [HVattrs type $attrs {}]
+ set disabled [HVattrs disabled $attrs normal]
+ set readonly [HVattrs readonly $attrs normal]
+
+ switch -- [string tolower $type] {
+ checkbox {
+ set name [HVattrs name $attrs var]
+ set value [HVattrs value $attrs on]
+ set checked [HVattrs checked $attrs nochecked]
+
+ set var(form,$n,name,$id) $name
+ if {$checked != "nochecked"} {
+ set var(form,$n,var,$id) $value
+ } else {
+ set var(form,$n,var,$id) {}
+ }
+ set var(form,$n,init,$id) $$var(form,$n,var,$id)
+
+ ttk::checkbutton $path -variable ${varname}(form,$n,var,$id) \
+ -onvalue $value -offvalue {} -state $disabled
+ }
+ radio {
+ set name [HVattrs name $attrs var]
+ # we need this so that all share the same variable
+ set id $name
+ set value [HVattrs value $attrs on]
+ set checked [HVattrs checked $attrs nochecked]
+
+ set var(form,$n,name,$id) $name
+ if {$checked != "nochecked"} {
+ set var(form,$n,var,$id) $value
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+ }
+
+ # override init value
+ foreach f $var(init) {
+ if {$n == [lindex $f 0] &&
+ $name == [lindex $f 1] &&
+ $value == [lindex $f 2]} {
+
+ set var(form,$n,var,$id) $value
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+ }
+ }
+
+ ttk::radiobutton $path -variable ${varname}(form,$n,var,$id) \
+ -value $value -state $disabled
+ }
+ button {
+ set name [HVattrs name $attrs submit]
+ set value [HVattrs value $attrs "Submit"]
+
+ ttk::button $path -text $value \
+ -command "HVSubmitForm $varname $n \{$name\} \{$value\}"
+ }
+ submit {
+ set name [HVattrs name $attrs submit]
+ set value [HVattrs value $attrs "Submit"]
+
+ ttk::button $path -text $value \
+ -command "HVSubmitForm $varname $n \{$name\} \{$value\}"
+
+ bind $var(top) <Return> \
+ "HVSubmitForm $varname $n \{$name\} \{$value\}"
+ }
+ reset {
+ set name [HVattrs name $attrs reset]
+ set value [HVattrs value $attrs "Reset"]
+
+ ttk::button $path -text $value -command "HVResetForm $varname $n"
+ }
+ image {
+ set name [HVattrs name $attrs submit]
+ set value [HVattrs value $attrs "Submit"]
+ set src [HVattrs src $attrs {}]
+
+ set img [HVImageCB $varname [$var(widget) resolve $src]]
+ if {$img != "$var(images,gray)"} {
+ ttk::button $path -image $img \
+ -command "HVSubmitForm $varname $n \{$name\} \{$value\}"
+ } else {
+ ttk::button $path -text $value -state $disabled \
+ -command "HVSubmitForm $varname $n \{$name\} \{$value\}"
+ }
+ return
+ }
+ hidden {
+ set name [HVattrs name $attrs var]
+ set value [HVattrs value $attrs {}]
+
+ set var(form,$n,name,$id) $name
+ set var(form,$n,var,$id) $value
+ }
+ password {
+ set name [HVattrs name $attrs var]
+ set value [HVattrs value $attrs {}]
+ set size [HVattrs size $attrs 20]
+
+ set var(form,$n,name,$id) $name
+ set var(form,$n,var,$id) $value
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+
+ ttk::entry $path -textvariable ${varname}(form,$n,var,$id) \
+ -width $size -show "*" -state $readonly
+ }
+ file {
+ set name [HVattrs name $attrs var]
+ set value [HVattrs value $attrs {}]
+ set size [HVattrs size $attrs 20]
+
+ set var(form,$n,name,$id) $name
+ set var(form,$n,var,$id) [HVInitVar $varname $n $name $value]
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+
+ ttk::entry $path -textvariable ${varname}(form,$n,var,$id) \
+ -width $size -state $readonly
+ }
+ text -
+ default {
+ set name [HVattrs name $attrs var]
+ set value [HVattrs value $attrs {}]
+ set size [HVattrs size $attrs 20]
+
+ set var(form,$n,name,$id) $name
+ set var(form,$n,var,$id) [HVInitVar $varname $n $name $value]
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+
+ ttk::entry $path -textvariable ${varname}(form,$n,var,$id) \
+ -width $size -state $readonly
+ }
+ }
+}
+
+proc HVFormSelect {varname n a} {
+ upvar #0 $varname var
+ global $varname
+ upvar $a args
+
+ global ds9
+ global debug
+
+ set path [lindex $args 0]
+ set attrs [lindex $args 1]
+ set choices [lindex $args 2]
+ set initial [lindex $args 3]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormSelect :$n:$path:$attrs:$choices:$initial:"
+ }
+
+ set id [lindex [split $path .] end]
+ set name [HVattrs name $attrs var]
+
+ set size [HVattrs size $attrs 0]
+ set multiple [HVattrs multiple $attrs single]
+ if {[string length $multiple] == 0} {
+ set multiple multiple
+ }
+
+ switch -- $multiple {
+ single {
+ set var(form,$n,name,$id) $name
+
+ ttk::menubutton $path -textvariable ${varname}(form,$n,single,$id) \
+ -menu $path.m
+ menu $path.m -tearoff 0
+
+ set l 0
+ set first 1
+ foreach f $choices {
+ set i [lindex $f 0]
+ set v [lindex $f 1]
+ set m [lindex $f 2]
+ if {[string length $v] == 0} {
+ set v $m
+ }
+
+ if {$i || $first} {
+ set var(form,$n,var,$id) $v
+ set var(form,$n,init,$id) $v
+ set var(form,$n,single,$id) $m
+ set var(form,$n,singleinit,$id) $m
+ set first 0
+ }
+
+ if {[string length $m]>$l} {
+ set l [string length $m]
+ }
+ $path.m add command -label $m -command \
+ "upvar #0 $varname var; set var(form,$n,var,$id) \"$v\"; set var(form,$n,single,$id) \"$m\""
+ }
+
+ # override init value
+ foreach f $var(init) {
+ if {$n == [lindex $f 0] && $name == [lindex $f 1]} {
+ set v [lindex $f 2]
+ set m [lindex $f 3]
+
+ set var(form,$n,var,$id) $v
+ set var(form,$n,init,$id) $v
+ set var(form,$n,single,$id) $m
+ set var(form,$n,singleinit,$id) $m
+ }
+ }
+
+ $path configure -width $l
+ }
+ multiple {
+ set var(form,$n,name,$id) $name
+ set var(form,$n,multivar,$id) {}
+ set var(form,$n,multiinit,$id) {}
+ set var(form,$n,multimenu,$id) {}
+
+ set l 0
+ set long {}
+ set ii 0
+ foreach f $choices {
+ if {[lindex $f 0]} {
+ lappend var(form,$n,multiinit,$id) $ii
+ }
+ set foo [lindex $f 1]
+ if {[string length $foo] == 0} {
+ set foo [lindex $f 2]
+ }
+ lappend var(form,$n,multivar,$id) $foo
+ lappend var(form,$n,multimenu,$id) [lindex $f 2]
+
+ set m [lindex $f 2]
+ if {[string length $m]>$l} {
+ set long $m
+ set l [string length $m]
+ }
+ incr ii
+ }
+ set var(form,$n,multiple,$id) $path
+
+ # we have a problem
+ # the frame we create will not resize itself based on the
+ # interior size of the listbox and the scrollbar
+ # so, we need to set the frame size by hand
+
+ set font "$var(font) $var(font,size) $var(font,weight) $var(font,slant)"
+ ttk::frame $path
+ ttk::scrollbar $path.scroll -command "$path.list yview"
+ listbox $path.list -selectmode multiple \
+ -width 0 -height $size \
+ -listvar ${varname}(form,$n,multimenu,$id) \
+ -font $font \
+ -yscroll "$path.scroll set" \
+ -exportselection false
+
+ set w [expr [font measure $font $long]+30]
+ set h [expr $size*[font metrics $font -linespace]]
+ $path configure -width $w -height $h
+
+ pack $path.list $path.scroll -side left -fill y -expand 1
+
+ foreach ii $var(form,$n,multiinit,$id) {
+ $path.list selection set $ii
+ }
+ }
+ }
+}
+
+proc HVFormTextArea {varname n a} {
+ upvar #0 $varname var
+ global $varname
+ upvar $a args
+
+ set path [lindex $args 0]
+ set attrs [lindex $args 1]
+ set initial [string range [lindex $args 2] 1 end]
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFormTextArea $n $path $attrs $initial"
+ }
+
+ set id [lindex [split $path .] end]
+ set name [HVattrs name $attrs var]
+
+ set rows [HVattrs rows $attrs 4]
+ set cols [HVattrs cols $attrs 20]
+ set readonly [HVattrs disabled $attrs normal]
+
+ # update initial
+ set initial [HVInitVar $varname $n $name $initial]
+
+ text $path -height $rows -width $cols -wrap none -state $readonly
+ $path insert end $initial
+
+ set var(form,$n,name,$id) $name
+ set var(form,$n,var,$id) $initial
+ set var(form,$n,init,$id) $var(form,$n,var,$id)
+ set var(form,$n,textarea,$id) $path
+}
+
+proc HVattrs {k l def} {
+ # break list up into key/value pairs
+ set key {}
+ set value {}
+ set w 1
+ foreach f $l {
+ if {$w} {
+ lappend key [string tolower $f]
+ set w 0
+ } else {
+ lappend value $f
+ set w 1
+ }
+ }
+ set a [lsearch -exact $key [string tolower $k]]
+ if {$a>=0} {
+ return [lindex $value $a]
+ } else {
+ return $def
+ }
+}
+
+proc HVSubmitForm {varname n name value} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVSubmitForm $n"
+ }
+
+ bind $var(top) <Return> {}
+
+ # update textareas
+ foreach x [array names $varname "form,$n,textarea,*"] {
+ set f [split $x ,]
+ set id [lindex $f 3]
+ set path $var($x)
+ set var(form,$n,var,$id) [$path get 1.0 end]
+ }
+
+ set query {}
+ # append button name=value
+ append query "[http::formatQuery $name $value]&"
+
+ # append normal vars
+ foreach x [array names $varname "form,$n,var,*"] {
+ set f [split $x ,]
+ set id [lindex $f 3]
+ set v [string trim $var($x)]
+ if {[string length $v] != 0} {
+ append query "[http::formatQuery $var(form,$n,name,$id) $v]&"
+ }
+ }
+
+ # append multiple select
+ foreach x [array names $varname "form,$n,multiple,*"] {
+ set f [split $x ,]
+ set id [lindex $f 3]
+ set path $var($x)
+ set iii [$path.list curselection]
+ foreach ii $iii {
+ set v [string trim [lindex $var(form,$n,multivar,$id) $ii]]
+ if {[string length $v] != 0} {
+ append query "[http::formatQuery $var(form,$n,name,$id) $v]&"
+ }
+ }
+ }
+
+ # remove last '&'
+ set query [string trimright $query &]
+
+ HVClearIndex $varname $var(index)
+
+ # and do it
+ # already resolved
+ switch -- [string tolower $var(form,$n,method)] {
+ get {HVLoadURL $varname "$var(form,$n,action)?$query" {} $var(sync)}
+ post {HVLoadURL $varname "$var(form,$n,action)" "$query" $var(sync)}
+ }
+}
+
+proc HVResetForm {varname n} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVResetForm $n"
+ }
+
+ foreach x [array names $varname "form,$n,init,*"] {
+ set f [split $x ,]
+ set var(form,$n,var,[lindex $f 3]) $var($x)
+ }
+
+ #update single select
+ foreach x [array names $varname "form,$n,singleinit,*"] {
+ set f [split $x ,]
+ set var(form,$n,single,[lindex $f 3]) $var($x)
+ }
+
+ # update multiple select
+ foreach x [array names $varname "form,$n,multiinit,*"] {
+ set f [split $x ,]
+ set path $var(form,$n,multiple,[lindex $f 3])
+ $path.list selection clear 0
+ foreach ii $var($x) {
+ $path.list selection set $ii
+ }
+ }
+
+ # update textareas
+ foreach x [array names $varname "form,$n,textarea,*"] {
+ set f [split $x ,]
+ set path $var($x)
+ $path delete 1.0 end
+ $path insert end $var(form,$n,init,[lindex $f 3])
+ }
+}
+
+proc HVInitVar {varname n name def} {
+ upvar #0 $varname var
+ global $varname
+
+ foreach f $var(init) {
+ if {$n == [lindex $f 0] && $name == [lindex $f 1]} {
+ return [lindex $f 2]
+ }
+ }
+ return $def
+}
+
+proc HVFixHTMLForm {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+
+ if {[regexp -nocase {<form [^>]*} $var(data) r]} {
+ if {![regexp -nocase {action=} $r]} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFixFormHTML action fixed"
+ }
+
+ set rr "$r action=[$var(widget) cget -base]"
+ regsub -nocase {<form [^>]*} $var(data) $rr var(data)
+ }
+ }
+}
diff --git a/ds9/library/hvsup.tcl b/ds9/library/hvsup.tcl
new file mode 100644
index 0000000..c16545a
--- /dev/null
+++ b/ds9/library/hvsup.tcl
@@ -0,0 +1,2089 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc HVCancel {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVCancel"
+ }
+
+ # set state to 0 so that we don't process the finish proc
+ set var(active) 0
+
+ # stop any refresh
+ if {$var(refresh,id)>0} {
+ after cancel $var(refresh,id)
+ set var(refresh,id) 0
+ }
+
+ # analysis
+ if {$var(analysis)} {
+ AnalysisTaskEnd $var(analysis,which) $var(analysis,i)
+ HVSetAnalysis $varname 0 {} 0
+ }
+
+ # clean up
+ HVClearTmpFile $varname
+
+ if {[info exists var(token)]} {
+ http::reset $var(token)
+ }
+
+ if {[info exists var(widget)]} {
+ $var(widget) configure -cursor {}
+ }
+}
+
+proc HVDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ihv
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVDestroy"
+ }
+
+ HVCancel $varname
+
+ # clear the widge and all images
+ $var(widget) clear
+
+ # clear image cache
+ foreach x [array names $varname "images,*"] {
+ image delete $var($x)
+ unset ${varname}($x)
+ }
+
+ # clear cache
+ HVClearCache $varname
+
+ # destroy the window and menubar
+ if {[winfo exists $var(top)]} {
+ destroy $var(top)
+ destroy $var(mb)
+ }
+
+ # delete it from the xpa list
+ set ii [lsearch $ihv(windows) $varname]
+ if {$ii>=0} {
+ set ihv(windows) [lreplace $ihv(windows) $ii $ii]
+ }
+
+ # clear varname
+ unset $varname
+}
+
+proc HVReset {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(active) 0
+
+ if {[info exists var(token)]} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVReset ***cleanup***"
+ }
+ http::cleanup $var(token)
+ unset var(token)
+ }
+}
+
+proc HVDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ HVStatus $varname {}
+ HVReset $varname
+}
+
+proc HVCancelled {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ HVStatus $varname {}
+ HVReset $varname
+}
+
+proc HVError {varname err} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVError $err"
+ }
+
+ HVReset $varname
+ Error $err
+}
+
+proc HVStatus {varname message} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(status) $message
+}
+
+proc HVResolveURL {varname url} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ global pvo
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVResolveURL $varname $url"
+ }
+
+ set sync $var(sync)
+ # sub xpa method
+ set exp {%40%40XPA_METHOD%40%40|@@XPA_METHOD@@}
+ if {[regexp $exp $url]} {
+ regsub -all $exp $url [XPAMethod] url
+ if {$debug(tcl,hv)} {
+ puts stderr "HVResolveURL XPA_METHOD $url"
+ }
+ }
+
+ # sub vo method
+ set exp {%40%40VO_METHOD%40%40|@@VO_METHOD@@}
+ if {[regexp $exp $url]} {
+ regsub -all $exp $url $pvo(method) url
+ if {$debug(tcl,hv)} {
+ puts stderr "HVResolveURL VO_METHOD $url"
+ }
+ }
+
+ # if pvo(method) is xpa, HV has to be async
+ if {$pvo(method) == {xpa}} {
+ set sync 0
+ }
+
+ # some old sites have a problem with '?' in the query not encoded
+ ParseURL $url rr
+ if {$rr(query) != {}} {
+ if {[regsub -all {\?} $rr(query) {%25} query]} {
+ set newurl "$rr(scheme)://$rr(authority)$rr(path)?$query"
+ if {$rr(fragment) != {}} {
+ append newurl "#$rr(fragment)"
+ }
+ HVLoadURL $varname $newurl {} $sync
+ } else {
+ HVLoadURL $varname $url {} $sync
+ }
+ } else {
+ HVLoadURL $varname $url {} $sync
+ }
+}
+
+# this is the main entry point, everybody calls here
+
+proc HVLoadURL {varname url query {sync 0}} {
+ upvar #0 $varname var
+ global $varname
+
+ # this assumes the url has been already resolved
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVLoadURL :$varname:$url:$query:$sync:"
+ }
+
+ # do we have anything?
+ if {$url == {}} {
+ return
+ }
+
+ HVStatus $varname {}
+
+ # parse url
+ ParseURL $url r
+ if {$debug(tcl,hv)} {
+ puts stderr "HVLoadURL |$r(scheme)|$r(authority)|$r(path)|$r(query)|$r(fragment)|$query|"
+ }
+
+ switch -- $r(scheme) {
+ file -
+ {} {HVProcessURLFile $varname $url $query r}
+ ftp {HVProcessURLFTP $varname $url $query r}
+ http {HVProcessURLHTTP $varname $url $query r $sync}
+ default {HVError $varname "[msgcat::mc {Sorry, DS9 does not support}] $r(scheme)"}
+ }
+}
+
+proc HVProcessURLFile {varname url query rr} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar $rr r
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLFile"
+ }
+
+ if {[file exists $r(path)]} {
+ if {[file isdirectory $r(path)]} {
+ HVSetURL $varname $url {} {}
+ HVSetResult $varname 200 "text/html"
+ HVSetData $varname \
+ [HVFileHtmlList $r(path) [HVDirList $r(path)]] {}
+
+ set var(delete) 0
+ HVParse $varname
+ } else {
+ HVSetURL $varname $url {} $r(fragment)
+ set var(delete) 0
+ HVLoadFile $varname $r(path)
+ }
+ }
+}
+
+proc HVProcessURLFTP {varname url query rr} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar $rr r
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLFTP"
+ DumpURL r
+ }
+
+ set fn [tmpnam [file extension $r(path)]]
+ set ftp [ftp::Open $r(authority) "ftp" "-ds9@" -mode passive]
+ if {$ftp > -1} {
+ # first try to get as file
+ set ftp::VERBOSE $debug(tcl,ftp)
+ set "ftp::ftp${ftp}(Output)" FTPLog
+ ftp::Type $ftp binary
+ if {[ftp::Get $ftp $r(path) "$fn"]} {
+ ftp::Close $ftp
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLFTP get $fn"
+ }
+ HVSetURL $varname $url {} $r(fragment)
+
+ set var(delete) 1
+ HVLoadFile $varname "$fn"
+
+ HVClearTmpFile $varname
+ } else {
+ # from the prev attempt
+ catch {file delete -force "$fn"}
+
+ # is it a dir or file that could not be download?
+ if {[file extension $r(path)] == {}} {
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLFTP list"
+ }
+
+ # now as a directory
+ set list [ftp::List $ftp $r(path)]
+ ftp::Close $ftp
+
+ HVSetURL $varname $url {} {}
+ HVSetResult $varname 200 "text/html"
+ HVSetData $varname [HVFTPHtmlList $r(authority) $r(path) $list] {}
+
+ set var(delete) 0
+ HVParse $varname
+ } else {
+ HVError $varname "[msgcat::mc {Unable to open file}] $r(path)"
+ return
+ }
+ }
+ }
+}
+
+proc HVProcessURLHTTP {varname url query rr sync} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar $rr r
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTP"
+ }
+
+ # stop any refresh
+ if {[info exists ${varname}(refresh,id)]} {
+ if {$var(refresh,id)>0} {
+ after cancel $var(refresh,id)
+ }
+ }
+
+ # do we already have it in cache?
+ if {[info exists ${varname}(cache,file,$url,$query)]} {
+
+ # has it expired?
+ if {($var(cache,expire,$url,$query) == 0) ||
+ ($var(cache,expire,$url,$query) > [clock seconds])} {
+
+ # just in case
+ if {[file exists $var(cache,file,$url,$query)]} {
+ # ok, to it
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTP found $url at $var(cache,file,$url,$query)"
+ }
+
+ HVSetURL $varname $url $query $r(fragment)
+ set var(delete) 0
+ HVSetResult $varname 200 $var(cache,mime,$url,$query)
+ HVSetData $varname {} $var(cache,file,$url,$query)
+
+ HVParse $varname
+
+ return
+ }
+ }
+
+ # expired or invalid, clean up
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTP expired or invalid $var(cache,file,$url,$query)"
+ }
+ catch {file delete $var(cache,file,$url,$query)}
+ unset var(cache,file,$url,$query)
+ unset var(cache,mime,$url,$query)
+ unset var(cache,expire,$url,$query)
+ }
+
+ HVSetURL $varname $url $query $r(fragment)
+ HVSetResult $varname {} {}
+ HVSetData $varname {} {}
+
+ set var(ch) {}
+
+ # do we have html? if so, use a var
+ ParseURL $url r
+
+ # geturl as file
+ set var(fn) [tmpnam {.http}]
+ if {[catch {open "$var(fn)" w} ${varname}(ch)]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $var(fn)"
+ return
+ }
+
+ # disable timeouts for analysis
+ global ihttp
+ set timeout $ihttp(timeout)
+ if {$var(analysis)} {
+ set timeout 0
+ }
+
+ if {$sync} {
+ if {![catch {set var(token) [http::geturl $url \
+ -query "$query" \
+ -timeout $timeout \
+ -headers "[HVHTTPHeader $varname]" \
+ -progress [list HVProgress $varname] \
+ -binary 1 \
+ -channel $var(ch)]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ set var(delete) 1
+ HVProcessURLHTTPFinish $varname $var(token)
+ } else {
+ catch {close $var(ch)}
+ HVError $varname "[msgcat::mc {Unable to locate URL}] $url"
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $url \
+ -query "$query" \
+ -timeout $timeout \
+ -headers "[HVHTTPHeader $varname]" \
+ -progress [list HVProgress $varname] \
+ -binary 1 \
+ -channel $var(ch) \
+ -command [list HVProcessURLHTTPFinish $varname]]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ set var(delete) 1
+ } else {
+ catch {close $var(ch)}
+ HVError $varname "[msgcat::mc {Unable to locate URL}] $url"
+ }
+ }
+}
+
+proc HVProcessURLHTTPFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTPFinish"
+ }
+
+ catch {close $var(ch)}
+
+ if {!($var(active))} {
+ HVCancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set var(code) [http::ncode $token]
+
+ # Meta
+ set var(meta) $t(meta)
+
+ # Cache defaults
+ set var(cache) 1
+ set var(cache,images) 1
+ set var(expire) 0
+
+ HVParseMeta $varname
+
+ # Log it
+ HTTPLog $token
+
+ # Result?
+ switch -- $var(code) {
+ 200 -
+ 203 -
+ 404 -
+ 503 {
+ if {$var(cache)} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTPFinish cacheing:$var(url),$var(query):$var(fn)"
+ }
+ set url $var(url)
+ set query $var(query)
+ set var(cache,file,$url,$query) $var(fn)
+ set var(cache,mime,$url,$query) $var(mime)
+ set var(cache,expire,$url,$query) $var(expire)
+ set var(delete) 0
+ }
+ HVParse $varname
+ HVDone $varname
+ }
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $var(meta) {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProcessURLHTTPFinish redirect $var(code) to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ HVClearTmpFile $varname
+
+ if {[info exists var(widget)]} {
+ HVLoadURL $varname [$var(widget) resolve $value] {} $var(sync)
+ } else {
+ HVLoadURL $varname $value {} $var(sync)
+ }
+ }
+ }
+ }
+
+ default {HVError $varname "HTTP [msgcat::mc {Error}] $var(code)"}
+ }
+}
+
+proc HVHTTPHeader {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set domain {}
+ ParseURL $var(url) rr
+ regexp {[^:]*} $rr(authority) domain
+
+ set result "[ProxyHTTP]"
+ foreach cc $var(cookies) {
+ if {$domain == [lindex $cc 2]} {
+ append result " Cookie [lindex $cc 0]=[lindex $cc 3]"
+ }
+ }
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVHTTPHeader:$result"
+ }
+
+ return $result
+}
+
+proc HVParseMeta {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseMeta: $var(meta)"
+ }
+
+ foreach {name value} $var(meta) {
+ switch -- [string tolower $name] {
+ content-type {
+ regexp -nocase {([^;]*);?(.*)} $value foo \
+ ${varname}(mime) ${varname}(mime,param)
+ set var(mime) [string tolower $var(mime)]
+ }
+ content-length {}
+ content-encoding {
+ switch -- [string tolower $value] {
+ gzip -
+ x-gzip {set var(encoding) gzip}
+ bzip2 {set var(encoding) bzip2}
+ compress -
+ Z {set var(encoding) compress}
+ pack -
+ z {set var(encoding) pack}
+ default {}
+ }
+ }
+ content-transfer-encoding {
+ switch -- [string tolower $value] {
+ binary -
+ base64 {set var(transfer) [string tolower $value]}
+ default {}
+ }
+ }
+
+ refresh {
+ set f [split $value \;]
+ set var(refresh,time) [lindex $f 0]
+ set var(refresh,url) [string range [lindex $f 1] 4 end]
+ if {$var(refresh,url) != {} & $var(refresh,time) != {}} {
+ set var(refresh,id) [after [expr $var(refresh,time)*1000] "HVLoadURL $varname \{$var(refresh,url)\} {} $var(sync)"]
+ } else {
+ set var(refresh,id) 0
+ }
+ }
+ expires {
+ if {[catch {set ss [clock scan $value]}]} {
+ set var(cache) 0
+ } else {
+ set var(cache) 1
+ set var(expire) $ss
+ }
+ }
+ cache-control {
+ foreach cc [split $value {,}] {
+ foreach {nn vv} [split $cc {=}] {
+ switch $nn {
+ public {set var(cache) 1}
+ private {set var(cache) 1}
+ no-cache {set var(cache) 0}
+ no-store {set var(cache) 1}
+
+ s-maxage -
+ min-fresh -
+ max-age {
+ set var(cache) 1
+ set var(expire) \
+ [expr [file mtime $var(fn)]+$vv]
+ }
+ max-stale {}
+ no-transform {}
+ only-if-cached {}
+ cache-extension {}
+
+ must-revalidate {}
+ proxy-revalidate {}
+ }
+ }
+ }
+ }
+ pragma {
+ switch $value {
+ no-cache {set var(cache) 0}
+ }
+ }
+ last-modified {
+ }
+ if-none-match {
+ }
+ set-cookie {
+ set cname {}
+ set cpath {/}
+ set cdomain {}
+ set cvalue {}
+
+ ParseURL $var(url) rr
+ regexp {[^:]*} $rr(authority) cdomain
+
+ foreach cc [split $value {;}] {
+ foreach {nn vv} [split $cc {=}] {
+ switch [string tolower [string trim $nn]] {
+ httponly {}
+ expires {}
+ path {set cpath $vv}
+ domain {set cdomain $vv}
+ {} {append cvalue {=}}
+ default {
+ if {$nn != {}} {
+ set cname $nn
+ set cvalue $vv
+ }
+ }
+ }
+ }
+ }
+ if {$cname != {}} {
+ lappend ${varname}(cookies) [list $cname $cpath $cdomain $cvalue]
+ }
+ }
+ }
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseMeta Content-Type:$var(mime):$var(mime,param):"
+ puts stderr "HVParseMeta Content-Encoding:$var(encoding):"
+ puts stderr "HVParseMeta Content-Transfer-Encoding:$var(transfer):"
+ puts stderr "HVParseMeta Refresh:$var(refresh,time):$var(refresh,url):"
+ puts stderr "HVParseMeta Cache:$var(cache)"
+ puts stderr "HVParseMeta Expires:$var(expire)"
+ puts stderr "HVParseMeta Cookies:$var(cookies)"
+ }
+}
+
+proc HVLoadFile {varname path} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVLoadFile $path"
+ }
+
+ HVSetResult $varname 200 {}
+ HVSetData $varname {} $path
+
+ # content-encoding
+ switch -- [string tolower [file extension $path]] {
+ .gz {
+ set path [file rootname $path]
+ set var(encoding) gzip
+ }
+ .bz2 {
+ set path [file rootname $path]
+ set var(encoding) bzip2
+ }
+ .Z {
+ set path [file rootname $path]
+ set var(encoding) compress
+ }
+ .z {
+ set path [file rootname $path]
+ set var(encoding) pack
+ }
+ }
+
+ switch -- [string tolower [file extension $path]] {
+ .html -
+ .htm {set var(mime) "text/html"}
+ .gif {set var(mime) "image/gif"}
+ .jpeg -
+ .jpg {set var(mime) "image/jpeg"}
+ .tiff -
+ .tif {set var(mime) "image/tiff"}
+ .png {set var(mime) "image/png"}
+
+ .fits -
+ .fit -
+ .fts {set var(mime) "image/fits"}
+
+ .ftz -
+ .fits.gz -
+ .fgz {
+ set var(mime) "image/fits"
+ set var(encoding) "gzip"
+ }
+
+ .text -
+ .txt {set var(mime) "text/plain"}
+ .multi {
+ set var(mime) "multipart/mixed"
+ set var(xpa,target) "*:*"
+ if {[file exists "$path"]} {
+ set ch [open "$path" r]
+ if {[gets $ch line] >= 0} {
+ set var(mime,param) "Content-Type: multipart/mixed; Boundary=[string range $line 2 end]"
+ }
+ catch {close $ch}
+ }
+ }
+
+ .sao {set var(mime) "text/x-cmap-sao"}
+
+ default {
+ switch -- $var(encoding) {
+ gzip -
+ bzip2 -
+ compress -
+ pack {set var(mime) "application/octet-stream"}
+ default {set var(mime) "text/plain"}
+ }
+ }
+ }
+
+ HVParse $varname
+}
+
+proc HVParse {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParse"
+ }
+
+ switch -- $var(mime) {
+ "multipart/alternative" -
+ "multipart/parallel" -
+ "multipart/digest" -
+ "multipart/related" -
+ "multipart/signed" -
+ "multipart/encrypted" -
+ "multipart/report" {}
+
+ "multipart/x-mixed-replace" -
+ "multipart/mixed" {
+ HVParseMulti $varname
+ HVClearCache $varname
+ }
+
+ default {HVParseSingle $varname}
+ }
+
+ if {$var(analysis)} {
+ AnalysisTaskEnd $var(analysis,which) $var(analysis,i)
+ HVSetAnalysis $varname 0 {} 0
+ }
+}
+
+proc HVParseMulti {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseMulti"
+ }
+
+ # do it now, to be restored later
+ if {[info exists var(index)]} {
+ incr ${varname}(index)
+ set var(index,$var(index)) [list $var(url) $var(query)]
+ set index $var(index)
+ }
+
+ set fn $var(fn)
+ set del $var(delete)
+
+ if {[file exists "$var(fn)"]} {
+ if {[catch {open "$var(fn)" r} ch]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $var(fn)"
+ return
+ }
+ }
+
+ set boundary [HVParseMimeParam $varname "boundary"]
+ if {[string equal "$boundary" {}]} {
+ HVError $varname [msgcat::mc {Invalid formated multipart/mixed mime type message}]
+ return
+ }
+
+ set state 1
+ set var(ch) {}
+
+ HVSetResult $varname 200 {}
+ HVSetData $varname {} {}
+
+ while {[gets $ch line] >= 0} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseMulti $state:$line"
+ }
+
+ switch -- $state {
+ 1 {
+ # boundary
+ if {[string equal "--$boundary" $line]} {
+ set state 2
+ }
+ }
+ 2 {
+ # header
+ if {[string length $line] == 0} {
+ HVParseMeta $varname
+
+ # save to a file
+ set var(fn) [tmpnam {.http}]
+ set var(delete) 1
+ if {[catch {open "$var(fn)" w} ${varname}(ch)]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $var(fn)"
+ return
+ }
+ switch $var(transfer) {
+ binary -
+ base64 {
+ fconfigure $var(ch) \
+ -translation binary -encoding binary
+ }
+ }
+
+ set state 3
+ } else {
+ if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} {
+ lappend var(meta) $key [string trim $value]
+ }
+ }
+ }
+ 3 {
+ # body
+ if {[string equal "--$boundary" $line]} {
+ catch {close $var(ch)}
+ HVParseSingle $varname
+ HVClearTmpFile $varname
+
+ set var(ch) {}
+
+ HVSetResult $varname 200 {}
+
+ # we want to preserve var(text)
+ # HVSetData $varname {} {}
+ set var(data) {}
+ set var(fn) {}
+
+ set state 2
+
+ } elseif {[string equal "--$boundary--" $line]} {
+ catch {close $var(ch)}
+ catch {close $ch}
+
+ HVParseSingle $varname
+ HVClearTmpFile $varname
+
+ # reset file values
+ set var(fn) $fn
+ set var(delete) $del
+
+ if {[info exists var(index)]} {
+ # reset index
+ set var(index) $index
+ HVClearIndex $varname $index
+ }
+
+ return
+
+ } else {
+ switch $var(transfer) {
+ binary {puts -nonewline $var(ch) $line}
+ base64 {
+ puts -nonewline $var(ch) [base64::decode $line]
+ }
+ default {puts $var(ch) $line}
+ }
+ }
+ }
+ }
+ }
+
+ # clean up
+ catch {close $ch}
+ set var(fn) $fn
+}
+
+proc HVParseSingle {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseSingle $var(url)"
+ }
+
+ switch -- $var(mime) {
+ "text/html" -
+ "text/plain" -
+ "application/octet-stream" {
+ # its never fails, someone can't get there mime types correct.
+ # Override the mime type based on path
+
+ ParseURL $var(url) r
+ set path [file tail $r(path)]
+
+ # set content-encoding
+ switch -- [file extension $path] {
+ .gz {
+ set path [file rootname $path]
+ set var(encoding) gzip
+ }
+ .bz2 {
+ set path [file rootname $path]
+ set var(encoding) bzip2
+ }
+ .Z {
+ set path [file rootname $path]
+ set var(encoding) compress
+ }
+ .z {
+ set path [file rootname $path]
+ set var(encoding) pack
+ }
+ }
+
+ # set Content-Type
+ switch -- [file extension $path] {
+ .html -
+ .htm {set var(mime) "text/html"}
+ .gif {set var(mime) "image/gif"}
+ .jpeg -
+ .jpg {set var(mime) "image/jpeg"}
+ .tiff -
+ .tif {set var(mime) "image/tiff"}
+ .png {set var(mime) "image/png"}
+
+ .fits -
+ .fit -
+ .fts {set var(mime) "image/fits"}
+
+ .ftz -
+ .fgz {
+ set var(mime) "image/fits"
+ set var(encoding) "gzip"
+ }
+
+ .xml -
+ .vot -
+ .votable {set var(mime) "text/xml"}
+
+ .text -
+ .txt {set var(mime) "text/plain"}
+
+ .sao {set var(mime) "text/x-cmap-sao"}
+ }
+ }
+ }
+
+ switch -- $var(mime) {
+ "text/html" {HVParseHTML $varname}
+ "text/plain" {HVParseText $varname}
+ "application/octet-stream" {HVParseSave $varname}
+
+ "image/gif" -
+ "image/jpeg" -
+ "image/tiff" -
+ "image/png" {HVParseImg $varname}
+
+ "image/fits" -
+ "application/fits" {HVParseFITS $varname}
+
+ "application/fits-image" -
+ "application/fits-table" -
+ "application/fits-group" {HVParseFITS $varname}
+
+ "image/x-fits" -
+ "binary/x-fits" -
+ "application/x-fits" {HVParseFITS $varname}
+
+ "image/fits-hcompress" -
+ "image/x-fits-h" {HVParseFITS $varname}
+
+ "image/x-gfits" -
+ "binary/x-gfits" -
+ "image/gz-fits" -
+ "application/x-gzip" -
+ "display/gz-fits" {
+ set var(encoding) gzip
+ HVParseFITS $varname
+ }
+
+ "image/bz2-fits" -
+ "display/bz2-fits" {
+ set var(encoding) bzip2
+ HVParseFITS $varname
+ }
+
+ "image/x-cfits" -
+ "binary/x-cfits" {
+ set var(encoding) compress
+ HVParseFITS $varname
+ }
+
+ "image/x-zfits" -
+ "binary/x-zfits" {
+ set var(encoding) pack
+ HVParseFITS $varname
+ }
+
+ "text/xml" -
+ "application/xml" -
+ "application/x-votable+xml" {HVParseVOT $varname}
+
+ "x-xpa/xpaget" {}
+ "x-xpa/xpaset" {HVParseXPASet $varname}
+ "x-xpa/xpainfo" {}
+ "x-xpa/xpaaccess" {}
+
+ "text/x-cmap-sao" {HVParseColormap $varname}
+
+ default {HVParseSave $varname}
+ }
+}
+
+proc HVParseText {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseText"
+ }
+
+ if {[string length $var(data)] == 0} {
+ if {[file exists "$var(fn)"]} {
+ if {[catch {open "$var(fn)" r} ch]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $var(fn)"
+ return
+ }
+ set var(data) [read $ch]
+ close $ch
+ }
+ }
+
+ if {$var(analysis)} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseText Analysis"
+ }
+ AnalysisProcessGetURL $var(analysis,which) $var(analysis,i) $var(data)
+ } else {
+ append var(text) $var(data)
+ set var(data) \
+ "<html>\n<body>\n$var(text)\n</body>\n</html>"
+ HVSetResult $varname 200 "text/html"
+ HVParseHTML $varname
+ }
+
+ HVClearCache $varname
+}
+
+proc HVParseHTML {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseHTML"
+ }
+
+ if {[string length $var(data)] == 0} {
+ if {[file exists "$var(fn)"]} {
+ if {[catch {open "$var(fn)" r} ch]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $var(fn)"
+ return
+ }
+ set var(data) [read $ch]
+ close $ch
+ }
+ }
+
+ # figure out the base
+ # we don't want any query or fragments
+ ParseURL $var(url) r
+
+ set base {}
+ # scheme
+ switch $r(scheme) {
+ http {append base "$r(scheme)://"}
+ ftp {}
+ file {}
+ }
+ # authority
+ if {[string length $r(authority)] != 0} {
+ append base "$r(authority)"
+ }
+ # path
+ if {[string length $r(path)] != 0} {
+ append base "$r(path)"
+ } else {
+ append base "/"
+ }
+ # query
+ if {[string length $r(query)] != 0} {
+ append base "?$r(query)"
+ }
+
+ # spaces?
+ # regsub { } $base {\ } base
+
+ $var(widget) config -base $base
+
+ if {$debug(tcl,hv)} {
+ DumpURL r
+ puts stderr "HVParseHTML base [$var(widget) cget -base]"
+ }
+
+ # we have a valid html
+ $var(widget) clear
+
+ # fix forms with no action
+ HVFixHTMLForm $varname
+
+ # and now, parse it
+ $var(widget) parse $var(data)
+
+ HVGotoHTML $varname
+}
+
+proc HVParseImg {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseImg $var(url)"
+ }
+
+ if {$var(save)} {
+ switch -- $var(mime) {
+ "image/gif" {set fn [SaveFileDialog giffbox]}
+ "image/jpeg" {set fn [SaveFileDialog jpegfbox]}
+ "image/tiff" {set fn [SaveFileDialog tifffbox]}
+ "image/png" {set fn [SaveFileDialog pngfbox]}
+ }
+
+ if {[string length "$fn"] != 0} {
+ if {![catch {file rename -force "$var(fn)" "$fn"}]} {
+ set var(fn) "$fn"
+ set var(delete) 0
+ }
+ }
+ }
+
+ switch -- $var(frame) {
+ new {MultiLoadBase}
+ current {}
+ }
+
+ ImportPhotoFile $var(fn) {}
+
+ HVClearTmpFile $varname
+ HVClearAll $varname
+ HVUpdateDialog $varname
+}
+
+proc HVParseFITS {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global debug
+
+ if {$var(save)} {
+ switch -- $var(encoding) {
+ gzip {FileLast savefitsfbox "ds9.fits.gz"}
+ bzip2 {FileLast savefitsfbox "ds9.fits.bz2"}
+ compress {FileLast savefitsfbox "ds9.fits.Z"}
+ pack {FileLast savefitsfbox "ds9.fits.z"}
+ default {FileLast savefitsfbox "ds9.fits"}
+ }
+
+ set fn [SaveFileDialog savefitsfbox]
+ if {[string length "$fn"] != 0} {
+ if {![catch {file rename -force "$var(fn)" "$fn"}]} {
+ set var(fn) "$fn"
+ set var(delete) 0
+ }
+ }
+ }
+
+ switch -- $var(frame) {
+ new {MultiLoadBase}
+ current {}
+ }
+
+ StartLoad
+ global loadParam
+ set loadParam(load,type) allocgz
+ set loadParam(load,layer) {}
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {}
+ set loadParam(file,name) "$var(fn)"
+ set loadParam(file,fn) $loadParam(file,name)
+
+ # may have to convert the file, based on content-encoding
+ switch -- "$var(encoding)" {
+ bzip2 {
+ catch {set ch [open "| bunzip2 < $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ compress {
+ catch {set ch [open "| uncompress < $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ pack {
+ catch {set ch [open "| pcat $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ }
+
+ ProcessLoad
+ FinishLoad
+
+ HVClearTmpFile $varname
+ HVClearAll $varname
+ HVUpdateDialog $varname
+}
+
+proc HVParseColormap {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseColormap"
+ }
+
+ set fn [HVParseMimeParam $varname "name"]
+ if {$fn == {}} {
+ ParseURL $var(url) r
+ set fn [file tail $r(path)]
+ }
+
+ if {![catch {file rename -force $var(fn) $ds9(tmpdir)/$fn}]} {
+ LoadColormapFile $ds9(tmpdir)/$fn
+ }
+
+ HVClearAll $varname
+ HVUpdateDialog $varname
+}
+
+proc HVParseVOT {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseVOT"
+ }
+
+ if {[file exists "$var(fn)"]} {
+ CATVOTFile "$var(fn)"
+ }
+
+ HVClearTmpFile $varname
+ HVClearAll $varname
+ HVUpdateDialog $varname
+}
+
+proc HVParseSave {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseSave"
+ }
+
+ set fn [HVParseMimeParam $varname "name"]
+ if {$fn == {}} {
+ ParseURL $var(url) r
+ set fn [file tail $r(path)]
+ }
+ FileLast savefitsfbox $fn
+ set fn [SaveFileDialog savefitsfbox]
+ if {[string length "$fn"] != 0} {
+ if {![catch {file rename -force "$var(fn)" "$fn"}]} {
+ set var(delete) 0
+ }
+ }
+
+ HVClearAll $varname
+ HVUpdateDialog $varname
+}
+
+proc HVParseXPASet {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVParseXPASet: [HVParseMimeParam $varname paramlist]"
+ }
+
+ if {[info exists var(xpa,target)]} {
+ set target $var(xpa,target)
+ } else {
+ set target [HVParseMimeParam $varname target]
+ }
+
+ if {$target == "$ds9(title)" ||
+ $target == "DS9:*" ||
+ $target == "DS9:$ds9(title)" ||
+ $target == "*:$ds9(title)" ||
+ $target == "*:*" ||
+ $target == [XPAMethod]} {
+
+ InitError hv
+ CommSet $var(fn) [HVParseMimeParam $varname paramlist] 1
+ } else {
+ HVError $varname "[msgcat::mc {Unable to match target with XPA Mime request}] $url"
+ }
+}
+
+proc HVGotoHTML {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ incr ${varname}(index)
+ set var(index,$var(index)) [list $var(url) $var(query)]
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVGotoHTML $var(index) |$var(url)|$var(query)|$var(fragment)|"
+ }
+
+ if {[string length $var(fragment)] != 0} {
+ if {$debug(tcl,idletasks)} {
+ puts stderr "HVGotoHTML"
+ }
+ update idletasks
+
+ $var(widget) yview $var(fragment)
+ } else {
+ $var(widget) yview moveto 0
+ }
+
+ HVUpdateDialog $varname
+}
+
+proc HVClearCache {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVClearCache $varname"
+ }
+
+ foreach x [array names $varname "cache,file,*"] {
+ catch {file delete $var($x)}
+ }
+ foreach x [array names $varname "cache,*"] {
+ unset ${varname}($x)
+ }
+}
+
+proc HVClearIndex {varname n} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVClearIndex $varname $n"
+ }
+
+ foreach x [array names $varname "index,*"] {
+ set f [split $x ,]
+ if {[lindex $f 1] > $n} {
+ unset ${varname}($x)
+ }
+ }
+ set var(index) $n
+}
+
+proc HVClearTmpFile {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVClearTmpFile"
+ }
+
+ if {$var(delete) && [string length "$var(fn)"] != 0} {
+ if {[file exists "$var(fn)"]} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVClearTmpFile delete $var(fn)"
+ }
+ file delete "$var(fn)"
+ }
+ set var(fn) {}
+ set var(delete) 0
+ }
+}
+
+proc HVUpdateDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # in case we've set the cursor
+ $var(widget) configure -cursor {}
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVUpdateDialog\n"
+ }
+
+ set id $var(index)
+ set id [incr id -1]
+ if {[info exists ${varname}(index,$id)]} {
+ $var(mb).view entryconfig [msgcat::mc {Back}] -state normal
+ } else {
+ $var(mb).view entryconfig [msgcat::mc {Back}] -state disabled
+ }
+
+ set id $var(index)
+ set id [incr id 1]
+ if {[info exists ${varname}(index,$id)]} {
+ $var(mb).view entryconfig [msgcat::mc {Forward}] -state normal
+ } else {
+ $var(mb).view entryconfig [msgcat::mc {Forward}] -state disabled
+ }
+}
+
+proc HVRefresh {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVRefresh"
+ }
+
+ set var(delete) 0
+ HVParse $varname
+}
+
+proc HVProgress {varname token totalsize currentsize} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVProgress:$varname"
+ }
+
+ if {$totalsize != 0} {
+ HVStatus $varname "$currentsize bytes of $totalsize bytes [expr int(double($currentsize)/$totalsize*100)]%"
+ } else {
+ HVStatus $varname "$currentsize bytes"
+ }
+}
+
+proc HVFTPHtmlList {host path list} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFTPHtmlList $host $path"
+ }
+ if {[string range $path end end] != "/"} {
+ append path {/}
+ }
+
+ set html {}
+ append html "<html>\n"
+ append html "<head>\n"
+ append html "<title>Index of $path on $host</title>\n"
+ append html "</head>\n"
+ append html "<body>\n"
+ append html "<h1>Index on $path on $host</h1>\n"
+ append html "<hr>\n"
+ append html "<pre>\n"
+ foreach l $list {
+ switch -- [llength $l] {
+ 8 {set offset 4}
+ 9 {set offset 5}
+ 10 {set offset 4}
+ 11 {set offset 5}
+ default {set offset 5}
+ }
+
+ set ii [lindex $l [expr $offset+3]]
+ switch -- [string range $l 0 0] {
+ d {
+ set new "<a href=\"ftp://$host$path$ii/\">$ii</A>"
+ }
+ l {
+ set new "<a href=\"ftp://$host$path$ii\">$ii</A>"
+ }
+ default {
+ set new "<a href=\"ftp://$host$path$ii\">$ii</A>"
+ }
+ }
+
+ regsub $ii $l $new l
+ append html "$l\n"
+ }
+ append html "</pre>\n"
+ append html "</hr>\n"
+ append html "</body>\n"
+
+ return $html
+}
+
+proc HVFileHtmlList {path list} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFileHtmlList $path"
+ }
+
+ if {[string range $path end end] != "/"} {
+ append path {/}
+ }
+
+ set html {}
+ append html "<html>\n"
+ append html "<head>\n"
+ append html "<title>Index of $path</title>\n"
+ append html "</head>\n"
+ append html "<body>\n"
+ append html "<h1>Index on $path</h1>\n"
+ append html "<hr>\n"
+ append html "<pre>\n"
+ foreach l $list {
+ switch -- [llength $l] {
+ 8 {set offset 4}
+ 9 {set offset 5}
+ 10 {set offset 4}
+ 11 {set offset 5}
+ default {set offset 5}
+ }
+
+ set ii [lindex $l [expr $offset+3]]
+ switch -- [string range $l 0 0] {
+ d {
+ set new "<a href=\"file:$path$ii/\">$ii</A>"
+ }
+ l {
+ set new "<a href=\"file:$path$ii\">$ii</A>"
+ }
+ default {
+ set new "<a href=\"file:$path$ii\">$ii</A>"
+ }
+ }
+
+ regsub $ii $l $new l
+ append html "$l\n"
+ }
+ append html "</pre>\n"
+ append html "</hr>\n"
+ append html "</body>\n"
+
+ return $html
+}
+
+proc HVDirList {path} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVDirList $path"
+ }
+ return [split [exec ls -l $path] \n]
+}
+
+proc HVSetURL {varname url query fragment} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVSetURL $url $query $fragment"
+ }
+
+ set var(url) $url
+ set var(query) $query
+ set var(fragment) $fragment
+}
+
+proc HVSetResult {varname code mime} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVSetResult $code $mime"
+ }
+
+ set var(code) $code
+ set var(meta) {}
+ set var(mime) $mime
+ set var(mime,param) {}
+ set var(cache) 0
+ set var(cache,images) 1
+ set var(expire) 0
+ set var(encoding) {}
+ set var(transfer) {}
+ set var(refresh,time) 0
+ set var(refresh,url) {}
+ set var(refresh,id) 0
+}
+
+proc HVSetData {varname data fn} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVSetData $fn"
+ }
+
+ set var(data) $data
+ set var(text) {}
+ set var(fn) "$fn"
+}
+
+proc HVSetAnalysis {varname aa which ii} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVSetAnalysis"
+ }
+
+ set var(analysis) $aa
+ set var(analysis,which) $which
+ set var(analysis,i) $ii
+}
+
+proc HVClearAll {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVClearAll"
+ }
+
+ HVSetURL $varname {} {} {}
+ HVSetResult $varname {} {}
+ HVSetData $varname {} {}
+ HVSetAnalysis $varname 0 {} 0
+}
+
+# CallBacks
+
+proc HVImageCB {varname args} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageCB $varname args: $args"
+ }
+
+ set url [lindex $args 0]
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageCB url: $url"
+ }
+
+ # do we have anything?
+ if {[string length $url] == 0} {
+ return
+ }
+
+ # do we have a width/height?
+ set aa [lindex $args 3]
+ set width [HVattrs width $aa 0]
+ set height [HVattrs height $aa 0]
+ set src [HVattrs src $aa 0]
+
+ # check for percent (100%) in width/height
+ if {![string is integer $width]} {
+ set width 0
+ }
+ if {![string is integer $height]} {
+ set height 0
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageCB src: $width $height $src"
+ }
+
+ # we have a problem in that htmlwidget will not properly resolve a windows
+ # file name, there for we may have a bad file name url
+ # double check with the src attribute
+ global tcl_platform
+ switch $tcl_platform(platform) {
+ unix {}
+ windows {
+ ParseURL $url r
+
+ switch -- $r(scheme) {
+ {} -
+ file {
+ if {![file exists $url]} {
+ # bad, try src
+ if {[file exists $src]} {
+ set url $src
+ }
+ }
+ }
+ }
+ }
+ }
+
+ set img [HVImageURL $varname $url $width $height]
+
+ if {[string length $img] != 0} {
+ return $img
+ } else {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageCB FAIL $url"
+ }
+ return $var(images,gray)
+ }
+}
+
+proc HVImageURL {varname url width height} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL $varname $url $width $height"
+ }
+
+ # do we already have the image?
+ if {[info exists ${varname}(images,$url)]} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL found image a $url"
+ }
+ return $var(images,$url)
+ }
+
+ ParseURL $url r
+
+ set fn {}
+ switch -- $r(scheme) {
+ {} -
+ file {
+ if {[file exists $r(path)]} {
+ # can't use -file for zvfs
+ # catch {image create photo -file $r(path)} img
+ set ch [open $r(path) r]
+ fconfigure $ch -translation binary -encoding binary
+ set dd [read $ch]
+ close $ch
+ unset ch
+
+ catch {image create photo -data "$dd"} img
+ unset dd
+ }
+ }
+ ftp {
+ set fn [tmpnam [file extension $r(path)]]
+ set ftp [ftp::Open $r(authority) "ftp" "-ds9@" -mode passive]
+ if {$ftp > -1} {
+ set ftp::VERBOSE $debug(tcl,ftp)
+ set "ftp::ftp${ftp}(Output)" FTPLog
+ ftp::Type $ftp binary
+ if {[ftp::Get $ftp $r(path) "$fn"]} {
+ ftp::Close $ftp
+
+ if {[file size "$fn"] == 0} {
+ catch {file delete -force "$fn"}
+ return {}
+ }
+ if {[catch {image create photo -file "$fn"} img]} {
+ catch {file delete -force "$fn"}
+ return {}
+ }
+ }
+ }
+ }
+ http {
+ set ch {}
+
+ set fn [tmpnam [file extension $r(path)]]
+
+ for {set ii 5} {$ii>0} {incr ii -1} {
+ if {[catch {open "$fn" w} ch]} {
+ HVError $varname "[msgcat::mc {Unable to open file}] $fn"
+ return {}
+ }
+
+ global ihttp
+ if {[catch {set token \
+ [http::geturl $url \
+ -timeout $ihttp(timeout) \
+ -progress [list HVProgress $varname] \
+ -channel $ch \
+ -binary 1 \
+ -headers "[HVHTTPHeader $varname]" \
+ ]}]} {
+
+ # if there is a problem, just bail
+ set ii 0
+ continue
+ }
+
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ catch {close $ch}
+
+ upvar #0 $token t
+ set code [http::ncode $token]
+ set meta $t(meta)
+
+ # result?
+ switch -- $code {
+ 200 -
+ 203 -
+ 503 {set ii 0}
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL redirect $code to $value"
+ }
+ # clean up and resubmit
+ set url $value
+ http::cleanup $token
+ catch {file delete -force "$fn"}
+ }
+ }
+ }
+
+ default {
+ # in general, we don't want to know about this
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL HTTP Error: $code"
+ }
+ set ii 0
+ }
+ }
+ }
+
+ catch {http::cleanup $token}
+
+ if {[file size "$fn"] == 0} {
+ catch {file delete -force "$fn"}
+ return {}
+ }
+ if {[catch {image create photo -file "$fn"} img]} {
+ catch {file delete -force "$fn"}
+ return {}
+ }
+ }
+ }
+
+ # do we have an img?
+ if {![info exists img]} {
+ return {}
+ }
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL got image $img"
+ }
+
+ # adjust image size if needed
+ if {$width != 0 || $height != 0} {
+ set iw [image width $img]
+ set ih [image height $img]
+
+ set doit 1
+ # check for one dimension of 0. calculate to maintain aspect ratio
+ if {$width == 0} {
+ set width [expr $iw*$height/$ih]
+
+ # see if we have a bad resample dimension
+ set wf [expr double($iw)*$height/$ih]
+ if {$width != $wf} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL abort resample image $img width $wf"
+ }
+ set doit 0
+ }
+ }
+ if {$height == 0} {
+ set height [expr $ih*$width/$iw]
+
+ # see if we have a bad resample dimension
+ set hf [expr double($ih)*$width/$iw]
+ if {$height != $hf} {
+ if {$debug(tcl,hv)} {
+ puts stderr \
+ "HVImageURL abort resample image $img height $hf"
+ }
+ set doit 0
+ }
+ }
+
+ # check to resample
+ if {$doit && ($width != $iw || $height != $ih)} {
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL resample image $iw->$width $ih->$height"
+ }
+
+ set img2 \
+ [image create photo -width $width -height $height]
+ if {[catch {blt::winop image resample $img $img2 box} ]} {
+ # just use existing img
+ if {$debug(tcl,hv)} {
+ puts stderr "HVImageURL error resample image $img"
+ }
+ } else {
+ set tmp $img
+ set img $img2
+ catch {image delete $tmp}
+ }
+ }
+ }
+
+ # delete any tmp files
+ if {"$fn" != {}} {
+ catch {file delete -force "$fn"}
+ }
+
+ if {$var(cache,images)} {
+ set var(images,$url) $img
+ }
+
+ return $img
+}
+
+proc HVFontCB {varname sz args} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFontCB $varname $sz $args"
+ }
+
+ set family $var(font)
+ set size $var(font,size)
+ set weight $var(font,weight)
+ set slant $var(font,slant)
+
+ global ds9
+ foreach ff [concat [lindex $args 0]] {
+ switch -- $ff {
+ fixed {
+ set family $ds9(courier)
+ set sz [expr $sz-1]
+ }
+ bold {set weight bold}
+ italic {set slant italic}
+ }
+ }
+
+ switch -- $sz {
+ 0 {incr size -3}
+ 1 {incr size -2}
+ 2 {incr size -1}
+ 3 {}
+ 4 {incr size 6}
+ 5 {incr size 12}
+ 6 {incr size 24}
+ 7 {incr size 36}
+ }
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFontCB \{$family\} $size $weight $slant"
+ }
+ return "\{$family\} $size $weight $slant"
+}
+
+proc HVNoScriptCB {varname n tag args} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+# puts stderr "HVNoScriptCB $varname $n $tag $args"
+ }
+}
+
+proc HVScriptCB {varname args} {
+ upvar #0 $varname var
+
+ global debug
+ if {$debug(tcl,hv)} {
+# puts stderr "HVScriptCB $varname $args"
+ }
+}
+
+proc HVFrameCB {varname args} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$debug(tcl,hv)} {
+ puts stderr "HVFrameCB $varname $args"
+ }
+}
+
+proc HVAppletCB {varname w args} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,hv)} {
+ puts stderr "HVAppletCB $varname $w $args"
+ }
+}
+
+proc HVParseMimeParam {varname key} {
+ upvar #0 $varname var
+ global $varname
+
+ foreach {pp} [split $var(mime,param) {;}] {
+ set id [string first {=} $pp]
+ set name [string trim [string range $pp 0 [expr $id-1]]]
+ set value [string trim [string range $pp [expr $id+1] end]]
+ if {[string equal -nocase $name $key]} {
+ return [string trim $value {"'}]
+ }
+ }
+
+ return {}
+}
diff --git a/ds9/library/iexam.tcl b/ds9/library/iexam.tcl
new file mode 100644
index 0000000..aa6795b
--- /dev/null
+++ b/ds9/library/iexam.tcl
@@ -0,0 +1,189 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc IExamDef {} {
+ global iexam
+
+ set iexam(button) 0
+ set iexam(key) 0
+ set iexam(any) 0
+ set iexam(frame) {}
+ set iexam(x) {}
+ set iexam(y) {}
+ set iexam(event) {}
+ set iexam(mode) {}
+}
+
+proc IExamButton {which xx yy} {
+ global iexam
+ global imarker
+
+ if {$iexam(button) || $iexam(any)} {
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set iexam(frame) $which
+ set iexam(x) $xx
+ set iexam(y) $yy
+
+ if {$iexam(any)} {
+ set iexam(event) {<1>}
+ }
+ set iexam(button) 0
+ set iexam(any) 0
+ }
+}
+
+proc IExamKey {which K xx yy} {
+ global iexam
+
+ if {$iexam(key) || $iexam(any)} {
+ set iexam(frame) $which
+ set iexam(x) $xx
+ set iexam(y) $yy
+ set iexam(event) $K
+
+ set iexam(key) 0
+ set iexam(any) 0
+ }
+}
+
+proc ProcessSendIExamCmd {proc id param} {
+ global iexam
+
+ global icursor
+ global current
+
+ set iexam(frame) {}
+ set iexam(x) {}
+ set iexam(y) {}
+ set iexam(event) {}
+ set iexam(mode) $current(mode)
+
+ set current(mode) iexam
+
+ set iexam(button) 0
+ set iexam(key) 0
+ set iexam(any) 0
+
+ # turn on blinking cursor
+ set icursor(timer) 1
+ CursorTimer
+
+ switch -- [string tolower [lindex $param 0]] {
+ button {
+ set iexam(button) 1
+ set varname {iexam(button)}
+ set param [join [lreplace $param 0 0]]
+ }
+ key {
+ set iexam(key) 1
+ set varname {iexam(key)}
+ set param [join [lreplace $param 0 0]]
+ }
+ any {
+ set iexam(any) 1
+ set varname {iexam(any)}
+ set param [join [lreplace $param 0 0]]
+ }
+ default {
+ set iexam(button) 1
+ set varname {iexam(button)}
+ }
+ }
+
+ switch -- [string tolower [lindex $param 0]] {
+ value -
+ data {
+ vwait $varname
+ set w [lindex $param 1]
+ set h [lindex $param 2]
+ if {$w == {}} {
+ set w 1
+ }
+ if {$h == {}} {
+ set h 1
+ }
+ $proc $id "$iexam(event) [$iexam(frame) get data canvas $iexam(x) $iexam(y) $w $h]\n"
+ }
+ coordinate {
+ set sys [lindex $param 1]
+ set sky [lindex $param 2]
+ set skyformat [lindex $param 3]
+ switch -- $skyformat {
+ {} {set skyformat degrees}
+ }
+ switch -- $sky {
+ {} {set sky fk5}
+ }
+ switch -- $sys {
+ {} {set sys physical}
+ fk4 -
+ fk5 -
+ icrs -
+ galactic -
+ ecliptic {set sky $sys; set sys wcs}
+ }
+
+ vwait $varname
+ $proc $id "$iexam(event) [$iexam(frame) get coordinates $iexam(x) $iexam(y) $sys $sky $skyformat]\n"
+ }
+ {} {
+ vwait $varname
+ $proc $id "$iexam(event) [$iexam(frame) get coordinates $iexam(x) $iexam(y) image fk5 degrees]\n"
+ }
+ default {
+ vwait $varname
+ set cmd $param
+
+ # $width,$height,$depth,$bitpix
+ ParseXYBitpixMacro cmd $iexam(frame)
+
+ # $filename[$regions]
+ ParseFilenameRegionMacro cmd $iexam(frame)
+
+ # $filename
+ ParseFilenameMacro cmd $iexam(frame)
+
+ # $regions
+ ParseRegionMacro cmd $iexam(frame)
+
+ # $env
+ ParseEnvMacro cmd
+
+ # $pan
+ ParsePanMacro cmd $iexam(frame)
+
+ # $value
+ ParseValueMacro cmd $iexam(frame) $iexam(x) $iexam(y)
+
+ # $x,$y
+ ParseXYMacro cmd $iexam(frame) $iexam(x) $iexam(y)
+
+ # $z
+ ParseZMacro cmd $iexam(frame)
+
+ $proc $id "$iexam(event) $cmd\n"
+ }
+ }
+
+ # turn off blinking cursor
+ set icursor(timer) 0
+
+ set current(mode) $iexam(mode)
+
+ set iexam(button) 0
+ set iexam(key) 0
+
+ set iexam(frame) {}
+ set iexam(x) {}
+ set iexam(y) {}
+ set iexam(event) {}
+ set iexam(mode) {}
+}
+
diff --git a/ds9/library/iis.tcl b/ds9/library/iis.tcl
new file mode 100644
index 0000000..5672ebf
--- /dev/null
+++ b/ds9/library/iis.tcl
@@ -0,0 +1,398 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc IISDef {} {
+ global iis
+
+ # all internal
+ set iis(state) 0
+ set iis(width) 512
+ set iis(height) 512
+ set iis(x) -1
+ set iis(y) -1
+ set iis(frame) {}
+
+ set iis(ififo) "/dev/imt1i"
+ set iis(ofifo) "/dev/imt1o"
+ set iis(port) 5137
+ set iis(unix) "/tmp/.IMT%d"
+}
+
+proc IISInit {} {
+ global iis
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISInit:"
+ }
+
+ iis open $iis(ififo) $iis(ofifo) $iis(port) $iis(unix)
+}
+
+proc IISClose {} {
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISClose:"
+ }
+
+ iis close
+}
+
+proc IISDebug {} {
+ global debug
+
+ iis debug $debug(iis)
+}
+
+# Callbacks
+
+proc IISInitializeCmd {w h} {
+ global iis
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISInitializeCmd: $w $h"
+ }
+
+ # default frame size
+ set iis(width) $w
+ set iis(height) $h
+}
+
+proc IISInitFrameCmd {which} {
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISInitFrameCmd: $which"
+ }
+}
+
+proc IISSetDisplayFrameCmd {which w h} {
+ global iis
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISSetDisplayFrameCmd: $which $w $h"
+ }
+ IISGotoFrame $which
+ IISLoadFrame $which
+}
+
+proc IISSetRefFrameCmd {which} {
+ global iis
+ global ds9
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISSetRefFrameCmd: $which"
+ }
+
+ if {[lsearch $ds9(frames) Frame$which] == -1} {
+ return {[NOSUCHFRAME]}
+ }
+
+ if {[Frame$which has iis]} {
+ return {}
+ }
+
+ set filename [Frame$which get iis file name $iis(x) $iis(y)]
+
+ if {![string equal [string index $filename 0] "/"] } {
+ set filename [file join [pwd] $filename]
+ }
+
+ return "$filename 1. 0. 0. 1. 0. 0. 1. 32767. 1."
+}
+
+proc IISEraseFrameCmd {which} {
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISEraseFrameCmd: $which"
+ }
+
+ Frame$which iis erase
+ IISResetTimer $which
+}
+
+proc IISMessageCmd {message} {
+ global current
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISMessageCmd: $message"
+ }
+
+ $current(frame) iis message "\"$message\""
+ RefreshInfoBox $current(frame)
+}
+
+proc IISWritePixelsCmd {which ptr x y dx dy} {
+ global debug
+ if {$debug(iis)} {
+# puts stderr "IISWritePixelsCmd: $which $x $y $dx $dy"
+ }
+
+ Frame$which iis set $ptr $x $y $dx $dy
+ IISResetTimer $which
+}
+
+proc IISReadPixelsCmd {which ptr x y dx dy} {
+ global current
+
+ global debug
+ if {$debug(iis)} {
+# puts stderr "IISReadPixelsCmd: $which $x $y $dx $dy"
+ }
+
+ if {$which > 0} {
+ Frame$which get iis $ptr $x $y $dx $dy
+ } else {
+ $current(frame) get iis $ptr $x $y $dx $dy
+ }
+# IISResetTimer $which
+}
+
+proc IISWCSCmd {which a b c d e f z1 z2 zt} {
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISWCSCmd: $which $a $b $c $d $e $f $z1 $z2 $zt"
+ }
+
+ # if there is a change in config, we are not told until now
+ if {$which > 0} {
+ IISLoadFrame $which
+ Frame$which iis wcs $a $b $c $d $e $f $z1 $z2 $zt
+ }
+}
+
+proc IISSetCursorPosCmd {x y} {
+ global current
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "***IISSetCursorPosCmd: $x $y"
+ }
+
+ $current(frame) iis cursor $x $y image
+}
+
+proc IISGetCursorPosCmd {} {
+ global current
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "***IISGetCursorPosCmd:"
+ }
+
+ if {[$current(frame) has iis]} {
+ # assume frame name 'Framexxx'
+ set num [string range $current(frame) 5 end]
+ return "[$current(frame) get iis cursor] $num"
+ } else {
+ # default to first frame
+ return "1 1 0"
+ }
+}
+
+proc IISCursorModeCmd {state} {
+ global iis
+ global current
+ global icursor
+ global ds9
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISCursorModeCmd: $iis(state)=$state $current(frame)=$iis(frame)"
+ }
+
+ if {$state != $iis(state)} {
+ # iis(frame) may have been deleted
+ if {[lsearch $ds9(frames) $iis(frame)] == -1} {
+ set iis(frame) {}
+ }
+
+ if {$iis(frame) == {}} {
+ set which $current(frame)
+ } else {
+ set which $iis(frame)
+ }
+
+ set iis(state) $state
+ $which iis cursor mode $state
+
+ if {$state} {
+ bind $ds9(canvas) <Key> [list IISCursorKey %K %A %x %y]
+ bind $ds9(canvas) <f> {}
+ UnBindEventsFrameKey $which
+
+ if {$icursor(timer,abort)} {
+ set icursor(timer,abort) 0
+ set icursor(timer) 1
+ } else {
+ set icursor(timer) 1
+ CursorTimer
+ }
+ } else {
+ bind $ds9(canvas) <Key> {}
+ bind $ds9(canvas) <f> {ToggleBindEvents}
+ BindEventsFrameKey $which
+
+ set icursor(timer,abort) 1
+ set icursor(timer) 0
+ set iis(frame) [lindex [$ds9(canvas) gettags current] 0]
+ }
+ }
+}
+
+proc IISLoadFrame {which} {
+ global iis
+ global ds9
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISLoadFrame: $which"
+ }
+
+ if {$which > 0} {
+ if {(![Frame$which has iis]) || \
+ ([Frame$which get fits width] != $iis(width)) || \
+ ([Frame$which get fits height] != $iis(height))} {
+
+ StartLoad
+ Frame$which iis new $iis(width) $iis(height)
+ FinishLoad
+ } else {
+ # make sure any previous data is rendered
+ Frame$which update now
+ }
+ }
+}
+
+proc IISGotoFrame {which} {
+ global current
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISGotoFrame: $which"
+ }
+
+ if {$which > 0} {
+ if {$current(frame) != "Frame$which"} {
+ CreateGotoFrame $which base
+ }
+ }
+}
+
+proc IISResetTimer {which} {
+ global iis
+
+ if {![info exists iis(timer$which)]} {
+ after 500 IISTimer $which
+ }
+ set iis(timer$which) 1
+}
+
+proc IISTimer {which} {
+ global iis
+
+ if {$iis(timer$which)} {
+ after 500 IISTimer $which
+ set iis(timer$which) 0
+ } else {
+ if {$which > 0} {
+ Frame$which iis update
+ # re-execute FinishLoad again since we are finally done loading
+ FinishLoad
+ }
+ unset iis(timer$which)
+ }
+}
+
+proc IISCursorKey {sym key xx yy} {
+ global current
+ global iis
+ global ds9
+
+ # MacOSX and Ubuntu returns bogus values in xx,yy
+ # calculate our own values
+ set xx [expr {[winfo pointerx $ds9(canvas)] - [winfo rootx $ds9(canvas)]}]
+ set yy [expr {[winfo pointery $ds9(canvas)] - [winfo rooty $ds9(canvas)]}]
+
+ global debug
+ if {$debug(iis)} {
+ puts stderr "IISCursorKey: $sym $key $xx $yy"
+ }
+
+ set which [lindex [$ds9(canvas) gettags current] 0]
+ if {$which == {}} {
+ return
+ }
+
+ set iis(x) $xx
+ set iis(y) $yy
+
+ switch -- $sym {
+ Up {$which warp 0 -1}
+ Down {$which warp 0 1}
+ Left {$which warp -1 0}
+ Right {$which warp 1 0}
+
+ default {
+ if {$key!={}} {
+ set num [string range $which end end]
+ set coord [$which get coordinates $xx $yy physical]
+ if {$coord == {}} {
+ switch -- $key {
+ : -
+ q {set coord "0 0"}
+ default {return}
+ }
+ }
+ $which iis cursor $xx $yy canvas
+ iis retcur [lindex $coord 0] [lindex $coord 1] $key $num
+ }
+ }
+ }
+}
+
+# Cmds
+
+proc ProcessIISCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+
+ switch -- [string tolower [lindex $var $i]] {
+ filename {
+ if {[string is integer [lindex $var [expr $i+2]]]} {
+ if {$current(frame) != {}} {
+ $current(frame) iis set file name \
+ [lindex $var [expr $i+1]] [lindex $var [expr $i+2]]
+ }
+ incr i 2
+ } else {
+ if {$current(frame) != {}} {
+ $current(frame) iis set file name [lindex $var [expr $i+1]]
+ }
+ incr i
+ }
+ }
+ }
+}
+
+proc ProcessSendIISCmd {proc id param} {
+ global current
+
+ switch -- [string tolower [lindex $param 0]] {
+ filename {
+ if {$current(frame) != {}} {
+ $proc $id \
+ "[$current(frame) get iis file name [lindex $param 1]]\n"
+ }
+ }
+ }
+}
+
diff --git a/ds9/library/ime.tcl b/ds9/library/ime.tcl
new file mode 100644
index 0000000..96deb0f
--- /dev/null
+++ b/ds9/library/ime.tcl
@@ -0,0 +1,609 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc IMEDef {} {
+ global iime
+ global ime
+ global pime
+
+ set ime(task) stats
+ set ime(shape) circle
+
+ array set pime [array get ime]
+}
+
+proc IMEChangeTask {} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {$current(mode) != {analysis}} {
+ return
+ }
+
+ UpdateTaskMenu
+ IMEChangeShape
+}
+
+proc IMEChangeShape {} {
+ global ime
+ global ds9
+ global current
+
+ switch $ime(task) {
+ stats -
+ hist {
+ switch $ime(shape) {
+ circle -
+ ellipse -
+ box -
+ polygon {}
+ default {set ime(shape) circle}
+ }
+ }
+ radial {
+ switch $ime(shape) {
+ annulus -
+ ellipseannulus -
+ boxannulus {}
+ default {set ime(shape) annulus}
+ }
+ }
+ plot2d {}
+ plot3d {
+ switch $ime(shape) {
+ circle -
+ ellipse -
+ box -
+ polygon -
+ point {}
+ default {set ime(shape) point}
+ }
+ }
+ }
+
+ foreach ff $ds9(frames) {
+ $ff marker analysis unselect all
+ set coord [$ff get crosshair canvas]
+ set XX [lindex $coord 0]
+ set YY [lindex $coord 1]
+
+ $ff analysis shape $ime(shape) $XX $YY
+
+ if {$current(frame) == $ff} {
+ IMEDoTask $current(frame)
+ }
+ }
+}
+
+proc IMEDoTask {which} {
+ global ime
+
+ if {![$which has fits]} {
+ return
+ }
+
+ switch $ime(task) {
+ stats {IMEStatsTask $which}
+ hist {IMEHistTask $which}
+ radial {IMERadialTask $which}
+ plot2d {IMEPlot2DTask $which}
+ plot3d {IMEPlot3DTask $which}
+ }
+}
+
+proc IMEKey {which K xx yy} {
+ global ime
+
+ # always available
+ switch $K {
+ question {
+ IMEHelp
+ return
+ }
+ }
+
+ if {![$which has fits]} {
+ return
+ }
+
+ switch $K {
+ a {
+ # FWHM (Aperture Sum)
+ }
+ b {
+ # Box Coords?
+ }
+ c {
+ # Column Cut
+ }
+ d {
+ # remap (Load Display)
+ set ime(task) plot3d
+ IMEKeyTask $which $xx $yy
+ }
+ e {
+ # remap (Contour)
+ }
+ f {
+ # remap (Redraw)
+ }
+ g {
+ # remap (Graphics Cursor)
+ }
+ h {
+ set ime(task) hist
+ IMEKeyTask $which $xx $yy
+ }
+ i {
+ # remap (Image Cursor)
+ }
+ j {
+ # Line Guassian Fit
+ }
+ k {
+ # Col Gaussian Fit
+ }
+ l {
+ # Line Cut
+ }
+ m {
+ set ime(task) stats
+ IMEKeyTask $which $xx $yy
+ }
+ n {
+ # remap (Next Frame)
+ }
+ o {
+ # remap (Overplot)
+ }
+ p {
+ # remap (Prev Frame)
+ }
+ q {
+ # remap (Quit)
+ }
+ r {
+ set ime(task) radial
+ IMEKeyTask $which $xx $yy
+ }
+ s {
+ # Surface Plot
+ }
+ t {
+ # remap (Output Image)
+ }
+ u {
+ # Vector Plot
+ }
+ v {
+ set ime(task) plot2d
+ IMEKeyTask $which $xx $yy
+ }
+ w {
+ # remap (Toggle Logfile)
+ }
+ x {
+ # Print coords/values
+ }
+ y {
+ # remap (Set Origin)
+ }
+ z {
+ # Print value grid
+ }
+ , {
+ # Quick Profile Photometry
+ }
+ . {
+ # Quick Radial Profile Plot and Fit
+ }
+ }
+}
+
+proc IMEKeyTask {which xx yy} {
+ global ime
+
+ $which crosshair canvas $xx $yy
+
+ $which analysis shape $ime(shape) $xx $yy
+ IMEDoTask $which
+
+ UpdateColormapLevelMosaic $which $xx $yy canvas
+ UpdateInfoBox $which $xx $yy canvas
+ UpdatePixelTableDialog $which $xx $yy canvas
+ UpdateGraph $which $xx $yy canvas
+}
+
+proc IMEButton {which xx yy} {
+ global ime
+ global imarker
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMEButton $which $xx $yy"
+ }
+
+ # see if we are on a handle
+ set hh [$which get marker analysis handle $xx $yy]
+ set id [lindex $hh 0]
+ set imarker(handle) [lindex $hh 1]
+
+ if {$imarker(handle)} {
+ $which marker analysis $id edit begin $imarker(handle)
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a segment of a polygon
+ set hh [$which get marker analysis polygon segment $xx $yy]
+ set id [lindex $hh 0]
+ set segment [lindex $hh 1]
+ if {$segment} {
+ $which marker analysis $id create polygon vertex $segment $xx $yy
+ $which marker analysis $id edit begin $imarker(handle)
+ set imarker(handle) [expr 4+$segment+1]
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # see if any markers are selected
+ if {[$which get marker analysis select number]>0} {
+ # else, see if we are on a marker
+ if {[$which get marker analysis id $xx $yy]} {
+ $which marker analysis $id move begin
+ set imarker(motion) beginMove
+ return
+ } else {
+ $which marker analysis unselect all
+ set imarker(motion) none
+ return
+ }
+ }
+
+ $which marker analysis $id move begin
+ set imarker(motion) beginMove
+
+ $which crosshair canvas $xx $yy
+ $which analysis shape $ime(shape) $xx $yy
+ IMEDoTask $which
+}
+
+proc IMEShift {which xx yy} {
+ global ime
+ global imarker
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMEShift $which $xx $yy"
+ }
+
+ # see if we are on a handle
+ set hh [$which get marker analysis handle $xx $yy]
+ set id [lindex $hh 0]
+ set imarker(handle) [lindex $hh 1]
+
+ if {$imarker(handle)} {
+ $which marker analysis $id rotate begin
+ set imarker(motion) beginRotate
+ }
+}
+
+proc IMEDouble {which xx yy} {
+ global ime
+ global imarker
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMEDouble $which $xx $yy"
+ }
+
+ if {[$which get marker analysis id $xx $yy]} {
+ $which marker analysis select only $xx $yy
+ }
+}
+
+proc IMEMotion {which xx yy} {
+ global ime
+ global imarker
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMEMotion $which $xx $yy"
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+ beginMove -
+ move {
+ $which marker analysis move motion $x $y
+ set imarker(motion) move
+ $which crosshair canvas $xx $yy
+ $which analysis shape $ime(shape) $xx $yy
+ IMEDoTask $which
+ }
+ beginEdit -
+ edit {
+ set imarker(motion) edit
+ $which marker analysis edit motion $xx $yy $imarker(handle)
+ IMEDoTask $which
+ }
+ beginRotate -
+ rotate {
+ set imarker(motion) rotate
+ $which marker analysis rotate motion $xx $yy $imarker(handle)
+ IMEDoTask $which
+ }
+ region -
+ shiftregion {}
+ }
+}
+
+proc IMERelease {which xx yy} {
+ global ime
+ global imarker
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMERelease $which $xx $yy"
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+ beginMove -
+ beginRotate {}
+ beginEdit {}
+ move {
+ $which marker analysis move end
+ IMEDoTask $which
+ }
+ edit {
+ $which marker analysis edit end
+ IMEDoTask $which
+ }
+ rotate {
+ $which marker analysis rotate end
+ IMEDoTask $which
+ }
+ region -
+ shiftregion {}
+ }
+
+ set imarker(motion) none
+ set imarker(handle) -1
+}
+
+proc IMEArrowKey {which xx yy} {
+ global ime
+ global ds9
+
+ global debug
+ if {$debug(tcl,ime)} {
+ puts stderr "IMEArrow $which $xx $yy"
+ }
+
+ $which crosshair warp $xx $yy
+
+ set coord [$which get crosshair canvas]
+ set XX [lindex $coord 0]
+ set YY [lindex $coord 1]
+
+ $which analysis shape $ime(shape) $XX $YY
+ IMEDoTask $which
+
+ UpdateColormapLevelMosaic $which $XX $YY canvas
+ UpdateInfoBox $which $XX $YY canvas
+ UpdatePixelTableDialog $which $XX $YY canvas
+ UpdateGraph $which $XX $YY canvas
+}
+
+proc IMEHelp {} {
+ global ime
+
+ set rr "\tAnalysis Help\n\n?\tPrint Help\nd\tPlot 3D\nm\tStatistics\nv\tPlot 2D\n"
+
+ SimpleTextDialog imehlp "Analysis Help" 80 20 insert top $rr
+}
+
+proc IMEStatsTask {which} {
+ global ime
+
+ set rr [$which get marker analysis hide analysis stats physical fk5]
+
+ SimpleTextDialog "imestat" "Statistics" 80 20 insert top $rr
+}
+
+proc IMEHistTask {which} {
+ global iime
+ global ime
+
+ set id 0
+
+ set varname imehist
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname analysishist
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ global $xdata $ydata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ PlotLineDialog $vvarname Histogram {} Values Counts
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata
+ }
+
+ $which get marker analysis hide analysis histogram $xdata $ydata 512
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ set vvar(smooth) step
+ set vvar(fill) 1
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc IMERadialTask {which} {
+ global iime
+ global ime
+
+ set varname imerad
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname analysisrad
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(system) physical
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ set yedata ${vvarname}ye
+ global $xdata $ydata $yedata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ PlotLineDialog $vvarname "Radial Profile" {} physical {}
+ MarkerAnalysisRadialAxisTitle $vvarname
+
+ set vvar(manage) 0
+ set vvar(dim) xyey
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ set vvar(yedata) $yedata
+ blt::vector create $xdata $ydata $yedata
+ }
+
+ $which get marker analysis hide analysis radial $xdata $ydata $yedata physical
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc IMEPlot2DTask {which} {
+ global iime
+ global ime
+
+ set varname imeplot2d
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname analysisplot2d
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(system) physical
+ set vvar(sky) fk5
+ set vvar(method) average
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ set xcdata ${vvarname}xc
+ set ycdata ${vvarname}yc
+ global $xdata $ydata $xcdata $ycdata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ PlotLineDialog $vvarname Plot2D {} physical Counts
+ MarkerAnalysisPlot2dXAxisTitle $vvarname
+ MarkerAnalysisPlot2dYAxisTitle $vvarname
+
+ # setup our own formatting
+ set vvar(graph,format) 0
+ set vvar(xcdata) $xcdata
+ set vvar(ycdata) $ycdata
+ $vvar(graph) xaxis configure \
+ -command "MarkerAnalysisPlot2dXAxis $vvarname"
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata $xcdata $ycdata
+ }
+
+ $which get marker analysis hide analysis plot2d $xdata $ydata $xcdata $ycdata physical fk5 average
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc IMEPlot3DTask {which} {
+ global iime
+ global ime
+
+ set varname imeplot3d
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname analysisplot3d
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(system) image
+ set vvar(method) average
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ global $xdata $ydata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ PlotLineDialog $vvarname Plot3D {} image Counts
+ MarkerAnalysisPlot3dXAxisTitle $vvarname
+ MarkerAnalysisPlot3dYAxisTitle $vvarname
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata
+ }
+
+ $which get marker analysis hide analysis plot3d $xdata $ydata physical average
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
diff --git a/ds9/library/imgsvr.tcl b/ds9/library/imgsvr.tcl
new file mode 100644
index 0000000..2b3b4fb
--- /dev/null
+++ b/ds9/library/imgsvr.tcl
@@ -0,0 +1,585 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc IMGSVRInit {varname title exec ack done error} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global pds9
+
+ # AR variables
+ ARInit $varname IMGSVRServer
+
+ # IMG variables
+ set var(proc,exec) $exec
+ set var(proc,ack) $ack
+ set var(proc,done) $done
+ set var(proc,error) $error
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ Toplevel $w $mb 6 $title "ARDestroy $varname"
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Retrieve}] \
+ -command "IMGSVRApply $varname 0"
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Update from Current Frame}] \
+ -command "IMGSVRUpdate $varname"
+ $mb.file add command \
+ -label [msgcat::mc {Update from Current Crosshair}] \
+ -command "IMGSVRCrosshair $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Acknowledgment}] \
+ -command "IMGSVRAck $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "ARDestroy $varname"
+
+ AREditMenu $varname
+ NSVRServerMenu $varname
+
+ $mb add cascade -label [msgcat::mc {Preferences}] -menu $mb.prefs
+ menu $mb.prefs
+ $mb.prefs add checkbutton -label [msgcat::mc {Save Image on Download}] \
+ -variable ${varname}(save)
+ $mb.prefs add separator
+ $mb.prefs add radiobutton -label [msgcat::mc {New Frame}] \
+ -variable ${varname}(mode) -value new
+ $mb.prefs add radiobutton -label [msgcat::mc {Current Frame}] \
+ -variable ${varname}(mode) -value current
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.nametitle -text [msgcat::mc {Object}]
+ ttk::entry $f.name -textvariable ${varname}(name) -width 50
+ ttk::label $f.sky -textvariable ${varname}(sky) -anchor w
+ set var(xname) [ttk::label $f.xtitle -text {} -width 1]
+ ttk::entry $f.x -textvariable ${varname}(x) -width 14
+ set var(yname) [ttk::label $f.ytitle -text {} -width 1]
+ ttk::entry $f.y -textvariable ${varname}(y) -width 14
+ ARSkyFormat $f.skyformat $varname
+ ttk::label $f.wtitle -text [msgcat::mc {Width}]
+ ttk::entry $f.w -textvariable ${varname}(width) -width 14
+ ttk::label $f.htitle -text [msgcat::mc {Height}]
+ ttk::entry $f.h -textvariable ${varname}(height) -width 14
+ ARRFormat $f.format $varname
+
+ grid $f.nametitle x $f.name - - - - -padx 2 -pady 2 -sticky ew
+ grid $f.sky $f.xtitle $f.x $f.ytitle $f.y $f.skyformat \
+ -padx 2 -pady 2 -sticky w
+ grid $f.wtitle x $f.w $f.htitle $f.h $f.format -padx 2 -pady 2 -sticky w
+
+ # Status
+ set f [ttk::frame $w.status]
+ ttk::label $f.title -text [msgcat::mc {Status}]
+ ttk::label $f.item -textvariable ${varname}(status)
+ grid $f.title $f.item -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ set var(apply) [ttk::button $f.apply -text [msgcat::mc {Retrieve}] \
+ -command "IMGSVRApply $varname 0"]
+ set var(cancel) [ttk::button $f.cancel -text [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname" -state disabled]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "ARDestroy $varname"
+ pack $f.apply $f.cancel $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.sep2 -orient horizontal
+ pack $w.buttons $w.sep $w.status $w.sep2 -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ ARCoord $varname
+ ARStatus $varname {}
+}
+
+proc IMGSVRApply {varname sync} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRApply $varname $sync"
+ }
+
+ set var(sync) $sync
+ ARApply $varname
+ if {($var(name) != {})} {
+ set var(sky) fk5
+ ARCoord $varname
+
+ NSVRServer $varname
+ } else {
+ IMGSVRServer $varname
+ }
+}
+
+proc IMGSVRAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRAck $varname"
+ }
+
+ eval "$var(proc,ack) $varname"
+}
+
+proc IMGSVRUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+ global wcs
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRUpdate $varname"
+ }
+
+ if {[winfo exists $var(top)]} {
+ set var(name) {}
+ if {$current(frame) != {} } {
+ if {[$current(frame) has wcs equatorial $wcs(system)]} {
+ set coord [$current(frame) get fits center \
+ $wcs(system) $var(sky) $var(skyformat)]
+ set var(x) [lindex $coord 0]
+ set var(y) [lindex $coord 1]
+
+ set size [$current(frame) get fits size \
+ $wcs(system) $var(sky) $var(rformat)]
+ set var(width) [lindex $size 0]
+ set var(height) [lindex $size 1]
+
+ return
+ }
+ } else {
+ set var(x) {}
+ set var(y) {}
+ set var(width) {}
+ set var(height) {}
+ }
+ }
+}
+
+proc IMGSVRCrosshair {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRCrosshair $varname"
+ }
+
+ global current
+ global wcs
+
+ if {[winfo exists $var(top)]} {
+ set var(name) {}
+ if {$current(frame) != {} } {
+ if {[$current(frame) has wcs equatorial $wcs(system)]} {
+ set coord [$current(frame) get crosshair \
+ $wcs(system) $var(sky) $var(skyformat)]
+ set var(x) [lindex $coord 0]
+ set var(y) [lindex $coord 1]
+
+ return
+ }
+ }
+ set var(x) {}
+ set var(y) {}
+ }
+}
+
+proc IMGSVRServer {varname} {
+ upvar #0 $varname var
+ global $varname
+ global current
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRServer $varname"
+ }
+
+ if {($var(x) != {}) &&
+ ($var(y) != {}) &&
+ ($var(width) != {}) &&
+ ($var(height) != {})} {
+
+ ARStatus $varname [msgcat::mc {Contacting Image Server}]
+ eval [list $var(proc,exec) $varname]
+ } else {
+ eval [list $var(proc,error) $varname [msgcat::mc {Please specify width, height, and either name or (ra,dec)}]]
+ }
+}
+
+proc IMGSVRGetURL {varname url} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRGetURL $varname $url $var(query)"
+ }
+
+ set var(ch) [open "$var(fn)" w]
+
+ global ihttp
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $url \
+ -timeout $ihttp(timeout) \
+ -channel $var(ch) \
+ -progress \
+ [list IMGSVRProgress $varname] \
+ -binary 1 \
+ -headers "[ProxyHTTP]" \
+ -query "$var(query)"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ IMGSVRGetURLFinish $varname $var(token)
+ } else {
+ catch {close $var(ch)}
+ eval [list $var(proc,error) $varname "[msgcat::mc {Unable to locate URL}] $url"]
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $url \
+ -timeout $ihttp(timeout) \
+ -channel $var(ch) \
+ -command \
+ [list IMGSVRGetURLFinish $varname] \
+ -progress \
+ [list IMGSVRProgress $varname] \
+ -binary 1 \
+ -headers "[ProxyHTTP]" \
+ -query "$var(query)"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ catch {close $var(ch)}
+ eval [list $var(proc,error) $varname "[msgcat::mc {Unable to locate URL}] $url"]
+ }
+ }
+}
+
+proc IMGSVRGetURLFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRGetURLFinish $varname"
+ }
+
+ global current
+ global ds9
+ global loadParam
+
+ catch {close $var(ch)}
+
+ if {!($var(active))} {
+ ARCancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set var(code) [http::ncode $token]
+
+ # Meta
+ set var(meta) $t(meta)
+
+ # Mime-type
+ # we want to strip and extra info after ';'
+ regexp -nocase {([^;])*} $t(type) var(mime)
+
+ # Content-Encoding
+ set var(encoding) {}
+ foreach {name value} $var(meta) {
+ if {[regexp -nocase ^content-encoding $name]} {
+ switch -- [string tolower $value] {
+ compress -
+ bzip2 {set var(encoding) bzip2}
+ Z {set var(encoding) compress}
+ pack -
+ z {set var(encoding) pack}
+ default {}
+ }
+ }
+ }
+
+ HTTPLog $token
+ # Result?
+ switch -- $var(code) {
+ 200 -
+ 203 {IMGSVRParse $varname}
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $var(meta) {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRGetURLFinish redirect $var(code) to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ IMGSVRGetURL $varname $value
+ }
+ }
+ }
+
+ default {
+ eval [list $var(proc,error) $varname "[msgcat::mc {Error code was returned}] $var(code)"]
+ }
+ }
+}
+
+proc IMGSVRParse {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+ global ds9
+ global loadParam
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "IMGSVRParse: $varname : fn $var(fn) : code $var(code) : meta $var(meta) : mime $var(mime) : encoding $var(encoding)"
+ }
+
+ switch -- [string tolower $var(mime)] {
+ "application/octet-stream" {
+ # its never fails, someone can't get there mime types correct.
+ # Override the mime type based on path
+ switch -- [file extension $var(fn)] {
+ .bz2 {set var(encoding) bzip2}
+ .Z {set var(encoding) compress}
+ .z {set var(encoding) pack}
+ }
+ }
+
+ "image/fits" -
+ "application/fits" {}
+
+ "application/fits-image" -
+ "application/fits-table" -
+ "application/fits-group" {}
+
+ "image/x-fits" -
+ "binary/x-fits" -
+ "application/x-fits" {}
+
+ "image/x-gfits" -
+ "binary/x-gfits" -
+ "image/gz-fits" -
+ "application/x-gzip" -
+ "display/gz-fits" {}
+
+ "image/fits-hcompress" -
+ "image/x-fits-h" {}
+
+ "image/bz2-fits" -
+ "display/bz2-fits" {set var(encoding) bzip2}
+
+ "image/x-cfits" -
+ "binary/x-cfits" {set var(encoding) compress}
+
+ "image/x-zfits" -
+ "binary/x-zfits" {set var(encoding) pack}
+
+ "text/html" -
+ "text/plain" -
+ default {
+ # NOTE: error notices may come as text/html
+ eval [list $var(proc,error) $varname [msgcat::mc {No Data Available}]]
+ return
+ }
+ }
+
+ switch -- $var(mode) {
+ new {MultiLoadBase}
+ current {}
+ }
+
+ StartLoad
+ # alloc it because we are going to delete it after load
+ set loadParam(load,type) allocgz
+ set loadParam(load,layer) {}
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {}
+ set loadParam(file,name) $var(fn)
+ set loadParam(file,fn) $loadParam(file,name)
+
+ # may have to convert the file, based on content-encoding
+ switch -- "$var(encoding)" {
+ bzip2 {
+ catch {set ch [open "| bunzip2 < $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ compress {
+ catch {set ch [open "| uncompress < $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ pack {
+ catch {set ch [open "| pcat $var(fn) " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ }
+ ProcessLoad
+ FinishLoad
+
+ if {!$var(save)} {
+ if {[file exists $var(fn)]} {
+ catch {file delete -force $var(fn)}
+ }
+ }
+
+ $var(proc,done) $varname
+}
+
+proc IMGSVRProgress {varname token totalsize currentsize} {
+ upvar #0 $varname var
+ global $varname
+
+ # sometimes we get nothing
+ if {$totalsize == {} || $currentsize == {}} {
+ ARStatus $varname {}
+ } elseif {$totalsize != 0} {
+ ARStatus $varname "$currentsize bytes of $totalsize bytes [expr int(double($currentsize)/$totalsize*100)]%"
+ } else {
+ ARStatus $varname "$currentsize bytes"
+ }
+}
+
+proc IMGSVRProcessCmd {varname iname vvarname} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ upvar #0 $vvarname vvar
+
+ switch -- [string tolower [lindex $var $i]] {
+ {} {
+ if {$vvar(name) != {} || ($vvar(x) != {} && $vvar(y) != {})} {
+ IMGSVRApply $vvarname 1
+ }
+ }
+ open {}
+ close {ARDestroy $vvarname}
+ save {
+ incr i
+ set vvar(save) [FromYesNo [lindex $var $i]]
+ }
+ frame {
+ incr i
+ set vvar(mode) [string tolower [lindex $var $i]]
+ }
+ survey {
+ incr i
+ set vvar(survey) [lindex $var $i]
+ }
+ size {
+ incr i
+ set vvar(width) [lindex $var $i]
+ incr i
+ set vvar(height) [lindex $var $i]
+ incr i
+ if {[lindex $var $i] != {} && \
+ [string range [lindex $var $i] 0 0] != {-}} {
+ set vvar(rformat) [lindex $var $i]
+ set vvar(rformat,msg) $vvar(rformat)
+ } else {
+ incr i -1
+ }
+ }
+ pixels {
+ incr i
+ set vvar(width,pixels) [lindex $var $i]
+ incr i
+ set vvar(height,pixels) [lindex $var $i]
+ }
+ update {
+ incr i
+ switch [string tolower [lindex $var $i]] {
+ frame {IMGSVRUpdate $vvarname}
+ crosshair {IMGSVRCrosshair $vvarname}
+ }
+ IMGSVRApply $vvarname 1
+ }
+ coord {
+ incr i
+ set vvar(x) [lindex $var $i]
+ incr i
+ set vvar(y) [lindex $var $i]
+ incr i
+ if {[lindex $var $i] != {} && \
+ [string range [lindex $var $i] 0 0] != {-}} {
+ set vvar(skyformat) [lindex $var $i]
+ set vvar(skyformat,msg) $vvar(skyformat)
+ } else {
+ incr i -1
+ }
+ IMGSVRApply $vvarname 1
+ }
+ name {
+ incr i
+ set vvar(name) [lindex $var $i]
+ if {$vvar(name) != {}} {
+ IMGSVRApply $vvarname 1
+ }
+ }
+ default {
+ set vvar(name) [lindex $var $i]
+ if {$vvar(name) != {}} {
+ IMGSVRApply $vvarname 1
+ }
+ }
+ }
+}
+
+proc IMGSVRProcessSendCmd {proc id param vvarname} {
+ upvar #0 $vvarname vvar
+
+ switch -- [string tolower [lindex $param 0]] {
+ save {$proc $id [ToYesNo $vvar(save)]}
+ frame {$proc $id "$vvar(mode)\n"}
+ survey {$proc $id "$vvar(survey)\n"}
+ size {$proc $id "$vvar(width) $vvar(height) $vvar(rformat)\n"}
+ pixels {$proc $id "$vvar(width,pixels) $vvar(height,pixels)\n"}
+ coord {$proc $id "$vvar(x) $vvar(y) $vvar(skyformat)\n"}
+ name -
+ default {$proc $id "$vvar(name)\n"}
+ }
+}
diff --git a/ds9/library/import.tcl b/ds9/library/import.tcl
new file mode 100644
index 0000000..cd7df24
--- /dev/null
+++ b/ds9/library/import.tcl
@@ -0,0 +1,230 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc Import {fn format layer mode fn2} {
+ global current
+
+ if {$fn == {}} {
+ return
+ }
+
+ StartLoad
+ switch -- $format {
+ array {ImportArrayFile $fn $layer}
+ rgbarray {
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {CreateRGBFrame}
+ rgb {}
+ }
+ ImportRGBArrayFile $fn
+ }
+ nrrd {ImportNRRDFile $fn $layer}
+ envi {ImportENVIFile $fn $fn2}
+ gif -
+ tiff -
+ jpeg -
+ png {ImportPhotoFile $fn $mode}
+ }
+ FinishLoad
+}
+
+# Support
+
+proc ImportDialog {format {layer {}} {mode {}}} {
+ global arrayfbox
+ global rgbarrayfbox
+ global nrrdfbox
+ global envifbox
+ global envi2fbox
+ global giffbox
+ global jpegfbox
+ global tifffbox
+ global pngfbox
+
+ switch -- $format {
+ array {set fn [OpenFileDialog arrayfbox]}
+ rgbarray {set fn [OpenFileDialog rgbarrayfbox]}
+ nrrd {set fn [OpenFileDialog nrrdfbox]}
+ envi {set fn [OpenFileDialog envifbox]}
+ gif {set fn [OpenFileDialog giffbox]}
+ jpeg {set fn [OpenFileDialog jpegfbox]}
+ tiff {set fn [OpenFileDialog tifffbox]}
+ png {set fn [OpenFileDialog pngfbox]}
+ }
+ set fn2 {}
+
+ if {$fn != {}} {
+ set ok 1
+ switch -- $format {
+ array {
+ # do we have an array spec tag'd on
+ if {![regexp -nocase {(.*)(\[.*\])} $fn foo base ext]} {
+ set ext {}
+ set ok [ArrayImportDialog 1 ext]
+ if {$ok} {
+ append fn "$ext"
+ }
+ }
+ }
+ rgbarray {
+ # do we have an array spec tag'd on
+ if {![regexp -nocase {(.*)(\[.*\])} $fn foo base ext]} {
+ set ext {}
+ set ok [ArrayImportDialog 3 ext]
+ if {$ok} {
+ append fn "$ext"
+ }
+ }
+ }
+ envi {
+ set fn2 [FindENVIDataFile $fn]
+ if {$fn2 == {}} {
+ set fn2 "[file rootname $fn].bsq"
+ SetFileLast envi2 $fn2
+ set fn2 [OpenFileDialog envi2fbox]
+ if {$fn2 == {}} {
+ set ok 0
+ }
+ }
+ }
+ nrrd -
+ gif -
+ jpeg -
+ tiff -
+ png {}
+ }
+
+ if {$ok} {
+ Import $fn $format $layer $mode $fn2
+ }
+ }
+}
+
+proc ArrayImportDialog {depth varname} {
+ upvar $varname var
+ global env
+ global ed
+ global ds9
+
+ set w {.arr}
+
+ set ed(ok) 0
+ set ed(x) $ds9(array,x)
+ set ed(y) $ds9(array,y)
+ set ed(z) $depth
+ set ed(bitpix) $ds9(array,bitpix)
+ set ed(skip) $ds9(array,skip)
+ set ed(arch) $ds9(array,arch)
+
+ if {[info exists env(DS9_ARRAY)]} {
+ if {[regexp {.*(dims.?=)([0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(x) $item
+ set ed(y) $item
+ }
+ if {[regexp {.*(dim.?=)([0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(x) $item
+ set ed(y) $item
+ }
+ if {[regexp {.*(xdim.?=)([0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(x) $item
+ }
+ if {[regexp {.*(ydim.?=)([0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(y) $item
+ }
+ if {[regexp {.*(zdim.?=)([0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(z) $item
+ }
+ if {[regexp {.*(bitpix.?=)(-?[0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(bitpix) $item
+ }
+ if {[regexp {.*(skip.?=)(-?[0-9]+)} $env(DS9_ARRAY) foo f1 item]} {
+ set ed(skip) $item
+ }
+ if {[regexp {.*arch.?=bigendian} $env(DS9_ARRAY) foo item]} {
+ set ed(arch) $item
+ }
+ if {[regexp {.*arch.?=littleendian} $env(DS9_ARRAY) foo item]} {
+ set ed(arch) $item
+ }
+ }
+
+ DialogCreate $w [msgcat::mc {Import Array}] ed(ok)
+
+ # Dim
+ set f [ttk::labelframe $w.dim -text [msgcat::mc {Dimension}] -padding 2]
+ ttk::entry $f.x -textvariable ed(x) -width 6
+ ttk::entry $f.y -textvariable ed(y) -width 6
+ ttk::entry $f.z -textvariable ed(z) -width 6
+ grid $f.x $f.y $f.z -padx 2 -pady 2 -sticky w
+
+ # Bitpix
+ set f [ttk::labelframe $w.bitpix -text [msgcat::mc {Pixel Size}] -padding 2]
+ ttk::radiobutton $f.char -text {Char} -variable ed(bitpix) -value 8
+ ttk::radiobutton $f.short -text {Short} -variable ed(bitpix) -value 16
+ ttk::radiobutton $f.ushort -text {UShort} -variable ed(bitpix) -value -16
+ ttk::radiobutton $f.long -text {Long} -variable ed(bitpix) -value 32
+ ttk::radiobutton $f.float -text {Float} -variable ed(bitpix) -value -32
+ ttk::radiobutton $f.double -text {Double} -variable ed(bitpix) -value -64
+ grid $f.char -padx 2 -pady 2 -sticky w
+ grid $f.short $f.ushort $f.long -padx 2 -pady 2 -sticky w
+ grid $f.float $f.double -padx 2 -pady 2 -sticky w
+
+ # Skip
+ set f [ttk::labelframe $w.skip -text [msgcat::mc {Header}] -padding 2]
+ ttk::label $f.t1 -text [msgcat::mc {Skip First}]
+ ttk::label $f.t2 -text [msgcat::mc {Bytes}]
+ ttk::entry $f.skip -textvariable ed(skip) -width 6
+ grid $f.t1 $f.skip $f.t2 -padx 2 -pady 2 -sticky w
+
+ # Arch
+ set f [ttk::labelframe $w.arch -text [msgcat::mc {Architecture}] -padding 2]
+ ttk::radiobutton $f.big -text {Big-Endian} -variable ed(arch) \
+ -value bigendian
+ ttk::radiobutton $f.little -text {Little-Endian} -variable ed(arch) \
+ -value littleendian
+ grid $f.big $f.little -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ grid $w.dim -sticky news
+ grid $w.bitpix -sticky news
+ grid $w.skip -sticky news
+ grid $w.arch -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid rowconfigure $w 2 -weight 1
+ grid rowconfigure $w 3 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set ds9(array,x) $ed(x)
+ set ds9(array,y) $ed(y)
+ set ds9(array,bitpix) $ed(bitpix)
+ set ds9(array,skip) $ed(skip)
+ set ds9(array,arch) $ed(arch)
+
+ set var "\[xdim=$ed(x),ydim=$ed(y),zdim=$ed(z),bitpix=$ed(bitpix),skip=$ed(skip),arch=$ed(arch)\]"
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
diff --git a/ds9/library/info.tcl b/ds9/library/info.tcl
new file mode 100644
index 0000000..1c05fa2
--- /dev/null
+++ b/ds9/library/info.tcl
@@ -0,0 +1,1177 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CreateInfoPanel {} {
+ global ds9
+ global pds9
+ global view
+ global infobox
+
+ # Panel Frame
+ set ds9(panel) [ttk::frame $ds9(main).panel]
+ set ds9(panel,sep) [ttk::separator $ds9(main).spanel -orient horizontal]
+
+ # Info
+ set ds9(info) [ttk::frame $ds9(panel).info]
+ ttk::frame $ds9(info).dummy
+
+ ttk::label $ds9(info).fileTitle -text [msgcat::mc {File}]
+ ttk::label $ds9(info).fileValue -relief groove \
+ -textvariable infobox(filename)
+
+ ttk::label $ds9(info).objTitle -text [msgcat::mc {Object}]
+ ttk::label $ds9(info).objValue -relief groove \
+ -textvariable infobox(object)
+
+ ttk::entry $ds9(info).keyWord -textvariable view(info,keyvalue)
+ ttk::label $ds9(info).keyValue -relief groove \
+ -textvariable infobox(keyvalue)
+
+ ttk::label $ds9(info).minTitle -text [msgcat::mc {Minimum}]
+ ttk::label $ds9(info).minValue -relief groove \
+ -textvariable infobox(min) -anchor center
+
+ ttk::label $ds9(info).minXLabel -text {X}
+ ttk::label $ds9(info).minXValue -relief groove \
+ -textvariable infobox(min,x) -anchor center
+ ttk::label $ds9(info).minYLabel -text {Y}
+ ttk::label $ds9(info).minYValue -relief groove \
+ -textvariable infobox(min,y) -anchor center
+
+ ttk::label $ds9(info).maxTitle -text [msgcat::mc {Maximum}]
+ ttk::label $ds9(info).maxValue -relief groove \
+ -textvariable infobox(max) -anchor center
+
+ ttk::label $ds9(info).maxXLabel -text {X}
+ ttk::label $ds9(info).maxXValue -relief groove \
+ -textvariable infobox(max,x) -anchor center
+ ttk::label $ds9(info).maxYLabel -text {Y}
+ ttk::label $ds9(info).maxYValue -relief groove \
+ -textvariable infobox(max,y) -anchor center
+
+ ttk::label $ds9(info).lowhighTitle \
+ -text "[msgcat::mc {Low}] [msgcat::mc {High}]"
+ ttk::label $ds9(info).lowValue -relief groove \
+ -textvariable infobox(low) -anchor center
+ ttk::label $ds9(info).highValue -relief groove \
+ -textvariable infobox(high) -anchor center
+
+ ttk::label $ds9(info).valueTitle -text [msgcat::mc {Value}]
+ ttk::label $ds9(info).value -relief groove \
+ -textvariable infobox(value) -anchor center
+
+ ttk::label $ds9(info).valueRTitle -text [msgcat::mc {r}]
+ ttk::label $ds9(info).valueR -relief groove \
+ -textvariable infobox(value,red) -anchor center
+ ttk::label $ds9(info).valueGTitle -text [msgcat::mc {g}]
+ ttk::label $ds9(info).valueG -relief groove \
+ -textvariable infobox(value,green) -anchor center
+ ttk::label $ds9(info).valueBTitle -text [msgcat::mc {b}]
+ ttk::label $ds9(info).valueB -relief groove \
+ -textvariable infobox(value,blue) -anchor center
+
+ ttk::label $ds9(info).bunitTitle -text [msgcat::mc {Units}]
+ ttk::label $ds9(info).bunitValue -relief groove \
+ -textvariable infobox(bunit)
+
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set infobox(wcs$ll,sys) "[msgcat::mc {WCS}] $ll"
+ ttk::label $ds9(info).wcsLabel$ll -textvariable infobox(wcs$ll,sys)
+
+ set infobox(wcs$ll,x,nm) [ttk::label $ds9(info).wcsXLabel$ll -text {}]
+ ttk::label $ds9(info).wcsXValue$ll -relief groove \
+ -textvariable infobox(wcs$ll,x) -anchor center
+ set infobox(wcs$ll,y,nm) [ttk::label $ds9(info).wcsYLabel$ll -text {}]
+ ttk::label $ds9(info).wcsYValue$ll -relief groove \
+ -textvariable infobox(wcs$ll,y) -anchor center
+ set infobox(wcs$ll,z,nm) [ttk::label $ds9(info).wcsZLabel$ll -text {}]
+ ttk::label $ds9(info).wcsZValue$ll -relief groove \
+ -textvariable infobox(wcs$ll,z) -anchor center
+ }
+
+ ttk::label $ds9(info).detectorTitle -text [msgcat::mc {Detector}]
+ ttk::label $ds9(info).detectorXLabel -text {X}
+ ttk::label $ds9(info).detectorXValue -relief groove \
+ -textvariable infobox(detector,x) -anchor center
+ ttk::label $ds9(info).detectorYLabel -text {Y}
+ ttk::label $ds9(info).detectorYValue -relief groove \
+ -textvariable infobox(detector,y) -anchor center
+ ttk::label $ds9(info).detectorZLabel -text {Z}
+ ttk::label $ds9(info).detectorZValue -relief groove \
+ -textvariable infobox(detector,z) -anchor center
+
+ ttk::label $ds9(info).amplifierTitle -text [msgcat::mc {Amplifier}]
+ ttk::label $ds9(info).amplifierXLabel -text {X}
+ ttk::label $ds9(info).amplifierXValue -relief groove \
+ -textvariable infobox(amplifier,x) -anchor center
+ ttk::label $ds9(info).amplifierYLabel -text {Y}
+ ttk::label $ds9(info).amplifierYValue -relief groove \
+ -textvariable infobox(amplifier,y) -anchor center
+ ttk::label $ds9(info).amplifierZLabel -text {Z}
+ ttk::label $ds9(info).amplifierZValue -relief groove \
+ -textvariable infobox(amplifier,z) -anchor center
+
+ ttk::label $ds9(info).physicalTitle -text [msgcat::mc {Physical}]
+ ttk::label $ds9(info).physicalXLabel -text {X}
+ ttk::label $ds9(info).physicalXValue -relief groove \
+ -textvariable infobox(physical,x) -anchor center
+ ttk::label $ds9(info).physicalYLabel -text {Y}
+ ttk::label $ds9(info).physicalYValue -relief groove \
+ -textvariable infobox(physical,y) -anchor center
+ ttk::label $ds9(info).physicalZLabel -text {Z}
+ ttk::label $ds9(info).physicalZValue -relief groove \
+ -textvariable infobox(physical,z) -anchor center
+
+ ttk::label $ds9(info).imageTitle -text [msgcat::mc {Image}]
+ ttk::label $ds9(info).imageXLabel -text {X}
+ ttk::label $ds9(info).imageXValue -relief groove \
+ -textvariable infobox(image,x) -anchor center
+ ttk::label $ds9(info).imageYLabel -text {Y}
+ ttk::label $ds9(info).imageYValue -relief groove \
+ -textvariable infobox(image,y) -anchor center
+ ttk::label $ds9(info).imageZLabel -text {Z}
+ ttk::label $ds9(info).imageZValue -relief groove \
+ -textvariable infobox(image,z) -anchor center
+
+ ttk::label $ds9(info).frame -textvariable infobox(frame) \
+ -width [expr [string length [msgcat::mc {Frame}]]+4]
+
+ ttk::label $ds9(info).zoomtitle -text [msgcat::mc {x}]
+ ttk::label $ds9(info).zoomValue -relief groove \
+ -textvariable infobox(zoom) -anchor center
+
+ ttk::label $ds9(info).angleTitle -text {°}
+ ttk::label $ds9(info).angleValue -relief groove \
+ -textvariable infobox(angle) -anchor center
+}
+
+proc UpdateFrameInfoBox {which} {
+ global ds9
+ global view
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "UpdateFrameInfoBox"
+ }
+
+ switch -- $which {
+ base {
+ grid forget $ds9(info).valueRTitle $ds9(info).valueR \
+ $ds9(info).valueGTitle $ds9(info).valueG \
+ $ds9(info).valueBTitle $ds9(info).valueB
+
+ switch -- $view(layout) {
+ vertical {
+ grid $ds9(info).value \
+ -row $ds9(info,row,value) \
+ -column 1 -padx 2 -sticky w
+ }
+ horizontal {
+ grid $ds9(info).value \
+ -row $ds9(info,row,value) \
+ -column 2 -padx 2 -sticky w
+ }
+ }
+
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ grid forget $ds9(info).wcsZLabel$ll
+ grid forget $ds9(info).wcsZValue$ll
+ }
+ grid forget $ds9(info).detectorZLabel $ds9(info).detectorZValue
+ grid forget $ds9(info).amplifierZLabel $ds9(info).amplifierZValue
+ grid forget $ds9(info).physicalZLabel $ds9(info).physicalZValue
+ grid forget $ds9(info).imageZLabel $ds9(info).imageZValue
+ }
+ rgb {
+ grid forget $ds9(info).value
+ switch $view(layout) {
+ vertical {
+ grid $ds9(info).valueRTitle \
+ -row $ds9(info,row,value,red) \
+ -column 0 -sticky w
+ grid $ds9(info).valueR -row $ds9(info,row,value,red) \
+ -column 1 -padx 2 -sticky w
+ grid $ds9(info).valueGTitle \
+ -row $ds9(info,row,value,green) \
+ -column 0 -sticky w
+ grid $ds9(info).valueG \
+ -row $ds9(info,row,value,green) \
+ -column 1 -padx 2 -sticky w
+ grid $ds9(info).valueBTitle \
+ -row $ds9(info,row,value,blue) \
+ -column 0 -sticky w
+ grid $ds9(info).valueB \
+ -row $ds9(info,row,value,blue) \
+ -column 1 -padx 2 -sticky w
+ }
+ horizontal {
+ grid $ds9(info).valueRTitle \
+ -row $ds9(info,row,value,red) \
+ -column 1 -sticky w
+ grid $ds9(info).valueR \
+ -row $ds9(info,row,value,red) \
+ -column 2 -padx 2 -sticky w
+ grid $ds9(info).valueGTitle \
+ -row $ds9(info,row,value,green) \
+ -column 3 -sticky w
+ grid $ds9(info).valueG \
+ -row $ds9(info,row,value,green) \
+ -column 4 -padx 2 -sticky w
+ grid $ds9(info).valueBTitle \
+ -row $ds9(info,row,value,blue) \
+ -column 5 -sticky w
+ grid $ds9(info).valueB \
+ -row $ds9(info,row,value,blue) \
+ -column 6 -padx 2 -sticky w
+ }
+ }
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ grid forget $ds9(info).wcsZLabel$ll
+ grid forget $ds9(info).wcsZValue$ll
+ }
+ grid forget $ds9(info).detectorZLabel $ds9(info).detectorZValue
+ grid forget $ds9(info).amplifierZLabel $ds9(info).amplifierZValue
+ grid forget $ds9(info).physicalZLabel $ds9(info).physicalZValue
+ grid forget $ds9(info).imageZLabel $ds9(info).imageZValue
+ }
+ 3d {
+ grid forget $ds9(info).valueRTitle $ds9(info).valueR \
+ $ds9(info).valueGTitle $ds9(info).valueG \
+ $ds9(info).valueBTitle $ds9(info).valueB
+
+ switch -- $view(layout) {
+ vertical {
+ grid $ds9(info).value -row $ds9(info,row,value) \
+ -column 1 -padx 2 -sticky w
+
+ foreach ll {{} a b c d e f g h i j
+ k l m n o p q r s t u v w x y z} {
+ if {$view(info,wcs$ll)} {
+ grid $ds9(info).wcsZLabel$ll \
+ -row $ds9(info,row,wcs$ll) \
+ -column 0 -sticky w
+ grid $ds9(info).wcsZValue$ll \
+ -row $ds9(info,row,wcs$ll) \
+ -column 1 -padx 2
+ incr row
+ } else {
+ grid forget $ds9(info).wcsZLabel$ll
+ grid forget $ds9(info).wcsZValue$ll
+ }
+ }
+
+ if {$view(info,detector)} {
+ grid $ds9(info).detectorZLabel \
+ -row $ds9(info,row,detector) \
+ -column 0 -sticky w
+ grid $ds9(info).detectorZValue \
+ -row $ds9(info,row,detector) \
+ -column 1 -padx 2
+ } else {
+ grid forget $ds9(info).detectorZLabel \
+ $ds9(info).detectorZValue
+ }
+ if {$view(info,amplifier)} {
+ grid $ds9(info).amplifierZLabel \
+ -row $ds9(info,row,amplifier) \
+ -column 0 -sticky w
+ grid $ds9(info).amplifierZValue \
+ -row $ds9(info,row,amplifier) \
+ -column 1 -padx 2
+ } else {
+ grid forget $ds9(info).amplifierZLabel \
+ $ds9(info).amplifierZValue
+ }
+ if {$view(info,physical)} {
+ grid $ds9(info).physicalZLabel \
+ -row $ds9(info,row,physical) \
+ -column 0 -sticky w
+ grid $ds9(info).physicalZValue \
+ -row $ds9(info,row,physical) \
+ -column 1 -padx 2
+ } else {
+ grid forget $ds9(info).physicalZLabel \
+ $ds9(info).physicalZValue
+ }
+ if {$view(info,image)} {
+ grid $ds9(info).imageZLabel \
+ -row $ds9(info,row,image) \
+ -column 0 -sticky w
+ grid $ds9(info).imageZValue \
+ -row $ds9(info,row,image) \
+ -column 1 -padx 2
+ } else {
+ grid forget $ds9(info).imageZLabel \
+ $ds9(info).imageZValue
+ }
+ }
+ horizontal {
+ grid $ds9(info).value -row $ds9(info,row,value) \
+ -column 2 -padx 2 -sticky w
+
+ foreach ll {{} a b c d e f g h i j
+ k l m n o p q r s t u v w x y z} {
+ if {$view(info,wcs$ll)} {
+ grid $ds9(info).wcsZLabel$ll \
+ -row $ds9(info,row,wcs$ll) \
+ -column 5 -sticky w
+ grid $ds9(info).wcsZValue$ll \
+ -row $ds9(info,row,wcs$ll) \
+ -column 6 -padx 2
+ incr row
+ } else {
+ grid forget $ds9(info).wcsZLabel$ll
+ grid forget $ds9(info).wcsZValue$ll
+ }
+ }
+
+ if {$view(info,detector)} {
+ grid $ds9(info).detectorZLabel \
+ -row $ds9(info,row,detector) \
+ -column 5 -sticky w
+ grid $ds9(info).detectorZValue \
+ -row $ds9(info,row,detector) \
+ -column 6 -padx 2
+ } else {
+ grid forget $ds9(info).detectorZLabel \
+ $ds9(info).detectorZValue
+ }
+ if {$view(info,amplifier)} {
+ grid $ds9(info).amplifierZLabel \
+ -row $ds9(info,row,amplifier) \
+ -column 5 -sticky w
+ grid $ds9(info).amplifierZValue \
+ -row $ds9(info,row,amplifier) \
+ -column 6 -padx 2
+ } else {
+ grid forget $ds9(info).amplifierZLabel \
+ $ds9(info).amplifierZValue
+ }
+ if {$view(info,physical)} {
+ grid $ds9(info).physicalZLabel \
+ -row $ds9(info,row,physical) \
+ -column 5 -sticky w
+ grid $ds9(info).physicalZValue \
+ -row $ds9(info,row,physical) \
+ -column 6 -padx 2
+ } else {
+ grid forget $ds9(info).physicalZLabel \
+ $ds9(info).physicalZValue
+ }
+ if {$view(info,image)} {
+ grid $ds9(info).imageZLabel \
+ -row $ds9(info,row,image) \
+ -column 5 -sticky w
+ grid $ds9(info).imageZValue \
+ -row $ds9(info,row,image) \
+ -column 6 -padx 2
+ } else {
+ grid forget $ds9(info).imageZLabel \
+ $ds9(info).imageZValue
+ }
+ }
+ }
+ }
+ }
+}
+
+proc EnterInfoBox {which} {
+ global infobox
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "EnterInfo $which"
+ }
+
+ UpdateFrameInfoBox [$which get type]
+ UpdateWCSInfoBox $which
+
+ set infobox(frame) "[msgcat::mc {Frame}] [string range $which 5 end]"
+ set infobox(angle) [$which get rotate]
+
+ set z [$which get zoom]
+ set z1 [lindex $z 0]
+ set z2 [lindex $z 1]
+ if {$z1 != $z2} {
+ set infobox(zoom) "$z1 $z2"
+ } else {
+ set infobox(zoom) $z1
+ }
+}
+
+proc LeaveInfoBox {} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "LeaveInfoBox"
+ }
+
+ ClearInfoBoxCoords
+}
+
+proc ClearInfoBox {} {
+ global infobox
+
+ global debug
+ if {$debug(tcl,info)} {
+ puts stderr "ClearInfoBox"
+ }
+
+ set infobox(filename) {}
+ set infobox(object) {}
+ set infobox(keyvalue) {}
+ set infobox(bunit) {}
+ set infobox(min) {}
+ set infobox(min,x) {}
+ set infobox(min,y) {}
+ set infobox(max) {}
+ set infobox(max,x) {}
+ set infobox(max,y) {}
+ set infobox(low) {}
+ set infobox(high) {}
+
+ ClearInfoBoxCoords
+
+ set infobox(frame) [msgcat::mc {Frame}]
+ set infobox(zoom) {}
+ set infobox(angle) {}
+}
+
+proc ClearInfoBoxCoords {} {
+ global infobox
+
+ global debug
+ if {$debug(tcl,info)} {
+ puts stderr "ClearInfoBoxCoords"
+ }
+
+ set infobox(value) {}
+ set infobox(value,red) {}
+ set infobox(value,green) {}
+ set infobox(value,blue) {}
+
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set infobox(wcs$ll,sys) "WCS $ll"
+ $infobox(wcs$ll,x,nm) configure -text {}
+ $infobox(wcs$ll,y,nm) configure -text {}
+ $infobox(wcs$ll,z,nm) configure -text {}
+ set infobox(wcs$ll,x) {}
+ set infobox(wcs$ll,y) {}
+ set infobox(wcs$ll,z) {}
+ }
+
+ set infobox(detector,x) {}
+ set infobox(detector,y) {}
+ set infobox(detector,z) {}
+ set infobox(amplifier,x) {}
+ set infobox(amplifier,y) {}
+ set infobox(amplifier,z) {}
+ set infobox(physical,x) {}
+ set infobox(physical,y) {}
+ set infobox(physical,z) {}
+ set infobox(image,x) {}
+ set infobox(image,y) {}
+ set infobox(image,z) {}
+}
+
+proc RefreshInfoBox {which} {
+ global current
+
+ global debug
+ if {$debug(tcl,info)} {
+ puts stderr "RefreshInfoBox"
+ }
+
+ if {$which != {}} {
+ switch -- $current(mode) {
+ crosshair -
+ analysis {
+ set coord [$which get crosshair canvas]
+ set x [lindex $coord 0]
+ set y [lindex $coord 1]
+ EnterInfoBox $which
+ UpdateInfoBox $which $x $y canvas
+ }
+ none -
+ pointer -
+ region -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ catalog -
+ examine -
+ iexam {
+ EnterInfoBox $which
+ ClearInfoBoxCoords
+ }
+ }
+ }
+ return
+}
+
+proc UpdateInfoBoxBase {} {
+ global debug
+ if {$debug(tcl,info)} {
+ puts stderr "UpdateInfoBoxBase"
+ }
+
+ global current
+ global infobox
+ if {$current(frame) != {}} {
+ $current(frame) get info infobox
+ }
+}
+
+proc UpdateInfoBox {which x y sys} {
+ global debug
+ if {$debug(tcl,info)} {
+ puts stderr "UpdateInfoBox $sys"
+ }
+
+ global ds9
+ global pds9
+ global infobox
+ global view
+
+ $which get info $sys $x $y infobox
+ set infobox(bunit) [$which get fits header keyword BUNIT]
+ if {$view(info,keyvalue) != ""} {
+ set infobox(keyvalue) \
+ [$which get fits header keyword \'$view(info,keyvalue)\']
+ } else {
+ set infobox(keyvalue) {}
+ }
+
+ # windows fonts can be larger, causing a layout event
+ switch $ds9(wm) {
+ x11 -
+ aqua {set fsz $pds9(font,size)}
+ win32 {set fsz [expr $pds9(font,size)-3]}
+ }
+
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ if {$view(info,wcs$ll)} {
+ if {![$which has fits]} {
+ set infobox(wcs$ll,sys) "WCS $ll"
+ $infobox(wcs$ll,x,nm) configure -text {}
+ $infobox(wcs$ll,y,nm) configure -text {}
+ } elseif {[$which has wcs equatorial wcs$ll]} {
+ switch -- $infobox(wcs$ll,sys) {
+ fk4 -
+ fk5 -
+ icrs {
+ $infobox(wcs$ll,x,nm) configure -text "\u03b1" \
+ -font "$ds9(times) $fsz"
+ $infobox(wcs$ll,y,nm) configure -text "\u03b4" \
+ -font "$ds9(times) $fsz"
+ }
+ galactic {
+ $infobox(wcs$ll,x,nm) configure -text {l} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ $infobox(wcs$ll,y,nm) configure -text {b} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ }
+ ecliptic {
+ $infobox(wcs$ll,x,nm) configure -text "\u03bb" \
+ -font "$ds9(times) $fsz"
+ $infobox(wcs$ll,y,nm) configure -text "\u03b2" \
+ -font "$ds9(times) $fsz"
+ }
+ }
+ } elseif {[$which has wcs celestrial wcs$ll]} {
+ set infobox(wcs$ll,sys) "WCS $ll"
+ $infobox(wcs$ll,x,nm) configure -text {l} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ $infobox(wcs$ll,y,nm) configure -text {b} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ } else {
+ set infobox(wcs$ll,sys) "WCS $ll"
+ $infobox(wcs$ll,x,nm) configure -text {x} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ $infobox(wcs$ll,y,nm) configure -text {y} \
+ -font "{$ds9(times)} $pds9(font,size) normal italic"
+ }
+ }
+ }
+}
+
+proc LayoutInfoPanel {} {
+ global ds9
+ global view
+
+ # reset
+ grid columnconfigure $ds9(info) 7 -weight 0
+ if {$ds9(row) > -1} {
+ grid rowconfigure $ds9(info) $ds9(row) -weight 0
+ set ds9(row) -1
+ }
+
+ # layout
+ switch $view(layout) {
+ vertical {LayoutInfoPanelVert}
+ horizontal {LayoutInfoPanelHorz}
+ }
+}
+
+proc LayoutInfoPanelHorz {} {
+ global ds9
+ global view
+
+ set ww 12
+ set row 0
+ # also adjust layout.tcl CanvasDef
+ switch $ds9(wm) {
+ x11 {set xx 42}
+ aqua {set xx 40}
+ win32 {set xx 40}
+ }
+
+ grid columnconfigure $ds9(info) 7 -weight 1
+
+ # filename
+ if {$view(info,filename)} {
+ $ds9(info).fileValue configure -width $xx
+
+ grid $ds9(info).fileTitle -row $row -column 0 -sticky w
+ grid $ds9(info).fileValue -row $row -column 2 -padx 2 \
+ -sticky ew -columnspan 6
+ incr row
+ } else {
+ grid forget $ds9(info).fileTitle
+ grid forget $ds9(info).fileValue
+ }
+
+ # object
+ if {$view(info,object)} {
+ $ds9(info).objValue configure -width $xx
+
+ grid $ds9(info).objTitle -row $row -column 0 -sticky w
+ grid $ds9(info).objValue -row $row -column 2 -padx 2 \
+ -sticky ew -columnspan 6
+ incr row
+ } else {
+ grid forget $ds9(info).objTitle
+ grid forget $ds9(info).objValue
+ }
+
+ # keyword
+ if {$view(info,keyword)} {
+ $ds9(info).keyWord configure -width $ww
+ $ds9(info).keyValue configure -width $xx
+
+ grid $ds9(info).keyWord -row $row -column 0 -sticky w
+ grid $ds9(info).keyValue -row $row -column 2 -padx 2 \
+ -sticky w -columnspan 6
+ incr row
+ } else {
+ grid forget $ds9(info).keyWord
+ grid forget $ds9(info).keyValue
+ }
+
+ # minmax
+ if {$view(info,minmax)} {
+ $ds9(info).minValue configure -width $ww
+ $ds9(info).minXValue configure -width $ww
+ $ds9(info).minYValue configure -width $ww
+
+ grid $ds9(info).minTitle -row $row -column 0 -sticky w
+ grid $ds9(info).minXLabel -row $row -column 1 -padx 2 -sticky w
+ grid $ds9(info).minXValue -row $row -column 2 -padx 2 -sticky w
+ grid $ds9(info).minYLabel -row $row -column 3 -padx 2 -sticky w
+ grid $ds9(info).minYValue -row $row -column 4 -padx 2 -sticky w
+ grid $ds9(info).minValue -row $row -column 6 -padx 2 -sticky w
+ incr row
+
+ $ds9(info).maxValue configure -width $ww
+ $ds9(info).maxXValue configure -width $ww
+ $ds9(info).maxYValue configure -width $ww
+
+ grid $ds9(info).maxTitle -row $row -column 0 -sticky w
+ grid $ds9(info).maxXLabel -row $row -column 1 -padx 2 -sticky w
+ grid $ds9(info).maxXValue -row $row -column 2 -padx 2 -sticky w
+ grid $ds9(info).maxYLabel -row $row -column 3 -padx 2 -sticky w
+ grid $ds9(info).maxYValue -row $row -column 4 -padx 2 -sticky w
+ grid $ds9(info).maxValue -row $row -column 6 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).minTitle
+ grid forget $ds9(info).minValue
+ grid forget $ds9(info).minXLabel
+ grid forget $ds9(info).minXValue
+ grid forget $ds9(info).minYLabel
+ grid forget $ds9(info).minYValue
+
+ grid forget $ds9(info).maxTitle
+ grid forget $ds9(info).maxValue
+ grid forget $ds9(info).maxXLabel
+ grid forget $ds9(info).maxXValue
+ grid forget $ds9(info).maxYLabel
+ grid forget $ds9(info).maxYValue
+ }
+
+ # lowhigh
+ if {$view(info,lowhigh)} {
+ $ds9(info).lowValue configure -width $ww
+ $ds9(info).highValue configure -width $ww
+
+ grid $ds9(info).lowhighTitle -row $row -column 0 -sticky w
+ grid $ds9(info).lowValue -row $row -column 2 -padx 2 -sticky w
+ grid $ds9(info).highValue -row $row -column 4 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).lowhighTitle
+ grid forget $ds9(info).lowValue
+ grid forget $ds9(info).highValue
+ }
+
+ # value
+ $ds9(info).value configure -width $ww
+ $ds9(info).valueR configure -width $ww
+ $ds9(info).valueG configure -width $ww
+ $ds9(info).valueB configure -width $ww
+
+ grid $ds9(info).valueTitle -row $row -column 0 -sticky w
+ set ds9(info,row,value) $row
+ set ds9(info,row,value,red) $row
+ set ds9(info,row,value,green) $row
+ set ds9(info,row,value,blue) $row
+ incr row
+ UpdateFrameInfoBox base
+
+ # unit
+ if {$view(info,bunit)} {
+ $ds9(info).bunitValue configure -width $ww
+
+ grid $ds9(info).bunitTitle -row $row -column 0 -sticky w
+ grid $ds9(info).bunitValue -row $row -column 2 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).bunitTitle
+ grid forget $ds9(info).bunitValue
+ }
+
+ # wcs
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $ds9(info).wcsLabel$ll configure -width $ww
+ $ds9(info).wcsXValue$ll configure -width $ww
+ $ds9(info).wcsYValue$ll configure -width $ww
+ $ds9(info).wcsZValue$ll configure -width $ww
+
+ if {$view(info,wcs$ll)} {
+ grid $ds9(info).wcsLabel$ll -row $row -column 0 -sticky w
+ grid $ds9(info).wcsXLabel$ll -row $row -column 1 -sticky w
+ grid $ds9(info).wcsXValue$ll -row $row -column 2 -padx 2
+ grid $ds9(info).wcsYLabel$ll -row $row -column 3 -sticky w
+ grid $ds9(info).wcsYValue$ll -row $row -column 4 -padx 2
+ set ds9(info,row,wcs$ll) $row
+ incr row
+ } else {
+ grid forget $ds9(info).wcsLabel$ll
+ grid forget $ds9(info).wcsXLabel$ll
+ grid forget $ds9(info).wcsXValue$ll
+ grid forget $ds9(info).wcsYLabel$ll
+ grid forget $ds9(info).wcsYValue$ll
+ }
+ }
+
+ # detector
+ if {$view(info,detector)} {
+ $ds9(info).detectorXValue configure -width $ww
+ $ds9(info).detectorYValue configure -width $ww
+ $ds9(info).detectorZValue configure -width $ww
+
+ grid $ds9(info).detectorTitle -row $row -column 0 -sticky w
+ grid $ds9(info).detectorXLabel -row $row -column 1 -sticky w
+ grid $ds9(info).detectorXValue -row $row -column 2 -padx 2
+ grid $ds9(info).detectorYLabel -row $row -column 3 -sticky w
+ grid $ds9(info).detectorYValue -row $row -column 4 -padx 2
+ set ds9(info,row,detector) $row
+ incr row
+ } else {
+ grid forget $ds9(info).detectorTitle
+ grid forget $ds9(info).detectorXLabel
+ grid forget $ds9(info).detectorXValue
+ grid forget $ds9(info).detectorYLabel
+ grid forget $ds9(info).detectorYValue
+ }
+
+ # amplifier
+ if {$view(info,amplifier)} {
+ $ds9(info).amplifierXValue configure -width $ww
+ $ds9(info).amplifierYValue configure -width $ww
+ $ds9(info).amplifierZValue configure -width $ww
+
+ grid $ds9(info).amplifierTitle -row $row -column 0 -sticky w
+ grid $ds9(info).amplifierXLabel -row $row -column 1 -sticky w
+ grid $ds9(info).amplifierXValue -row $row -column 2 -padx 2
+ grid $ds9(info).amplifierYLabel -row $row -column 3 -sticky w
+ grid $ds9(info).amplifierYValue -row $row -column 4 -padx 2
+ set ds9(info,row,amplifier) $row
+ incr row
+ } else {
+ grid forget $ds9(info).amplifierTitle
+ grid forget $ds9(info).amplifierXLabel
+ grid forget $ds9(info).amplifierXValue
+ grid forget $ds9(info).amplifierYLabel
+ grid forget $ds9(info).amplifierYValue
+ }
+
+ # physical
+ if {$view(info,physical)} {
+ $ds9(info).physicalXValue configure -width $ww
+ $ds9(info).physicalYValue configure -width $ww
+ $ds9(info).physicalZValue configure -width $ww
+
+ grid $ds9(info).physicalTitle -row $row -column 0 -sticky w
+ grid $ds9(info).physicalXLabel -row $row -column 1 -sticky w
+ grid $ds9(info).physicalXValue -row $row -column 2 -padx 2
+ grid $ds9(info).physicalYLabel -row $row -column 3 -sticky w
+ grid $ds9(info).physicalYValue -row $row -column 4 -padx 2
+ set ds9(info,row,physical) $row
+ incr row
+ } else {
+ grid forget $ds9(info).physicalTitle
+ grid forget $ds9(info).physicalXLabel
+ grid forget $ds9(info).physicalXValue
+ grid forget $ds9(info).physicalYLabel
+ grid forget $ds9(info).physicalYValue
+ }
+
+ # image
+ if {$view(info,image)} {
+ $ds9(info).imageXValue configure -width $ww
+ $ds9(info).imageYValue configure -width $ww
+ $ds9(info).imageZValue configure -width $ww
+
+ grid $ds9(info).imageTitle -row $row -column 0 -sticky w
+ grid $ds9(info).imageXLabel -row $row -column 1 -sticky w
+ grid $ds9(info).imageXValue -row $row -column 2 -padx 2
+ grid $ds9(info).imageYLabel -row $row -column 3 -sticky w
+ grid $ds9(info).imageYValue -row $row -column 4 -padx 2
+ set ds9(info,row,image) $row
+ incr row
+ } else {
+ grid forget $ds9(info).imageTitle
+ grid forget $ds9(info).imageXLabel
+ grid forget $ds9(info).imageXValue
+ grid forget $ds9(info).imageYLabel
+ grid forget $ds9(info).imageYValue
+ }
+
+ # frame, zoom, angle
+ if {$view(info,frame)} {
+ $ds9(info).zoomValue configure -width $ww
+ $ds9(info).angleValue configure -width $ww
+
+ grid $ds9(info).frame -row $row -column 0 -sticky w
+ grid $ds9(info).zoomtitle -row $row -column 1 -sticky w
+ grid $ds9(info).zoomValue -row $row -column 2 -padx 2 -sticky w
+ grid $ds9(info).angleValue -row $row -column 4 -padx 2 -sticky w
+ grid $ds9(info).angleTitle -row $row -column 5 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).frame
+ grid forget $ds9(info).zoomtitle
+ grid forget $ds9(info).zoomValue
+ grid forget $ds9(info).angleTitle
+ grid forget $ds9(info).angleValue
+ }
+
+ # dummy
+ grid forget $ds9(info).dummy
+}
+
+proc LayoutInfoPanelVert {} {
+ global ds9
+ global view
+
+ set ww 13
+ set row 0
+
+ # filename
+ if {$view(info,filename)} {
+ $ds9(info).fileValue configure -width $ww
+
+ grid $ds9(info).fileTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).fileValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).fileTitle
+ grid forget $ds9(info).fileValue
+ }
+
+ # object
+ if {$view(info,object)} {
+ $ds9(info).objValue configure -width $ww
+
+ grid $ds9(info).objTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).objValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).objTitle
+ grid forget $ds9(info).objValue
+ }
+
+ # keyword
+ if {$view(info,keyword)} {
+ $ds9(info).keyWord configure -width $ww
+ $ds9(info).keyValue configure -width $ww
+
+ grid $ds9(info).keyWord -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).keyValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).keyWord
+ grid forget $ds9(info).keyValue
+ }
+
+ # minmax
+ if {$view(info,minmax)} {
+ $ds9(info).minValue configure -width $ww
+ $ds9(info).minXValue configure -width $ww
+ $ds9(info).minYValue configure -width $ww
+
+ grid $ds9(info).minTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).minXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).minXValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ grid $ds9(info).minYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).minYValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ grid $ds9(info).minValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+
+ $ds9(info).maxXValue configure -width $ww
+ $ds9(info).maxValue configure -width $ww
+ $ds9(info).maxYValue configure -width $ww
+
+ grid $ds9(info).maxTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).maxXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).maxXValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ grid $ds9(info).maxYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).maxYValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ grid $ds9(info).maxValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).minTitle
+ grid forget $ds9(info).minValue
+ grid forget $ds9(info).minXValue
+ grid forget $ds9(info).minYValue
+
+ grid forget $ds9(info).maxTitle
+ grid forget $ds9(info).maxValue
+ grid forget $ds9(info).maxXValue
+ grid forget $ds9(info).maxYValue
+ }
+
+ # lowhigh
+ if {$view(info,lowhigh)} {
+ $ds9(info).lowValue configure -width $ww
+ $ds9(info).highValue configure -width $ww
+
+ grid $ds9(info).lowhighTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).lowValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ grid $ds9(info).highValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).lowhighTitle
+ grid forget $ds9(info).lowValue
+ grid forget $ds9(info).highValue
+ }
+
+ # value
+ $ds9(info).value configure -width $ww
+ $ds9(info).valueR configure -width $ww
+ $ds9(info).valueG configure -width $ww
+ $ds9(info).valueB configure -width $ww
+
+ grid $ds9(info).valueTitle -row $row -column 1 -sticky w
+ incr row
+ set ds9(info,row,value) $row
+ set ds9(info,row,value,red) $row
+ incr row
+ set ds9(info,row,value,green) $row
+ incr row
+ set ds9(info,row,value,blue) $row
+ incr row
+ UpdateFrameInfoBox base
+
+ # units
+ if {$view(info,bunit)} {
+ $ds9(info).bunitValue configure -width $ww
+
+ grid $ds9(info).bunitTitle -row $row -column 1 -sticky w
+ incr row
+ grid $ds9(info).bunitValue -row $row -column 1 -padx 2 -sticky w
+ incr row
+ } else {
+ grid forget $ds9(info).bunitTitle
+ grid forget $ds9(info).bunitValue
+ }
+
+ # wcs
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $ds9(info).wcsLabel$ll configure -width $ww
+ $ds9(info).wcsXValue$ll configure -width $ww
+ $ds9(info).wcsYValue$ll configure -width $ww
+ $ds9(info).wcsZValue$ll configure -width $ww
+
+ if {$view(info,wcs$ll)} {
+ grid $ds9(info).wcsLabel$ll -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).wcsXLabel$ll -row $row -column 0 -sticky e
+ grid $ds9(info).wcsXValue$ll -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).wcsYLabel$ll -row $row -column 0 -sticky e
+ grid $ds9(info).wcsYValue$ll -row $row -column 1 -padx 2
+ incr row
+ set ds9(info,row,wcs$ll) $row
+ incr row
+ } else {
+ grid forget $ds9(info).wcsLabel$ll
+ grid forget $ds9(info).wcsXLabel$ll
+ grid forget $ds9(info).wcsXValue$ll
+ grid forget $ds9(info).wcsYLabel$ll
+ grid forget $ds9(info).wcsYValue$ll
+ }
+ }
+
+ # detector
+ if {$view(info,detector)} {
+ $ds9(info).detectorXValue configure -width $ww
+ $ds9(info).detectorYValue configure -width $ww
+ $ds9(info).detectorZValue configure -width $ww
+
+ grid $ds9(info).detectorTitle -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).detectorXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).detectorXValue -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).detectorYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).detectorYValue -row $row -column 1 -padx 2
+ incr row
+ set ds9(info,row,detector) $row
+ incr row
+ } else {
+ grid forget $ds9(info).detectorTitle
+ grid forget $ds9(info).detectorXLabel
+ grid forget $ds9(info).detectorXValue
+ grid forget $ds9(info).detectorYLabel
+ grid forget $ds9(info).detectorYValue
+ }
+
+ # amplifier
+ if {$view(info,amplifier)} {
+ $ds9(info).amplifierXValue configure -width $ww
+ $ds9(info).amplifierYValue configure -width $ww
+ $ds9(info).amplifierZValue configure -width $ww
+
+ grid $ds9(info).amplifierTitle -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).amplifierXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).amplifierXValue -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).amplifierYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).amplifierYValue -row $row -column 1 -padx 2
+ incr row
+ set ds9(info,row,amplifier) $row
+ incr row
+ } else {
+ grid forget $ds9(info).amplifierTitle
+ grid forget $ds9(info).amplifierXLabel
+ grid forget $ds9(info).amplifierXValue
+ grid forget $ds9(info).amplifierYLabel
+ grid forget $ds9(info).amplifierYValue
+ }
+
+ # physical
+ if {$view(info,physical)} {
+ $ds9(info).physicalXValue configure -width $ww
+ $ds9(info).physicalYValue configure -width $ww
+ $ds9(info).physicalZValue configure -width $ww
+
+ grid $ds9(info).physicalTitle -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).physicalXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).physicalXValue -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).physicalYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).physicalYValue -row $row -column 1 -padx 2
+ incr row
+ set ds9(info,row,physical) $row
+ incr row
+ } else {
+ grid forget $ds9(info).physicalTitle
+ grid forget $ds9(info).physicalXLabel
+ grid forget $ds9(info).physicalXValue
+ grid forget $ds9(info).physicalYLabel
+ grid forget $ds9(info).physicalYValue
+ }
+
+ # image
+ if {$view(info,image)} {
+ $ds9(info).imageXValue configure -width $ww
+ $ds9(info).imageYValue configure -width $ww
+ $ds9(info).imageZValue configure -width $ww
+
+ grid $ds9(info).imageTitle -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).imageXLabel -row $row -column 0 -sticky e
+ grid $ds9(info).imageXValue -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).imageYLabel -row $row -column 0 -sticky e
+ grid $ds9(info).imageYValue -row $row -column 1 -padx 2
+ incr row
+ set ds9(info,row,image) $row
+ incr row
+ } else {
+ grid forget $ds9(info).imageTitle
+ grid forget $ds9(info).imageXLabel
+ grid forget $ds9(info).imageXValue
+ grid forget $ds9(info).imageYLabel
+ grid forget $ds9(info).imageYValue
+ }
+
+ # frame, zoom, angle
+ if {$view(info,frame)} {
+ $ds9(info).zoomValue configure -width $ww
+ $ds9(info).angleValue configure -width $ww
+
+ grid $ds9(info).frame -row $row -column 1 -sticky ew
+ incr row
+ grid $ds9(info).zoomtitle -row $row -column 0 -sticky e
+ grid $ds9(info).zoomValue -row $row -column 1 -padx 2
+ incr row
+ grid $ds9(info).angleTitle -row $row -column 0 -sticky e
+ grid $ds9(info).angleValue -row $row -column 1 -padx 2
+ incr row
+ } else {
+ grid forget $ds9(info).frame
+ grid forget $ds9(info).zoomtitle
+ grid forget $ds9(info).zoomValue
+ grid forget $ds9(info).angleTitle
+ grid forget $ds9(info).angleValue
+ }
+
+ # dummy
+ global ds9
+ set ds9(row) $row
+
+ grid $ds9(info).dummy -row $row -column 1
+ grid rowconfigure $ds9(info) $row -weight 1
+}
diff --git a/ds9/library/layout.tcl b/ds9/library/layout.tcl
new file mode 100644
index 0000000..191a748
--- /dev/null
+++ b/ds9/library/layout.tcl
@@ -0,0 +1,1086 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CanvasDef {} {
+ global canvas
+ global icanvas
+ global ds9
+
+ # also adjust info.tcl LayoutInfoPanelHorz
+ switch $ds9(wm) {
+ x11 {set icanvas(horz,width) 738}
+ aqua {set icanvas(horz,width) 777}
+ win32 {set icanvas(horz,width) 740}
+ }
+
+ set icanvas(horz,height) 480
+ set icanvas(vert,width) 640
+ set icanvas(vert,height) 640
+ set canvas(width) $icanvas(horz,width)
+ set canvas(height) $icanvas(horz,height)
+ set canvas(gap) 4
+
+ switch $ds9(wm) {
+ x11 {
+ # this is not fool proof. it does not take into account redirecting
+ # the DISPLAY. There must be a better way.
+ global tcl_platform
+ switch -- $tcl_platform(os) {
+ Darwin {set canvas(gap,bottom) 14}
+ default {set canvas(gap,bottom) 0}
+ }
+ }
+ aqua {set canvas(gap,bottom) 14}
+ win32 {set canvas(gap,bottom) 0}
+ }
+}
+
+proc BlinkDef {} {
+ global blink
+ global iblink
+ global pblink
+
+ set iblink(id) 0
+ set iblink(index) -1
+
+ set blink(interval) 500
+
+ array set pblink [array get blink]
+}
+
+proc TileDef {} {
+ global tile
+ global itile
+ global ptile
+
+ set itile(top) .tile
+ set itile(mb) .tilemb
+
+ set tile(mode) grid
+ set tile(grid,row) 10
+ set tile(grid,col) 10
+ set tile(grid,mode) automatic
+ set tile(grid,dir) x
+ set tile(grid,gap) 4
+
+ array set ptile [array get tile]
+}
+
+proc ViewDef {} {
+ global view
+ global pview
+
+ set view(layout) horizontal
+ set view(info) 1
+ set view(panner) 1
+ set view(magnifier) 1
+ set view(buttons) 1
+ set view(colorbar) 1
+ set view(graph,horz) 0
+ set view(graph,vert) 0
+
+ set view(info,filename) 1
+ set view(info,object) 1
+ set view(info,keyvalue) {}
+ set view(info,keyword) 0
+ set view(info,minmax) 0
+ set view(info,minmax,xy) 0
+ set view(info,lowhigh) 0
+ set view(info,bunit) 0
+ set view(info,wcs) 1
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set "view(info,wcs$l)" 0
+ }
+ set view(info,detector) 0
+ set view(info,amplifier) 0
+ set view(info,physical) 1
+ set view(info,image) 1
+ set view(info,frame) 1
+
+ array set pview [array get view]
+}
+
+# canvas
+
+proc CreateCanvas {} {
+ global ds9
+ global canvas
+
+ LayoutViewAdjust diff
+ set ww [expr $canvas(width)+$diff(x)]
+ set hh [expr $canvas(height)+$diff(y)]
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "CreateCanvas $canvas(width) $canvas(height) ${ww}x${hh}"
+ }
+
+ set ds9(image) [ttk::frame $ds9(main).f]
+ set ds9(canvas) [canvas $ds9(image).c -width $ww -height $hh \
+ -highlightthickness 0 -insertofftime 0 -bg $ds9(bg)]
+ grid rowconfigure $ds9(image) 0 -weight 1
+ grid columnconfigure $ds9(image) 0 -weight 1
+ grid $ds9(canvas) -row 0 -column 0 -sticky news
+
+ # extra space for window tab
+ if {$canvas(gap,bottom)>0} {
+ set f [frame $ds9(image).b -width 1 -height $canvas(gap,bottom) \
+ -bg $ds9(bg)]
+ grid $f -row 1 -column 0 -sticky ew
+ }
+
+ # needed to realize window so Layout routines will work
+ grid $ds9(image)
+}
+
+proc InitCanvas {} {
+ global ds9
+
+ # Bindings
+
+ bind $ds9(canvas) <Tab> [list NextFrame]
+ bind $ds9(canvas) <Shift-Tab> [list PrevFrame]
+ switch $ds9(wm) {
+ x11 {bind $ds9(canvas) <ISO_Left_Tab> [list PrevFrame]}
+ aqua -
+ win32 {}
+ }
+
+ bind $ds9(canvas) <Configure> [list ConfigureView]
+ switch $ds9(wm) {
+ x11 -
+ aqua {
+ bind $ds9(canvas) <Enter> [list focus $ds9(canvas)]
+ bind $ds9(canvas) <Leave> [list focus {}]
+ }
+ win32 {}
+ }
+ switch $ds9(wm) {
+ x11 {}
+ aqua -
+ win32 {bind $ds9(canvas) <MouseWheel> [list MouseWheelFrame %x %y %D]}
+ }
+
+ # backward compatible bindings
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ bind $ds9(canvas) <Button-3> {Button3Canvas %x %y}
+ bind $ds9(canvas) <B3-Motion> {Motion3Canvas %x %y}
+ bind $ds9(canvas) <ButtonRelease-3> {Release3Canvas %x %y}
+ }
+ aqua {
+ # swap button-2 and button-3 on the mighty mouse
+ bind $ds9(canvas) <Button-2> {Button3Canvas %x %y}
+ bind $ds9(canvas) <B2-Motion> {Motion3Canvas %x %y}
+ bind $ds9(canvas) <ButtonRelease-2> {Release3Canvas %x %y}
+
+ # x11 command key emulation
+ bind $ds9(canvas) <Command-Button-1> {Button3Canvas %x %y}
+ bind $ds9(canvas) <Command-B1-Motion> {Motion3Canvas %x %y}
+ bind $ds9(canvas) <Command-ButtonRelease-1> {Release3Canvas %x %y}
+ }
+ }
+
+ # freeze
+ bind $ds9(canvas) <f> {ToggleBindEvents}
+}
+
+proc Button3Canvas {x y} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button3Canvas"
+ }
+
+ set ds9(b3) 1
+ ColorbarButton3 $x $y
+}
+
+proc Motion3Canvas {x y} {
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Motion3Canvas"
+ }
+
+ ColorbarMotion3 $x $y
+}
+
+proc Release3Canvas {x y} {
+ global ds9
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Release3Canvas"
+ }
+
+ set ds9(b3) 0
+ ColorbarRelease3 $x $y
+}
+
+proc UnBindEventsCanvas {} {
+ global ds9
+
+ foreach f $ds9(active) {
+ UnBindEventsFrame $f
+ }
+}
+
+proc BindEventsCanvas {} {
+ global ds9
+ global current
+
+ switch -- $ds9(display) {
+ single -
+ blink {BindEventsFrame $current(frame)}
+ tile {
+ foreach f $ds9(active) {
+ BindEventsFrame $f
+ }
+ }
+ }
+}
+
+# view
+
+proc ConfigureView {} {
+ global ds9
+ global canvas
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "ConfigureView old $canvas(width) $canvas(height)"
+ }
+
+ # calculate ds9(canvas) size
+ LayoutViewAdjust diff
+
+ # adjust window size
+ set canvas(width) [expr [winfo width $ds9(canvas)]-$diff(x)]
+ set canvas(height) [expr [winfo height $ds9(canvas)]-$diff(y)]
+
+ if {$debug(tcl,layout)} {
+ puts stderr "ConfigureView new $canvas(width) $canvas(height)"
+ }
+
+ LayoutView
+}
+
+proc UpdateView {} {
+ global ds9
+ global canvas
+
+ # note: assume canvas(width) and canvas(height) have been set to desired
+ # values.
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "UpdateView to $canvas(width) x $canvas(height)"
+ }
+
+ # save current size
+ set wo [winfo width $ds9(top)]
+ set ho [winfo height $ds9(top)]
+
+ # calculate ds9(canvas) size
+ LayoutViewAdjust diff
+
+ # adjust window size
+ set ww [expr $canvas(width)+$diff(x)]
+ set hh [expr $canvas(height)+$diff(y)]
+
+ # determine how much to change
+ set wc [winfo width $ds9(canvas)]
+ set hc [winfo height $ds9(canvas)]
+
+ set wt [winfo width $ds9(top)]
+ set ht [winfo height $ds9(top)]
+
+ if {$debug(tcl,layout)} {
+ puts stderr "UpdateView before ds9(top) $wt x $ht"
+ }
+
+ set w [expr $ww - $wc + $wt]
+ set h [expr $hh - $hc + $ht]
+
+ if {$debug(tcl,layout)} {
+ puts stderr "UpdateView after ds9(top) $w x $h"
+ }
+
+ # change window size
+ wm geometry $ds9(top) ${w}x${h}
+
+ LayoutView
+}
+
+proc LayoutView {} {
+ global view
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "LayoutView"
+ }
+
+ switch $view(layout) {
+ horizontal {LayoutViewHorz}
+ vertical {LayoutViewVert}
+ }
+
+ LayoutInfoPanel
+ LayoutButtons
+ LayoutFrames
+ LayoutColorbar
+ LayoutGraphs
+}
+
+proc LayoutViewAdjust {varname} {
+ upvar $varname var
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "LayoutViewAdjust"
+ }
+
+ global view
+ global colorbar
+ global icolorbar
+ global igraph
+ global canvas
+ global ds9
+
+ set var(x) 0
+ set var(y) 0
+
+ set cbh [expr $view(colorbar) && \
+ [string equal $colorbar(orientation) {horizontal}]]
+ set cbv [expr $view(colorbar) && \
+ [string equal $colorbar(orientation) {vertical}]]
+ set grh $view(graph,horz)
+ set grv $view(graph,vert)
+
+ if {$colorbar(numerics)} {
+ # ww horizontal: tickgap
+ set ww 12
+ # hh vertical: approx number of numerals to display
+ set hh 7
+
+ # can't trust 'tk scaling'
+ switch $ds9(wm) {
+ x11 -
+ win32 {set scaling [tk scaling]}
+ aqua {set scaling 1.4}
+ }
+
+ set icolorbar(horizontal,height) \
+ [expr int($colorbar(size) + $colorbar(font,size)*$scaling+$ww)]
+
+ set icolorbar(vertical,width) \
+ [expr $colorbar(size) + $colorbar(font,size)*$hh]
+ } else {
+ set icolorbar(horizontal,height) [expr $colorbar(size) +2]
+ set icolorbar(vertical,width) [expr $colorbar(size) +2]
+ }
+
+ # basics
+ if {$cbh} {
+ incr var(y) $icolorbar(horizontal,height)
+ }
+
+ if {$cbv} {
+ incr var(x) $icolorbar(vertical,width)
+ }
+
+ if {$grh} {
+ incr var(y) $igraph(size)
+ }
+
+ if {$grv} {
+ incr var(x) $igraph(size)
+ }
+
+ # canvas gap
+ if {$cbh || $grh} {
+ incr var(y) $canvas(gap)
+ }
+
+ if {$cbv || $grv} {
+ incr var(x) $canvas(gap)
+ }
+
+ # graph gap
+ if {$grv && !$cbh} {
+ incr var(y) $igraph(gap,y)
+ }
+
+ if {$grh && !$cbv} {
+ incr var(x) $igraph(gap,x)
+ }
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "LayoutViewAdjust $var(x) $var(y)"
+ }
+}
+
+proc LayoutOrient {} {
+ global ds9
+ global canvas
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "LayoutOrient"
+ }
+
+ # save original canvas size
+ set ww $canvas(width)
+ set hh $canvas(height)
+
+ # horizontal
+ grid rowconfigure $ds9(main) 4 -weight 0
+ grid columnconfigure $ds9(main) 0 -weight 0
+
+ # vertical
+ grid rowconfigure $ds9(main) 0 -weight 0
+ grid columnconfigure $ds9(main) 4 -weight 0
+
+ grid forget $ds9(panel)
+ grid forget $ds9(panel,sep)
+ grid forget $ds9(buttons)
+ grid forget $ds9(buttons,sep)
+ grid forget $ds9(image)
+ pack forget $ds9(info)
+ pack forget $ds9(panner)
+ pack forget $ds9(magnifier)
+
+ UpdateView
+ update
+
+ # restore original canvas size
+ set canvas(width) $ww
+ set canvas(height) $hh
+ UpdateView
+}
+
+proc LayoutViewHorz {} {
+ global ds9
+ global current
+ global view
+
+ # canvas
+ grid rowconfigure $ds9(main) 4 -weight 1
+ grid columnconfigure $ds9(main) 0 -weight 1
+ grid $ds9(image) -row 4 -column 0 -sticky news
+
+ # info panel
+ if {$view(info) || $view(magnifier) || $view(panner)} {
+ grid $ds9(panel) -row 0 -column 0 -sticky ew -columnspan 3
+ $ds9(panel,sep) configure -orient horizontal
+ grid $ds9(panel,sep) -row 1 -column 0 -sticky ew -columnspan 3
+ } else {
+ grid forget $ds9(panel)
+ grid forget $ds9(panel,sep)
+ }
+
+ if {$view(info)} {
+ pack $ds9(info) -side left -anchor nw -padx 2 -pady 2 \
+ -fill x -expand true
+ } else {
+ pack forget $ds9(info)
+ }
+
+ if {$view(panner)} {
+ pack $ds9(panner) -side right -padx 2 -pady 2
+ } else {
+ pack forget $ds9(panner)
+ }
+
+ if {$view(magnifier)} {
+ pack $ds9(magnifier) -side right -padx 2 -pady 2
+ if {$view(panner)} {
+ pack $ds9(magnifier) -before $ds9(panner)
+ }
+ } else {
+ pack forget $ds9(magnifier)
+ }
+
+ # buttons
+ if {$view(buttons)} {
+ grid $ds9(buttons) -row 2 -sticky ew -columnspan 3
+ $ds9(buttons,sep) configure -orient horizontal
+ grid $ds9(buttons,sep) -row 3 -column 0 -sticky ew -columnspan 3
+ } else {
+ grid forget $ds9(buttons)
+ grid forget $ds9(buttons,sep)
+ }
+}
+
+proc LayoutViewVert {} {
+ global ds9
+ global current
+ global view
+
+ # canvas
+ grid rowconfigure $ds9(main) 0 -weight 1
+ grid columnconfigure $ds9(main) 4 -weight 1
+ grid $ds9(image) -row 0 -column 4 -sticky news
+
+ # info panel
+ if {$view(info) || $view(magnifier) || $view(panner)} {
+ grid $ds9(panel) -row 0 -column 0 -sticky ns
+ $ds9(panel,sep) configure -orient vertical
+ grid $ds9(panel,sep) -row 0 -column 1 -sticky ns
+ } else {
+ grid forget $ds9(panel)
+ grid forget $ds9(panel,sep)
+ }
+
+ if {$view(magnifier)} {
+ pack $ds9(magnifier) -side top -padx 2 -pady 2
+ } else {
+ pack forget $ds9(magnifier)
+ }
+
+ if {$view(info)} {
+ pack $ds9(info) -side top -padx 2 -pady 2 -fill y -expand true
+ if {$view(magnifier)} {
+ pack $ds9(info) -after $ds9(magnifier)
+ }
+ } else {
+ pack forget $ds9(info)
+ }
+
+ if {$view(panner)} {
+ pack $ds9(panner) -side bottom -padx 2 -pady 2
+ } else {
+ pack forget $ds9(panner)
+ }
+
+ # buttons
+ if {$view(buttons)} {
+ grid $ds9(buttons) -row 0 -column 2 -sticky ns
+ $ds9(buttons,sep) configure -orient vertical
+ grid $ds9(buttons,sep) -row 0 -column 3 -sticky ns
+ } else {
+ grid forget $ds9(buttons)
+ grid forget $ds9(buttons,sep)
+ }
+}
+
+proc LayoutFrames {} {
+ global ds9
+ global current
+ global tile
+ global view
+ global colorbar
+
+ # turn everything off
+ foreach f $ds9(frames) {
+ $f hide
+ $f highlite off
+ $f panner off
+ $f magnifier off
+ UnBindEventsFrame $f
+ }
+
+ if {$ds9(active,num) > 0} {
+ switch -- $ds9(display) {
+ single {TileOne}
+ tile {
+ switch -- $tile(mode) {
+ row {TileRect 1 $ds9(active,num) $tile(grid,gap)}
+ column {TileRect $ds9(active,num) 1 $tile(grid,gap)}
+ grid {
+ switch -- $tile(grid,mode) {
+ automatic {
+ TileRect [expr int(sqrt($ds9(active,num)-1))+1] \
+ [expr int(sqrt($ds9(active,num))+.5)] \
+ $tile(grid,gap)
+ }
+ manual {
+ TileRect \
+ $tile(grid,col) \
+ $tile(grid,row) \
+ $tile(grid,gap)
+ }
+ }
+ }
+ }
+ }
+ blink {TileOne}
+ }
+ } else {
+ set current(frame) {}
+ set ds9(next) {}
+
+ # panner
+ if {$view(panner)} {
+ panner clear
+ }
+
+ # magnifier
+ if {$view(magnifier)} {
+ magnifier clear
+ }
+
+ # process proper colorbar
+ colorbar show
+ colorbarrgb hide
+ $ds9(canvas) raise colorbar colorbarrgb
+
+ set current(colorbar) colorbar
+ set colorbar(map) [colorbar get name]
+ set colorbar(invert) [colorbar get invert]
+
+ # update menus/dialogs
+ UpdateDS9
+ }
+}
+
+
+# This procedure is called when we have only 1 frames to display
+
+proc TileOne {} {
+ global ds9
+ global view
+ global current
+ global canvas
+ global colorbar
+
+ set ww $canvas(width)
+ set hh $canvas(height)
+
+ set xx 0
+ set yy 0
+
+ foreach f $ds9(active) {
+ $f configure -x $xx -y $yy -width $ww -height $hh -anchor nw
+ }
+
+ # only show the current frame
+ $current(frame) show
+ FrameToFront
+}
+
+proc TileRect {numx numy gap} {
+ global view
+ global canvas
+ global tile
+
+ set ww $canvas(width)
+ set hh $canvas(height)
+
+ set w [expr int(($ww-$gap*($numx-1))/$numx)]
+ set h [expr int(($hh-$gap*($numy-1))/$numy)]
+
+ switch $tile(grid,dir) {
+ x {
+ for {set jj 0} {$jj<$numy} {incr jj} {
+ for {set ii 0} {$ii<$numx} {incr ii} {
+ set nn [expr $jj*$numx + $ii]
+ set x($nn) [expr ($w+$gap)*$ii]
+ set y($nn) [expr ($h+$gap)*$jj]
+ }
+ }
+ }
+ y {
+ for {set ii 0} {$ii<$numx} {incr ii} {
+ for {set jj 0} {$jj<$numy} {incr jj} {
+ set nn [expr $ii*$numy + $jj]
+ set x($nn) [expr ($w+$gap)*$ii]
+ set y($nn) [expr ($h+$gap)*$jj]
+ }
+ }
+ }
+ }
+
+ TileIt $w $h x y [expr $numx*$numy]
+}
+
+proc TileIt {ww hh xvar yvar nn} {
+ upvar $xvar x
+ upvar $yvar y
+ global ds9
+ global current
+
+ set ii 0
+ foreach ff $ds9(active) {
+ if {$ii<$nn} {
+ $ff configure -x $x($ii) -y $y($ii) \
+ -width $ww -height $hh -anchor nw
+ $ff show
+ $ds9(canvas) raise $ff
+ if {!$ds9(freeze)} {
+ BindEventsFrame $ff
+ }
+ }
+ incr ii
+ }
+
+ # if manual grid, current frame could be not included
+ if {$current(frame) != {}} {
+ $current(frame) colorbar tag "\{[$current(colorbar) get tag]\}"
+ }
+ if {$ds9(active,num) > $nn} {
+ set current(frame) [lindex $ds9(active) 0]
+ }
+ FrameToFront
+}
+
+proc DisplayDefaultDialog {} {
+ global canvas
+ global ed
+
+ set w {.defdpy}
+
+ set ed(ok) 0
+ set ed(x) $canvas(width)
+ set ed(y) $canvas(height)
+
+ DialogCreate $w [msgcat::mc {Display Size}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.xTitle -text {X}
+ ttk::label $f.yTitle -text {Y}
+ ttk::entry $f.x -textvariable ed(x) -width 10
+ ttk::entry $f.y -textvariable ed(y) -width 10
+ ttk::label $f.xunit -text [msgcat::mc {Pixels}]
+ ttk::label $f.yunit -text [msgcat::mc {Pixels}]
+
+ grid $f.xTitle $f.x $f.xunit -padx 2 -pady 2 -sticky w
+ grid $f.yTitle $f.y $f.yunit -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ $w.param.x select range 0 end
+ DialogWait $w ed(ok) $w.param.x
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set canvas(width) $ed(x)
+ set canvas(height) $ed(y)
+ UpdateView
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc ViewHorzCmd {} {
+ global canvas
+ global icanvas
+
+ set canvas(width) $icanvas(horz,width)
+ set canvas(height) $icanvas(horz,height)
+ LayoutOrient
+}
+
+proc ViewVertCmd {} {
+ global canvas
+ global icanvas
+
+ set canvas(width) $icanvas(vert,width)
+ set canvas(height) $icanvas(vert,height)
+ LayoutOrient
+}
+
+# Process Cmds
+
+proc ProcessHeightCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ # can't use ProcessRealize
+ RealizeDS9
+
+ global canvas
+ set canvas(height) [lindex $var $i]
+ UpdateView
+}
+
+proc ProcessSendHeightCmd {proc id param} {
+ global canvas
+ $proc $id "$canvas(height)\n"
+}
+
+proc ProcessWidthCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ # can't use ProcessRealize
+ RealizeDS9
+
+ global canvas
+ set canvas(width) [lindex $var $i]
+ UpdateView
+}
+
+proc ProcessSendWidthCmd {proc id param} {
+ global canvas
+ $proc $id "$canvas(width)\n"
+}
+
+proc ProcessViewCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global view
+ global rgb
+ global canvas
+ global icanvas
+
+ set item [string tolower [lindex $var $i]]
+
+ switch -- $item {
+ layout {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ horizontal {
+ set view(layout) $item
+ ViewHorzCmd
+ }
+ vertical {
+ set view(layout) $item
+ ViewVertCmd
+ }
+ }
+ }
+ keyvalue {
+ incr i
+ set view(info,keyvalue) [lindex $var $i]
+ }
+ horizontal {
+ # backward compatibility
+ set view(layout) $item
+ ViewHorzCmd
+ }
+ vertical {
+ # backward compatibility
+ set view(layout) $item
+ ViewVertCmd
+ }
+
+ default {
+ set yesno [lindex $var [expr $i+1]]
+ switch -- $yesno {
+ 1 -
+ 0 -
+ yes -
+ no -
+ on -
+ off -
+ true -
+ false {incr i}
+ default {
+ set yesno 1
+ }
+ }
+
+ switch -- $item {
+ info -
+ panner -
+ magnifier -
+ buttons -
+ colorbar {set view($item) [FromYesNo $yesno]}
+
+ colorbarnumerics {
+ # backward compatibility
+ set colorbar(numerics) [FromYesNo $yesno]
+ }
+ graph {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ horizontal {
+ set yesno [lindex $var [expr $i+1]]
+ switch -- $yesno {
+ 1 -
+ 0 -
+ yes -
+ no -
+ on -
+ off -
+ true -
+ false {incr i}
+ default {
+ set yesno 1
+ }
+ }
+ set view(graph,horz) [FromYesNo $yesno]
+ }
+ vertical {
+ set yesno [lindex $var [expr $i+1]]
+ switch -- $yesno {
+ 1 -
+ 0 -
+ yes -
+ no -
+ on -
+ off -
+ true -
+ false {incr i}
+ default {
+ set yesno 1
+ }
+ }
+ set view(graph,vert) [FromYesNo $yesno]
+ }
+ }
+ }
+ horzgraph {
+ # backward compatibility
+ set view(graph,horz) [FromYesNo $yesno]
+ }
+ vertgraph {
+ # backward compatibility
+ set view(graph,vert) [FromYesNo $yesno]
+ }
+
+ filename -
+ object -
+ keyword -
+ minmax -
+ lowhigh -
+ units -
+
+ detector -
+ amplifier -
+ physical -
+ image -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz -
+
+ frame {set view(info,$item) [FromYesNo $yesno]}
+
+ red -
+ green -
+ blue {set rgb($item) [FromYesNo $yesno]; RGBView}
+ }
+ UpdateView
+ }
+ }
+}
+
+proc ProcessSendViewCmd {proc id param} {
+ global view
+
+ switch -- [string tolower [lindex $param 0]] {
+ layout {$proc $id "$view(layout)\n"}
+ keyvalue {$proc $id "$view(info,keyvalue)\n"}
+ info {$proc $id [ToYesNo $view(info)]}
+ panner {$proc $id [ToYesNo $view(panner)]}
+ magnifier {$proc $id [ToYesNo $view(magnifier)]}
+ buttons {$proc $id [ToYesNo $view(buttons)]}
+ colorbar {$proc $id [ToYesNo $view(colorbar)]}
+ colorbarnumerics {
+ # backward compatibility
+ $proc $id [ToYesNo $colorbar(numerics)]
+ }
+ graph {
+ switch -- [string tolower [lindex $param 1]] {
+ horizontal {$proc $id [ToYesNo $view(graph,horz)]}
+ vertical {$proc $id [ToYesNo $view(graph,vert)]}
+ }
+ }
+ horzgraph {
+ # backward compatibility
+ $proc $id [ToYesNo $view(graph,horz)]
+ }
+ vertgraph {
+ # backward compatibility
+ $proc $id [ToYesNo $view(graph,vert)]
+ }
+
+ filename {$proc $id [ToYesNo $view(info,filename)]}
+ object {$proc $id [ToYesNo $view(info,object)]}
+ keyword {$proc $id [ToYesNo $view(info,keyword)]}
+ minmax {$proc $id [ToYesNo $view(info,minmax)]}
+ minmaxxy {$proc $id [ToYesNo $view(info,minmax,xy)]}
+ lowhigh {$proc $id [ToYesNo $view(info,lowhigh)]}
+ units {$proc $id [ToYesNo $view(info,bunit)]}
+
+ detector {$proc $id [ToYesNo $view(info,detector)]}
+ amplifier {$proc $id [ToYesNo $view(info,amplifier)]}
+ physical {$proc $id [ToYesNo $view(info,physical)]}
+ image {$proc $id [ToYesNo $view(info,image)]}
+ wcs {$proc $id [ToYesNo $view(info,wcs)]}
+ wcsa {$proc $id [ToYesNo $view(info,wcsa)]}
+ wcsb {$proc $id [ToYesNo $view(info,wcsb)]}
+ wcsc {$proc $id [ToYesNo $view(info,wcsc)]}
+ wcsd {$proc $id [ToYesNo $view(info,wcsd)]}
+ wcse {$proc $id [ToYesNo $view(info,wcse)]}
+ wcsf {$proc $id [ToYesNo $view(info,wcsf)]}
+ wcsg {$proc $id [ToYesNo $view(info,wcsg)]}
+ wcsh {$proc $id [ToYesNo $view(info,wcsh)]}
+ wcsi {$proc $id [ToYesNo $view(info,wcsi)]}
+ wcsj {$proc $id [ToYesNo $view(info,wcsj)]}
+ wcsk {$proc $id [ToYesNo $view(info,wcsk)]}
+ wcsl {$proc $id [ToYesNo $view(info,wcsl)]}
+ wcsm {$proc $id [ToYesNo $view(info,wcsm)]}
+ wcsn {$proc $id [ToYesNo $view(info,wcsn)]}
+ wcso {$proc $id [ToYesNo $view(info,wcso)]}
+ wcsp {$proc $id [ToYesNo $view(info,wcsp)]}
+ wcsq {$proc $id [ToYesNo $view(info,wcsq)]}
+ wcsr {$proc $id [ToYesNo $view(info,wcsr)]}
+ wcss {$proc $id [ToYesNo $view(info,wcss)]}
+ wcst {$proc $id [ToYesNo $view(info,wcst)]}
+ wcsu {$proc $id [ToYesNo $view(info,wcsu)]}
+ wcsv {$proc $id [ToYesNo $view(info,wcsv)]}
+ wcsw {$proc $id [ToYesNo $view(info,wcsw)]}
+ wcsx {$proc $id [ToYesNo $view(info,wcsx)]}
+ wcsy {$proc $id [ToYesNo $view(info,wcsy)]}
+ wcsz {$proc $id [ToYesNo $view(info,wcsz)]}
+
+ frame {$proc $id [ToYesNo $view(info,frame)]}
+ default {
+ # backward compatibility
+ $proc $id "$view(layout)\n"
+ }
+ }
+}
diff --git a/ds9/library/line.tcl b/ds9/library/line.tcl
new file mode 100644
index 0000000..bdea1b5
--- /dev/null
+++ b/ds9/library/line.tcl
@@ -0,0 +1,121 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LineDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set arrows [$var(frame) get marker $var(id) line arrow]
+ set var(p1arrow) [lindex $arrows 0]
+ set var(p2arrow) [lindex $arrows 1]
+
+ # procs
+ set var(which) line
+ set var(proc,apply) LineApply
+ set var(proc,coordCB) LineCoordCB
+ set var(proc,editCB) LineEditCB
+ set var(proc,distCB) LineDistCB
+
+ # base
+ MarkerBaseLineDialog $varname 375 150
+ # raise plot?
+ global marker
+ set var(plot2d) $marker(plot2d)
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ # plot2d
+ MarkerAnalysisPlot2dDialog $varname
+
+ set f $var(top).param
+
+ # Arrows
+ ttk::label $f.tarrow -text [msgcat::mc {Arrow}]
+ ttk::checkbutton $f.p1arrow -variable ${varname}(p1arrow) \
+ -text [msgcat::mc {Left}] -command "LineArrow $varname"
+ ttk::checkbutton $f.p2arrow -variable ${varname}(p2arrow) \
+ -text [msgcat::mc {Right}] -command "LineArrow $varname"
+
+ grid $f.tarrow $f.p1arrow $f.p2arrow -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc LineApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) line point $var(system) $var(sky) \
+ $var(x) $var(y) $var(x2) $var(y2)
+
+ MarkerBaseLineApply $varname
+}
+
+# support
+
+proc LineArrow {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) line arrow $var(p1arrow) $var(p2arrow)
+}
+
+# callbacks
+
+proc LineCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "LineCoordCB"
+ }
+
+ MarkerAnalysisPlot2dSystem $varname
+ MarkerBaseCoordCB $varname
+ LineEditCB $varname
+}
+
+proc LineEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "LineEditCB"
+ }
+
+ MarkerBaseLineEditCB $varname
+
+ set var(dist) [$var(frame) get marker $var(id) line length \
+ $var(dcoord) $var(dformat)]
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+}
+
+proc LineDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "LineDistCB"
+ }
+
+ set var(dist) [$var(frame) get marker $var(id) line length \
+ $var(dcoord) $var(dformat)]
+}
+
+
diff --git a/ds9/library/load.tcl b/ds9/library/load.tcl
new file mode 100644
index 0000000..4742977
--- /dev/null
+++ b/ds9/library/load.tcl
@@ -0,0 +1,534 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MultiLoad {{layer {}} {mode {}}} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "MultiLoad"
+ }
+
+ if {$layer != {} || $mode != {}} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ if {![$current(frame) has fits]} {
+ return
+ }
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {CreateFrame}
+ rgb {}
+ }
+ } else {
+ CreateFrame
+ return
+ }
+
+ # go into tile mode if more than one
+ set cnt [llength $ds9(frames)]
+ if {$cnt > 1 && $current(display) != "tile"} {
+ set current(display) tile
+ DisplayMode
+ }
+}
+
+proc MultiLoadBase {} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "MultiLoadBase"
+ }
+
+ if {$current(frame) != {}} {
+ if {![$current(frame) has fits]} {
+ return
+ }
+ CreateFrame
+ } else {
+ CreateFrame
+ return
+ }
+
+ # go into tile mode if more than one
+ set cnt [llength $ds9(frames)]
+ if {$cnt > 1 && $current(display) != "tile"} {
+ set current(display) tile
+ DisplayMode
+ }
+}
+
+proc MultiLoadRGB {} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,layout)} {
+ puts stderr "MultiLoadRGB"
+ }
+
+ if {$current(frame) != {}} {
+ if {![$current(frame) has fits]} {
+ return
+ }
+ CreateRGBFrame
+ } else {
+ CreateRGBFrame
+ return
+ }
+
+ # go into tile mode if more than one
+ set cnt [llength $ds9(frames)]
+ if {$cnt > 1 && $current(display) != "tile"} {
+ set current(display) tile
+ DisplayMode
+ }
+}
+
+# used by backup
+proc ProcessLoad {{err 1}} {
+ global current
+ global loadParam
+ global ds9
+
+ # restrict load type for windows
+ switch $ds9(wm) {
+ x11 -
+ aqua {}
+ win32 {
+ switch -- $loadParam(load,type) {
+ alloc -
+ allocgz -
+ channel -
+ var -
+ photo {}
+
+ mmap -
+ mmapincr {
+ set loadParam(load,type) allocgz
+ set loadParam(file,fn) $loadParam(file,name)
+ }
+
+ smmap -
+ shared -
+ sshared -
+ socket -
+ socketgz {Error "[msgcat::mc {This function is not currently supported for this port.}]"}
+ }
+ }
+ }
+
+ if {[catch {
+ switch -- $loadParam(load,type) {
+ alloc -
+ allocgz {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ \{$loadParam(file,fn)\} \
+ $loadParam(load,layer)}
+ channel {
+ fconfigure $loadParam(channel,name) -translation binary \
+ -encoding binary
+ $current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(channel,name) \
+ $loadParam(load,layer)
+
+ # clean up
+ catch {close $loadParam(channel,name)}
+ }
+ mmap -
+ mmapincr {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(load,layer)}
+ smmap {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,header)\} \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(load,layer)}
+ shared {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(shared,idtype) \
+ $loadParam(shared,id) \
+ $loadParam(load,layer)}
+ sshared {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(shared,idtype) \
+ $loadParam(shared,hdr) \
+ $loadParam(shared,id) \
+ $loadParam(load,layer)}
+ socket -
+ socketgz {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(socket,id) \
+ $loadParam(load,layer)}
+ var {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ \{$loadParam(file,name)\} \
+ $loadParam(load,type) \
+ $loadParam(var,name) \
+ $loadParam(load,layer)}
+ photo {$current(frame) load $loadParam(file,type) \
+ $loadParam(file,mode) \
+ $loadParam(var,name) \{$loadParam(file,name)\}
+ }
+ }
+ } rr]} {
+ if {$err} {
+ Error "[msgcat::mc {Unable to load}] $loadParam(file,type) $loadParam(file,mode) $loadParam(file,name)"
+ }
+ return 0
+ }
+
+ # save loadParam
+ if {$loadParam(load,layer) == {}} {
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {ProcessLoadSaveParams $current(frame)}
+ rgb {
+ switch -- $loadParam(file,mode) {
+ {rgb image} -
+ {rgb cube} {ProcessLoadSaveParams $current(frame)}
+ default {
+ ProcessLoadSaveParams \
+ "$current(frame)[$current(frame) get rgb channel]"
+ }
+ }
+ }
+ }
+ }
+
+ unset loadParam
+ return 1
+}
+
+proc ProcessLoadSaveParams {varname} {
+ global loadParam
+ global current
+
+ switch $loadParam(file,mode) {
+ slice -
+ {mosaic wcs} -
+ {mosaic iraf} {
+ # special case
+ global $varname
+ if {[info exists $varname]} {
+ set varname "$varname.[$current(frame) get fits count]"
+ }
+ }
+ }
+
+ global $varname
+ if {[info exists $varname]} {
+ unset $varname
+ }
+
+ array set $varname [array get loadParam]
+
+ # always save absolute path
+ upvar #0 $varname var
+ if {[file pathtype $var(file,name)] == {relative}} {
+ set var(file,name) [file join [pwd] $var(file,name)]
+ }
+}
+
+proc StartLoad {} {
+}
+
+proc FinishLoadPre {} {
+ global loadParam
+ global current
+ global threed
+
+ UpdateWCS
+
+ # generate grid so updatemenu is correct
+ GridUpdateCurrent
+
+ # generate contour so updatemenu is correct
+ UpdateContourScale
+ ContourUpdate
+
+ # just in case, frame may have been deleted before FinishLoad during startup
+ if {$current(frame) == {}} {
+ return
+ }
+
+ # if header(s) were open, remove them
+ DestroyHeader $current(frame)
+
+ # Cube?
+ if {[$current(frame) has fits cube]} {
+ CubeDialog
+ }
+}
+
+proc FinishLoadPost {} {
+ UpdateDS9
+}
+
+proc FinishLoad {} {
+ FinishLoadPre
+ FinishLoadPost
+}
+
+proc IsLocalFile {fn} {
+ # strip any brackets
+ set aa [string first "\[" $fn]
+ if {$aa > 0} {
+ set fn [string range $fn 0 [expr $aa-1]]
+ }
+
+ if {![file exists $fn]} {
+ return 0
+ }
+ if {![file isfile $fn]} {
+ return 0
+ }
+ if {[file isdirectory $fn]} {
+ return 0
+ }
+ if {[file readable $fn]} {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+proc ConvertFitsFile {} {
+ foreach t {Stdin ExternalFits GzipFile BZip2File CompressFile PackFile} {
+ if {[$t]} {
+ return
+ }
+ }
+}
+
+proc ConvertArrayFile {} {
+ foreach t {Stdin GzipFile BZip2File CompressFile PackFile} {
+ if {[$t]} {
+ return
+ }
+ }
+}
+
+# File Types
+
+proc Stdin {} {
+ global loadParam
+
+ # find -, -[], -[foo] but not -abc
+ if {[regexp -- {^-(\[.*)?$} $loadParam(file,name)]} {
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) "stdin[string range $loadParam(file,name) 1 end]"
+ set loadParam(file,fn) $loadParam(file,name)
+ return 1
+ } elseif {[string range $loadParam(file,name) 0 4] == "stdin" ||
+ [string range $loadParam(file,name) 0 4] == "STDIN"} {
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) "stdin[string range $loadParam(file,name) 5 end]"
+ set loadParam(file,fn) $loadParam(file,name)
+ return 1
+ }
+ return 0
+}
+
+proc BZip2File {} {
+ global loadParam
+
+ if { [regexp {(.*)\.bz2($|\[)} $loadParam(file,name) matched root] } {
+ if {[catch {set ch [open "| bunzip2 < $root.bz2 " r]}]} {
+ return 0
+ }
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ return 1
+ }
+ return 0
+}
+
+proc CompressFile {} {
+ global loadParam
+
+ if {[regexp {(.*)\.Z($|\[)} $loadParam(file,name) matched root]} {
+ if {[catch {set ch [open "| uncompress < $root.Z " r]}]} {
+ return 0
+ }
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ return 1
+ }
+ return 0
+}
+
+proc PackFile {} {
+ global loadParam
+
+ if {[regexp {(.*)\.z($|\[)} $loadParam(file,name) matched root]} {
+ if {[catch {set ch [open "| pcat $root.z " r]}]} {
+ return 0
+ }
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ return 1
+ }
+ return 0
+}
+
+proc GzipFile {} {
+ global loadParam
+
+ set fn $loadParam(file,name)
+ set id [string first "\[" $fn]
+ if {$id > 0} {
+ set fn [string range $fn 0 [expr $id-1]]
+ }
+
+ catch {
+ set ch [open $fn r]
+ fconfigure $ch -encoding binary -translation binary
+ set bb [read $ch 2]
+ close $ch
+ binary scan $bb H4 cc
+ if {$cc == {1f8b}} {
+ set loadParam(load,type) allocgz
+ set loadParam(file,fn) $loadParam(file,name)
+ return 1
+ }
+ }
+ return 0
+}
+
+proc ExternalFits {} {
+ global loadParam
+ global extFits
+
+ foreach id [array names extFits] {
+ if {[string match $id "$loadParam(file,name)"]} {
+ regsub -all {\$filename} $extFits($id) "$loadParam(file,name)" \
+ result
+ set cmd "| $result"
+ if {[catch {set ch [open "$cmd" r]} err]} {
+ Error "open $cmd failed: $err"
+ return 0
+ }
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ return 1
+ }
+ }
+ return 0
+}
+
+# Preserve
+
+proc ProcessPreserveCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ global scale
+ global panzoom
+ global marker
+
+ switch -- [string tolower [lindex $var $i]] {
+ pan {
+ incr i
+ set panzoom(preserve) [FromYesNo [lindex $var $i]]
+ PreservePan
+ }
+ marker -
+ regions {
+ incr i
+ set marker(preserve) [FromYesNo [lindex $var $i]]
+ MarkerPreserve
+ }
+ }
+}
+
+proc ProcessSendPreserveCmd {proc id param} {
+ global scale
+ global panzoom
+ global marker
+
+ switch -- [string tolower $param] {
+ scale {
+ # backward compatibility
+ $proc $id "no\n"
+ }
+ pan {$proc $id [ToYesNo $panzoom(preserve)]}
+ regions {$proc $id [ToYesNo $marker(preserve)]}
+ }
+}
+
+# Update
+
+proc ProcessUpdateCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ global ds9
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {[lindex $var $i] != {} && [string range [lindex $var $i] 0 0] != {-}} {
+ switch -- [string tolower [lindex $var $i]] {
+ on -
+ yes -
+ no -
+ off {
+ # backward compatibility
+ }
+
+ now {
+ if {[string is integer [lindex $var [expr $i+1]]]} {
+ $current(frame) update now \
+ [lindex $var [expr $i+1]] \
+ [lindex $var [expr $i+2]] [lindex $var [expr $i+3]] \
+ [lindex $var [expr $i+4]] [lindex $var [expr $i+5]]
+
+ incr i 5
+ } else {
+ $current(frame) update now
+ }
+ }
+ {} {
+ $current(frame) update
+ incr i -1
+ }
+
+ default {
+ $current(frame) update \
+ [lindex $var $i] \
+ [lindex $var [expr $i+1]] [lindex $var [expr $i+2]] \
+ [lindex $var [expr $i+3]] [lindex $var [expr $i+4]]
+ incr i 4
+ }
+ }
+ } else {
+ $current(frame) update
+ incr i -1
+ }
+}
diff --git a/ds9/library/macosx.tcl b/ds9/library/macosx.tcl
new file mode 100644
index 0000000..782f11d
--- /dev/null
+++ b/ds9/library/macosx.tcl
@@ -0,0 +1,82 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MacOSXOpenDocEvent {fc} {
+ global ds9
+
+ if {$ds9(event,opendoc) != {}} {
+ StartLoad
+ foreach f $ds9(event,opendoc) {
+ MultiLoad
+ LoadFitsFile $f {} {}
+ FileLast fitsfbox $f
+ }
+ FinishLoad
+ }
+}
+
+proc MacOSXPrintDocEvent {bye} {
+ global ds9
+
+ if {$ds9(event,printdoc) != {}} {
+ set fc 0
+
+ foreach f $ds9(event,printdoc) {
+ RealizeDS9
+ StartLoad
+
+ MultiLoad
+ LoadFitsFile $f {} {}
+ FileLast fitsfbox $f
+
+ FinishLoad
+ PostScript
+ }
+
+ if {$bye} {
+ Quit
+ }
+ }
+}
+
+proc MacOSXGetLocale {} {
+ return [macosx locale]
+}
+
+#proc MacOSXPrint {} {
+# global ds9
+#
+# we need to be realized
+# RealizeDS9
+# need the colorbar levels updated
+# UpdateColormapLevel
+#
+# if {[macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] yes]} {
+# foreach f $ds9(frames) {
+# $f macosx print
+# }
+# colorbar macosx print
+# colorbarrgb macosx print
+# macosx pm print end
+# }
+#}
+
+#proc MacOSXPrintPre {} {
+# global ds9
+
+# if {[macosx pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] no]} {
+# foreach f $ds9(frames) {
+# $f macosx print
+# }
+# colorbar macosx print
+# colorbarrgb macosx print
+# macosx pm print end
+# }
+#}
+
+#proc MacOSXPageSetup {} {
+# macosx pm pagesetup
+#}
diff --git a/ds9/library/magnifier.tcl b/ds9/library/magnifier.tcl
new file mode 100644
index 0000000..f1883dd
--- /dev/null
+++ b/ds9/library/magnifier.tcl
@@ -0,0 +1,187 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CreateMagnifier {} {
+ global imagnifier
+ global ds9
+
+ set ds9(magnifier) [canvas $ds9(panel).mag -width $imagnifier(size) \
+ -height $imagnifier(size) \
+ -relief groove \
+ -borderwidth 2 \
+ -highlightthickness 0 \
+ -insertofftime 0 \
+ -takefocus 0]
+ $ds9(magnifier) create magnifier$ds9(visual) \
+ -width $imagnifier(size) \
+ -height $imagnifier(size) \
+ -command magnifier \
+ -tag magnifier \
+ -helvetica $ds9(helvetica) \
+ -courier $ds9(courier) \
+ -times $ds9(times)
+}
+
+proc MagnifierDef {} {
+ global imagnifier
+ global pmagnifier
+
+ set imagnifier(size) 128
+
+ # prefs only
+ set pmagnifier(cursor) 1
+ set pmagnifier(zoom) 4
+ set pmagnifier(region) 1
+ set pmagnifier(color) white
+}
+
+proc UpdateMagnifier {which x y} {
+ global view
+
+ if {$view(magnifier)} {
+ $which magnifier update $x $y
+ }
+}
+
+proc MagnifierFrameBackup {ch which} {
+ global pmagnifier
+
+ puts $ch "$which magnifier graphics $pmagnifier(region)"
+ puts $ch "$which magnifier cursor $pmagnifier(cursor)"
+ puts $ch "$which magnifier zoom $pmagnifier(zoom)"
+ puts $ch "$which magnifier color $pmagnifier(color)"
+}
+
+# Prefs Cmds
+
+proc MagnifierRegion {} {
+ global pmagnifier
+ global ds9
+
+ foreach ff $ds9(frames) {
+ $ff magnifier graphics $pmagnifier(region)
+ }
+}
+
+proc MagnifierCursor {} {
+ global pmagnifier
+ global ds9
+
+ foreach ff $ds9(frames) {
+ $ff magnifier cursor $pmagnifier(cursor)
+ }
+}
+
+proc MagnifierZoom {} {
+ global pmagnifier
+ global ds9
+
+ foreach ff $ds9(frames) {
+ $ff magnifier zoom $pmagnifier(zoom)
+ }
+}
+
+proc MagnifierColor {} {
+ global pmagnifier
+ global ds9
+
+ foreach ff $ds9(frames) {
+ $ff magnifier color $pmagnifier(color)
+ }
+}
+
+# Prefs
+
+proc PrefsDialogMagnifier {} {
+ global dprefs
+ global pmagnifier
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Magnifier}]
+ lappend dprefs(tabs) [ttk::frame $w.magnifier]
+
+ set f [ttk::labelframe $w.magnifier.param -text [msgcat::mc {Magnifier}]]
+
+ ttk::label $f.tshow -text [msgcat::mc {Show}]
+ ttk::checkbutton $f.graphics -text [msgcat::mc {Graphics}] \
+ -variable pmagnifier(region) -command MagnifierRegion
+ ttk::checkbutton $f.cursor -text [msgcat::mc {Cursor}] \
+ -variable pmagnifier(cursor) -command MagnifierCursor
+
+ ttk::label $f.tcolor -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pmagnifier color MagnifierColor
+
+ ttk::label $f.tx -text [msgcat::mc {Magnification}]
+ ttk::radiobutton $f.x1 -text {1x} \
+ -variable pmagnifier(zoom) -value 1 -command MagnifierZoom
+ ttk::radiobutton $f.x2 -text {2x} \
+ -variable pmagnifier(zoom) -value 2 -command MagnifierZoom
+ ttk::radiobutton $f.x4 -text {4x} \
+ -variable pmagnifier(zoom) -value 4 -command MagnifierZoom
+ ttk::radiobutton $f.x8 -text {8x} \
+ -variable pmagnifier(zoom) -value 8 -command MagnifierZoom
+ ttk::radiobutton $f.x16 -text {16x} \
+ -variable pmagnifier(zoom) -value 16 -command MagnifierZoom
+
+ grid $f.tshow $f.graphics - $f.cursor - -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color - - -padx 2 -pady 2 -sticky w
+ grid $f.tx $f.x1 $f.x2 $f.x4 $f.x8 $f.x16 -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+# Process Cmds
+
+proc ProcessMagnifierCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global pmagnifier
+ global view
+
+ switch -- [string tolower [lindex $var $i]] {
+ color {
+ incr i
+ set pmagnifier(color) [lindex $var $i]
+ MagnifierColor
+ }
+ zoom {
+ incr i
+ set pmagnifier(zoom) [lindex $var $i]
+ MagnifierZoom
+ }
+ cursor {
+ incr i
+ set pmagnifier(cursor) [FromYesNo [lindex $var $i]]
+ MagnifierCursor
+ }
+ region {
+ incr i
+ set pmagnifier(region) [FromYesNo [lindex $var $i]]
+ MagnifierRegion
+ }
+ default {
+ # backward compatibility
+ set view(magnifier) 1
+ UpdateView
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendMagnifierCmd {proc id param} {
+ global pmagnifier
+
+ switch -- [string tolower [lindex $param 0]] {
+ color {$proc $id "$pmagnifier(color)\n"}
+ zoom {$proc $id "$pmagnifier(zoom)\n"}
+ cursor {$proc $id [ToYesNo $pmagnifier(cursor)]}
+ region {$proc $id [ToYesNo $pmagnifier(region)]}
+ }
+}
+
+
diff --git a/ds9/library/manalysis.tcl b/ds9/library/manalysis.tcl
new file mode 100644
index 0000000..67a93b0
--- /dev/null
+++ b/ds9/library/manalysis.tcl
@@ -0,0 +1,602 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc AnalysisMainMenu {} {
+ global ds9
+
+ # WARNING: this is a variable length menu.
+ # Be sure to update ds9(menu,size,analysis)
+ menu $ds9(mb).analysis
+# IME
+# $ds9(mb).analysis add cascade -label [msgcat::mc {Task}]
+# -menu $ds9(mb).analysis.task
+# $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command -label "[msgcat::mc {Pixel Table}]..." \
+ -command PixelTableDialog
+ $ds9(mb).analysis add command -label "[msgcat::mc {Mask Parameters}]..." \
+ -command MaskDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add checkbutton -label [msgcat::mc {Contours}] \
+ -variable contour(view) -command ContourUpdate
+ $ds9(mb).analysis add command -label "[msgcat::mc {Contour Parameters}]..."\
+ -command ContourDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add checkbutton -label [msgcat::mc {Coordinate Grid}] \
+ -variable grid(view) -command GridUpdateCurrent
+ $ds9(mb).analysis add command \
+ -label "[msgcat::mc {Coordinate Grid Parameters}]..." \
+ -command GridDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add cascade -label [msgcat::mc {Block}] \
+ -menu $ds9(mb).analysis.block
+ $ds9(mb).analysis add command -label "[msgcat::mc {Block Parameters}]..."\
+ -command BlockDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable smooth(view) -command SmoothUpdate
+ $ds9(mb).analysis add command -label "[msgcat::mc {Smooth Parameters}]..." \
+ -command SmoothDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command \
+ -label "[msgcat::mc {Crosshair Parameters}]..." \
+ -command CrosshairDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command -label "[msgcat::mc {Name Resolution}]..." \
+ -command NRESDialog
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add cascade -label [msgcat::mc {Image Servers}] \
+ -menu $ds9(mb).analysis.image
+ $ds9(mb).analysis add cascade -label [msgcat::mc {Archives}] \
+ -menu $ds9(mb).analysis.arch
+ $ds9(mb).analysis add cascade -label [msgcat::mc {Catalogs}] \
+ -menu $ds9(mb).analysis.cat
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command -label "[msgcat::mc {Catalog Tool}]..." \
+ -command CATTool
+ $ds9(mb).analysis add command -label "[msgcat::mc {Line Plot Tool}]..." \
+ -command PlotLineTool
+ $ds9(mb).analysis add command -label "[msgcat::mc {Bar Plot Tool}]..." \
+ -command PlotBarTool
+ $ds9(mb).analysis add command -label "[msgcat::mc {Scatter Plot Tool}]..." \
+ -command PlotScatterTool
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command \
+ -label "[msgcat::mc {Virtual Observatory}]..."\
+ -command VODialog
+ $ds9(mb).analysis add command -label "[msgcat::mc {Web Browser}]..." \
+ -command {HV web Web {}}
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add checkbutton \
+ -label [msgcat::mc {Analysis Command Log}] \
+ -variable panalysis(log)
+ $ds9(mb).analysis add separator
+ $ds9(mb).analysis add command \
+ -label "[msgcat::mc {Load Analysis Commands}]..." \
+ -command OpenAnalysisMenu
+ $ds9(mb).analysis add command \
+ -label [msgcat::mc {Clear Analysis Commands}] \
+ -command ClearAnalysisMenu
+
+ menu $ds9(mb).analysis.task
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Statistics}] \
+ -variable ime(task) -value stats -command IMEChangeTask
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Histogram}] \
+ -variable ime(task) -value hist -command IMEChangeTask
+ $ds9(mb).analysis.task add radiobutton \
+ -label [msgcat::mc {Radial Profile}] \
+ -variable ime(task) -value radial -command IMEChangeTask
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Plot 2D}] \
+ -variable ime(task) -value plot2d -command IMEChangeTask
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Plot 3D}] \
+ -variable ime(task) -value plot3d -command IMEChangeTask
+ $ds9(mb).analysis.task add separator
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ime(shape) -value circle -command IMEChangeShape
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable ime(shape) -value ellipse -command IMEChangeShape
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Box}] \
+ -variable ime(shape) -value box -command IMEChangeShape
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Polygon}] \
+ -variable ime(shape) -value polygon -command IMEChangeShape
+ $ds9(mb).analysis.task add separator
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Point}] \
+ -variable ime(shape) -value point -command IMEChangeShape
+ $ds9(mb).analysis.task add separator
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Annulus}] \
+ -variable ime(shape) -value annulus -command IMEChangeShape
+ $ds9(mb).analysis.task add radiobutton \
+ -label [msgcat::mc {Ellipse Annulus}] \
+ -variable ime(shape) -value ellipseannulus -command IMEChangeShape
+ $ds9(mb).analysis.task add radiobutton -label [msgcat::mc {Box Annulus}] \
+ -variable ime(shape) -value boxannulus -command IMEChangeShape
+
+ menu $ds9(mb).analysis.block
+ $ds9(mb).analysis.block add command -label [msgcat::mc {Block In}] \
+ -command {Block .5 .5}
+ $ds9(mb).analysis.block add command -label [msgcat::mc {Block Out}] \
+ -command {Block 2 2}
+ $ds9(mb).analysis.block add command -label [msgcat::mc {Block Fit}] \
+ -command BlockToFit
+ $ds9(mb).analysis.block add separator
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 1" \
+ -variable block(factor) -value { 1 1 } -command ChangeBlock
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 2" \
+ -variable block(factor) -value { 2 2 } -command ChangeBlock
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 4" \
+ -variable block(factor) -value { 4 4 } -command ChangeBlock
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 8" \
+ -variable block(factor) -value { 8 8 } -command ChangeBlock
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 16" \
+ -variable block(factor) -value { 16 16 } -command ChangeBlock
+ $ds9(mb).analysis.block add radiobutton -label "[msgcat::mc {Block}] 32" \
+ -variable block(factor) -value { 32 32 } -command ChangeBlock
+
+ menu $ds9(mb).analysis.image
+ $ds9(mb).analysis.image add command \
+ -label {DSS (SAO)} -command SAODialog
+ $ds9(mb).analysis.image add command \
+ -label {DSS (ESO} -command ESODialog
+ $ds9(mb).analysis.image add command \
+ -label {DSS (STSCI)} -command STSCIDialog
+ $ds9(mb).analysis.image add separator
+ $ds9(mb).analysis.image add command \
+ -label {2MASS (NASA/IPAC)} -command 2MASSDialog
+ $ds9(mb).analysis.image add command \
+ -label {VLA (NRAO)} -command VLADialog
+ $ds9(mb).analysis.image add command \
+ -label {NVSS (NRAO)} -command NVSSDialog
+ $ds9(mb).analysis.image add command \
+ -label {NLSS (NRAO)} -command VLSSDialog
+ $ds9(mb).analysis.image add separator
+ $ds9(mb).analysis.image add command \
+ -label {SkyView (NASA/HEASARC)} -command SkyViewDialog
+
+ menu $ds9(mb).analysis.arch
+ $ds9(mb).analysis.arch add cascade -label {Chandra (NASA/CXC)} \
+ -menu $ds9(mb).analysis.arch.chandra
+ $ds9(mb).analysis.arch add separator
+ SIAAnalysisMenu $ds9(mb).analysis.arch
+
+ menu $ds9(mb).analysis.arch.chandra
+ $ds9(mb).analysis.arch.chandra add command \
+ -label {Chaser} -command HVArchChandraChaser
+ $ds9(mb).analysis.arch.chandra add command \
+ -label {Fast Image} -command HVArchChandraPop
+ $ds9(mb).analysis.arch.chandra add command \
+ -label {Public FTP} -command HVArchChandraFTP
+
+ menu $ds9(mb).analysis.arch.simbad
+ $ds9(mb).analysis.arch.simbad add command -label {SAO} \
+ -command HVArchSIMBADSAO
+ $ds9(mb).analysis.arch.simbad add command -label {CDS} \
+ -command HVArchSIMBADCDS
+
+ menu $ds9(mb).analysis.arch.ads
+ $ds9(mb).analysis.arch.ads add command -label {SAO} \
+ -command HVArchADSSAO
+ $ds9(mb).analysis.arch.ads add command -label {CDS} \
+ -command HVArchADSCDS
+
+ menu $ds9(mb).analysis.cat
+ $ds9(mb).analysis.cat add command \
+ -label [msgcat::mc {Search for Catalogs}] \
+ -command "CATCDSSrchDialog catcdssrch1"
+ $ds9(mb).analysis.cat add command -label [msgcat::mc {Clear All}] \
+ -command CATClearFrame
+ $ds9(mb).analysis.cat add command -label [msgcat::mc {Match}] \
+ -command CATMatchFrame
+ $ds9(mb).analysis.cat add separator
+ CATAnalysisMenu
+}
+
+proc PrefsDialogAnalysisMenu {w} {
+ global ds9
+
+ set f [ttk::labelframe $w.manalysis -text [msgcat::mc {Analysis}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarAnalysis $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+# IME
+# $m add cascade -label [msgcat::mc {Task}]
+# -menu $m.task
+# $m add separator
+ $m add checkbutton -label [msgcat::mc {Contours}] \
+ -variable pcontour(view)
+ $m add checkbutton -label [msgcat::mc {Coordinate Grid}] \
+ -variable pgrid(view)
+ $m add separator
+ $m add cascade -label [msgcat::mc {Block}] \
+ -menu $m.block
+ $m add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable psmooth(view)
+
+ menu $m.task
+ $m.task add radiobutton -label [msgcat::mc {Statistics}] \
+ -variable pime(task) -value stats
+ $m.task add radiobutton -label [msgcat::mc {Histogram}] \
+ -variable pime(task) -value hist
+ $m.task add radiobutton -label [msgcat::mc {Radial Profile}] \
+ -variable pime(task) -value radial
+ $m.task add radiobutton -label [msgcat::mc {Plot 2D}] \
+ -variable pime(task) -value plot2d
+ $m.task add radiobutton -label [msgcat::mc {Plot 3D}] \
+ -variable pime(task) -value plot3d
+
+ menu $m.block
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 1" \
+ -variable pblock(factor) -value { 1 1 }
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 2" \
+ -variable pblock(factor) -value { 2 2 }
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 4" \
+ -variable pblock(factor) -value { 4 4 }
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 8" \
+ -variable pblock(factor) -value { 8 8 }
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 16" \
+ -variable pblock(factor) -value { 16 16 }
+ $m.block add radiobutton -label "[msgcat::mc {Block}] 32" \
+ -variable pblock(factor) -value { 32 32 }
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsAnalysisDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ analysis,contours 1
+ analysis,grid 1
+ analysis,smooth 1
+ analysis,bin 1
+ analysis,bout 1
+ analysis,bfit 1
+ analysis,b1 1
+ analysis,b2 1
+ analysis,b4 1
+ analysis,b8 0
+ analysis,b16 0
+ analysis,b32 0
+ }
+
+# IME
+# analysis,none 1
+# analysis,stats 1
+# analysis,hist 1
+# analysis,radial 1
+# analysis,plot2d 1
+# analysis,plot3d 1
+}
+
+proc CreateButtonsAnalysis {} {
+ global buttons
+ global ds9
+
+ ttk::frame $ds9(buttons).analysis
+
+# IME
+# RadioButton $ds9(buttons).analysis.stats
+# [string tolower [msgcat::mc {Stats}]]
+# ime(task) stats IMEChangeTask
+# RadioButton $ds9(buttons).analysis.hist
+# [string tolower [msgcat::mc {Histogram}]]
+# ime(task) hist IMEChangeTask
+# RadioButton $ds9(buttons).analysis.radial
+# [string tolower [msgcat::mc {Radial}]]
+# ime(task) radial IMEChangeTask
+# RadioButton $ds9(buttons).analysis.plot2d
+# [string tolower [msgcat::mc {Plot 2D}]]
+# ime(task) plot2d IMEChangeTask
+# RadioButton $ds9(buttons).analysis.plot3d
+# [string tolower [msgcat::mc {Plot 3D}]]
+# ime(task) plot3d IMEChangeTask
+
+ CheckButton $ds9(buttons).analysis.contours \
+ [string tolower [msgcat::mc {Contours}]] \
+ contour(view) ContourUpdate
+ CheckButton $ds9(buttons).analysis.grid \
+ [string tolower [msgcat::mc {Grid}]] \
+ grid(view) GridUpdateCurrent
+
+ ButtonButton $ds9(buttons).analysis.bin \
+ [string tolower [msgcat::mc {Block In}]] {Block .5 .5}
+ ButtonButton $ds9(buttons).analysis.bout \
+ [string tolower [msgcat::mc {Block Out}]] {Block 2 2}
+ ButtonButton $ds9(buttons).analysis.bfit \
+ [string tolower [msgcat::mc {Block Fit}]] BlockToFit
+ RadioButton $ds9(buttons).analysis.b1 \
+ "[string tolower [msgcat::mc {Block}]] 1" \
+ block(factor) { 1 1 } ChangeBlock
+ RadioButton $ds9(buttons).analysis.b2 \
+ "[string tolower [msgcat::mc {Block}]] 2" \
+ block(factor) { 2 2 } ChangeBlock
+ RadioButton $ds9(buttons).analysis.b4 \
+ "[string tolower [msgcat::mc {Block}]] 4" \
+ block(factor) { 4 4 } ChangeBlock
+ RadioButton $ds9(buttons).analysis.b8 \
+ "[string tolower [msgcat::mc {Block}]] 8" \
+ block(factor) { 8 8 } ChangeBlock
+ RadioButton $ds9(buttons).analysis.b16 \
+ "[string tolower [msgcat::mc {Block}]] 16" \
+ block(factor) { 16 16 } ChangeBlock
+ RadioButton $ds9(buttons).analysis.b32 \
+ "[string tolower [msgcat::mc {Block}]] 32" \
+ block(factor) { 32 32 } ChangeBlock
+
+ CheckButton $ds9(buttons).analysis.smooth \
+ [string tolower [msgcat::mc {Smooth}]] \
+ smooth(view) SmoothUpdate
+
+ set buttons(analysis) "
+ $ds9(buttons).analysis.contours pbuttons(analysis,contours)
+ $ds9(buttons).analysis.grid pbuttons(analysis,grid)
+
+ $ds9(buttons).analysis.bin pbuttons(analysis,bin)
+ $ds9(buttons).analysis.bout pbuttons(analysis,bout)
+ $ds9(buttons).analysis.bfit pbuttons(analysis,bfit)
+ $ds9(buttons).analysis.b1 pbuttons(analysis,b1)
+ $ds9(buttons).analysis.b2 pbuttons(analysis,b2)
+ $ds9(buttons).analysis.b4 pbuttons(analysis,b4)
+ $ds9(buttons).analysis.b8 pbuttons(analysis,b8)
+ $ds9(buttons).analysis.b16 pbuttons(analysis,b16)
+ $ds9(buttons).analysis.b32 pbuttons(analysis,b32)
+
+ $ds9(buttons).analysis.smooth pbuttons(analysis,smooth)
+ "
+
+# IME
+# $ds9(buttons).analysis.stats pbuttons(analysis,stats)
+# $ds9(buttons).analysis.hist pbuttons(analysis,hist)
+# $ds9(buttons).analysis.radial pbuttons(analysis,radial)
+# $ds9(buttons).analysis.plot2d pbuttons(analysis,plot2d)
+# $ds9(buttons).analysis.plot3d pbuttons(analysis,plot3d)
+}
+
+proc PrefsDialogButtonbarAnalysis {f} {
+ global ds9
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+# IME
+# $m add checkbutton -label [msgcat::mc {Statistics}]
+# -variable pbuttons(analysis,stats)
+# -command {UpdateButtons buttons(analysis)}
+# $m add checkbutton -label [msgcat::mc {Histogram}]
+# -variable pbuttons(analysis,hist)
+# -command {UpdateButtons buttons(analysis)}
+# $m add checkbutton -label [msgcat::mc {Radial Profile}]
+# -variable pbuttons(analysis,radial)
+# -command {UpdateButtons buttons(analysis)}
+# $m add checkbutton -label [msgcat::mc {Plot 2D}]
+# -variable pbuttons(analysis,plot2d)
+# -command {UpdateButtons buttons(analysis)}
+# $m add checkbutton -label [msgcat::mc {Plot 3D}]
+# -variable pbuttons(analysis,plot3d)
+# -command {UpdateButtons buttons(analysis)}
+# $m add separator
+ $m add checkbutton -label [msgcat::mc {Contours}] \
+ -variable pbuttons(analysis,contours) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label [msgcat::mc {Grid}] \
+ -variable pbuttons(analysis,grid) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Block In}] \
+ -variable pbuttons(analysis,bin) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label [msgcat::mc {Block Out}] \
+ -variable pbuttons(analysis,bout) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label [msgcat::mc {Block Fit}] \
+ -variable pbuttons(analysis,bfit) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 1" \
+ -variable pbuttons(analysis,b1) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 2" \
+ -variable pbuttons(analysis,b2) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 4" \
+ -variable pbuttons(analysis,b4) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 8" \
+ -variable pbuttons(analysis,b8) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 16" \
+ -variable pbuttons(analysis,b16) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add checkbutton -label "[msgcat::mc {Block}] 32" \
+ -variable pbuttons(analysis,b32) \
+ -command {UpdateButtons buttons(analysis)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable pbuttons(analysis,smooth) \
+ -command {UpdateButtons buttons(analysis)}
+}
+
+proc UpdateAnalysisMenuStatic {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateAnalysisMenuStatic"
+ }
+
+ if {$ds9(active,num) > 0} {
+ $ds9(mb) entryconfig [msgcat::mc {Analysis}] -state normal
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Analysis}] -state disabled
+ }
+}
+
+proc UpdateAnalysisMenu {} {
+ global ds9
+ global current
+ global ianalysis
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateAnalysisMenu"
+ }
+
+ if {$current(frame) != {}} {
+ for {set ii 0} {$ii<$ianalysis(menu,count)} {incr ii} {
+
+ if {[$current(frame) has fits]} {
+ set fn [$current(frame) get fits file name 1]
+ } else {
+ set fn {none}
+ }
+
+ # disable by default
+ $ianalysis(menu,$ii,parent) entryconfig $ianalysis(menu,$ii,item) \
+ -state disabled
+
+ foreach tt $ianalysis(menu,$ii,template) {
+ if {[regexp ".$tt" $fn]} {
+ $ianalysis(menu,$ii,parent) entryconfig \
+ $ianalysis(menu,$ii,item) -state normal
+ break
+ }
+ }
+ }
+ }
+}
+
+proc PrefsDialogAnalysis {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Analysis}]
+ lappend dprefs(tabs) [ttk::frame $w.analysis]
+
+ set f [ttk::labelframe $w.analysis.file \
+ -text [msgcat::mc {Analysis File}]]
+
+ ttk::checkbutton $f.auto -text [msgcat::mc {Autoload}] \
+ -variable panalysis(autoload)
+
+ ttk::entry $f.pre -textvariable panalysis(user) -width 60
+ ttk::button $f.browse -text [msgcat::mc {Browse}] \
+ -command "AnalysisPrefOpen panalysis(user)"
+ ttk::entry $f.pre2 -textvariable panalysis(user2) -width 60
+ ttk::button $f.browse2 -text [msgcat::mc {Browse}] \
+ -command "AnalysisPrefOpen panalysis(user2)"
+ ttk::entry $f.pre3 -textvariable panalysis(user3) -width 60
+ ttk::button $f.browse3 -text [msgcat::mc {Browse}] \
+ -command "AnalysisPrefOpen panalysis(user3)"
+ ttk::entry $f.pre4 -textvariable panalysis(user4) -width 60
+ ttk::button $f.browse4 -text [msgcat::mc {Browse}] \
+ -command "AnalysisPrefOpen panalysis(user4)"
+
+ grid $f.auto -padx 2 -pady 2 -sticky w
+ grid $f.pre $f.browse -padx 2 -pady 2 -sticky w
+ grid $f.pre2 $f.browse2 -padx 2 -pady 2 -sticky w
+ grid $f.pre3 $f.browse3 -padx 2 -pady 2 -sticky w
+ grid $f.pre4 $f.browse4 -padx 2 -pady 2 -sticky w
+
+ set f [ttk::labelframe $w.analysis.log -text [msgcat::mc {Analysis Log}]]
+
+ ttk::checkbutton $f.log -text [msgcat::mc {Show Command}] \
+ -variable panalysis(log)
+
+ grid $f.log -padx 2 -pady 2 -sticky w
+
+ pack $w.analysis.file $w.analysis.log -side top -fill both -expand true
+}
+
+# Support
+
+proc UpdateTaskMenu {} {
+ global ds9
+ global ime
+
+ switch $ime(task) {
+ stats -
+ hist {
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Circle}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Polygon}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Point}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box Annulus}] \
+ -state disabled
+ }
+ radial {
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Circle}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Polygon}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Point}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Annulus}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse Annulus}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box Annulus}] \
+ -state normal
+ }
+ plot2d {
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Circle}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Polygon}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Point}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box Annulus}] \
+ -state disabled
+ }
+ plot3d {
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Circle}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Polygon}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Point}] \
+ -state normal
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Ellipse Annulus}] \
+ -state disabled
+ $ds9(mb).analysis.task entryconfig [msgcat::mc {Box Annulus}] \
+ -state disabled
+ }
+ }
+}
diff --git a/ds9/library/marker.tcl b/ds9/library/marker.tcl
new file mode 100644
index 0000000..1678a15
--- /dev/null
+++ b/ds9/library/marker.tcl
@@ -0,0 +1,2076 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerDef {} {
+ global marker
+ global imarker
+ global pmarker
+
+ set imarker(id) -1
+ set imarker(x) -1
+ set imarker(y) -1
+ set imarker(motion) none
+ set imarker(handle) -1
+ set imarker(prefix,dialog) {mkr}
+ set imarker(prefix,plot3d) {plot3d}
+ set imarker(prefix,plot2d) {plot2d}
+ set imarker(prefix,stats) {stats}
+ set imarker(prefix,radial) {radial}
+ set imarker(prefix,panda) {panda}
+ set imarker(prefix,histogram) {hist}
+
+ set marker(show) 1
+ set marker(show,text) 1
+ set marker(centroid,auto) 0
+ set marker(centroid,iteration) 30
+ set marker(centroid,radius) 10
+ set marker(shape) circle
+ set marker(color) green
+ set marker(dashlist) {8 3}
+ set marker(width) 1
+ set marker(dash) 0
+ set marker(fixed) 0
+ set marker(edit) 1
+ set marker(move) 1
+ set marker(rotate) 1
+ set marker(delete) 1
+ set marker(include) 1
+ set marker(source) 1
+ set marker(font) helvetica
+ set marker(font,size) 10
+ set marker(font,weight) normal
+ set marker(font,slant) roman
+ set marker(preserve) 0
+
+ set marker(plot2d) 0
+ set marker(plot3d) 0
+ set marker(stats) 0
+
+ set marker(copy) {}
+ set marker(copy,system) {}
+ set marker(maxdialog) 48
+ set marker(load) current
+
+ set marker(format) ds9
+ # these are only used for save/load/list and are set from current wcs values
+ set marker(system) physical
+ set marker(sky) fk5
+ set marker(skyformat) degrees
+ set marker(strip) 0
+
+ array set pmarker [array get marker]
+ unset pmarker(copy)
+ unset pmarker(copy,system)
+ unset pmarker(maxdialog)
+ unset pmarker(load)
+ unset pmarker(system)
+ unset pmarker(sky)
+ unset pmarker(skyformat)
+ unset pmarker(strip)
+
+ set pmarker(epsilon) 3
+ set pmarker(dformat) degrees
+ set pmarker(circle,radius) 20
+ set pmarker(annulus,inner) 15
+ set pmarker(annulus,outer) 30
+ set pmarker(annulus,annuli) 1
+ set pmarker(panda,inner) 15
+ set pmarker(panda,outer) 30
+ set pmarker(panda,annuli) 1
+ set pmarker(panda,ang1) 0
+ set pmarker(panda,ang2) 360
+ set pmarker(panda,angnum) 4
+ set pmarker(ellipse,radius1) 40
+ set pmarker(ellipse,radius2) 20
+ set pmarker(ellipseannulus,radius1) 40
+ set pmarker(ellipseannulus,radius2) 20
+ set pmarker(ellipseannulus,radius3) 60
+ set pmarker(ellipseannulus,annuli) 1
+ set pmarker(epanda,radius1) 40
+ set pmarker(epanda,radius2) 20
+ set pmarker(epanda,radius3) 60
+ set pmarker(epanda,annuli) 1
+ set pmarker(epanda,ang1) 0
+ set pmarker(epanda,ang2) 360
+ set pmarker(epanda,angnum) 4
+ set pmarker(box,radius1) 80
+ set pmarker(box,radius2) 40
+ set pmarker(boxannulus,radius1) 80
+ set pmarker(boxannulus,radius2) 40
+ set pmarker(boxannulus,radius3) 120
+ set pmarker(boxannulus,annuli) 1
+ set pmarker(bpanda,radius1) 80
+ set pmarker(bpanda,radius2) 40
+ set pmarker(bpanda,radius3) 120
+ set pmarker(bpanda,annuli) 1
+ set pmarker(bpanda,ang1) 0
+ set pmarker(bpanda,ang2) 360
+ set pmarker(bpanda,angnum) 4
+ set pmarker(compass,radius) 40
+ set pmarker(polygon,width) 20
+ set pmarker(polygon,height) 20
+ set pmarker(projection,thick) 0
+ set pmarker(point,size) 11
+ set pmarker(segment,length) 20
+}
+
+# procs shared between region and catalog mode
+
+proc MarkerControl {which x y} {
+ global imarker
+ global current
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set id [$which get marker $current(mode) id $x $y]
+ if {$id} {
+ # are we on a selected annulus?
+ if {[$which get marker $current(mode) select $x $y] == $id} {
+ switch -- [$which get marker $current(mode) $id type] {
+ annulus {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create annulus radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ panda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create panda radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ ellipseannulus {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create ellipseannulus radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ epanda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create epanda radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ boxannulus {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create boxannulus radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ bpanda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create bpanda radius $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ }
+ }
+ }
+}
+
+proc MarkerControlShift {which x y} {
+ global imarker
+ global current
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # we need this cause MarkerMotion maybe called,
+ # and we don't want it
+ set imarker(motion) none
+ set imarker(handle) -1
+
+ set id [$which get marker $current(mode) id $x $y]
+ if {$id} {
+ # are we on a selected annulus?
+ if {[$which get marker $current(mode) select $x $y] == $id} {
+ switch -- [$which get marker $current(mode) $id type] {
+ panda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create panda angle $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ epanda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create epanda angle $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ bpanda {
+ set imarker(handle) \
+ [$which marker $current(mode) $id create bpanda angle $x $y]
+ $which marker $current(mode) $id edit begin $imarker(handle)
+ set imarker(motion) edit
+ }
+ }
+ }
+ }
+}
+
+proc MarkerCursor {which x y handleCursor overCursor} {
+ global current
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # are we over any selected marker handles?
+ # remember, handles are outside of a marker
+ set h [$which get marker $current(mode) handle $x $y]
+ set id [lindex $h 0]
+ set handle [lindex $h 1]
+ if {$handle} {
+ if {$handle < 5} {
+ # edit/rotate handle
+ SetCursor $handleCursor
+ } else {
+ # polygon/segment/annulus vertex
+ SetCursor dotbox
+ }
+ return
+ }
+
+ # else, see if we are on a segement of a polygon/segment
+ set h [$which get marker $current(mode) polygon segment $x $y]
+ if {[lindex $h 0]} {
+ SetCursor draped_box
+ return
+ }
+ set h [$which get marker $current(mode) segment segment $x $y]
+ if {[lindex $h 0]} {
+ SetCursor draped_box
+ return
+ }
+
+ # are we over a marker?
+ set id [$which get marker $current(mode) select $x $y]
+ if {$id} {
+ # are we on a selected annulus and control key down?
+ switch -- [$which get marker $current(mode) $id type] {
+ annulus -
+ panda -
+ ellipseannulus -
+ epanda -
+ boxannulus -
+ bpanda {SetCursor $overCursor}
+ default {SetCursor fleur}
+ }
+ return
+ }
+
+ # else, set no cursor
+ SetCursor {}
+}
+
+proc MarkerArrowKey {which x y} {
+ global current
+
+ $which warp $x $y
+ $which marker $current(mode) move $x $y
+}
+
+# Marker only
+
+proc MarkerButton {which x y} {
+ global marker
+ global imarker
+ global itemplate
+ global ds9
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # see if we are on a handle
+ set h [$which get marker handle $x $y]
+ set id [lindex $h 0]
+ set imarker(handle) [lindex $h 1]
+
+ if {$imarker(handle)} {
+ $which marker $id edit begin $imarker(handle)
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a segment of a polygon
+ set h [$which get marker polygon segment $x $y]
+ set id [lindex $h 0]
+ set segment [lindex $h 1]
+ if {$segment} {
+ $which marker $id create polygon vertex $segment $x $y
+ $which marker $id edit begin $imarker(handle)
+ set imarker(handle) [expr 4+$segment+1]
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a segment of a segment
+ set h [$which get marker segment segment $x $y]
+ set id [lindex $h 0]
+ set segment [lindex $h 1]
+ if {$segment} {
+ $which marker $id create segment vertex $segment $x $y
+ $which marker $id edit begin $imarker(handle)
+ set imarker(handle) [expr 4+$segment+1]
+ set imarker(motion) beginEdit
+ return
+ }
+
+ # else, see if we are on a marker
+ if {[$which get marker id $x $y]} {
+ $which marker select only $x $y
+ $which marker move begin $x $y
+ set imarker(motion) beginMove
+ UpdateRegionMenu
+ return
+ }
+
+ # see if any markers are selected
+ if {[$which get marker select number]>0} {
+ $which marker unselect all
+ set imarker(motion) none
+ UpdateRegionMenu
+ return
+ }
+
+ # else, create a marker
+ set imarker(handle) 0
+ set imarker(motion) none
+
+ switch -- $marker(shape) {
+ circle -
+ annulus -
+ panda -
+ ellipse -
+ ellipseannulus -
+ epanda -
+ box -
+ boxannulus -
+ bpanda -
+ polygon -
+ line -
+ vector -
+ projection -
+ segment -
+ text -
+ ruler -
+ compass -
+ {circle point} -
+ {box point} -
+ {diamond point} -
+ {cross point} -
+ {x point} -
+ {arrow point} -
+ {boxcircle point} {MarkerCreateShape $which $x $y}
+ default {
+ set fn "$ds9(root)/template/$itemplate($marker(shape))"
+ set ch [open $fn r]
+
+ global vardata
+ set vardata [read $ch]
+ close $ch
+
+ $which marker create template var vardata $x $y
+ }
+ }
+}
+
+proc MarkerShift {which x y} {
+ global imarker
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # see if we are on a handle
+ set h [$which get marker handle $x $y]
+ set id [lindex $h 0]
+ set imarker(handle) [lindex $h 1]
+
+ if {$imarker(handle)} {
+ $which marker $id rotate begin
+ set imarker(motion) beginRotate
+ return
+ }
+
+ # else, see if we are on a marker
+ if {[$which marker select toggle $x $y]} {
+ UpdateRegionMenu
+ $which marker move begin $x $y
+ set imarker(motion) beginMove
+ return
+ }
+
+ # else, start a region select
+ $which region select begin $x $y
+ set imarker(motion) shiftregion
+}
+
+proc MarkerMotion {which x y} {
+ global imarker
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+
+ beginCreate -
+ create {
+ $which marker edit motion $x $y $imarker(handle)
+ set imarker(motion) create
+ }
+
+ beginMove -
+ move {
+ $which marker move motion $x $y
+ set imarker(motion) move
+ }
+
+ beginEdit -
+ edit {
+ $which marker edit motion $x $y $imarker(handle)
+ set imarker(motion) edit
+ }
+
+ beginRotate -
+ rotate {
+ $which marker rotate motion $x $y $imarker(handle)
+ set imarker(motion) rotate
+ }
+
+ region -
+ shiftregion {$which region select motion $x $y}
+ }
+}
+
+proc MarkerRelease {which x y} {
+ global marker
+ global imarker
+ global current
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ switch -- $imarker(motion) {
+ none {}
+ beginCreate {
+ # the user has just clicked, so resize to make visible or delete
+ # assumes imarker(id) from create
+ $which marker edit end
+ MarkerDefault $which
+
+ if {$imarker(id)>=0} {
+ if {$marker(centroid,auto)} {
+ $which marker centroid $imarker(id)
+ }
+
+ MarkerReleaseCB $which
+ }
+
+ set imarker(id) -1
+ set imarker(x) -1
+ set imarker(y) -1
+ }
+ create {
+ $which marker edit end
+
+ # determine if this is an accident and just create the default
+ set diffx [expr $x-$imarker(x)]
+ set diffy [expr $y-$imarker(y)]
+ if {[expr sqrt($diffx*$diffx + $diffy*$diffy)]<2} {
+ MarkerDefault $which
+ }
+
+ if {$imarker(id)>=0} {
+ if {$marker(centroid,auto)} {
+ $which marker centroid $imarker(id)
+ }
+
+ MarkerReleaseCB $which
+ }
+
+ set imarker(id) -1
+ set imarker(x) -1
+ set imarker(y) -1
+ }
+ beginMove -
+ beginRotate {}
+ beginEdit {}
+ move {
+ $which marker move end
+ if {$marker(centroid,auto)} {
+ $which marker centroid
+ }
+ }
+ edit {
+ $which marker edit end
+ if {$marker(centroid,auto)} {
+ $which marker centroid
+ }
+ }
+ rotate {
+ $which marker rotate end
+ if {$marker(centroid,auto)} {
+ $which marker centroid
+ }
+ }
+ region {$which region select end}
+ shiftregion {$which region select shift end}
+ }
+ set imarker(motion) none
+ set imarker(handle) -1
+}
+
+proc MarkerReleaseCB {which} {
+ global marker
+ global imarker
+ global current
+
+ # special callbacks
+ switch [$which get marker $imarker(id) type] {
+ projection {MarkerAnalysisPlot2d $which $imarker(id) 1}
+ line -
+ vector {
+ if {$marker(plot2d)} {
+ MarkerAnalysisPlot2d $which $imarker(id) 1
+ }
+ }
+ circle -
+ ellipse -
+ box -
+ polygon -
+ point {
+ if {$marker(plot3d)} {
+ MarkerAnalysisPlot3d $which $imarker(id) 1
+ }
+ if {$marker(stats)} {
+ MarkerAnalysisStats $which $imarker(id) 1
+ }
+ }
+ }
+}
+
+proc MarkerDouble {which x y} {
+ global imarker
+
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ set id [$which get marker id $x $y]
+
+ if {$id} {
+ if {[$which get marker $id PROPERTY SELECT]} {
+ MarkerDialog $which $id
+
+ switch [$which get marker $id type] {
+ projection -
+ line -
+ vector -
+ circle -
+ ellipse -
+ box -
+ polygon -
+ point {
+ set vvarname proj${id}${which}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ }
+ }
+ }
+ }
+}
+
+proc MarkerCreateShape {which x y} {
+ global marker
+ global imarker
+ global pmarker
+ global current
+ global wcs
+
+ # for compass/ruler
+ global ed
+ set ed(system) $wcs(system)
+ set ed(sky) $wcs(sky)
+ AdjustCoordSystem ed system
+ set ed(dformat) $pmarker(dformat)
+
+ set cmd "$which marker create $marker(shape) $x $y"
+ switch -- $marker(shape) {
+ circle {append cmd " 0"}
+ annulus {append cmd " .001 .002 $pmarker(annulus,annuli)"}
+ panda {append cmd " $pmarker(panda,ang1) $pmarker(panda,ang2) $pmarker(panda,angnum) .001 .002 $pmarker(panda,annuli)"}
+ ellipse {append cmd " 0 0"}
+ ellipseannulus {append cmd " .001 .001 .002 $pmarker(ellipseannulus,annuli)"}
+ epanda {append cmd " $pmarker(epanda,ang1) $pmarker(epanda,ang2) $pmarker(epanda,angnum) .001 .001 .002 $pmarker(epanda,annuli)"}
+ box {append cmd " 0 0"}
+ boxannulus {append cmd " .002 .002 .004 $pmarker(boxannulus,annuli)"}
+ bpanda {append cmd " $pmarker(bpanda,ang1) $pmarker(bpanda,ang2) $pmarker(bpanda,angnum) .001 .001 .002 $pmarker(bpanda,annuli)"}
+ polygon {append cmd " .001 .001"}
+ line {append cmd " $x $y"}
+ vector {append cmd " $x $y"}
+ projection {append cmd " $x $y $pmarker(projection,thick) "}
+ segment {append cmd " .001 .001"}
+ text {
+ set txt "Region"
+ set r [EntryDialog "Text Region" "Enter Text:" 40 txt]
+ if {$r == 1 && $txt != {}} {
+ append cmd " 0 text = \{\{$txt\}\}"
+ } else {
+ return
+ }
+ }
+ ruler {append cmd " $x $y $ed(system) $ed(sky) $ed(system) $ed(dformat)"}
+ compass {append cmd " 15 $ed(system) $ed(sky) "}
+ {circle point} -
+ {box point} -
+ {diamond point} -
+ {cross point} -
+ {x point} -
+ {arrow point} -
+ {boxcircle point} {append cmd " $pmarker(point,size)"}
+ }
+ append cmd " color = $marker(color)"
+ append cmd " width = $marker(width)"
+ append cmd " font = \{\"$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\"\}"
+ append cmd " dash = $marker(dash)"
+ append cmd " fixed = $marker(fixed)"
+ append cmd " edit = $marker(edit)"
+ append cmd " move = $marker(move)"
+ append cmd " rotate = $marker(rotate)"
+ append cmd " delete = $marker(delete)"
+ append cmd " include = $marker(include)"
+ append cmd " source = $marker(source)"
+
+ $which marker unselect all
+
+ set imarker(id) [eval $cmd]
+ set imarker(motion) beginCreate
+ set imarker(x) $x
+ set imarker(y) $y
+
+ switch -- $marker(shape) {
+ circle -
+ annulus -
+ panda -
+ ellipse -
+ ellipseannulus -
+ epanda -
+ box -
+ boxannulus -
+ bpanda -
+ compass -
+ polygon -
+ segment {
+ set imarker(handle) 1
+ $which marker $imarker(id) edit begin $imarker(handle)
+ }
+ line -
+ vector -
+ ruler -
+ projection {
+ set imarker(handle) 2
+ $which marker $imarker(id) edit begin $imarker(handle)
+ }
+ }
+}
+
+proc MarkerDefault {which} {
+ global imarker
+ global pmarker
+ global current
+
+ # scale the default size to take into account the current
+ set z1 double([lindex $current(zoom) 0])
+ set z2 double([lindex $current(zoom) 1])
+ if {$z1>$z2} {
+ set zz $z1
+ } else {
+ set zz $z2
+ }
+
+ set item [$which get marker $imarker(id) type]
+ switch -- $item {
+ circle {
+ $which marker $imarker(id) circle radius \
+ [expr ($pmarker(circle,radius)/$zz)] \
+ image degrees
+ }
+ annulus {
+ $which marker $imarker(id) annulus radius \
+ [expr ($pmarker(annulus,inner)/$zz)] \
+ [expr ($pmarker(annulus,outer)/$zz)] \
+ $pmarker(annulus,annuli) image degrees
+ }
+ panda {
+ $which marker $imarker(id) panda edit \
+ $pmarker(panda,ang1) $pmarker(panda,ang2) \
+ $pmarker(panda,angnum) \
+ [expr ($pmarker(panda,inner)/$zz)] \
+ [expr ($pmarker(panda,outer)/$zz)] \
+ $pmarker(panda,annuli) image
+ }
+ ellipse {
+ $which marker $imarker(id) ellipse radius \
+ [expr ($pmarker(ellipse,radius1)/$z1)] \
+ [expr ($pmarker(ellipse,radius2)/$z2)] \
+ image degrees
+ }
+ ellipseannulus {
+ $which marker $imarker(id) ellipseannulus radius \
+ [expr ($pmarker(ellipseannulus,radius1)/$z1)] \
+ [expr ($pmarker(ellipseannulus,radius2)/$z2)] \
+ [expr ($pmarker(ellipseannulus,radius3)/$z1)] \
+ $pmarker(ellipseannulus,annuli) image
+ }
+ epanda {
+ $which marker $imarker(id) epanda edit \
+ $pmarker(epanda,ang1) $pmarker(epanda,ang2) \
+ $pmarker(epanda,angnum) \
+ [expr ($pmarker(epanda,radius1)/$z1)] \
+ [expr ($pmarker(epanda,radius2)/$z2)] \
+ [expr ($pmarker(epanda,radius3)/$z1)] \
+ $pmarker(epanda,annuli) image
+ }
+ box {
+ $which marker $imarker(id) box radius \
+ [expr ($pmarker(box,radius1)/$z1)] \
+ [expr ($pmarker(box,radius2)/$z2)] \
+ image degrees
+ }
+ boxannulus {
+ $which marker $imarker(id) boxannulus radius \
+ [expr ($pmarker(boxannulus,radius1)/$z1)] \
+ [expr ($pmarker(boxannulus,radius2)/$z2)] \
+ [expr ($pmarker(boxannulus,radius3)/$z1)] \
+ $pmarker(boxannulus,annuli) image
+ }
+ bpanda {
+ $which marker $imarker(id) bpanda edit \
+ $pmarker(bpanda,ang1) $pmarker(bpanda,ang2) \
+ $pmarker(bpanda,angnum) \
+ [expr ($pmarker(bpanda,radius1)/$z1)] \
+ [expr ($pmarker(bpanda,radius2)/$z2)] \
+ [expr ($pmarker(bpanda,radius3)/$z1)] \
+ $pmarker(bpanda,annuli) image
+ }
+ compass {
+ $which marker $imarker(id) compass radius \
+ $pmarker(compass,radius) image degrees
+ }
+ polygon {
+ $which marker $imarker(id) polygon reset \
+ [expr ($pmarker(polygon,width)/$z1)] \
+ [expr ($pmarker(polygon,height)/$z2)] \
+ image degrees
+ }
+ segment {
+ $which marker $imarker(id) segment reset \
+ [expr ($pmarker(segment,length)/$z1)] \
+ [expr ($pmarker(segment,length)/$z2)] \
+ image degrees
+ }
+ line -
+ vector -
+ ruler -
+ projection {
+ $which marker $imarker(id) delete
+ set imarker(id) -1
+ set imarker(x) -1
+ set imarker(y) -1
+ }
+ }
+}
+
+proc MarkerDeleteKey {which x y} {
+ # if nothing is loaded, abort
+ if {![$which has fits]} {
+ return
+ }
+
+ # see if we are on a polygon/segment
+ set h [$which get marker handle $x $y]
+ set id [lindex $h 0]
+ set handle [lindex $h 1]
+
+ set t [$which get marker $id type]
+ switch -- $t {
+ polygon -
+ segment -
+ annulus -
+ panda -
+ ellipseannulus -
+ epanda -
+ boxannulus -
+ bpanda {
+ if {$handle > 4} {
+ switch -- $t {
+ polygon {$which marker $id delete polygon vertex $handle}
+ segment {$which marker $id delete segment vertex $handle}
+ annulus {$which marker $id delete annulus $handle}
+ panda {$which marker $id delete panda $handle}
+ ellipseannulus {$which marker $id delete \
+ ellipseannulus $handle}
+ epanda {$which marker $id delete epanda $handle}
+ boxannulus {$which marker $id delete boxannulus $handle}
+ bpanda {$which marker $id delete bpanda $handle}
+ }
+ } else {
+ # delete polygon/segment
+ $which marker delete
+ UpdateGroupDialog
+ }
+ }
+ default {
+ # delete marker
+ $which marker delete
+ UpdateGroupDialog
+ }
+ }
+}
+
+proc MarkerEpsilon {} {
+ global ds9
+ global pmarker
+
+ foreach ff $ds9(frames) {
+ $ff marker epsilon $pmarker(epsilon)
+ }
+}
+
+proc MarkerShow {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker show $marker(show)
+ }
+}
+
+proc MarkerShowText {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker show text $marker(show,text)
+ }
+}
+
+proc MarkerPreserve {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker preserve $marker(preserve)
+ }
+}
+
+proc MarkerCentroid {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker centroid
+ }
+}
+
+proc MarkerCentroidAuto {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker centroid auto $marker(centroid,auto)
+ }
+}
+
+proc MarkerCentroidRadius {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker centroid radius $marker(centroid,radius)
+ }
+}
+
+proc MarkerCentroidIteration {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker centroid iteration $marker(centroid,iteration)
+ }
+}
+
+proc MarkerFront {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker move front
+ }
+}
+
+proc MarkerBack {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker move back
+ $current(frame) marker unselect all
+ }
+}
+
+proc MarkerSelectAll {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker select all
+ }
+
+ UpdateEditMenu
+}
+
+proc MarkerUnselectAll {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker unselect all
+ }
+
+ UpdateEditMenu
+}
+
+proc MarkerSelectInvert {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker select toggle
+ }
+
+ UpdateEditMenu
+}
+
+proc MarkerDeleteSelect {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker delete
+ UpdateGroupDialog
+ }
+
+ UpdateEditMenu
+}
+
+proc MarkerDeleteAllMenu {} {
+ global current
+ global pds9
+
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message [msgcat::mc {Delete All Regions?}]] != {ok}} {
+ return
+ }
+ }
+ MarkerDeleteAll
+}
+
+proc MarkerDeleteAll {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker delete all
+ UpdateGroupDialog
+ }
+
+ UpdateEditMenu
+}
+
+proc MarkerColor {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker color $marker(color)
+ }
+}
+
+proc MarkerWidth {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker width $marker(width)
+ }
+}
+
+proc MarkerProp {prop} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker property $prop $marker($prop)
+ }
+}
+
+proc MarkerFont {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ $current(frame) marker font \"$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\"
+ }
+}
+
+proc MarkerList {} {
+ global current
+ global marker
+
+ if {$current(frame) == {}} {
+ return
+ }
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {[MarkerSaveDialog [msgcat::mc {List Regions}]]} {
+ SimpleTextDialog markertxt [msgcat::mc {Region}] 80 20 insert top \
+ [$current(frame) marker list $marker(format) $marker(system) \
+ $marker(sky) $marker(skyformat) $marker(strip)]
+ }
+}
+
+proc MarkerLoad {} {
+ global ds9
+ global current
+ global marker
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ set fns [OpenFileDialog markerfbox]
+ if {$fns != {}} {
+ if {[MarkerLoadDialog]} {
+ switch -- $marker(load) {
+ current {set frames $current(frame)}
+ all {set frames $ds9(frames)}
+ }
+ MarkerLoadFrames $fns $frames \
+ $marker(format) $marker(system) $marker(sky)
+ }
+ }
+}
+
+proc MarkerLoadFrames {str frames format sys sky} {
+ if {$str == {}} {
+ return
+ }
+
+ if {[catch {glob $str} fns]} {
+ # reset errors, we don't want to hear about it
+ InitError tcl
+
+ # could be an unique name, i.e. foo[bar], just try to load
+ foreach fr $frames {
+ if {[catch {MarkerLoadFile $str $fr $format $sys $sky}]} {
+ return
+ }
+ }
+ } else {
+ foreach fn $fns {
+ foreach fr $frames {
+ if {[catch {MarkerLoadFile $fn $fr $format $sys $sky}]} {
+ return
+ }
+ }
+ }
+ }
+}
+
+proc MarkerLoadFile {filename which format sys sky} {
+ global current
+ global marker
+
+ if {$filename == {}} {
+ return
+ }
+
+ if {![$which has fits]} {
+ return
+ }
+
+ # determine if its a fits file
+ # first, strip the filename
+ if {![regexp -nocase {(.*)(\[.*\])} $filename foo base ext]} {
+ set base $filename
+ set ext {}
+ }
+
+ if {[catch {open $base} fd]} {
+ Error [msgcat::mc {Unable to load region file}]
+ return -code error
+ }
+
+ set ll [read $fd 9]
+ close $fd
+
+ # is it a fits file?
+ if {$ll == "SIMPLE ="} {
+ # see if we need to add an extension
+ if {$ext == {}} {
+ set filename "$base\[REGION\]"
+ }
+
+ # open it
+ if {[catch {$which marker load fits "\{$filename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} {
+ if {$ext == {}} {
+ # ok now try the first extension
+ set filename "$base\[1\]"
+ if {[catch {$which marker load fits "\{$filename\}" $marker(color) $marker(dashlist) $marker(width) "\{$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\}"}]} {
+ Error [msgcat::mc {Unable to load region file}]
+ return -code error
+ }
+
+ # reset errors, we don't want to hear about it
+ InitError tcl
+ } else {
+ Error [msgcat::mc {Unable to load region file}]
+ return -code error
+ }
+ }
+ } else {
+ # no, its ascii
+ if {[catch {$which marker load $format "\{$filename\}" $sys $sky}]} {
+ Error [msgcat::mc {Unable to load region file}]
+ return -code error
+ }
+ }
+
+ FileLast markerfbox $filename
+ UpdateGroupDialog
+}
+
+proc MarkerSave {} {
+ global current
+ global marker
+
+ if {$current(frame) == {}} {
+ return
+ }
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ set filename [SaveFileDialog markerfbox]
+ if {$filename == {}} {
+ return
+ }
+
+ if {[MarkerSaveDialog [msgcat::mc {Save Regions}]]} {
+ $current(frame) marker save "\{$filename\}" \
+ $marker(format) $marker(system) $marker(sky) \
+ $marker(skyformat) $marker(strip)
+ }
+}
+
+proc MarkerInfo {} {
+ global current
+ global marker
+ global pds9
+
+ if {$current(frame) != {}} {
+ set ll [$current(frame) get marker select]
+ if {$ll != {}} {
+ set ii 0
+ foreach dd $ll {
+ incr ii
+ if {$ii > $marker(maxdialog)} {
+ return
+ }
+ MarkerDialog $current(frame) $dd
+ }
+ } else {
+ if {$pds9(confirm)} {
+ tk_messageBox -type ok -icon info -message [msgcat::mc {Please Select a Region}]
+ }
+ }
+ }
+}
+
+proc MarkerDialog {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set var(frame) $frame
+ set var(id) $id
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ switch -- [$frame get marker $id type] {
+ circle {CircleDialog $varname}
+ annulus {AnnulusDialog $varname}
+ panda {PandaDialog $varname}
+ ellipse {EllipseDialog $varname}
+ ellipseannulus {EllipseAnnulusDialog $varname}
+ epanda {EpandaDialog $varname}
+ box {BoxDialog $varname}
+ boxannulus {BoxAnnulusDialog $varname}
+ bpanda {BpandaDialog $varname}
+ polygon {PolygonDialog $varname}
+ line {LineDialog $varname}
+ vector {VectorDialog $varname}
+ projection {ProjectionDialog $varname}
+ segment {SegmentDialog $varname}
+ text {TextDialog $varname}
+ ruler {RulerDialog $varname}
+ compass {CompassDialog $varname}
+ point {PointDialog $varname}
+ composite {CompositeDialog $varname}
+ }
+}
+
+proc MarkerCopy {} {
+ global current
+ global marker
+ global wcs
+
+ if {$current(frame) != {}} {
+ $current(frame) marker copy
+ set marker(copy) $current(frame)
+ set marker(copy,system) $wcs(system)
+ }
+ UpdateEditMenu
+}
+
+proc MarkerCut {} {
+ global current
+ global marker
+ global wcs
+
+ if {$current(frame) != {}} {
+ $current(frame) marker cut
+ set marker(copy) $current(frame)
+ set marker(copy,system) $wcs(system)
+ }
+ UpdateEditMenu
+ UpdateGroupDialog
+}
+
+proc MarkerUndo {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker undo
+ }
+ UpdateEditMenu
+ UpdateGroupDialog
+}
+
+proc MarkerPaste {} {
+ global current
+ global marker
+ global wcs
+
+ # if nothing is loaded, abort
+ if {$current(frame) == {}} {
+ return
+ }
+ if {$marker(copy) == {} || $marker(copy,system) == {}} {
+ return
+ }
+ if {(![$current(frame) has fits]) || (![$marker(copy) has fits])} {
+ return
+ }
+
+ # same frame?
+ if {$current(frame) == $marker(copy)} {
+ # use internal
+ $current(frame) marker paste
+ } else {
+ global cmd
+ # do we have a valid wcs?
+ if {[$marker(copy) has wcs $marker(copy,system)] &&
+ [$current(frame) has wcs $marker(copy,system)]} {
+
+ # do we have an equatorial wcs?
+ if {[$marker(copy) has wcs equatorial $marker(copy,system)] &&
+ [$current(frame) has wcs equatorial $marker(copy,system)]} {
+ # then use wcs
+ set cmd "[$marker(copy) marker paste $marker(copy,system)]"
+ } else {
+ # mix of equatorial and non-equatorial wcs, use physical
+ set cmd "[$marker(copy) marker paste physical]"
+ }
+ } else {
+ # default, use physical
+ set cmd "[$marker(copy) marker paste physical]"
+ }
+ $current(frame) marker command ds9 var cmd
+ unset cmd
+ }
+
+ UpdateEditMenu
+ UpdateGroupDialog
+}
+
+proc CompositeCreate {} {
+ global current
+ global marker
+
+ if {$current(frame) != {}} {
+ set cmd "$current(frame) marker create composite"
+ append cmd " color = $marker(color)"
+ append cmd " width = $marker(width)"
+ append cmd " font = \{\"$marker(font) $marker(font,size) $marker(font,weight) $marker(font,slant)\"\}"
+ append cmd " dash = $marker(dash)"
+ append cmd " edit = $marker(edit)"
+ append cmd " move = $marker(move)"
+ append cmd " rotate = $marker(rotate)"
+ append cmd " delete = $marker(delete)"
+ append cmd " fixed = $marker(fixed)"
+ append cmd " include = $marker(include)"
+ append cmd " source = $marker(source)"
+
+ eval $cmd
+ }
+}
+
+proc CompositeDelete {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) marker composite delete
+ }
+}
+
+proc MarkerBackup {ch which fdir rdir} {
+ if {[$which get marker number] > 0} {
+ set fn $fdir/ds9.reg
+ set rfn $rdir/ds9.reg
+
+ catch {file delete -force $fn}
+ if {[$which has wcs equatorial wcs]} {
+ $which marker save \"$fn\" ds9 wcs fk5 degrees 0
+ } else {
+ $which marker save \"$fn\" ds9 physical fk5 degrees 0
+ }
+ puts $ch "$which marker load ds9 \{\"$rfn\"\}"
+ }
+}
+
+# Process Cmds
+
+proc ProcessRegionsCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ global current
+ global marker
+ global pmarker
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ epsilon {
+ incr i
+ set pmarker(epsilon) [lindex $var $i]
+ MarkerEpsilon
+ }
+ show {
+ incr i
+ set marker(show) [FromYesNo [lindex $var $i]]
+ MarkerShow
+ }
+ showtext {
+ incr i
+ set marker(show,text) [FromYesNo [lindex $var $i]]
+ MarkerShowText
+ }
+ getinfo {MarkerInfo}
+ centroid {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ auto {
+ incr i
+ set marker(centroid,auto) [FromYesNo [lindex $var $i]]
+ MarkerCentroidAuto
+ }
+ radius {
+ incr i
+ set marker(centroid,radius) [lindex $var $i]
+ MarkerCentroidRadius
+ }
+ iteration {
+ incr i
+ set marker(centroid,iteration) [lindex $var $i]
+ MarkerCentroidIteration
+ }
+ default {
+ incr i -1
+ MarkerCentroid
+ }
+ }
+ }
+ autocentroid {
+ # backward compatibilty
+ incr i
+ set marker(centroid,auto) [FromYesNo [lindex $var $i]]
+ MarkerCentroidAuto
+ }
+ movefront {MarkerFront}
+ moveback {MarkerBack}
+ move {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ front {MarkerFront}
+ back {MarkerBack}
+ }
+ }
+
+ selectall {MarkerSelectAll}
+ selectnone {MarkerUnselectAll}
+ select {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ group {
+ # backward compatibility, use group <> select
+ incr i
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker "\{[lindex $var $i]\}" select
+ }
+ }
+ }
+ all {MarkerSelectAll}
+ none {MarkerUnselectAll}
+ invert {MarkerSelectInvert}
+ }
+ }
+
+ deleteall {MarkerDeleteAll}
+ delete {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ select {MarkerDeleteSelect}
+ all {MarkerDeleteAll}
+ }
+ }
+
+ format {
+ incr i
+ set marker(format) [string tolower [lindex $var $i]]
+ }
+ coord -
+ system {
+ # for backward compatibility
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {
+ incr i
+ set marker(system) wcs
+ set marker(sky) [string tolower [lindex $var $i]]
+ }
+
+ default {set marker(system) [string tolower [lindex $var $i]]}
+ }
+ }
+ sky {
+ incr i
+ set marker(sky) [string tolower [lindex $var $i]]
+ }
+ coordformat -
+ skyformat {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ deg -
+ degree -
+ degrees {set marker(skyformat) degrees}
+ default {
+ set marker(skyformat) [string tolower [lindex $var $i]]
+ }
+ }
+ }
+ strip {
+ incr i
+ set marker(strip) [FromYesNo [lindex $var $i]]
+ }
+ delim {
+ incr i
+ if {[lindex $var $i] != "nl"} {
+ set marker(strip) 1
+ } else {
+ set marker(strip) 0
+ }
+ }
+ shape {
+ incr i
+ set marker(shape) [string tolower [lindex $var $i]]
+ }
+ color {
+ incr i
+ set marker(color) [string tolower [lindex $var $i]]
+ MarkerColor
+ }
+ width {
+ incr i
+ set marker(width) [lindex $var $i]
+ MarkerWidth
+ }
+
+ fixed {
+ incr i
+ set marker(fixed) [FromYesNo [lindex $var $i]]
+ MarkerProp fixed
+ }
+ edit {
+ incr i
+ set marker(edit) [FromYesNo [lindex $var $i]]
+ MarkerProp edit
+ }
+ rotate {
+ incr i
+ set marker(rotate) [FromYesNo [lindex $var $i]]
+ MarkerProp rotate
+ }
+ delete {
+ incr i
+ set marker(delete) [FromYesNo [lindex $var $i]]
+ MarkerProp delete
+ }
+ include {
+ set marker(include) 1
+ MarkerProp include
+ }
+ exclude {
+ set marker(include) 0
+ MarkerProp include
+ }
+ source {
+ set marker(source) 1
+ MarkerProp source
+ }
+ background {
+ set marker(source) 0
+ MarkerProp source
+ }
+
+ tag -
+ tags -
+ group -
+ groups {
+ incr i
+
+ if {[string tolower [lindex $var $i]] == {new}} {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ set name [$current(frame) get marker tag default name]
+ $current(frame) marker tag "\{$name\}"
+ UpdateGroupDialog
+ }
+ }
+ } else {
+ set tag "\{[lindex $var $i]\}"
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker tag $tag
+ UpdateGroupDialog
+ }
+ }
+ }
+ update {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker tag update $tag
+ UpdateGroupDialog
+ }
+ }
+ }
+ delete {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag delete
+ UpdateGroupDialog
+ }
+ }
+ }
+ select {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag select
+ }
+ }
+ }
+ color {
+ incr i
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag color \
+ [string tolower [lindex $var $i]]
+ }
+ }
+ }
+ copy {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag copy
+ }
+ }
+ }
+ cut {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag cut
+ }
+ }
+ }
+ font {
+ incr i
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag font \
+ "\{[lindex $var $i]\}"
+ }
+ }
+ }
+ move {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag move \
+ [lindex $var [expr $i+1]] \
+ [lindex $var [expr $i+2]]
+ }
+ }
+ incr i 2
+ }
+ movefront {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag move front
+ }
+ }
+ }
+ moveback {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag move back
+ }
+ }
+ }
+ property {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker $tag property \
+ [lindex $var [expr $i+1]] \
+ [lindex $var [expr $i+2]]
+ }
+ }
+ incr i 2
+ }
+ }
+ }
+ }
+
+ copy {MarkerCopy}
+ cut {MarkerCut}
+ paste {
+ set marker(paste,system) [string tolower [lindex $var [expr $i+1]]]
+ switch -- $marker(paste,system) {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {}
+ default {set marker(paste,system) wcs}
+ }
+
+# backward compatibility
+ if {[string range [lindex $var [expr $i+2]] 0 0] == {-}} {
+ incr i 1
+ } else {
+ incr i 2
+ }
+
+ MarkerPaste
+ }
+ undo {MarkerUndo}
+
+ composite {CompositeCreate}
+ desolve -
+ dissove {CompositeDelete}
+
+ template {
+ incr i
+ set ff [lindex $var $i]
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ at {
+ incr i
+ set ra [lindex $var $i]
+ incr i
+ set dec [lindex $var $i]
+ incr i
+ set sys [string tolower [lindex $var $i]]
+ incr i
+ set sky [string tolower [lindex $var $i]]
+ switch -- $sys {
+ fk4 -
+ fk5 -
+ icrs -
+ galatic -
+ ecliptic {
+ set sky $sys
+ set sys wcs
+ incr i -1
+ }
+ }
+ LoadTemplateMarkerAt $ff $ra $dec $sys $sky
+ FileLast templatefbox $ff
+ }
+ default {
+ LoadTemplateMarker $ff
+ FileLast templatefbox $ff
+ incr i -1
+ }
+ }
+ }
+ savetemplate {
+ incr i
+ set ff [lindex $var $i]
+ if {$ff != {}} {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker save template "\{$ff\}"
+ }
+ }
+ FileLast templatefbox $ff
+ }
+ }
+
+ command {
+ incr i
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker command $marker(format) \
+ "\{[lindex $var $i]\}"
+ }
+ }
+ UpdateGroupDialog
+ }
+
+ list {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ close {SimpleTextDestroy markertxt}
+ default {
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ SimpleTextDialog markertxt [msgcat::mc {Region}] \
+ 80 20 insert top \
+ [$current(frame) marker list $marker(format) \
+ $marker(system) $marker(sky) \
+ $marker(skyformat) $marker(strip)]
+ }
+ }
+ incr i -1
+ }
+ }
+ }
+ save {
+ incr i
+ set ff [lindex $var $i]
+ if {$ff == {}} {
+ return
+ }
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker save "\{$ff\}" \
+ $marker(format) $marker(system) $marker(sky) \
+ $marker(skyformat) $marker(strip)
+ }
+ }
+ FileLast markerfbox $ff
+ }
+
+ file -
+ load {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ all {
+ incr i
+ set frames $ds9(frames)
+ }
+ default {
+ set frames $current(frame)
+ }
+ }
+ MarkerLoadFrames [lindex $var $i] $frames \
+ $marker(format) $marker(system) $marker(sky)
+ }
+ default {
+ set format $marker(format)
+ set sys $marker(system)
+ set sky $marker(sky)
+
+ while {[string range [lindex $var $i] 0 0] == "-"} {
+ switch -- [string tolower [lindex $var $i]] {
+ -format {
+ incr i
+ set format [lindex $var $i]
+ }
+ -sys -
+ -coord -
+ -system {
+ incr i
+ # for backward compatibility
+ switch -- [lindex $var $i] {
+ fk4 -
+ fk5 -
+ icrs -
+ galactic -
+ ecliptic {
+ set sys wcs
+ set sky [lindex $var $i]
+ }
+ default {
+ set sys [lindex $var $i]
+ }
+ }
+ }
+ -sky {
+ incr i
+ set sky [lindex $var $i]
+ }
+ default {
+ Error "Illegal option: [lindex $var $i]"
+ return
+ }
+ }
+ incr i
+ }
+
+ if {$sock != {}} {
+ # xpa path
+ if {[lindex $var $i] != {}} {
+ MarkerLoadFrames [lindex $var $i] $current(frame) \
+ $format $sys $sky
+ } else {
+ # fits regions files not supported
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $current(frame) marker load $format $sock $sys $sky
+ }
+ }
+ UpdateGroupDialog
+ }
+ } elseif {$fn != {}} {
+ # samp path
+ if {[lindex $var $i] != {}} {
+ MarkerLoadFrames [lindex $var $i] $current(frame) \
+ $format $sys $sky
+ } else {
+ MarkerLoadFrames $fn $current(frame) \
+ $format $sys $sky
+ }
+ } else {
+ # this will open a fits regions file
+ MarkerLoadFrames [lindex $var $i] $current(frame) \
+ $format $sys $sky
+ }
+ }
+ }
+}
+
+proc ProcessSendRegionsCmd {proc id param sock fn} {
+ global current
+ global marker
+ global pmarker
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ switch -- [lindex $param 0] {
+ epsilon {$proc $id "$pmarker(epsilon)\n"}
+ show {$proc $id [ToYesNo $marker(show)]}
+ showtext {$proc $id [ToYesNo $marker(show,text)]}
+ centroid {
+ switch -- [lindex $param 1] {
+ auto {$proc $id [ToYesNo $marker(centroid,auto)]}
+ radius {$proc $id "$marker(centroid,radius)\n"}
+ iteration {$proc $id "$marker(centroid,iteration)\n"}
+ }
+ }
+ autocentroid {$proc $id [ToYesNo $marker(centroid,auto)]}
+ format {$proc $id "$marker(format)\n"}
+ coord -
+ system {$proc $id "$marker(system)\n"}
+ sky {$proc $id "$marker(sky)\n"}
+ coordformat -
+ skyformat {$proc $id "$marker(skyformat)\n"}
+ strip {$proc $id [ToYesNo $marker(strip)]}
+ delim {
+ if {$marker(strip)} {
+ $proc $id "semicolon\n"
+ } else {
+ $proc $id "nl\n"
+ }
+ }
+ shape {$proc $id "$marker(shape)\n"}
+ color {$proc $id "$marker(color)\n"}
+ width {$proc $id "$marker(width)\n"}
+
+ tag -
+ tags -
+ group -
+ groups {$proc $id "[lsort [$current(frame) get marker tag all]]\n"}
+
+ default {
+ set format $marker(format)
+ set sys $marker(system)
+ set sky $marker(sky)
+ set skyformat $marker(skyformat)
+ set strip $marker(strip)
+ set select {}
+ set props {}
+ set tags {}
+
+ set i 0
+ set l [llength $param]
+ while {$i < $l} {
+ switch -- [lindex $param $i] {
+ -format {incr i; set format [lindex $param $i]}
+ -sys -
+ -coord -
+ -system {
+ incr i
+ # for backward compatibility
+ switch -- [lindex $param $i] {
+ fk4 -
+ fk5 -
+ icrs -
+ galactic -
+ ecliptic {
+ set sys wcs
+ set sky [lindex $param $i]
+ }
+
+ default {set sys [lindex $param $i]}
+ }
+ }
+ -sky {incr i; set sky [lindex $param $i]}
+ -coordformat -
+ -skyformat {
+ incr i
+ switch -- [lindex $param $i] {
+ deg -
+ degree -
+ degrees {set skyformat degrees}
+ default {set skyformat [lindex $param $i]}
+ }
+ }
+ -strip {
+ incr i;
+ set strip [FromYesNo [lindex $param $i]]
+ }
+ -delim {
+ incr i;
+ if {[lindex $param $i] != "nl"} {
+ set strip 1
+ } else {
+ set strip 0
+ }
+ }
+
+ include {append props " include = 1"}
+ exclude {append props " include = 0"}
+ source {append props " source = 1"}
+ background {append props " source = 0"}
+ selected {set select "select"}
+ -prop {
+ append props " [lindex $param [expr $i+1]] = [lindex $param [expr $i+2]]"
+ incr i 2
+ }
+ -tag -
+ -group {
+ incr i
+ append tags "tag = \{[lindex $param $i]\}"
+ }
+ }
+ incr i
+ }
+
+ switch -- $format {
+ xml {set ext {.xml}}
+ default {set ext {.rgn}}
+ }
+ ProcessSend $proc $id $sock $fn $ext \
+ [$current(frame) marker list $select $format \
+ $sys $sky $skyformat $strip $props $tags]
+ }
+ }
+}
diff --git a/ds9/library/markeranalysishist.tcl b/ds9/library/markeranalysishist.tcl
new file mode 100644
index 0000000..4e3032d
--- /dev/null
+++ b/ds9/library/markeranalysishist.tcl
@@ -0,0 +1,116 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerAnalysisHistogramDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set id $var(id)
+ set frame $var(frame)
+
+ set vvarname ${imarker(prefix,histogram)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(histogram) [info exists ${vvarname}(top)]
+
+ $var(mb).analysis add checkbutton -label [msgcat::mc {Histogram}] \
+ -variable ${varname}(histogram) \
+ -command "MarkerAnalysisHistogramCmd $varname"
+}
+
+# support
+
+proc MarkerAnalysisHistogramCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisHistogram $var(frame) $var(id) $var(histogram)
+}
+
+proc MarkerAnalysisHistogram {frame id plot} {
+ global imarker
+
+ $frame marker $id analysis histogram $plot
+ if {$plot} {
+ MarkerAnalysisHistogramCB $frame $id
+
+ set vvarname ${imarker(prefix,histogram)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ } else {
+ MarkerAnalysisHistogramDeleteCB $frame $id
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisHistogramCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,histogram)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(frame) $frame
+ set vvar(id) $id
+ set vvar(nbins) 512
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ global $xdata $ydata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ set tt [string totitle [$frame get marker $id type]]
+ PlotLineDialog $vvarname $tt Histogram Values Counts
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata
+ }
+
+ $frame get marker $id analysis histogram $xdata $ydata $vvar(nbins)
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ set vvar(smooth) step
+ set vvar(fill) 1
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisHistogramDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
+
+ global imarker
+
+ set vvarname ${imarker(prefix,histogram)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
+}
diff --git a/ds9/library/markeranalysispanda.tcl b/ds9/library/markeranalysispanda.tcl
new file mode 100644
index 0000000..9a726f0
--- /dev/null
+++ b/ds9/library/markeranalysispanda.tcl
@@ -0,0 +1,160 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerAnalysisPandaDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set id $var(id)
+ set frame $var(frame)
+
+ set vvarname ${imarker(prefix,panda)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(panda) [info exists ${vvarname}(top)]
+
+ $var(mb).analysis add checkbutton -label [msgcat::mc {Radial Profile}] \
+ -variable ${varname}(panda) \
+ -command "MarkerAnalysisPandaCmd $varname"
+}
+
+proc MarkerAnalysisPandaCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisPanda $var(frame) $var(id) $var(panda)
+}
+
+proc MarkerAnalysisPanda {frame id panda} {
+ global imarker
+
+ $frame marker $id analysis panda $panda
+ if {$panda} {
+ MarkerAnalysisPandaCB $frame $id
+
+ set vvarname ${imarker(prefix,panda)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ } else {
+ MarkerAnalysisPandaDeleteCB $frame $id
+ }
+}
+
+proc MarkerAnalysisPandaSystem {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,panda)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(panda)]} {
+ if {$var(panda)} {
+ MarkerAnalysisPandaCB $var(frame) $var(id)
+ MarkerAnalysisPandaAxisTitle $vvarname
+ }
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisPandaCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,panda)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(frame) $frame
+ set vvar(id) $id
+
+ if {[info exists var(system)]} {
+ set vvar(system) $var(system)
+ set sys $var(system)
+ } elseif {[info exists vvar(system)]} {
+ set sys $vvar(system)
+ } else {
+ global wcs
+ set vvar(system) $wcs(system)
+ set sys $wcs(system)
+ }
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ set tt [string totitle [$frame get marker $id type]]
+ PlotLineDialog $vvarname $tt "Radial Profile" $sys {}
+ MarkerAnalysisPandaAxisTitle $vvarname
+ }
+
+ PlotClearData $vvarname
+ PlotDataSet $vvarname 3 [$frame get marker $id analysis panda $sys]
+ $vvar(proc,updategraph) $vvarname
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc MarkerAnalysisPandaDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
+
+ global imarker
+
+ set vvarname ${imarker(prefix,panda)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
+}
+
+proc MarkerAnalysisPandaAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ switch -- $vvar(system) {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set xtitle "Avg Radius (pixels)"
+ set ytitle "Surface Brightness (cnts/pixels**2)"
+ }
+ default {
+ if {[$vvar(frame) has wcs equatorial $vvar(system)]} {
+ set xtitle "Avg Radius (arcsecs)"
+ set ytitle "Surface Brightness (cnts/arcsec**2)"
+ } else {
+ set xtitle "Avg Radius (pixels)"
+ set ytitle "Surface Brightness (cnts/pixels**2)"
+ }
+ }
+ }
+
+ # set for plot code
+ set vvar(axis,x,title) $xtitle
+ set vvar(axis,y,title) $ytitle
+
+ # update now (may not make it into plot code)
+ $vvar(graph) xaxis configure -title $xtitle
+ $vvar(graph) yaxis configure -title $ytitle
+}
diff --git a/ds9/library/markeranalysisplot2d.tcl b/ds9/library/markeranalysisplot2d.tcl
new file mode 100644
index 0000000..615f416
--- /dev/null
+++ b/ds9/library/markeranalysisplot2d.tcl
@@ -0,0 +1,273 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# support
+
+proc MarkerAnalysisPlot2dDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set id $var(id)
+ set frame $var(frame)
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(plot2d) [info exists ${vvarname}(top)]
+ set var(method) average
+
+ $var(mb).analysis add checkbutton -label [msgcat::mc {Plot 2D}] \
+ -variable ${varname}(plot2d) \
+ -command "MarkerAnalysisPlot2dCmd $varname"
+ $var(mb).analysis add separator
+ $var(mb).analysis add cascade \
+ -label [msgcat::mc {Method}] \
+ -menu $var(mb).analysis.method
+
+ menu $var(mb).analysis.method
+ $var(mb).analysis.method add radiobutton \
+ -label [msgcat::mc {Average}] \
+ -variable ${varname}(method) -value average \
+ -command "MarkerAnalysisPlot2dMethod $varname"
+ $var(mb).analysis.method add radiobutton \
+ -label [msgcat::mc {Sum}] \
+ -variable ${varname}(method) -value sum \
+ -command "MarkerAnalysisPlot2dMethod $varname"
+}
+
+proc MarkerAnalysisPlot2dCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisPlot2d $var(frame) $var(id) $var(plot2d)
+}
+
+proc MarkerAnalysisPlot2d {frame id plot} {
+ global imarker
+
+ $frame marker $id analysis plot2d $plot
+ if {$plot} {
+ MarkerAnalysisPlot2dCB $frame $id
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ } else {
+ MarkerAnalysisPlot2dDeleteCB $frame $id
+ }
+}
+
+proc MarkerAnalysisPlot2dMethod {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(plot2d)]} {
+ if {$var(plot2d)} {
+ MarkerAnalysisPlot2dCB $var(frame) $var(id)
+ MarkerAnalysisPlot2dYAxisTitle $vvarname
+ }
+ }
+}
+
+proc MarkerAnalysisPlot2dSystem {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(plot2d)]} {
+ if {$var(plot2d)} {
+ MarkerAnalysisPlot2dCB $var(frame) $var(id)
+ MarkerAnalysisPlot2dXAxisTitle $vvarname
+ }
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisPlot2dCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(frame) $frame
+ set vvar(id) $id
+
+ if {[info exists var(system)]} {
+ set vvar(system) $var(system)
+ set sys $var(system)
+ } elseif {[info exists vvar(system)]} {
+ set sys $vvar(system)
+ } else {
+ global wcs
+ set vvar(system) $wcs(system)
+ set sys $wcs(system)
+ }
+
+ if {[info exists var(sky)]} {
+ set vvar(sky) $var(sky)
+ set sky $var(sky)
+ } elseif {[info exists vvar(sky)]} {
+ set sky $vvar(sky)
+ } else {
+ global wcs
+ set sky $wcs(sky)
+ }
+
+ if {[info exists var(method)]} {
+ set vvar(method) $var(method)
+ set method $var(method)
+ } elseif {[info exists vvar(method)]} {
+ set method $vvar(method)
+ } else {
+ set vvar(method) average
+ set method average
+ }
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ set xcdata ${vvarname}xc
+ set ycdata ${vvarname}yc
+ global $xdata $ydata $xcdata $ycdata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ set tt [string totitle [$frame get marker $id type]]
+ PlotLineDialog $vvarname $tt Plot2D $sys Counts
+ MarkerAnalysisPlot2dXAxisTitle $vvarname
+ MarkerAnalysisPlot2dYAxisTitle $vvarname
+
+ # setup our own formatting
+ set vvar(graph,format) 0
+ set vvar(xcdata) $xcdata
+ set vvar(ycdata) $ycdata
+ $vvar(graph) xaxis configure \
+ -command "MarkerAnalysisPlot2dXAxis $vvarname"
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata $xcdata $ycdata
+ }
+
+ $frame get marker $id analysis plot2d $xdata $ydata $xcdata $ycdata \
+ $sys $sky $method
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc MarkerAnalysisPlot2dDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
+
+ global imarker
+
+ set vvarname ${imarker(prefix,plot2d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set xcdata ${vvarname}xc
+ set ycdata ${vvarname}yc
+
+ # clear extra vectors
+ global $xcdata $ycdata
+ catch {blt::vector destroy $xcdata $ycdata}
+
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
+}
+
+proc MarkerAnalysisPlot2dXAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ switch -- $vvar(system) {
+ image -
+ physical -
+ amplifier -
+ detector {set xtitle "$vvar(system)"}
+ default {
+ if {[$vvar(frame) has wcs equatorial $vvar(system)]} {
+ set xtitle "$vvar(system)"
+ } else {
+ set xtitle "[$vvar(frame) get wcs name $vvar(system)]"
+ }
+ }
+ }
+
+ # set for plot code
+ set vvar(axis,x,title) $xtitle
+
+ # update now (may not make it into plot code)
+ $vvar(graph) xaxis configure -title $xtitle
+}
+
+proc MarkerAnalysisPlot2dYAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # set for plot code
+ set vvar(axis,y,title) "Counts [string totitle $vvar(method)]"
+
+ # update now (may not make it into plot code)
+ $vvar(graph) yaxis configure -title $vvar(axis,y,title)
+}
+
+proc MarkerAnalysisPlot2dXAxis {vvarname w xx} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set x [expr $xx-1]
+
+ global $vvar(xcdata) $vvar(ycdata)
+ # sometimes, $x equals $vvar(xcdata) length
+ set ll [$vvar(xcdata) length]
+ if {($ll>=1) && ($x>=0) && ($x<$ll)} {
+ set a [format "%6.3f" [expr "$$vvar(xcdata)\($x\)"]]
+ set b [format "%6.3f" [expr "$$vvar(ycdata)\($x\)"]]
+ return "$a\n$b"
+ } else {
+ return {}
+ }
+}
diff --git a/ds9/library/markeranalysisplot3d.tcl b/ds9/library/markeranalysisplot3d.tcl
new file mode 100644
index 0000000..1e9263a
--- /dev/null
+++ b/ds9/library/markeranalysisplot3d.tcl
@@ -0,0 +1,231 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerAnalysisPlot3dDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set id $var(id)
+ set frame $var(frame)
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(plot3d) [info exists ${vvarname}(top)]
+ set var(method) average
+
+ $var(mb).analysis add checkbutton -label [msgcat::mc {Plot 3D}] \
+ -variable ${varname}(plot3d) \
+ -command "MarkerAnalysisPlot3dCmd $varname"
+ $var(mb).analysis add separator
+ $var(mb).analysis add cascade \
+ -label [msgcat::mc {Method}] \
+ -menu $var(mb).analysis.method
+
+ menu $var(mb).analysis.method
+ $var(mb).analysis.method add radiobutton \
+ -label [msgcat::mc {Average}] \
+ -variable ${varname}(method) -value average \
+ -command "MarkerAnalysisPlot3dMethod $varname"
+ $var(mb).analysis.method add radiobutton \
+ -label [msgcat::mc {Sum}] \
+ -variable ${varname}(method) -value sum \
+ -command "MarkerAnalysisPlot3dMethod $varname"
+}
+
+# support
+
+proc MarkerAnalysisPlot3dCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisPlot3d $var(frame) $var(id) $var(plot3d)
+}
+
+proc MarkerAnalysisPlot3d {frame id plot} {
+ global imarker
+
+ $frame marker $id analysis plot3d $plot
+ if {$plot} {
+ MarkerAnalysisPlot3dCB $frame $id
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ } else {
+ MarkerAnalysisPlot3dDeleteCB $frame $id
+ }
+}
+
+proc MarkerAnalysisPlot3dMethod {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(plot3d)]} {
+ if {$var(plot3d)} {
+ MarkerAnalysisPlot3dCB $frame $id
+ MarkerAnalysisPlot3dYAxisTitle $vvarname
+ }
+ }
+}
+
+proc MarkerAnalysisPlot3dSystem {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(plot3d)]} {
+ if {$var(plot3d)} {
+ MarkerAnalysisPlot3dCB $frame $id
+ MarkerAnalysisPlot3dXAxisTitle $vvarname
+ }
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisPlot3dCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(frame) $frame
+ set vvar(id) $id
+
+ if {[info exists var(system)]} {
+ set vvar(system) $var(system)
+ set sys $var(system)
+ } elseif {[info exists vvar(system)]} {
+ set sys $vvar(system)
+ } else {
+ global wcs
+ set vvar(system) $wcs(system)
+ set sys $wcs(system)
+ }
+
+ if {[info exists var(method)]} {
+ set vvar(method) $var(method)
+ set method $var(method)
+ } elseif {[info exists vvar(method)]} {
+ set method $vvar(method)
+ } else {
+ set vvar(method) average
+ set method average
+ }
+
+ set xdata ${vvarname}x
+ set ydata ${vvarname}y
+ global $xdata $ydata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ set tt [string totitle [$frame get marker $id type]]
+ PlotLineDialog $vvarname $tt Plot3D $sys Counts
+ MarkerAnalysisPlot3dXAxisTitle $vvarname
+ MarkerAnalysisPlot3dYAxisTitle $vvarname
+
+ set vvar(manage) 0
+ set vvar(dim) xy
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ blt::vector create $xdata $ydata
+ }
+
+ $frame get marker $id analysis plot3d $xdata $ydata $sys $method
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisPlot3dDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
+
+ global imarker
+
+ set vvarname ${imarker(prefix,plot3d)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
+}
+
+proc MarkerAnalysisPlot3dXAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ switch -- $vvar(system) {
+ image -
+ physical -
+ amplifier -
+ detector {set xtitle "$vvar(system)"}
+ default {
+ set w [string range $vvar(system) 3 3]
+ set tt [string trim [$vvar(frame) get fits header keyword \{CTYPE3$w\}]]
+ if {$tt != {}} {
+ set xtitle "$tt"
+ } else {
+ set xtitle "$vvar(system)"
+ }
+ }
+ }
+
+ # set for plot code
+ set vvar(axis,x,title) $xtitle
+
+ # update now (may not make it into plot code)
+ $vvar(graph) xaxis configure -title $xtitle
+}
+
+proc MarkerAnalysisPlot3dYAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # set for plot code
+ set vvar(axis,y,title) "Counts [string totitle $vvar(method)]"
+
+ # update now (may not make it into plot code)
+ $vvar(graph) yaxis configure -title $vvar(axis,y,title)
+}
diff --git a/ds9/library/markeranalysisradial.tcl b/ds9/library/markeranalysisradial.tcl
new file mode 100644
index 0000000..7eb2f3d
--- /dev/null
+++ b/ds9/library/markeranalysisradial.tcl
@@ -0,0 +1,177 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerAnalysisRadialDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set id $var(id)
+ set frame $var(frame)
+
+ set vvarname ${imarker(prefix,radial)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(radial) [info exists ${vvarname}(top)]
+
+ $var(mb).analysis add checkbutton -label [msgcat::mc {Radial Profile}] \
+ -variable ${varname}(radial) \
+ -command "MarkerAnalysisRadialCmd $varname"
+}
+
+proc MarkerAnalysisRadialCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisRadial $var(frame) $var(id) $var(radial)
+}
+
+proc MarkerAnalysisRadial {frame id radial} {
+ global imarker
+
+ $frame marker $id analysis radial $radial
+ if {$radial} {
+ MarkerAnalysisRadialCB $frame $id
+
+ set vvarname ${imarker(prefix,radial)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ PlotRaise $vvarname
+ } else {
+ MarkerAnalysisRadialDeleteCB $frame $id
+ }
+}
+
+proc MarkerAnalysisRadialSystem {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,radial)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(radial)]} {
+ if {$var(radial)} {
+ MarkerAnalysisRadialCB $var(frame) $var(id)
+ MarkerAnalysisRadialAxisTitle $vvarname
+ }
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisRadialCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,radial)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set vvar(frame) $frame
+ set vvar(id) $id
+
+ if {[info exists var(system)]} {
+ set vvar(system) $var(system)
+ set sys $var(system)
+ } elseif {[info exists vvar(system)]} {
+ set sys $vvar(system)
+ } else {
+ global wcs
+ set vvar(system) $wcs(system)
+ set sys $wcs(system)
+ }
+
+ set xdata ${imarker(prefix,radial)}${id}${frame}x
+ set ydata ${imarker(prefix,radial)}${id}${frame}y
+ set yedata ${imarker(prefix,radial)}${id}${frame}ye
+ global $xdata $ydata $yedata
+
+ set ping [PlotPing $vvarname]
+
+ if {!$ping} {
+ set tt [string totitle [$frame get marker $id type]]
+ PlotLineDialog $vvarname $tt "Radial Profile" $sys {}
+ MarkerAnalysisRadialAxisTitle $vvarname
+
+ set vvar(manage) 0
+ set vvar(dim) xyey
+ set vvar(xdata) $xdata
+ set vvar(ydata) $ydata
+ set vvar(yedata) $yedata
+ blt::vector create $xdata $ydata $yedata
+ }
+
+ $frame get marker $id analysis radial $xdata $ydata $yedata $sys
+
+ if {!$ping} {
+ PlotExternal $vvarname
+ $vvar(proc,updateelement) $vvarname
+ $vvar(proc,updategraph) $vvarname
+ }
+
+ PlotStats $vvarname
+ PlotList $vvarname
+}
+
+proc MarkerAnalysisRadialDeleteCB {frame id} {
+ # this routine could be called by the region
+ # after the dialog has been deleted
+
+ global imarker
+
+ set vvarname ${imarker(prefix,radial)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ # clear any errors
+ global errorInfo
+ set errorInfo {}
+
+ PlotDestroy $vvarname
+}
+
+proc MarkerAnalysisRadialAxisTitle {vvarname} {
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ switch -- $vvar(system) {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set xtitle "Avg Radius (pixels)"
+ set ytitle "Surface Brightness (cnts/pixels**2)"
+ }
+ default {
+ if {[$vvar(frame) has wcs equatorial $vvar(system)]} {
+ set xtitle "Avg Radius (arcsecs)"
+ set ytitle "Surface Brightness (cnts/arcsec**2)"
+ } else {
+ set xtitle "Avg Radius (pixels)"
+ set ytitle "Surface Brightness (cnts/pixels**2)"
+ }
+ }
+ }
+
+ # set for plot code
+ set vvar(axis,x,title) $xtitle
+ set vvar(axis,y,title) $ytitle
+
+ # update now (may not make it into plot code)
+ $vvar(graph) xaxis configure -title $xtitle
+ $vvar(graph) yaxis configure -title $ytitle
+}
diff --git a/ds9/library/markeranalysisstats.tcl b/ds9/library/markeranalysisstats.tcl
new file mode 100644
index 0000000..325b2e2
--- /dev/null
+++ b/ds9/library/markeranalysisstats.tcl
@@ -0,0 +1,102 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerAnalysisStatsDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global imarker
+
+ set frame $var(frame)
+ set id $var(id)
+
+ set vvarname ${imarker(prefix,stats)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ set var(stats) [info exists ${vvarname}(top)]
+
+ $var(mb).analysis add checkbutton \
+ -label [msgcat::mc {Statistics}] \
+ -variable ${varname}(stats) \
+ -command "MarkerAnalysisStatsCmd $varname"
+}
+
+proc MarkerAnalysisStatsCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerAnalysisStats $var(frame) $var(id) $var(stats)
+}
+
+proc MarkerAnalysisStats {frame id stats} {
+ $frame marker $id analysis stats $stats
+ if {$stats} {
+ MarkerAnalysisStatsCB $frame $id
+ } else {
+ MarkerAnalysisStatsDeleteCB $frame $id
+ }
+}
+
+proc MarkerAnalysisStatsSystem {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[info exists var(stats)]} {
+ if {$var(stats)} {
+ MarkerAnalysisStatsCB $var(frame) $var(id)
+ }
+ }
+}
+
+# hardcoded marker.C
+proc MarkerAnalysisStatsCB {frame id} {
+ global imarker
+
+ set varname ${imarker(prefix,dialog)}${id}${frame}
+ global $varname
+ upvar #0 $varname var
+
+ set vvarname ${imarker(prefix,stats)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists var(system)]} {
+ set vvar(system) $var(system)
+ set sys $var(system)
+ } elseif {[info exists vvar(system)]} {
+ set sys $vvar(system)
+ } else {
+ global wcs
+ set sys $wcs(system)
+ }
+
+ if {[info exists var(sky)]} {
+ set vvar(sky) $var(sky)
+ set sky $var(sky)
+ } elseif {[info exists vvar(sky)]} {
+ set sky $vvar(sky)
+ } else {
+ global wcs
+ set sky $wcs(sky)
+ }
+
+ set tt [string totitle [$frame get marker $id type]]
+ set rr [$frame get marker $id analysis stats $sys $sky]
+ SimpleTextDialog $vvarname $tt 80 20 insert top $rr
+}
+
+proc MarkerAnalysisStatsDeleteCB {frame id} {
+ global imarker
+
+ set vvarname ${imarker(prefix,stats)}${id}${frame}
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ if {[info exists $vvarname]} {
+ SimpleTextDestroy $vvarname
+ }
+}
diff --git a/ds9/library/markerbase.tcl b/ds9/library/markerbase.tcl
new file mode 100644
index 0000000..332380b
--- /dev/null
+++ b/ds9/library/markerbase.tcl
@@ -0,0 +1,313 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBaseDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set tt [$var(frame) get marker $var(id) type]
+ switch -- [lindex $tt 1] {
+ point {set type "[string totitle [lindex $tt 0]] [string totitle [lindex $tt 1]]"}
+ {} {set type [string totitle [lindex $tt 0]]}
+ }
+
+ # variables - some may already be initialized (compass,ruler)
+ if {![info exists var(system)]} {
+ set rr [$var(frame) get wcs]
+ set var(system) [lindex $rr 0]
+ set var(sky) [lindex $rr 1]
+ set var(skyformat) [lindex $rr 2]
+ }
+ AdjustCoordSystem $varname system
+
+ # init
+ MarkerBaseTextCB $varname
+ MarkerBaseColorCB $varname
+ MarkerBaseLineWidthCB $varname
+ MarkerBasePropertyCB $varname
+ MarkerBaseFontCB $varname
+ $var(proc,coordCB) $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback delete MarkerBaseDeleteCB $varname
+ $var(frame) marker $var(id) callback text MarkerBaseTextCB $varname
+ $var(frame) marker $var(id) callback color MarkerBaseColorCB $varname
+ $var(frame) marker $var(id) callback width MarkerBaseLineWidthCB $varname
+ $var(frame) marker $var(id) callback property MarkerBasePropertyCB $varname
+ $var(frame) marker $var(id) callback font MarkerBaseFontCB $varname
+
+ # window
+ Toplevel $var(top) $var(mb) 6 [msgcat::mc "$type"] \
+ "$var(proc,close) $varname"
+
+ # menus
+ MarkerBaseMenu $varname
+ MarkerBaseFileMenu $varname
+ EditMenu $var(mb) $varname
+ ColorMenu $var(mb).color $varname color [list MarkerBaseColor $varname]
+ WidthDashMenu $var(mb).width $varname linewidth dash \
+ [list MarkerBaseLineWidth $varname] \
+ [list MarkerBaseProperty $varname dash]
+ MarkerBasePropertyMenu $varname
+ FontMenu $var(mb).font $varname font font,size font,weight \
+ font,slant [list MarkerBaseFont $varname]
+
+ # Param
+ set f [ttk::frame $var(top).param]
+ ttk::label $f.tid -text [msgcat::mc {Number}]
+ ttk::label $f.id -text "$var(id)"
+ ttk::label $f.ttext -text [msgcat::mc {Text}]
+ ttk::entry $f.text -textvariable ${varname}(text) -width 45
+ grid $f.tid $f.id -padx 2 -pady 2 -sticky w
+ grid $f.ttext $f.text - - - -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $var(top).buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command "$var(proc,apply) $varname"
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "$var(proc,close) $varname"
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ bind $var(top) <Return> "$var(proc,apply) $varname"
+
+ # Fini
+ ttk::separator $var(top).sep -orient horizontal
+ pack $var(top).buttons $var(top).sep -side bottom -fill x
+ pack $var(top).param -side top -fill both -expand true
+
+ # some window managers need a hint
+ raise $var(top)
+}
+
+# actions
+
+proc MarkerBaseClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback delete MarkerBaseDeleteCB
+ $var(frame) marker $var(id) delete callback text MarkerBaseTextCB
+ $var(frame) marker $var(id) delete callback color MarkerBaseColorCB
+ $var(frame) marker $var(id) delete callback width MarkerBaseLineWidthCB
+ $var(frame) marker $var(id) delete callback property MarkerBasePropertyCB
+ $var(frame) marker $var(id) delete callback font MarkerBaseFontCB
+
+ MarkerBaseDeleteCB $varname
+
+ unset $varname
+}
+
+proc MarkerBaseApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) text \{$var(text)\}
+
+ UpdateRegionMenu
+}
+
+proc MarkerBaseColor {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) color $var(color)
+}
+
+proc MarkerBaseLineWidth {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) width $var(linewidth)
+}
+
+proc MarkerBaseProperty {varname prop} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) property $prop $var($prop)
+}
+
+proc MarkerBaseFont {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) font \
+ \"$var(font) $var(font,size) $var(font,weight) $var(font,slant)\"
+}
+
+# callbacks
+
+proc MarkerBaseDeleteCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseDeleteCB"
+ }
+
+ # variables
+ foreach m [array names marker] {
+ set mm [split $m ,]
+ if {[lindex $mm 0] == $var(frame) && [lindex $mm 1] == $var(id)} {
+ unset marker($m)
+ }
+ }
+
+ # destroy the window and menubar
+ if {[winfo exists $var(top)]} {
+ destroy $var(top)
+ destroy $var(mb)
+ }
+}
+
+proc MarkerBaseTextCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseTextCB"
+ }
+
+ set var(text) [$var(frame) get marker $var(id) text]
+}
+
+proc MarkerBaseColorCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseColorCB"
+ }
+
+ set var(color) [$var(frame) get marker $var(id) color]
+}
+
+proc MarkerBaseLineWidthCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseLineWidthCB"
+ }
+
+ set var(linewidth) [$var(frame) get marker $var(id) width]
+}
+
+proc MarkerBasePropertyCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePropertyCB"
+ }
+
+ set var(dash) [$var(frame) get marker $var(id) property dash]
+ set var(fixed) [$var(frame) get marker $var(id) property fixed]
+ set var(edit) [$var(frame) get marker $var(id) property edit]
+ set var(move) [$var(frame) get marker $var(id) property move]
+ set var(rotate) [$var(frame) get marker $var(id) property rotate]
+ set var(delete) [$var(frame) get marker $var(id) property delete]
+ set var(include) [$var(frame) get marker $var(id) property include]
+ set var(source) [$var(frame) get marker $var(id) property source]
+}
+
+proc MarkerBaseFontCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseFontCB"
+ }
+
+ set f [$var(frame) get marker $var(id) font]
+
+ set var(font) [lindex $f 0]
+ set var(font,size) [lindex $f 1]
+ set var(font,weight) [lindex $f 2]
+ set var(font,slant) [lindex $f 3]
+}
+
+proc MarkerBaseCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseCoordCB"
+ }
+
+ AdjustCoordSystem $varname system
+}
+
+# menus
+
+proc MarkerBaseMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(mb) add cascade -label [msgcat::mc {File}] -menu $var(mb).file
+ $var(mb) add cascade -label [msgcat::mc {Edit}] -menu $var(mb).edit
+ $var(mb) add cascade -label [msgcat::mc {Color}] -menu $var(mb).color
+ $var(mb) add cascade -label [msgcat::mc {Width}] -menu $var(mb).width
+ $var(mb) add cascade -label [msgcat::mc {Property}] -menu $var(mb).properties
+ $var(mb) add cascade -label [msgcat::mc {Font}] -menu $var(mb).font
+}
+
+proc MarkerBaseFileMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $var(mb).file
+ $var(mb).file add command -label [msgcat::mc {Apply}] \
+ -command "$var(proc,apply) $varname"
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Close}] \
+ -command "$var(proc,close) $varname"
+}
+
+proc MarkerBasePropertyMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $var(mb).properties
+ $var(mb).properties add checkbutton -label [msgcat::mc {Fixed in Size}] \
+ -variable ${varname}(fixed) \
+ -command "MarkerBaseProperty $varname fixed"
+ $var(mb).properties add separator
+ $var(mb).properties add checkbutton -label [msgcat::mc {Can Edit}] \
+ -variable ${varname}(edit) \
+ -command "MarkerBaseProperty $varname edit"
+ $var(mb).properties add checkbutton -label [msgcat::mc {Can Move}] \
+ -variable ${varname}(move) \
+ -command "MarkerBaseProperty $varname move"
+ $var(mb).properties add checkbutton -label [msgcat::mc {Can Rotate}] \
+ -variable ${varname}(rotate) \
+ -command "MarkerBaseProperty $varname rotate"
+ $var(mb).properties add checkbutton -label [msgcat::mc {Can Delete}] \
+ -variable ${varname}(delete) \
+ -command "MarkerBaseProperty $varname delete"
+ $var(mb).properties add separator
+ $var(mb).properties add radiobutton -label [msgcat::mc {Include}] \
+ -variable ${varname}(include) -value 1 \
+ -command "MarkerBaseProperty $varname include"
+ $var(mb).properties add radiobutton -label [msgcat::mc {Exclude}] \
+ -variable ${varname}(include) -value 0 \
+ -command "MarkerBaseProperty $varname include"
+ $var(mb).properties add separator
+ $var(mb).properties add radiobutton -label [msgcat::mc {Source}] \
+ -variable ${varname}(source) -value 1 \
+ -command "MarkerBaseProperty $varname source"
+ $var(mb).properties add radiobutton -label [msgcat::mc {Background}] \
+ -variable ${varname}(source) -value 0 \
+ -command "MarkerBaseProperty $varname source"
+}
diff --git a/ds9/library/markerbaseannulus.tcl b/ds9/library/markerbaseannulus.tcl
new file mode 100644
index 0000000..6253f8b
--- /dev/null
+++ b/ds9/library/markerbaseannulus.tcl
@@ -0,0 +1,274 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBaseAnnulusDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set t [$var(frame) get marker $var(id) type]
+ switch -- $t {
+ ellipseannulus {set type "Ellipse Annulus"}
+ boxannulus {set type "Box Annulus"}
+ default {set type [string totitle $t]}
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(system) [lindex $rr 0]
+ set var(sky) [lindex $rr 1]
+ set var(skyformat) [lindex $rr 2]
+ AdjustCoordSystem $varname system
+
+ set var(x) 0
+ set var(y) 0
+
+ # init
+ MarkerBaseTextCB $varname
+ MarkerBaseColorCB $varname
+ MarkerBaseLineWidthCB $varname
+ MarkerBasePropertyCB $varname
+ MarkerBaseFontCB $varname
+ $var(proc,coordCB) $varname
+
+ MarkerBaseCenterMoveCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback delete MarkerBaseDeleteCB $varname
+ $var(frame) marker $var(id) callback text MarkerBaseTextCB $varname
+ $var(frame) marker $var(id) callback color MarkerBaseColorCB $varname
+ $var(frame) marker $var(id) callback width MarkerBaseLineWidthCB $varname
+ $var(frame) marker $var(id) callback property MarkerBasePropertyCB $varname
+ $var(frame) marker $var(id) callback font MarkerBaseFontCB $varname
+
+ $var(frame) marker $var(id) callback move MarkerBaseCenterMoveCB $varname
+
+ # window
+ Toplevel $var(top) $var(mb) 6 [msgcat::mc "$type"] \
+ "$var(proc,close) $varname"
+
+ # menus
+ MarkerBaseMenu $varname
+ MarkerBaseAnnulusFileMenu $varname
+ EditMenu $var(mb) $varname
+ ColorMenu $var(mb).color $varname color [list MarkerBaseColor $varname]
+ WidthDashMenu $var(mb).width $varname linewidth dash \
+ [list MarkerBaseLineWidth $varname] \
+ [list MarkerBaseProperty $varname dash]
+ MarkerBasePropertyMenu $varname
+ FontMenu $var(mb).font $varname font font,size font,weight \
+ font,slant [list MarkerBaseFont $varname]
+
+ # Param
+ set f [ttk::labelframe $var(top).param -text [msgcat::mc "Parameters"] \
+ -padding 2]
+
+ ttk::label $f.tid -text [msgcat::mc {Number}]
+ ttk::label $f.id -text "$var(id)"
+ ttk::label $f.ttext -text [msgcat::mc {Text}]
+ ttk::entry $f.text -textvariable ${varname}(text) -width 45
+ ttk::label $f.tcenter -text [msgcat::mc {Center}]
+ ttk::entry $f.centerx -textvariable ${varname}(x) -width 13
+ ttk::entry $f.centery -textvariable ${varname}(y) -width 13
+ CoordMenuButton $f.ucenter $varname system 1 sky skyformat \
+ [list $var(proc,coordCB) $varname]
+ CoordMenuEnable $f.ucenter.menu $varname system 1 sky skyformat
+
+ grid $f.tid $f.id -padx 2 -pady 2 -sticky w
+ grid $f.ttext $f.text - - - -padx 2 -pady 2 -sticky w
+ grid $f.tcenter $f.centerx $f.centery $f.ucenter \
+ -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $var(top).buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] \
+ -command "$var(proc,apply) $varname"
+ ttk::button $f.generate -text [msgcat::mc {Generate}] \
+ -command "$var(proc,generate) $varname"
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "$var(proc,close) $varname"
+ pack $f.apply $f.generate $f.close -side left -expand true -padx 2 -pady 4
+
+ bind $var(top) <Return> "$var(proc,apply) $varname"
+
+ # Fini
+ grid $var(top).param -sticky news
+ grid $var(top).buttons - - -sticky ew
+
+ # some window managers need a hint
+ raise $var(top)
+}
+
+proc MarkerBaseAnnulusFileMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $var(mb).file
+ $var(mb).file add command -label [msgcat::mc {Apply}] \
+ -command "$var(proc,apply) $varname"
+ $var(mb).file add command -label [msgcat::mc {Generate}] \
+ -command "$var(proc,generate) $varname"
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Close}] \
+ -command "$var(proc,close) $varname"
+}
+
+proc MarkerBaseAnnulusMethodMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(mb) add cascade -label [msgcat::mc {Method}] -menu $var(mb).method
+ menu $var(mb).method
+ $var(mb).method add radiobutton -label [msgcat::mc {Equal Distance}] \
+ -variable ${varname}(method) -value dist
+ $var(mb).method add radiobutton -label [msgcat::mc {Equal Area}] \
+ -variable ${varname}(method) -value area
+}
+
+proc MarkerBaseAnnulusGenerateCircle {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(annulitxt) delete 1.0 end
+
+ if {$var(annuli) < 1} {
+ set var(annuli) 1
+ }
+
+ set inner $var(inner)
+ set outer $var(outer)
+ set annuli $var(annuli)
+
+ if {($inner != {}) && ($outer != {}) && ($annuli != {})} {
+ switch -- $var(method) {
+ dist {
+ for {set i 0} {$i<=$annuli} {incr i} {
+ $var(annulitxt) insert end \
+ "[expr ((($outer-$inner)/double($annuli))*$i)+$inner]\n"
+ }
+ }
+
+ area {
+ set pi 3.14159265358979323846
+ set area [expr $pi*(($outer*$outer)-($inner*$inner))/$annuli]
+
+ set r0 $inner
+ $var(annulitxt) insert end "$r0\n"
+ for {set i 0} {$i<$annuli} {incr i} {
+ set r1 [expr sqrt(($area+($pi*$r0*$r0))/$pi)]
+ $var(annulitxt) insert end \
+ [format "%.4f\n" $r1]
+ set r0 $r1
+ }
+ }
+ }
+ }
+}
+
+proc MarkerBaseAnnulusGenerateEllipse {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(annulitxt) delete 1.0 end
+
+ if {$var(annuli) < 1} {
+ set var(annuli) 1
+ }
+
+ set radius1 $var(radius1)
+ set radius2 $var(radius2)
+ set radius3 $var(radius3)
+ set annuli $var(annuli)
+
+ if {($radius1 != {}) && ($radius2 != {}) && \
+ ($radius3 != {}) && ($annuli != {})} {
+
+ switch -- $var(method) {
+ dist {
+ for {set i 0} {$i<=$annuli} {incr i} {
+ set major [expr ((($radius1-$radius3)/double($annuli))*$i)\
+ +$radius3]
+ set minor [expr $major*$radius2/$radius1]
+ $var(annulitxt) insert end "$major $minor\n"
+ }
+ }
+
+ area {
+ set pi 3.14159265358979323846
+ set r [expr double($radius2)/$radius1]
+ set area [expr $pi*(($radius1*$radius2)-($radius3*$radius3*$r))\
+ /$annuli]
+
+ set major0 $radius3
+ set minor0 [expr $radius3*$r]
+ $var(annulitxt) insert end "$major0 $minor0\n"
+ for {set i 0} {$i<$annuli} {incr i} {
+ set major1 [expr sqrt(($area+($pi*$major0*$minor0)) / \
+ ($pi*$r))]
+ set minor1 [expr $major1*$r]
+ $var(annulitxt) insert end \
+ [format "%.4f %.4f\n" $major1 $minor1]
+ set major0 $major1
+ set minor0 $minor1
+ }
+ }
+ }
+ }
+}
+
+proc MarkerBaseAnnulusGenerateBox {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(annulitxt) delete 1.0 end
+
+ if {$var(annuli) < 1} {
+ set var(annuli) 1
+ }
+
+ set radius1 $var(radius1)
+ set radius2 $var(radius2)
+ set radius3 $var(radius3)
+ set annuli $var(annuli)
+
+ if {($radius1 != {}) && ($radius2 != {}) && \
+ ($radius3 != {}) && ($annuli != {})} {
+
+ if {$radius1<=0} {
+ set radius1 1
+ }
+ if {$radius2<=0} {
+ set radius2 1
+ }
+
+ switch -- $var(method) {
+ dist {
+ for {set i 0} {$i<=$annuli} {incr i} {
+ set major [expr ((($radius1-$radius3)/$annuli)*$i)+$radius3]
+ set minor [expr $major*$radius2/$radius1]
+ $var(annulitxt) insert end "$major $minor\n"
+ }
+ }
+
+ area {
+ set r [expr double($radius2)/$radius1]
+ set area [expr (($radius1*$radius2)-($radius3*$radius3*$r)) \
+ /$annuli]
+
+ set major0 $radius3
+ set minor0 [expr $radius3*$r]
+ $var(annulitxt) insert end "$major0 $minor0\n"
+ for {set i 0} {$i<$annuli} {incr i} {
+ set major1 [expr sqrt(($area+($major0*$minor0))/$r)]
+ set minor1 [expr $major1*$r]
+ $var(annulitxt) insert end \
+ [format "%.4f %.4f\n" $major1 $minor1]
+ set major0 $major1
+ set minor0 $minor1
+ }
+ }
+ }
+ }
+}
diff --git a/ds9/library/markerbaseannulusrect.tcl b/ds9/library/markerbaseannulusrect.tcl
new file mode 100644
index 0000000..3ec3274
--- /dev/null
+++ b/ds9/library/markerbaseannulusrect.tcl
@@ -0,0 +1,188 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBaseAnnulusRectDialog {varname unit major minor} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ set unit2 [string totitle $unit]
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ set var(method) dist
+
+ # base
+ MarkerBaseAnnulusDialog $varname
+
+ # menus
+ MarkerBaseAnnulusMethodMenu $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisRadialDialog $varname
+
+ # callbacks
+# $var(frame) marker $var(id) callback move $var(proc,editCB) $varname
+ $var(frame) marker $var(id) callback edit $var(proc,editCB) $varname
+ $var(frame) marker $var(id) callback end edit $var(proc,editCB) $varname
+ $var(frame) marker $var(id) callback rotate MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.majorTitle -text $major
+ ttk::label $f.minorTitle -text $minor
+ ttk::label $f.outerTitle -text [msgcat::mc "Outer"]
+ ttk::entry $f.radius1 -textvariable ${varname}(radius1) -width 13
+ ttk::entry $f.radius2 -textvariable ${varname}(radius2) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list $var(proc,distCB) $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+ ttk::label $f.innerTitle -text [msgcat::mc "Inner"]
+ ttk::entry $f.radius3 -textvariable ${varname}(radius3) -width 13
+
+ # Annulus
+ ttk::label $f.tannuli -text [msgcat::mc {Annuli}]
+ ttk::entry $f.vannuli -textvariable ${varname}(annuli) -width 13
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.vangle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid x $f.majorTitle $f.minorTitle -padx 2 -pady 2 -sticky w
+ grid $f.outerTitle $f.radius1 $f.radius2 $f.uradius \
+ -padx 2 -pady 2 -sticky w
+ grid $f.innerTitle $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.tannuli $f.vannuli -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.vangle $f.uangle -padx 2 -pady 2 -sticky w
+
+ # Annuli
+ set f [ttk::labelframe $var(top).annuli -text [msgcat::mc {Annuli}] \
+ -padding 2]
+
+ set var(annulitxt) [text $f.txt \
+ -height 10 \
+ -width 15 \
+ -wrap none \
+ -font [font actual TkDefaultFont] \
+ -yscrollcommand [list $f.yscroll set] \
+ ]
+ ttk::scrollbar $f.yscroll -command [list $var(annulitxt) yview] \
+ -orient vertical
+
+ grid $var(annulitxt) $f.yscroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Fini
+ grid $var(top).annuli -row 0 -column 1 -sticky news
+ grid rowconfigure $var(top) 0 -weight 1
+ grid columnconfigure $var(top) 1 -weight 1
+
+ # init - do this last
+ $var(proc,distCB) $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+# actions
+
+proc MarkerBaseAnnulusRectClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # $var(frame) marker $var(id) delete callback move $var(proc,editCB)
+ $var(frame) marker $var(id) delete callback edit $var(proc,editCB)
+ $var(frame) marker $var(id) delete callback end edit $var(proc,editCB)
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc MarkerBaseAnnulusRectApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set levels {}
+ regsub -all "\n" "[$var(annulitxt) get 1.0 end]" " " levels
+ # and trim any trailing spaces
+ set levels [string trimright $levels " "]
+
+ if {$levels != {}} {
+ $var(frame) marker $var(id) $var(which) radius "\{$levels\}" \
+ $var(dcoord) $var(dformat)
+ }
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc MarkerBaseAnnulusRectCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseAnnulusRectCoordCB"
+ }
+
+ MarkerAnalysisRadialSystem $varname
+ MarkerAnalysisStatsSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+proc MarkerBaseAnnulusRectEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseAnnulusRectEditCB"
+ }
+
+ set t [$var(frame) get marker $var(id) $var(which) radius \
+ $var(dcoord) $var(dformat)]
+
+ set last [llength $t]
+ set var(annuli) [expr $last/2-1]
+ set var(radius1) [lindex $t [expr $last-2]]
+ set var(radius2) [lindex $t [expr $last-1]]
+ set var(radius3) [lindex $t 0]
+
+ $var(annulitxt) delete 1.0 end
+ $var(annulitxt) insert end "$t"
+}
+
+proc MarkerBaseAnnulusRectDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseAnnulusRectDistCB"
+ }
+
+ $var(proc,editCB) $varname
+}
diff --git a/ds9/library/markerbasecenter.tcl b/ds9/library/markerbasecenter.tcl
new file mode 100644
index 0000000..1207f41
--- /dev/null
+++ b/ds9/library/markerbasecenter.tcl
@@ -0,0 +1,91 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBaseCenterDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # variables
+ set var(x) 0
+ set var(y) 0
+
+ # base
+ MarkerBaseDialog $varname
+
+ # init
+ MarkerBaseCenterMoveCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback move MarkerBaseCenterMoveCB $varname
+
+ set f $var(top).param
+
+ # Center
+ ttk::label $f.tcenter -text [msgcat::mc {Center}]
+ ttk::entry $f.centerx -textvariable ${varname}(x) -width 13
+ ttk::entry $f.centery -textvariable ${varname}(y) -width 13
+
+ CoordMenuButton $f.ucenter $varname system 1 sky skyformat \
+ [list $var(proc,coordCB) $varname]
+ CoordMenuEnable $f.ucenter.menu $varname system 1 sky skyformat
+
+ grid $f.tcenter $f.centerx $f.centery $f.ucenter -padx 2 -pady 2 -sticky w
+}
+
+proc MarkerBaseCenterClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback move MarkerBaseCenterMoveCB
+
+ MarkerBaseClose $varname
+}
+
+proc MarkerBaseCenterApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(x) != {} &&
+ $var(y) != {}} {
+ $var(frame) marker $var(id) move to $var(system) $var(sky) \
+ $var(x) $var(y)
+ }
+
+ MarkerBaseApply $varname
+}
+
+proc MarkerBaseCenterRotate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) angle $var(angle) $var(system) $var(sky)
+}
+
+# callbacks
+
+proc MarkerBaseCenterMoveCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseCenterMoveCB"
+ }
+
+ set center [$var(frame) get marker $var(id) center $var(system) $var(sky) \
+ $var(skyformat)]
+ set var(x) [lindex $center 0]
+ set var(y) [lindex $center 1]
+}
+
+proc MarkerBaseCenterRotateCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+}
+
diff --git a/ds9/library/markerbaseline.tcl b/ds9/library/markerbaseline.tcl
new file mode 100644
index 0000000..06832b4
--- /dev/null
+++ b/ds9/library/markerbaseline.tcl
@@ -0,0 +1,99 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBaseLineDialog {varname width height} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # variables - some may already initialized (ruler)
+ if {![info exists ${varname}(dcoord)]} {
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ }
+ AdjustCoordSystem $varname dcoord
+
+ # procs
+ set var(proc,close) MarkerBaseLineClose
+
+ # base
+ MarkerBaseDialog $varname
+
+ # init
+ $var(proc,distCB) $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback move "$var(proc,editCB)" $varname
+ $var(frame) marker $var(id) callback edit "$var(proc,editCB)" $varname
+
+ set f $var(top).param
+
+ # Points
+ ttk::label $f.title -text [msgcat::mc {Points}]
+ ttk::entry $f.x -textvariable ${varname}(x) -width 13
+ ttk::entry $f.y -textvariable ${varname}(y) -width 13
+ CoordMenuButton $f.coord $varname system 1 sky skyformat \
+ [list $var(proc,coordCB) $varname]
+ CoordMenuEnable $f.coord.menu $varname system 1 sky skyformat
+ ttk::entry $f.x2 -textvariable ${varname}(x2) -width 13
+ ttk::entry $f.y2 -textvariable ${varname}(y2) -width 13
+
+ # Length
+ ttk::label $f.dtitle -text [msgcat::mc {Length}]
+ ttk::label $f.dist -textvariable ${varname}(dist) \
+ -relief groove -width 12
+ DistMenuButton $f.udist $varname dcoord 1 dformat \
+ [list $var(proc,distCB) $varname]
+ DistMenuEnable $f.udist.menu $varname dcoord 1 dformat
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::label $f.angle -textvariable ${varname}(angle) \
+ -relief groove -width 12
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.title $f.x $f.y $f.coord -padx 2 -pady 2 -sticky w
+ grid x $f.x2 $f.y2 -padx 2 -pady 2 -sticky w
+ grid $f.dtitle $f.dist $f.udist -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+}
+
+proc MarkerBaseLineClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback move "$var(proc,editCB)"
+ $var(frame) marker $var(id) delete callback edit "$var(proc,editCB)"
+
+ MarkerBaseClose $varname
+}
+
+proc MarkerBaseLineApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseApply $varname
+}
+
+proc MarkerBaseLineEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBaseLineEditCB"
+ }
+
+ set p [$var(frame) get marker $var(id) $var(which) point $var(system) \
+ $var(sky) $var(skyformat)]
+
+ set var(x) [lindex $p 0]
+ set var(y) [lindex $p 1]
+ set var(x2) [lindex $p 2]
+ set var(y2) [lindex $p 3]
+}
diff --git a/ds9/library/markerbasepanda.tcl b/ds9/library/markerbasepanda.tcl
new file mode 100644
index 0000000..8e31099
--- /dev/null
+++ b/ds9/library/markerbasepanda.tcl
@@ -0,0 +1,216 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBasePandaDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ set var(method) dist
+ set var(init) 0
+
+ # base
+ MarkerBaseAnnulusDialog $varname
+
+ # menus
+ MarkerBaseAnnulusMethodMenu $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisPandaDialog $varname
+
+ # callbacks
+# $var(frame) marker $var(id) callback move $var(proc,editCB) $varname
+ $var(frame) marker $var(id) callback edit $var(proc,editCB) $varname
+ $var(frame) marker $var(id) callback end edit $var(proc,editCB) $varname
+
+ set f $var(top).param
+
+ # Angles
+ ttk::label $f.tang1 -text [msgcat::mc {Start}]
+ ttk::label $f.tang2 -text [msgcat::mc {End}]
+ ttk::label $f.tangles -text [msgcat::mc {Angles}]
+ ttk::entry $f.ang1 -textvariable ${varname}(ang1) -width 13
+ ttk::entry $f.ang2 -textvariable ${varname}(ang2) -width 13
+ ttk::label $f.uangles -text [msgcat::mc {Degrees}]
+ ttk::label $f.tangnum -text [msgcat::mc {Number}]
+ ttk::entry $f.angnum -textvariable ${varname}(angnum) -width 13
+
+ grid x $f.tang1 $f.tang2 -padx 2 -pady 2 -sticky w
+ grid $f.tangles $f.ang1 $f.ang2 $f.uangles -padx 2 -pady 2 -sticky w
+ grid $f.tangnum $f.angnum -padx 2 -pady 2 -sticky w
+
+ # Radius
+ set f [ttk::labelframe $var(top).radius -text [msgcat::mc {Radius}] \
+ -padding 2]
+ set var(annulitxt) [text $f.txt \
+ -height 15 \
+ -width 15 \
+ -wrap none \
+ -font [font actual TkDefaultFont] \
+ -yscrollcommand [list $f.yscroll set] \
+ ]
+ ttk::scrollbar $f.yscroll -command [list $var(annulitxt) yview] \
+ -orient vertical
+
+ grid $var(annulitxt) $f.yscroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Radius Fini
+ grid $var(top).radius -row 0 -column 1 -sticky news
+ grid rowconfigure $var(top) 0 -weight 1
+ grid columnconfigure $var(top) 1 -weight 1
+
+ # Angles
+ set f [ttk::labelframe $var(top).angles -text [msgcat::mc {Angles}] \
+ -padding 2]
+
+ set var(angtxt) [text $f.txt \
+ -height 15 \
+ -width 15 \
+ -wrap none \
+ -font [font actual TkDefaultFont] \
+ -yscrollcommand [list $f.yscroll set] \
+ ]
+ ttk::scrollbar $f.yscroll -command [list $var(angtxt) yview] \
+ -orient vertical
+
+ grid $var(angtxt) $f.yscroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Angles Fini
+ grid $var(top).angles -row 0 -column 2 -sticky news
+ grid rowconfigure $var(top) 0 -weight 1
+ grid columnconfigure $var(top) 2 -weight 1
+
+ set var(init) 1
+}
+
+# actions
+
+proc MarkerBasePandaClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+# $var(frame) marker $var(id) delete callback move $var(proc,editCB)
+ $var(frame) marker $var(id) delete callback edit $var(proc,editCB)
+ $var(frame) marker $var(id) delete callback end edit $var(proc,editCB)
+
+ MarkerBaseCenterClose $varname
+}
+
+proc MarkerBasePandaApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set levels {}
+ regsub -all "\n" "[$var(annulitxt) get 1.0 end]" " " levels
+ # and trim any trailing spaces
+ set levels [string trimright $levels " "]
+
+ set angles {}
+ regsub -all "\n" "[$var(angtxt) get 1.0 end]" " " angles
+ # and trim any trailing spaces
+ set angles [string trimright $angles " "]
+
+ if {($levels != {}) && ($angles != {})} {
+ $var(frame) marker $var(id) $var(which) edit \
+ "\{$angles\}" "\{$levels\}" $var(system) $var(sky) \
+ $var(dcoord) $var(dformat)
+ }
+
+ MarkerBaseCenterApply $varname
+}
+
+proc MarkerBasePandaGenerateAngles {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(angtxt) delete 1.0 end
+
+ set ang1 $var(ang1)
+ set ang2 $var(ang2)
+ set angnum $var(angnum)
+
+ if {($ang1 != {}) && ($ang2 != {}) && ($angnum != {})} {
+ # normalize between 0 <= ang < 360
+ if {[::math::fuzzy::tgt $ang1 0]} {
+ while {[::math::fuzzy::tge $ang1 360]} {
+ set ang1 [expr $ang1-360]
+ }
+ } else {
+ while {[::math::fuzzy::tlt $ang1 0]} {
+ set ang1 [expr $ang1+360]
+ }
+ }
+
+ if {[::math::fuzzy::tgt $ang2 0]} {
+ while {[::math::fuzzy::tge $ang2 360]} {
+ set ang2 [expr $ang2-360]
+ }
+ } else {
+ while {[::math::fuzzy::tlt $ang2 0]} {
+ set ang2 [expr $ang2+360]
+ }
+ }
+
+ # with ang2 > ang1
+ while {[::math::fuzzy::tge $ang1 $ang2]} {
+ set ang2 [expr $ang2+360]
+ }
+
+ for {set i 0} {$i<=$angnum} {incr i} {
+ set v [expr ((($ang2-$ang1)/double($angnum))*$i)+$ang1]
+ $var(angtxt) insert end "$v\n"
+ }
+ }
+}
+
+# callbacks
+
+
+proc MarkerBasePandaCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePandaCoordCB"
+ }
+
+ MarkerAnalysisPandaSystem $varname
+ MarkerAnalysisStatsSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ if {$var(init)} {
+ $var(proc,editCB) $varname
+ }
+}
+
+proc MarkerBasePandaDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePandaDistCB"
+ }
+
+ $var(proc,editCB) $varname
+}
+
diff --git a/ds9/library/markerbasepandarect.tcl b/ds9/library/markerbasepandarect.tcl
new file mode 100644
index 0000000..320cb73
--- /dev/null
+++ b/ds9/library/markerbasepandarect.tcl
@@ -0,0 +1,130 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerBasePandaRectDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # base panda dialog
+ MarkerBasePandaDialog $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback rotate \
+ MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Radius
+ ttk::label $f.tmajor -text [msgcat::mc {Major}]
+ ttk::label $f.tminor -text [msgcat::mc {Minor}]
+ ttk::label $f.touter -text [msgcat::mc {Outer}]
+ ttk::entry $f.radius1 -textvariable ${varname}(radius1) -width 13
+ ttk::entry $f.radius2 -textvariable ${varname}(radius2) -width 13
+ DistMenuButton $f.uradius $varname dcoord 1 dformat \
+ [list $var(proc,distCB) $varname]
+ DistMenuEnable $f.uradius.menu $varname dcoord 1 dformat
+ ttk::label $f.tinner -text [msgcat::mc {Inner}]
+ ttk::entry $f.radius3 -textvariable ${varname}(radius3) -width 13
+
+ # Annuli
+ ttk::label $f.tannuli -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable ${varname}(annuli) -width 13
+
+ grid x $f.tmajor $f.tminor -padx 2 -pady 2 -sticky w
+ grid $f.touter $f.radius1 $f.radius2 $f.uradius -padx 2 -pady 2 -sticky w
+ grid $f.tinner $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.tannuli $f.annuli -padx 2 -pady 2 -sticky w
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+
+ # init - do this last
+ $var(proc,distCB) $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+# actions
+
+proc MarkerBasePandaRectClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBasePandaClose $varname
+}
+
+proc MarkerBasePandaRectApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBasePandaApply $varname
+ MarkerBaseCenterRotate $varname
+}
+
+# callbacks
+
+proc MarkerBasePandaRectCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePandaRectCoordCB"
+ }
+
+ MarkerBasePandaCoordCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
+proc MarkerBasePandaRectEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePandaRectEditCB"
+ }
+
+ set t [$var(frame) get marker $var(id) $var(which) radius \
+ $var(dcoord) $var(dformat)]
+
+ set last [llength $t]
+ set var(annuli) [expr $last/2-1]
+ set var(radius1) [lindex $t [expr $last-2]]
+ set var(radius2) [lindex $t [expr $last-1]]
+ set var(radius3) [lindex $t 0]
+
+ $var(annulitxt) delete 1.0 end
+ $var(annulitxt) insert end "$t"
+
+ set a [$var(frame) get marker $var(id) $var(which) angle \
+ $var(system) $var(sky)]
+
+ set last [expr [llength $a]-1]
+ set var(ang1) [lindex $a 0]
+ set var(ang2) [lindex $a $last]
+ set var(angnum) $last
+
+ $var(angtxt) delete 1.0 end
+ $var(angtxt) insert end "$a"
+}
+
+proc MarkerBasePandaRectDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "MarkerBasePandaRectDistCB"
+ }
+
+ MarkerBasePandaDistCB $varname
+}
diff --git a/ds9/library/markerdialog.tcl b/ds9/library/markerdialog.tcl
new file mode 100644
index 0000000..3cee4b7
--- /dev/null
+++ b/ds9/library/markerdialog.tcl
@@ -0,0 +1,292 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MarkerLoadDialog {} {
+ global marker
+ global ed
+ global current
+ global wcs
+
+ set w {.mkd}
+
+ set ed(ok) 0
+ set ed(format) $marker(format)
+ set ed(load) $marker(load)
+ set ed(frame) $current(frame)
+
+ set ed(system) $wcs(system)
+ set ed(sky) $wcs(sky)
+ set ed(skyformat) $wcs(skyformat)
+ AdjustCoordSystem ed system
+
+ DialogCreate $w [msgcat::mc {Load Regions}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.formattitle -text [msgcat::mc {Format}]
+ set m $f.formatbutton.menu
+ ttk::menubutton $f.formatbutton -textvariable ed(format) -menu $m
+ ttk::label $f.coordtitle -text [msgcat::mc {Coordinate System}]
+ set ed(cb) $f.coordbutton
+ CoordMenuButton $ed(cb) ed system 1 sky skyformat {}
+ ttk::radiobutton $f.current -text [msgcat::mc {Load into Current Frame}] \
+ -variable ed(load) -value current
+ ttk::radiobutton $f.all -text [msgcat::mc {Load into All Frames}] \
+ -variable ed(load) -value all
+
+ menu $m
+ $m add radiobutton -label {DS9/Funtools} -variable ed(format) -value ds9 \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {XML} -variable ed(format) -value xml \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {CIAO} -variable ed(format) -value ciao \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {SAOtng} -variable ed(format) -value saotng \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {SAOimage} -variable ed(format) -value saoimage \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {IRAF PROS} -variable ed(format) -value pros \
+ -command UpdateMarkerLoadDialog
+ $m add radiobutton -label {X Y} -variable ed(format) -value xy \
+ -command UpdateMarkerLoadDialog
+
+ grid $f.formattitle $f.formatbutton -padx 2 -pady 2 -sticky w
+ grid $f.coordtitle $f.coordbutton -padx 2 -pady 2 -sticky w
+ grid $f.current - -padx 2 -pady 2 -sticky w
+ grid $f.all - -padx 2 -pady 2 -sticky w
+
+ # Button
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ UpdateMarkerLoadDialog
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set marker(format) $ed(format)
+ set marker(system) $ed(system)
+ set marker(sky) $ed(sky)
+ set marker(skyformat) $ed(skyformat)
+ set marker(load) $ed(load)
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc UpdateMarkerLoadDialog {} {
+ global ed
+ global current
+
+ set mm $ed(cb).menu
+ set ed(frame) $current(frame)
+ CoordMenuEnable $mm ed system 1 sky skyformat
+
+ switch -- $ed(format) {
+ xy {$ed(cb) configure -state normal}
+ default {$ed(cb) configure -state disabled}
+ }
+
+ AdjustCoordSystem ed system
+ CoordMenuButtonCmd ed system sky {}
+}
+
+proc MarkerSaveDialog {title} {
+ global marker
+ global ed
+ global current
+ global wcs
+
+ set w {.mkd}
+
+ set ed(ok) 0
+ set ed(format) $marker(format)
+ set ed(frame) $current(frame)
+
+ set ed(system) $wcs(system)
+ set ed(sky) $wcs(sky)
+ set ed(skyformat) $wcs(skyformat)
+ AdjustCoordSystem ed system
+
+ DialogCreate $w $title ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.formattitle -text [msgcat::mc {Format}]
+ set m $f.formatbutton.menu
+ ttk::menubutton $f.formatbutton -textvariable ed(format) -menu $m
+ ttk::label $f.coordtitle -text [msgcat::mc {Coordinate System}]
+ set ed(cb) $f.coordbutton
+
+ CoordMenuButton $ed(cb) ed system 1 sky skyformat UpdateMarkerSaveDialog
+
+ menu $m
+ $m add radiobutton -label {DS9/Funtools} -variable ed(format) -value ds9 \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {XML} -variable ed(format) -value xml \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {CIAO} -variable ed(format) -value ciao \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {SAOtng} -variable ed(format) -value saotng \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {SAOimage} -variable ed(format) -value saoimage \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {IRAF PROS} -variable ed(format) -value pros \
+ -command UpdateMarkerSaveDialog
+ $m add radiobutton -label {X Y} -variable ed(format) -value xy \
+ -command UpdateMarkerSaveDialog
+
+ grid $f.formattitle $f.formatbutton -padx 2 -pady 2 -sticky w
+ grid $f.coordtitle $f.coordbutton -padx 2 -pady 2 -sticky w
+
+ # Button
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ UpdateMarkerSaveDialog
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set marker(format) $ed(format)
+ set marker(system) $ed(system)
+ set marker(sky) $ed(sky)
+ set marker(skyformat) $ed(skyformat)
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc UpdateMarkerSaveDialog {} {
+ global ed
+ global current
+
+ set mm $ed(cb).menu
+ set ed(frame) $current(frame)
+ CoordMenuEnable $mm ed system 1 sky skyformat
+
+ switch -- $ed(format) {
+ ds9 -
+ xml -
+ xy {}
+
+ ciao {
+ switch -- $ed(system) {
+ detector -
+ amplifier -
+ physical -
+ image {set ed(system) physical}
+ wcs -
+ default {set ed(system) wcs}
+ }
+
+ set ed(sky) fk5
+ set ed(skyformat) sexagesimal
+
+ $mm entryconfig [msgcat::mc {Multiple WCS}] -state disabled
+ $mm entryconfig [msgcat::mc {Image}] -state disabled
+ $mm entryconfig [msgcat::mc {Amplifier}] -state disabled
+ $mm entryconfig [msgcat::mc {Detector}] -state disabled
+
+ $mm entryconfig [msgcat::mc {FK4}] -state disabled
+ $mm entryconfig [msgcat::mc {ICRS}] -state disabled
+ $mm entryconfig [msgcat::mc {Galactic}] -state disabled
+ $mm entryconfig [msgcat::mc {Ecliptic}] -state disabled
+
+ $mm entryconfig [msgcat::mc {Degrees}] -state disabled
+ }
+
+ saotng {
+ switch -- $ed(system) {
+ detector -
+ amplifier -
+ image -
+ physical {set ed(system) image}
+ wcs -
+ default {set ed(system) wcs}
+ }
+
+ $mm entryconfig [msgcat::mc {Multiple WCS}] -state disabled
+ $mm entryconfig [msgcat::mc {Physical}] -state disabled
+ $mm entryconfig [msgcat::mc {Amplifier}] -state disabled
+ $mm entryconfig [msgcat::mc {Detector}] -state disabled
+ }
+
+ saoimage {
+ set ed(system) image
+
+ $mm entryconfig [msgcat::mc {WCS}] -state disabled
+ $mm entryconfig [msgcat::mc {Multiple WCS}] -state disabled
+ $mm entryconfig [msgcat::mc {Physical}] -state disabled
+ $mm entryconfig [msgcat::mc {Amplifier}] -state disabled
+ $mm entryconfig [msgcat::mc {Detector}] -state disabled
+
+ $mm entryconfig [msgcat::mc {FK4}] -state disabled
+ $mm entryconfig [msgcat::mc {FK5}] -state disabled
+ $mm entryconfig [msgcat::mc {ICRS}] -state disabled
+ $mm entryconfig [msgcat::mc {Galactic}] -state disabled
+ $mm entryconfig [msgcat::mc {Ecliptic}] -state disabled
+
+ $mm entryconfig [msgcat::mc {Degrees}] -state disabled
+ $mm entryconfig {Sexagesimal} -state disabled
+ }
+
+ pros {
+ switch -- $ed(system) {
+ detector -
+ physical -
+ amplifier {set ed(system) physical}
+ image {}
+ wcs -
+ default {set ed(system) wcs}
+ }
+ if {$ed(sky) == {icrs}} {
+ set ed(sky) fk5
+ }
+
+ $mm entryconfig [msgcat::mc {Multiple WCS}] -state disabled
+ $mm entryconfig [msgcat::mc {Amplifier}] -state disabled
+ $mm entryconfig [msgcat::mc {Detector}] -state disabled
+
+ $mm entryconfig [msgcat::mc {ICRS}] -state disabled
+ }
+ }
+
+ AdjustCoordSystem ed system
+ CoordMenuButtonCmd ed system sky {}
+}
+
+
diff --git a/ds9/library/mask.tcl b/ds9/library/mask.tcl
new file mode 100644
index 0000000..aa3de7c
--- /dev/null
+++ b/ds9/library/mask.tcl
@@ -0,0 +1,297 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MaskDef {} {
+ global mask
+ global imask
+ global pmask
+
+ set imask(top) .msk
+ set imask(mb) .mskmb
+
+ set mask(color) red
+ set mask(mark) 1
+ set mask(transparency) 0
+
+ array set pmask [array get mask]
+}
+
+proc MaskTransparency {} {
+ global mask
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) mask transparency $mask(transparency)
+ }
+}
+
+proc MaskClear {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) mask clear
+ }
+}
+
+proc MaskDialog {} {
+ global mask
+ global imask
+ global current
+ global ds9
+
+ # see if we already have a ctr window visible
+ if {[winfo exists $imask(top)]} {
+ raise $imask(top)
+ return
+ }
+
+ # create the mask window
+ set w $imask(top)
+ set mb $imask(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Mask Parameters}] MaskDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label "[msgcat::mc {Open}]..." \
+ -command [list OpenDialog fits mask]
+ $mb.file add cascade -label [msgcat::mc {Open as}] \
+ -menu $mb.file.open
+ $mb.file add separator
+ $mb.file add cascade -label [msgcat::mc {Import}] \
+ -menu $mb.file.import
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Apply}] -command MaskApplyDialog
+ $mb.file add command -label [msgcat::mc {Clear}] -command MaskClear
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command MaskDestroyDialog
+
+ menu $mb.file.open
+ $mb.file.open add command \
+ -label "[msgcat::mc {Mosaic WCS}]..." \
+ -command [list OpenDialog mosaicimagewcs mask]
+ $mb.file.open add command \
+ -label "[msgcat::mc {Mosaic WCS Segment}]..." \
+ -command [list OpenDialog mosaicwcs mask]
+ $mb.file.open add command \
+ -label "[msgcat::mc {Mosaic IRAF}]..." \
+ -command [list OpenDialog mosaicimageiraf mask]
+ $mb.file.open add command \
+ -label "[msgcat::mc {Mosaic IRAF Segment}]..." \
+ -command [list OpenDialog mosaiciraf mask]
+
+ menu $mb.file.import
+ $mb.file.import add command \
+ -label "[msgcat::mc {Array}]..." \
+ -command [list ImportDialog array mask]
+ $mb.file.import add command \
+ -label "[msgcat::mc {NRRD}]..." \
+ -command [list ImportDialog nrrd mask]
+
+ EditMenu $mb imask
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ slider $f.slider 0 100 [msgcat::mc {Transparency}] \
+ mask(transparency) [list MaskTransparency]
+
+ grid $f.slider -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command MaskApplyDialog
+ ttk::button $f.clear -text [msgcat::mc {Clear}] -command MaskClear
+ ttk::button $f.close -text [msgcat::mc {Close}] -command MaskDestroyDialog
+ pack $f.apply $f.clear $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+}
+
+proc MaskApplyDialog {} {
+ global mask
+
+ MaskTransparency
+}
+
+proc MaskDestroyDialog {} {
+ global imask
+
+ if {[winfo exists $imask(top)]} {
+ destroy $imask(top)
+ destroy $imask(mb)
+ }
+}
+
+proc UpdateMaskMenu {} {
+ global mask
+ global current
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateMaskMenu"
+ }
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set mask(color) [$current(frame) get mask color]
+ set mask(mark) [$current(frame) get mask mark]
+ set mask(transparency) [$current(frame) get mask transparency]
+
+ switch -- [$current(frame) get type] {
+ base {
+ $ds9(mb).analysis entryconfig \
+ "[msgcat::mc {Mask Parameters}]..." -state normal
+ }
+ 3d -
+ rgb {
+ $ds9(mb).analysis entryconfig \
+ "[msgcat::mc {Mask Parameters}]..." -state disabled
+ }
+ }
+}
+
+proc MaskLoad {} {
+ global current
+ global mask
+
+ set rr [MaskParamsDialog]
+ if {$current(frame) != {}} {
+ if {$rr} {
+ $current(frame) mask color $mask(color)
+ $current(frame) mask mark $mask(mark)
+ }
+ }
+ return $rr
+}
+
+proc MaskParamsDialog {} {
+ global mask
+ global ed
+
+ set w {.mskd}
+
+ set ed(ok) 0
+ set ed(color) $mask(color)
+ set ed(mark) $mask(mark)
+
+ DialogCreate $w [msgcat::mc {Mask Parameters}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.colortitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.colorbutton ed color {}
+ ttk::label $f.marktitle -text [msgcat::mc {Block}]
+ ttk::radiobutton $f.markz -text [msgcat::mc {Zero}] \
+ -variable ed(mark) -value 0
+ ttk::radiobutton $f.marknz -text [msgcat::mc {Non-zero}] \
+ -variable ed(mark) -value 1
+ ttk::label $f.marktitle2 -text [msgcat::mc {Value}]
+
+ grid $f.colortitle $f.colorbutton - -padx 2 -pady 2 -sticky w
+ grid $f.marktitle $f.markz $f.marknz $f.marktitle2 -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set mask(color) [string tolower $ed(color)]
+ set mask(mark) $ed(mark)
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc MaskBackup {ch which} {
+ puts $ch "$which mask color [$which get mask color]"
+ puts $ch "$which mask mark [$which get mask mark]"
+ puts $ch "$which mask transparency [$which get mask transparency]"
+}
+
+proc ProcessMaskCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global mask
+ global current
+
+ set rr {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {MaskDialog}
+ close {MaskDestroyDialog}
+ color {
+ incr i
+ set mask(color) [lindex $var $i]
+ if {$current(frame) != {}} {
+ $current(frame) mask color $mask(color)
+ }
+ }
+ mark {
+ incr i
+ set mask(mark) [lindex $var $i]
+ if {$current(frame) != {}} {
+ $current(frame) mask mark $mask(mark)
+ }
+ }
+ transparency {
+ incr i
+ set mask(transparency) [lindex $var $i]
+ if {$current(frame) != {}} {
+ $current(frame) mask transparency $mask(transparency)
+ }
+ MaskTransparency
+ }
+ clear {
+ MaskClear
+ }
+
+ default {
+ set rr mask
+ incr i -1
+ }
+ }
+
+ return $rr
+}
+
+proc ProcessSendMaskCmd {proc id param} {
+ global mask
+
+ switch -- [string tolower $param] {
+ color {$proc $id "$mask(color)\n"}
+ mark {$proc $id "$mask(mark)\n"}
+ transparency {$proc $id "$mask(transparency)\n"}
+ }
+}
+
diff --git a/ds9/library/mbin.tcl b/ds9/library/mbin.tcl
new file mode 100644
index 0000000..cfdb21d
--- /dev/null
+++ b/ds9/library/mbin.tcl
@@ -0,0 +1,341 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menu
+
+proc BinMainMenu {} {
+ global ds9
+
+ menu $ds9(mb).bin
+ $ds9(mb).bin add radiobutton -label [msgcat::mc {Average}] \
+ -variable bin(function) -value average -command ChangeBinFunction
+ $ds9(mb).bin add radiobutton -label [msgcat::mc {Sum}] \
+ -variable bin(function) -value sum -command ChangeBinFunction
+ $ds9(mb).bin add separator
+ $ds9(mb).bin add command -label [msgcat::mc {Bin In}] \
+ -command {Bin .5 .5}
+ $ds9(mb).bin add command -label [msgcat::mc {Bin Out}] \
+ -command {Bin 2 2}
+ $ds9(mb).bin add command -label [msgcat::mc {Bin Fit}] \
+ -command BinToFit
+ $ds9(mb).bin add separator
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 1" \
+ -variable bin(factor) -value { 1 1 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 2" \
+ -variable bin(factor) -value { 2 2 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 4" \
+ -variable bin(factor) -value { 4 4 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 8" \
+ -variable bin(factor) -value { 8 8 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 16" \
+ -variable bin(factor) -value { 16 16 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 32" \
+ -variable bin(factor) -value { 32 32 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 64" \
+ -variable bin(factor) -value { 64 64 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 128" \
+ -variable bin(factor) -value { 128 128 } -command ChangeBinFactor
+ $ds9(mb).bin add radiobutton -label "[msgcat::mc {Bin}] 256" \
+ -variable bin(factor) -value { 256 256 } -command ChangeBinFactor
+ $ds9(mb).bin add separator
+ $ds9(mb).bin add radiobutton -label {128x128} \
+ -variable bin(buffersize) -value 128 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {256x256} \
+ -variable bin(buffersize) -value 256 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {512x512} \
+ -variable bin(buffersize) -value 512 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {1024x1024} \
+ -variable bin(buffersize) -value 1024 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {2048x2048} \
+ -variable bin(buffersize) -value 2048 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {4096x4096} \
+ -variable bin(buffersize) -value 4096 -command ChangeBinBufferSize
+ $ds9(mb).bin add radiobutton -label {8192x8192} \
+ -variable bin(buffersize) -value 8192 -command ChangeBinBufferSize
+ $ds9(mb).bin add separator
+ $ds9(mb).bin add command -label "[msgcat::mc {Binning Parameters}]..." \
+ -command BinDialog
+}
+
+proc PrefsDialogBinMenu {w} {
+ set f [ttk::labelframe $w.mbin -text [msgcat::mc {Bin}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarBin $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {Average}] \
+ -variable pbin(function) -value average
+ $m add radiobutton -label [msgcat::mc {Sum}] \
+ -variable pbin(function) -value sum
+ $m add separator
+ $m add radiobutton -label "[msgcat::mc {Bin}] 1" \
+ -variable pbin(factor) -value { 1 1 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 2" \
+ -variable pbin(factor) -value { 2 2 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 4" \
+ -variable pbin(factor) -value { 4 4 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 8" \
+ -variable pbin(factor) -value { 8 8 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 16" \
+ -variable pbin(factor) -value { 16 16 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 32" \
+ -variable pbin(factor) -value { 32 32 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 64" \
+ -variable pbin(factor) -value { 64 64 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 128" \
+ -variable pbin(factor) -value { 128 128 }
+ $m add radiobutton -label "[msgcat::mc {Bin}] 256" \
+ -variable pbin(factor) -value { 256 256 }
+ $m add separator
+ $m add radiobutton -label {128x128} -variable pbin(buffersize) -value 128
+ $m add radiobutton -label {256x256} -variable pbin(buffersize) -value 256
+ $m add radiobutton -label {512x512} -variable pbin(buffersize) -value 512
+ $m add radiobutton -label {1024x1204} -variable pbin(buffersize) -value 1024
+ $m add radiobutton -label {2048x2048} -variable pbin(buffersize) -value 2048
+ $m add radiobutton -label {4096x4096} -variable pbin(buffersize) -value 4096
+ $m add radiobutton -label {8192x8192} -variable pbin(buffersize) -value 8192
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogBin {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Bin}]
+ lappend dprefs(tabs) [ttk::frame $w.bin]
+
+ # Mouse
+ set f [ttk::labelframe $w.bin.mouse -text [msgcat::mc {Mouse Wheel Bin}]]
+
+ ttk::checkbutton $f.click -text [msgcat::mc {Enable}] \
+ -variable pbin(wheel)
+ ttk::label $f.title2 -text [msgcat::mc {Factor}]
+ ttk::entry $f.factor -textvariable pbin(wheel,factor) -width 10
+
+ grid $f.click $f.title2 $f.factor -padx 2 -pady 2 -sticky w
+
+ pack $w.bin.mouse -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsBinDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ bin,average 0
+ bin,sum 0
+ bin,in 1
+ bin,out 1
+ bin,fit 1
+ bin,1 1
+ bin,2 1
+ bin,4 1
+ bin,8 1
+ bin,16 1
+ bin,32 1
+ bin,64 1
+ bin,128 0
+ bin,256 0
+ bin,128x 0
+ bin,256x 0
+ bin,512x 0
+ bin,1024x 0
+ bin,2048x 0
+ bin,4096x 0
+ bin,8192x 0
+ bin,params 0
+ }
+}
+
+proc CreateButtonsBin {} {
+ global buttons
+ global ds9
+
+ ttk::frame $ds9(buttons).bin
+
+ RadioButton $ds9(buttons).bin.average \
+ [string tolower [msgcat::mc {Average}]] \
+ bin(function) average ChangeBinFunction
+ RadioButton $ds9(buttons).bin.sum \
+ [string tolower [msgcat::mc {Sum}]] \
+ bin(function) sum ChangeBinFunction
+
+ ButtonButton $ds9(buttons).bin.in \
+ [string tolower [msgcat::mc {Bin In}]] {Bin .5 .5}
+ ButtonButton $ds9(buttons).bin.out \
+ [string tolower [msgcat::mc {Bin Out}]] {Bin 2 2}
+ ButtonButton $ds9(buttons).bin.fit \
+ [string tolower [msgcat::mc {Bin Fit}]] BinToFit
+
+ RadioButton $ds9(buttons).bin.1 \
+ "[string tolower [msgcat::mc {Bin}]] 1" \
+ bin(factor) { 1 1 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.2 \
+ "[string tolower [msgcat::mc {Bin}]] 2" \
+ bin(factor) { 2 2 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.4 \
+ "[string tolower [msgcat::mc {Bin}]] 4" \
+ bin(factor) { 4 4 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.8 \
+ "[string tolower [msgcat::mc {Bin}]] 8" \
+ bin(factor) { 8 8 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.16 \
+ "[string tolower [msgcat::mc {Bin}]] 16" \
+ bin(factor) { 16 16 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.32 \
+ "[string tolower [msgcat::mc {Bin}]] 32" \
+ bin(factor) { 32 32 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.64 \
+ "[string tolower [msgcat::mc {Bin}]] 64" \
+ bin(factor) { 64 64 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.128 \
+ "[string tolower [msgcat::mc {Bin}]] 128" \
+ bin(factor) { 128 128 } ChangeBinFactor
+ RadioButton $ds9(buttons).bin.256 \
+ "[string tolower [msgcat::mc {Bin}]] 256" \
+ bin(factor) { 256 256 } ChangeBinFactor
+
+ RadioButton $ds9(buttons).bin.128x {128x128} \
+ bin(buffersize) 128 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.256x {256x256} \
+ bin(buffersize) 256 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.512x {512x512} \
+ bin(buffersize) 512 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.1024x {1024x1024} \
+ bin(buffersize) 1024 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.2048x {2048x2048} \
+ bin(buffersize) 2048 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.4096x {4096x4096} \
+ bin(buffersize) 4096 ChangeBinBufferSize
+ RadioButton $ds9(buttons).bin.8192x {8192x8192} \
+ bin(buffersize) 8192 ChangeBinBufferSize
+
+ ButtonButton $ds9(buttons).bin.params \
+ [string tolower [msgcat::mc {Parameters}]] BinDialog
+
+ set buttons(bin) "
+ $ds9(buttons).bin.average pbuttons(bin,average)
+ $ds9(buttons).bin.sum pbuttons(bin,sum)
+ $ds9(buttons).bin.in pbuttons(bin,in)
+ $ds9(buttons).bin.out pbuttons(bin,out)
+ $ds9(buttons).bin.fit pbuttons(bin,fit)
+ $ds9(buttons).bin.1 pbuttons(bin,1)
+ $ds9(buttons).bin.2 pbuttons(bin,2)
+ $ds9(buttons).bin.4 pbuttons(bin,4)
+ $ds9(buttons).bin.8 pbuttons(bin,8)
+ $ds9(buttons).bin.16 pbuttons(bin,16)
+ $ds9(buttons).bin.32 pbuttons(bin,32)
+ $ds9(buttons).bin.64 pbuttons(bin,64)
+ $ds9(buttons).bin.128 pbuttons(bin,128)
+ $ds9(buttons).bin.256 pbuttons(bin,256)
+ $ds9(buttons).bin.128x pbuttons(bin,128x)
+ $ds9(buttons).bin.256x pbuttons(bin,256x)
+ $ds9(buttons).bin.512x pbuttons(bin,512x)
+ $ds9(buttons).bin.1024x pbuttons(bin,1024x)
+ $ds9(buttons).bin.2048x pbuttons(bin,2048x)
+ $ds9(buttons).bin.4096x pbuttons(bin,4096x)
+ $ds9(buttons).bin.8192x pbuttons(bin,8192x)
+ $ds9(buttons).bin.params pbuttons(bin,params)
+ "
+}
+
+proc PrefsDialogButtonbarBin {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Average}] \
+ -variable pbuttons(bin,average) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label [msgcat::mc {Sum}] \
+ -variable pbuttons(bin,sum) -command {UpdateButtons buttons(bin)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Bin In}] \
+ -variable pbuttons(bin,in) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label [msgcat::mc {Bin Out}] \
+ -variable pbuttons(bin,out) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label [msgcat::mc {Bin Fit}] \
+ -variable pbuttons(bin,fit) -command {UpdateButtons buttons(bin)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Bin}] 1" \
+ -variable pbuttons(bin,1) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 2" \
+ -variable pbuttons(bin,2) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 4" \
+ -variable pbuttons(bin,4) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 8" \
+ -variable pbuttons(bin,8) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 16" \
+ -variable pbuttons(bin,16) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 32" \
+ -variable pbuttons(bin,32) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 64" \
+ -variable pbuttons(bin,64) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 128" \
+ -variable pbuttons(bin,128) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label "[msgcat::mc {Bin}] 256" \
+ -variable pbuttons(bin,256) -command {UpdateButtons buttons(bin)}
+ $m add separator
+ $m add checkbutton -label {128x128} \
+ -variable pbuttons(bin,128x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {256x256} \
+ -variable pbuttons(bin,256x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {512x512} \
+ -variable pbuttons(bin,512x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {1024x1204} \
+ -variable pbuttons(bin,1024x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {2048x2048} \
+ -variable pbuttons(bin,2048x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {4096x4096} \
+ -variable pbuttons(bin,4096x) -command {UpdateButtons buttons(bin)}
+ $m add checkbutton -label {8192x8192} \
+ -variable pbuttons(bin,8192x) -command {UpdateButtons buttons(bin)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Binning Parameters}]..." \
+ -variable pbuttons(bin,params) -command {UpdateButtons buttons(bin)}
+}
+
+# Support
+
+proc UpdateBinMenu {} {
+ global ds9
+ global current
+ global bin
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateBinMenu"
+ }
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ if {[$current(frame) has fits bin]} {
+ $ds9(mb) entryconfig [msgcat::mc {Bin}] -state normal
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Bin}] -state disabled
+ }
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Bin}] -state normal
+ }
+
+ set bin(function) [$current(frame) get bin function]
+ set bin(factor) "[$current(frame) get bin factor]"
+ set bin(depth) [$current(frame) get bin depth]
+ set bin(buffersize) [$current(frame) get bin buffer size]
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Bin}] -state disabled
+ }
+}
+
diff --git a/ds9/library/mcolor.tcl b/ds9/library/mcolor.tcl
new file mode 100644
index 0000000..782b451
--- /dev/null
+++ b/ds9/library/mcolor.tcl
@@ -0,0 +1,498 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+# Default colormap names
+# [msgcat::mc {grey}]
+# [msgcat::mc {red}]
+# [msgcat::mc {green}]
+# [msgcat::mc {blue}]
+# [msgcat::mc {heat}]
+# [msgcat::mc {cool}]
+# [msgcat::mc {rainbow}]
+# [msgcat::mc {standard}]
+# [msgcat::mc {staircase}]
+# [msgcat::mc {color}]
+
+proc ColorMainMenu {} {
+ global colorbar
+ global icolorbar
+ global ds9
+
+ menu $ds9(mb).color
+
+ set id [colorbar list id]
+ # base
+ foreach jj $id {
+ set name [colorbar get name $jj]
+ $ds9(mb).color add radiobutton \
+ -label [msgcat::mc $name] \
+ -variable colorbar(map) -value $name \
+ -command "ChangeColormapID $jj"
+ incr icolorbar(count)
+ }
+
+ set icolorbar(end) $icolorbar(count)
+ set icolorbar(h5) $icolorbar(count)
+ set icolorbar(matplotlib) $icolorbar(count)
+ set icolorbar(cubehelix) $icolorbar(count)
+ set icolorbar(gist) $icolorbar(count)
+ set icolorbar(topo) $icolorbar(count)
+ set icolorbar(user) $icolorbar(count)
+
+ $ds9(mb).color add separator
+ $ds9(mb).color add cascade -label [msgcat::mc {h5utils}] \
+ -menu $ds9(mb).color.h5
+ $ds9(mb).color add cascade -label [msgcat::mc {Matplotlib}] \
+ -menu $ds9(mb).color.matplotlib
+ $ds9(mb).color add cascade -label [msgcat::mc {Cubehelix}] \
+ -menu $ds9(mb).color.cubehelix
+ $ds9(mb).color add cascade -label [msgcat::mc {Gist}] \
+ -menu $ds9(mb).color.gist
+ $ds9(mb).color add cascade -label [msgcat::mc {Topographic}] \
+ -menu $ds9(mb).color.topo
+ $ds9(mb).color add cascade -label [msgcat::mc {User}] \
+ -menu $ds9(mb).color.user
+ $ds9(mb).color add separator
+ $ds9(mb).color add checkbutton -label [msgcat::mc {Invert Colormap}] \
+ -variable colorbar(invert) -command InvertColorbar
+ $ds9(mb).color add command -label [msgcat::mc {Reset Colormap}] \
+ -command ResetColormap
+ $ds9(mb).color add separator
+ $ds9(mb).color add cascade -label [msgcat::mc {Colorbar}] \
+ -menu $ds9(mb).color.colorbar
+ $ds9(mb).color add separator
+ $ds9(mb).color add command -label "[msgcat::mc {Colormap Parameters}]..." \
+ -command ColormapDialog
+
+ menu $ds9(mb).color.h5
+ menu $ds9(mb).color.matplotlib
+ menu $ds9(mb).color.cubehelix
+ menu $ds9(mb).color.gist
+ menu $ds9(mb).color.topo
+ menu $ds9(mb).color.user
+
+ menu $ds9(mb).color.colorbar
+ $ds9(mb).color.colorbar add cascade -label [msgcat::mc {Orientation}] \
+ -menu $ds9(mb).color.colorbar.orient
+ $ds9(mb).color.colorbar add cascade -label [msgcat::mc {Numerics}] \
+ -menu $ds9(mb).color.colorbar.numerics
+ $ds9(mb).color.colorbar add cascade -label [msgcat::mc {Font}] \
+ -menu $ds9(mb).color.colorbar.cb
+ $ds9(mb).color.colorbar add separator
+ $ds9(mb).color.colorbar add command \
+ -label "[msgcat::mc {Size}]..." \
+ -command ColorbarSizeDialog
+ $ds9(mb).color.colorbar add command \
+ -label "[msgcat::mc {Number of Ticks}]..." \
+ -command TicksDialog
+
+ menu $ds9(mb).color.colorbar.orient
+ $ds9(mb).color.colorbar.orient add radiobutton \
+ -label [msgcat::mc {Horizontal}] -variable colorbar(orientation) \
+ -value horizontal -command UpdateView
+ $ds9(mb).color.colorbar.orient add radiobutton \
+ -label [msgcat::mc {Vertical}] -variable colorbar(orientation) \
+ -value vertical -command UpdateView
+
+ menu $ds9(mb).color.colorbar.numerics
+ $ds9(mb).color.colorbar.numerics add checkbutton \
+ -label [msgcat::mc {Show}] -variable colorbar(numerics) \
+ -command UpdateView
+ $ds9(mb).color.colorbar.numerics add separator
+ $ds9(mb).color.colorbar.numerics add radiobutton \
+ -label [msgcat::mc {Space Equal Value}] -variable colorbar(space) \
+ -value 1 -command UpdateView
+ $ds9(mb).color.colorbar.numerics add radiobutton \
+ -label [msgcat::mc {Space Equal Distance}] -variable colorbar(space) \
+ -value 0 -command UpdateView
+
+ FontMenu $ds9(mb).color.colorbar.cb colorbar font font,size font,weight \
+ font,slant UpdateView
+
+ CreateExColorMenu h5
+ CreateExColorMenu matplotlib
+ CreateExColorMenu cubehelix
+ CreateExColorMenu gist
+ CreateExColorMenu topo
+ CreateExColorMenu user
+}
+
+proc CreateExColorMenu {which} {
+ global ds9
+ global icolorbar
+
+ # save start location
+ set icolorbar($which) $icolorbar(count)
+
+ foreach fn $icolorbar($which,fn) {
+ if {[lindex $fn 0] == {-}} {
+ $ds9(mb).color.$which add separator
+ } else {
+ set ch [open "$ds9(root)/cmaps/$fn" r]
+ global vardata
+ set vardata [read $ch]
+ close $ch
+
+ colorbar load var "\{$fn\}" vardata
+ set id [colorbar get id]
+ set map [colorbar get name]
+ incr icolorbar(count)
+
+ $ds9(mb).color.$which add radiobutton \
+ -label "$map" \
+ -variable colorbar(map) \
+ -command [list ChangeColormapID $id]
+ }
+ }
+}
+
+proc PrefsDialogColorMenu {w} {
+ global colorbar
+ global icolorbar
+ global pcolorbar
+
+ set f [ttk::labelframe $w.mcolor -text [msgcat::mc {Color}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarColor $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2 -sticky w
+
+ set m $f.menu.menu
+ menu $m
+
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ $m add radiobutton -label [msgcat::mc $name] \
+ -variable pcolorbar(map) -value $name
+ }
+
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Invert Colormap}] \
+ -variable pcolorbar(invert)
+ $m add separator
+ $m add cascade -label [msgcat::mc {Colorbar}] -menu $m.colorbar
+
+ menu $m.colorbar
+ $m.colorbar add cascade -label [msgcat::mc {Orientation}] \
+ -menu $m.colorbar.orient
+ $m.colorbar add cascade -label [msgcat::mc {Numerics}] \
+ -menu $m.colorbar.numerics
+ $m.colorbar add cascade -label [msgcat::mc {Font}] \
+ -menu $m.colorbar.cb
+
+ menu $m.colorbar.orient
+ $m.colorbar.orient add radiobutton -label [msgcat::mc {Horizontal}] \
+ -variable pcolorbar(orientation) -value horizontal
+ $m.colorbar.orient add radiobutton -label [msgcat::mc {Vertical}] \
+ -variable pcolorbar(orientation) -value vertical
+
+ menu $m.colorbar.numerics
+ $m.colorbar.numerics add checkbutton -label [msgcat::mc {Show}] \
+ -variable pcolorbar(numerics)
+ $m.colorbar.numerics add separator
+ $m.colorbar.numerics add radiobutton \
+ -label [msgcat::mc {Space Equal Value}] \
+ -variable pcolorbar(space) -value 1
+ $m.colorbar.numerics add radiobutton \
+ -label [msgcat::mc {Space Equal Distance}] \
+ -variable pcolorbar(space) -value 0
+
+ FontMenu $m.colorbar.cb pcolorbar font font,size font,weight \
+ font,slant {}
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogColor {} {
+ global dprefs
+ global colorbar
+ global icolorbar
+ global pcolorbar
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Color}]
+ lappend dprefs(tabs) [ttk::frame $w.color]
+
+ set f [ttk::labelframe $w.color.colorbar -text [msgcat::mc {Colorbar}]]
+
+ ttk::label $f.tsize -text [msgcat::mc {Colorbar Size}]
+ ttk::entry $f.size -textvariable pcolorbar(size) -width 10
+
+ ttk::label $f.tticks -text [msgcat::mc {Number of Ticks}]
+ ttk::entry $f.ticks -textvariable pcolorbar(ticks) -width 10
+
+ ttk::label $f.tcolor -text [msgcat::mc {Tag Color}]
+ ColorMenuButton $f.color pcolorbar tag {}
+
+ grid $f.tsize $f.size -padx 2 -pady 2 -sticky w
+ grid $f.tticks $f.ticks -padx 2 -pady 2 -sticky w
+ grid $f.tcolor $f.color -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsColorDef {} {
+ global pbuttons
+
+ # we have a chicken or the egg problem
+ # the colorbar has not been defined yet, but we must define vars
+ # before prefs are processed, so hard code all default cmaps
+ array set pbuttons {
+ color,grey 1
+ color,red 0
+ color,green 0
+ color,blue 0
+ color,a 1
+ color,b 1
+ color,bb 1
+ color,he 1
+ color,i8 1
+ color,aips0 1
+ color,sls 0
+ color,hsv 0
+ color,heat 1
+ color,cool 1
+ color,rainbow 1
+ color,standard 0
+ color,staircase 0
+ color,color 0
+ color,invert 0
+ color,reset 0
+ color,horz 0
+ color,vert 0
+ color,numerics 0
+ color,numvalue 0
+ color,numspace 0
+ color,params 0
+ }
+}
+
+proc CreateButtonsColor {} {
+ global buttons
+ global ds9
+ global colorbar
+ global icolorbar
+
+ ttk::frame $ds9(buttons).color
+
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ RadioButton $ds9(buttons).color.$name [msgcat::mc $name] \
+ colorbar(map) $name "ChangeColormapID $jj"
+ }
+
+ CheckButton $ds9(buttons).color.invert \
+ [string tolower [msgcat::mc {Invert}]] colorbar(invert) InvertColorbar
+ ButtonButton $ds9(buttons).color.reset \
+ [string tolower [msgcat::mc {Reset}]] ResetColormap
+ RadioButton $ds9(buttons).color.horz \
+ [string tolower [msgcat::mc {Horizontal}]] \
+ colorbar(orientation) horizontal UpdateView
+ RadioButton $ds9(buttons).color.vert \
+ [string tolower [msgcat::mc {Vertical}]] \
+ colorbar(orientation) vertical UpdateView
+ CheckButton $ds9(buttons).color.numerics \
+ [string tolower [msgcat::mc {Numerics}]] \
+ colorbar(numerics) UpdateView
+ RadioButton $ds9(buttons).color.numvalue \
+ [string tolower [msgcat::mc {Value}]] \
+ colorbar(space) 1 UpdateView
+ RadioButton $ds9(buttons).color.numspace \
+ [string tolower [msgcat::mc {Distance}]] \
+ colorbar(space) 0 UpdateView
+
+ ButtonButton $ds9(buttons).color.params \
+ [string tolower [msgcat::mc {Parameters}]] ColormapDialog
+
+ set buttons(color) {}
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ append buttons(color) "$ds9(buttons).color.$name pbuttons(color,$name) "
+ }
+
+ append buttons(color) "$ds9(buttons).color.invert pbuttons(color,invert) "
+ append buttons(color) "$ds9(buttons).color.reset pbuttons(color,reset) "
+ append buttons(color) "$ds9(buttons).color.horz pbuttons(color,horz) "
+ append buttons(color) "$ds9(buttons).color.vert pbuttons(color,vert) "
+ append buttons(color) "$ds9(buttons).color.numerics pbuttons(color,numerics) "
+ append buttons(color) "$ds9(buttons).color.numvalue pbuttons(color,numvalue) "
+ append buttons(color) "$ds9(buttons).color.numspace pbuttons(color,numspace) "
+ append buttons(color) "$ds9(buttons).color.params pbuttons(color,params) "
+}
+
+proc PrefsDialogButtonbarColor {f} {
+ global icolorbar
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ $m add checkbutton -label [msgcat::mc $name] \
+ -variable pbuttons(color,$name) \
+ -command {UpdateButtons buttons(color)}
+ }
+
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Invert Colormap}] \
+ -variable pbuttons(color,invert) \
+ -command {UpdateButtons buttons(color)}
+ $m add checkbutton -label [msgcat::mc {Reset Colormap}] \
+ -variable pbuttons(color,reset) \
+ -command {UpdateButtons buttons(color)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {Colorbar}] -menu $m.colorbar
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Colormap Parameters}]..." \
+ -variable pbuttons(color,params) \
+ -command {UpdateButtons buttons(color)}
+
+ menu $m.colorbar
+ $m.colorbar add cascade -label [msgcat::mc {Orientation}] \
+ -menu $m.colorbar.orient
+ $m.colorbar add cascade -label [msgcat::mc {Numerics}] \
+ -menu $m.colorbar.numerics
+
+ menu $m.colorbar.orient
+ $m.colorbar.orient add checkbutton -label [msgcat::mc {Horizontal}] \
+ -variable pbuttons(color,horz) \
+ -command {UpdateButtons buttons(color)}
+ $m.colorbar.orient add checkbutton -label [msgcat::mc {Vertical}] \
+ -variable pbuttons(color,vert) \
+ -command {UpdateButtons buttons(color)}
+
+ menu $m.colorbar.numerics
+ $m.colorbar.numerics add checkbutton -label [msgcat::mc {Show}] \
+ -variable pbuttons(color,numerics) \
+ -command {UpdateButtons buttons(color)}
+ $m.colorbar.numerics add separator
+ $m.colorbar.numerics add checkbutton -label [msgcat::mc {Equal Value}] \
+ -variable pbuttons(color,numvalue) \
+ -command {UpdateButtons buttons(color)}
+ $m.colorbar.numerics add checkbutton -label [msgcat::mc {Equal Spacing}] \
+ -variable pbuttons(color,numspace) \
+ -command {UpdateButtons buttons(color)}
+}
+
+# Support
+
+proc UpdateColorMenu {} {
+ global icolorbar
+ global ds9
+ global current
+ global buttons
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateColorMenu"
+ }
+
+ set end [expr $icolorbar(end)+$icolorbar(start)]
+ if {$current(frame) != {}} {
+ switch [$current(frame) get type] {
+ base -
+ 3d {
+ # menus
+ # base
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $ds9(mb).color entryconfig $ii -state normal
+ }
+ $ds9(mb).color entryconfig [msgcat::mc {h5utils}] \
+ -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Matplotlib}] \
+ -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Cubehelix}] \
+ -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Gist}] \
+ -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Topographic}] \
+ -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {User}] \
+ -state normal
+
+ # buttons
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ $ds9(buttons).color.$name configure -state normal
+ }
+ }
+ rgb {
+ # menus
+ # base
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $ds9(mb).color entryconfig $ii -state disabled
+ }
+ $ds9(mb).color entryconfig [msgcat::mc {h5utils}] \
+ -state disabled
+ $ds9(mb).color entryconfig [msgcat::mc {Matplotlib}] \
+ -state disabled
+ $ds9(mb).color entryconfig [msgcat::mc {Cubehelix}] \
+ -state disabled
+ $ds9(mb).color entryconfig [msgcat::mc {Gist}] \
+ -state disabled
+ $ds9(mb).color entryconfig [msgcat::mc {Topographic}] \
+ -state disabled
+ $ds9(mb).color entryconfig [msgcat::mc {User}] \
+ -state disable
+
+ # buttons
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ $ds9(buttons).color.$name configure -state disabled
+ }
+ }
+ }
+ } else {
+ # menus
+ # base
+ for {set ii $icolorbar(start)} {$ii<$end} {incr ii} {
+ $ds9(mb).color entryconfig $ii -state normal
+ }
+ $ds9(mb).color entryconfig [msgcat::mc {h5utils}] -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Matplotlib}] -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Cubehelix}] -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Gist}] -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {Topographic}] -state normal
+ $ds9(mb).color entryconfig [msgcat::mc {User}] -state normal
+
+ # buttons
+ set id [colorbar list id]
+ # base
+ for {set ii 0} {$ii<$icolorbar(end)} {incr ii} {
+ set jj [lindex $id $ii]
+ set name [colorbar get name $jj]
+ $ds9(buttons).color.$name configure -state normal
+ }
+ }
+}
diff --git a/ds9/library/mecube.tcl b/ds9/library/mecube.tcl
new file mode 100644
index 0000000..824497a
--- /dev/null
+++ b/ds9/library/mecube.tcl
@@ -0,0 +1,133 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMECubeFile {fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {ext cube}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMECubeAlloc {path fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {ext cube}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc LoadMECubeSocket {sock fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {ext cube}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ return [ProcessLoad 0]
+}
+
+proc SaveMECubeFile {fn} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits ext cube file "\{$fn\}"
+}
+
+proc SaveMECubeSocket {sock} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits ext cube socket $sock
+}
+
+proc ProcessMECubeCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMECubeSocket $sock $param]} {
+ InitError xpa
+ LoadMECubeFile $param
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMECubeAlloc $fn $param
+ } else {
+ LoadMECubeFile $param
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendMECubeCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {$sock != {}} {
+ # xpa
+ SaveMECubeSocket $sock
+ } elseif {$fn != {}} {
+ # comm
+ SaveMECubeFile $fn
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/medit.tcl b/ds9/library/medit.tcl
new file mode 100644
index 0000000..7177e17
--- /dev/null
+++ b/ds9/library/medit.tcl
@@ -0,0 +1,321 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc EditMainMenu {} {
+ global ds9
+ global current
+
+ menu $ds9(mb).edit
+ $ds9(mb).edit add command -label [msgcat::mc {Undo}] -command UndoFrame \
+ -accelerator "${ds9(ctrl)}Z"
+ $ds9(mb).edit add separator
+ $ds9(mb).edit add command -label [msgcat::mc {Cut}] -command CutFrame \
+ -accelerator "${ds9(ctrl)}X"
+ $ds9(mb).edit add command -label [msgcat::mc {Copy}] -command CopyFrame \
+ -accelerator "${ds9(ctrl)}C"
+ $ds9(mb).edit add command -label [msgcat::mc {Paste}] -command PasteFrame \
+ -accelerator "${ds9(ctrl)}V"
+ $ds9(mb).edit add separator
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {None}] \
+ -variable current(mode) -value none -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Region}] \
+ -variable current(mode) -value region -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Crosshair}] \
+ -variable current(mode) -value crosshair -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Colorbar}] \
+ -variable current(mode) -value colorbar -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Pan}] \
+ -variable current(mode) -value pan -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Zoom}] \
+ -variable current(mode) -value zoom -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Rotate}] \
+ -variable current(mode) -value rotate -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Crop}] \
+ -variable current(mode) -value crop -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Catalog}] \
+ -variable current(mode) -value catalog -command ChangeMode
+# IME
+# $ds9(mb).edit add radiobutton -label [msgcat::mc {Analysis}]
+# -variable current(mode) -value analysis -command ChangeMode
+ $ds9(mb).edit add radiobutton -label [msgcat::mc {Examine}] \
+ -variable current(mode) -value examine -command ChangeMode
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(mb).edit add separator
+ $ds9(mb).edit add command -label "[msgcat::mc {Preferences}]..." \
+ -command PrefsDialog
+ }
+ aqua {}
+ }
+
+ # Bindings
+ bind $ds9(top) <<Undo>> UndoFrame
+ bind $ds9(top) <<Cut>> CutFrame
+ bind $ds9(top) <<Copy>> CopyFrame
+ bind $ds9(top) <<Paste>> PasteFrame
+}
+
+proc PrefsDialogEditMenu {w} {
+ global ds9
+
+ set f [ttk::labelframe $w.medit -text [msgcat::mc {Edit}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarEdit $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {None}] \
+ -variable pcurrent(mode) -value none
+ $m add radiobutton -label [msgcat::mc {Region}] \
+ -variable pcurrent(mode) -value region
+ $m add radiobutton -label [msgcat::mc {Crosshair}] \
+ -variable pcurrent(mode) -value crosshair
+ $m add radiobutton -label [msgcat::mc {Colorbar}] \
+ -variable pcurrent(mode) -value colorbar
+ $m add radiobutton -label [msgcat::mc {Pan}] \
+ -variable pcurrent(mode) -value pan
+ $m add radiobutton -label [msgcat::mc {Zoom}] \
+ -variable pcurrent(mode) -value zoom
+ $m add radiobutton -label [msgcat::mc {Rotate}] \
+ -variable pcurrent(mode) -value rotate
+ $m add radiobutton -label [msgcat::mc {Crop}] \
+ -variable pcurrent(mode) -value crop
+ $m add radiobutton -label [msgcat::mc {Catalog}] \
+ -variable pcurrent(mode) -value catalog
+# IME
+# $m add radiobutton -label [msgcat::mc {Analysis}]
+# -variable pcurrent(mode) -value analysis
+ $m add radiobutton -label [msgcat::mc {Examine}] \
+ -variable pcurrent(mode) -value examine
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsEditDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ edit,undo 0
+ edit,cut 0
+ edit,copy 0
+ edit,paste 0
+ edit,none 1
+ edit,region 1
+ edit,crosshair 1
+ edit,colorbar 1
+ edit,pan 1
+ edit,zoom 1
+ edit,rotate 1
+ edit,crop 1
+ edit,catalog 1
+ edit,examine 1
+ edit,prefs 0
+ }
+# IME
+# edit,analysis 1
+}
+
+proc CreateButtonsEdit {} {
+ global buttons
+ global ds9
+ global current
+
+ ttk::frame $ds9(buttons).edit
+
+ ButtonButton $ds9(buttons).edit.undo \
+ [string tolower [msgcat::mc {Undo}]] UndoFrame
+ ButtonButton $ds9(buttons).edit.cut \
+ [string tolower [msgcat::mc {Cut}]] CutFrame
+ ButtonButton $ds9(buttons).edit.copy \
+ [string tolower [msgcat::mc {Copy}]] CopyFrame
+ ButtonButton $ds9(buttons).edit.paste \
+ [string tolower [msgcat::mc {Paste}]] PasteFrame
+
+ RadioButton $ds9(buttons).edit.none \
+ [string tolower [msgcat::mc {None}]] \
+ current(mode) none ChangeMode
+ RadioButton $ds9(buttons).edit.region \
+ [string tolower [msgcat::mc {Region}]] \
+ current(mode) region ChangeMode
+ RadioButton $ds9(buttons).edit.crosshair \
+ [string tolower [msgcat::mc {Cross}]] \
+ current(mode) crosshair ChangeMode
+ RadioButton $ds9(buttons).edit.colorbar \
+ [string tolower [msgcat::mc {Colorbar}]] \
+ current(mode) colorbar ChangeMode
+ RadioButton $ds9(buttons).edit.pan \
+ [string tolower [msgcat::mc {Pan}]] \
+ current(mode) pan ChangeMode
+ RadioButton $ds9(buttons).edit.zoom \
+ [string tolower [msgcat::mc {Zoom}]] \
+ current(mode) zoom ChangeMode
+ RadioButton $ds9(buttons).edit.rotate \
+ [string tolower [msgcat::mc {Rotate}]] \
+ current(mode) rotate ChangeMode
+ RadioButton $ds9(buttons).edit.crop \
+ [string tolower [msgcat::mc {Crop}]] \
+ current(mode) crop ChangeMode
+ RadioButton $ds9(buttons).edit.catalog \
+ [string tolower [msgcat::mc {Cat}]] \
+ current(mode) catalog ChangeMode
+# IME
+# RadioButton $ds9(buttons).edit.analysis
+# [string tolower [msgcat::mc {Analysis}]]
+# current(mode) analysis ChangeMode
+ RadioButton $ds9(buttons).edit.examine \
+ [string tolower [msgcat::mc {Exam}]] \
+ current(mode) examine ChangeMode
+
+ ButtonButton $ds9(buttons).edit.prefs \
+ [string tolower [msgcat::mc {Preferences}]] PrefsDialog
+
+ set buttons(edit) "
+ $ds9(buttons).edit.undo pbuttons(edit,undo)
+ $ds9(buttons).edit.cut pbuttons(edit,cut)
+ $ds9(buttons).edit.copy pbuttons(edit,copy)
+ $ds9(buttons).edit.paste pbuttons(edit,paste)
+ $ds9(buttons).edit.none pbuttons(edit,none)
+ $ds9(buttons).edit.region pbuttons(edit,region)
+ $ds9(buttons).edit.crosshair pbuttons(edit,crosshair)
+ $ds9(buttons).edit.colorbar pbuttons(edit,colorbar)
+ $ds9(buttons).edit.pan pbuttons(edit,pan)
+ $ds9(buttons).edit.zoom pbuttons(edit,zoom)
+ $ds9(buttons).edit.rotate pbuttons(edit,rotate)
+ $ds9(buttons).edit.crop pbuttons(edit,crop)
+ $ds9(buttons).edit.catalog pbuttons(edit,catalog)
+ $ds9(buttons).edit.examine pbuttons(edit,examine)
+ $ds9(buttons).edit.prefs pbuttons(edit,prefs)
+ "
+# IME
+# $ds9(buttons).edit.analysis pbuttons(edit,analysis)
+}
+
+proc PrefsDialogButtonbarEdit {f} {
+ global ds9
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Undo}] \
+ -variable pbuttons(edit,undo) -command {UpdateButtons buttons(edit)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Cut}] \
+ -variable pbuttons(edit,cut) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Copy}] \
+ -variable pbuttons(edit,copy) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Paste}] \
+ -variable pbuttons(edit,paste) -command {UpdateButtons buttons(edit)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(edit,none) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Region}] \
+ -variable pbuttons(edit,region) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Crosshair}] \
+ -variable pbuttons(edit,crosshair) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable pbuttons(edit,colorbar) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Pan}] \
+ -variable pbuttons(edit,pan) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Zoom}] \
+ -variable pbuttons(edit,zoom) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Rotate}] \
+ -variable pbuttons(edit,rotate) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Crop}] \
+ -variable pbuttons(edit,crop) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Catalog}] \
+ -variable pbuttons(edit,catalog) -command {UpdateButtons buttons(edit)}
+# IME
+# $m add checkbutton -label [msgcat::mc {Analysis}]
+# -variable pbuttons(edit,analysis) -command {UpdateButtons buttons(edit)}
+ $m add checkbutton -label [msgcat::mc {Examine}] \
+ -variable pbuttons(edit,examine) -command {UpdateButtons buttons(edit)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Preferences}] \
+ -variable pbuttons(edit,prefs) -command {UpdateButtons buttons(edit)}
+}
+
+# Support
+
+proc UpdateEditMenu {} {
+ global ds9
+ global current
+ global marker
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateEditMenu"
+ }
+
+ switch -- $current(mode) {
+ pointer -
+ region {
+ if {$current(frame) != {}} {
+ set l [$current(frame) has marker undo]
+ if {$l != {}} {
+ $ds9(mb).edit entryconfig [msgcat::mc {Undo}] \
+ -state normal
+ } else {
+ $ds9(mb).edit entryconfig [msgcat::mc {Undo}] \
+ -state disabled
+ }
+
+ if {[$current(frame) has marker select]} {
+ $ds9(mb).edit entryconfig [msgcat::mc {Cut}] \
+ -state normal
+ $ds9(mb).edit entryconfig [msgcat::mc {Copy}] \
+ -state normal
+ } else {
+ $ds9(mb).edit entryconfig [msgcat::mc {Cut}] \
+ -state disabled
+ $ds9(mb).edit entryconfig [msgcat::mc {Copy}] \
+ -state disabled
+ }
+
+ if {$marker(copy) != {} } {
+ if {[$marker(copy) has marker paste]} {
+ $ds9(mb).edit entryconfig [msgcat::mc {Paste}] \
+ -state normal
+ } else {
+ $ds9(mb).edit entryconfig [msgcat::mc {Paste}] \
+ -state disabled
+ }
+ } else {
+ $ds9(mb).edit entryconfig [msgcat::mc {Paste}] \
+ -state disabled
+ }
+ } else {
+ $ds9(mb).edit entryconfig [msgcat::mc {Undo}] -state disabled
+ $ds9(mb).edit entryconfig [msgcat::mc {Cut}] -state disabled
+ $ds9(mb).edit entryconfig [msgcat::mc {Copy}] -state disabled
+ $ds9(mb).edit entryconfig [msgcat::mc {Paste}] -state disabled
+ }
+ }
+ none -
+ crosshair -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ catalog -
+ analysis -
+ examine -
+ iexam {$ds9(mb).edit entryconfig [msgcat::mc {Undo}] -state disabled}
+ }
+}
+
diff --git a/ds9/library/menu.tcl b/ds9/library/menu.tcl
new file mode 100644
index 0000000..70997a5
--- /dev/null
+++ b/ds9/library/menu.tcl
@@ -0,0 +1,586 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CreateMenuBar {} {
+ global ds9
+
+ # we need this first, before the configure command
+ menu $ds9(mb)
+ AppleMenu $ds9(mb)
+ $ds9(top) configure -menu $ds9(mb)
+
+ $ds9(mb) add cascade -label [msgcat::mc {File}] -menu $ds9(mb).file
+ $ds9(mb) add cascade -label [msgcat::mc {Edit}] -menu $ds9(mb).edit
+ $ds9(mb) add cascade -label [msgcat::mc {View}] -menu $ds9(mb).view
+ $ds9(mb) add cascade -label [msgcat::mc {Frame}] -menu $ds9(mb).frame
+ $ds9(mb) add cascade -label [msgcat::mc {Bin}] -menu $ds9(mb).bin
+ $ds9(mb) add cascade -label [msgcat::mc {Zoom}] -menu $ds9(mb).zoom
+ $ds9(mb) add cascade -label [msgcat::mc {Scale}] -menu $ds9(mb).scale
+ $ds9(mb) add cascade -label [msgcat::mc {Color}] -menu $ds9(mb).color
+ $ds9(mb) add cascade -label [msgcat::mc {Region}] -menu $ds9(mb).region
+ $ds9(mb) add cascade -label [msgcat::mc {WCS}] -menu $ds9(mb).wcs
+ $ds9(mb) add cascade -label [msgcat::mc {Analysis}] -menu $ds9(mb).analysis
+
+ FileMainMenu
+ EditMainMenu
+ ViewMainMenu
+ FrameMainMenu
+ BinMainMenu
+ ZoomMainMenu
+ ScaleMainMenu
+ ColorMainMenu
+ RegionMainMenu
+ WCSMainMenu
+ AnalysisMainMenu
+ HelpMainMenu
+}
+
+proc AppleMenu {mb} {
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ # apple menu
+ menu $mb.apple
+ $mb add cascade -menu $mb.apple
+ $mb.apple add command \
+ -label [msgcat::mc {About SAOImage DS9}] \
+ -command AboutBox
+# -command ::tk::mac::standardAboutPanel
+ }
+ }
+}
+
+# CoordMenu
+proc CoordMenu {w varname system other sky skyformat cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label [msgcat::mc {WCS}] \
+ -variable ${varname}($system) -value wcs -command $cmd
+ $w add cascade -label [msgcat::mc {Multiple WCS}] -menu $w.wcs
+ menu $w.wcs
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $w.wcs add radiobutton -label "[msgcat::mc {WCS}] $l" \
+ -variable ${varname}($system) -value "wcs$l" -command $cmd
+ }
+
+ switch -- $other {
+ 1 {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Image}] \
+ -variable ${varname}($system) -value image -command $cmd
+ $w add radiobutton -label [msgcat::mc {Physical}] \
+ -variable ${varname}($system) -value physical -command $cmd
+ $w add radiobutton -label [msgcat::mc {Amplifier}] \
+ -variable ${varname}($system) -value amplifier -command $cmd
+ $w add radiobutton -label [msgcat::mc {Detector}] \
+ -variable ${varname}($system) -value detector -command $cmd
+ }
+ 2 {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Image}] \
+ -variable ${varname}($system) -value image -command $cmd
+ }
+ }
+
+ if {$sky != {}} {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {FK4}] \
+ -variable ${varname}($sky) -value fk4 -command $cmd
+ $w add radiobutton -label [msgcat::mc {FK5}] \
+ -variable ${varname}($sky) -value fk5 -command $cmd
+ $w add radiobutton -label [msgcat::mc {ICRS}] \
+ -variable ${varname}($sky) -value icrs -command $cmd
+ $w add radiobutton -label [msgcat::mc {Galactic}] \
+ -variable ${varname}($sky) -value galactic -command $cmd
+ $w add radiobutton -label [msgcat::mc {Ecliptic}] \
+ -variable ${varname}($sky) -value ecliptic -command $cmd
+ }
+
+ if {$skyformat != {}} {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Degrees}] \
+ -variable ${varname}($skyformat) -value degrees -command $cmd
+ $w add radiobutton -label {Sexagesimal} \
+ -variable ${varname}($skyformat) -value sexagesimal -command $cmd
+ }
+}
+
+proc CoordMenuButton {w varname system other sky skyformat cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ CoordMenuButtonCmd $varname $system $sky {}
+ ttk::menubutton $w -textvariable ${varname}($system,msg) -menu $w.menu
+ CoordMenu $w.menu $varname $system $other $sky $skyformat \
+ [list CoordMenuButtonCmd $varname $system $sky $cmd]
+}
+
+proc CoordMenuButtonCmd {varname system sky cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}($system,msg) [msgcat::mc $var($system)]
+
+ if {$sky != {}} {
+ switch -- $var($system) {
+ image -
+ physical -
+ amplifier -
+ detector {}
+ default {
+ if {[info exists var(frame)]} {
+ if {$var(frame) != {}} {
+ if {[$var(frame) has wcs equatorial $var($system)]} {
+ set ${varname}($system,msg) [msgcat::mc $var($sky)]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {$cmd != {}} {
+ eval $cmd
+ }
+}
+
+proc CoordMenuEnable {w varname system other sky skyformat} {
+ upvar #0 $varname var
+ global $varname
+
+ if {![info exists var(frame)]} {
+ return
+ }
+
+ if {$var(frame) == {}} {
+ return
+ }
+
+ if {[$var(frame) has wcs wcs]} {
+ $w entryconfig [msgcat::mc {WCS}] -state normal
+ } else {
+ $w entryconfig [msgcat::mc {WCS}] -state disabled
+ }
+
+ $w entryconfig [msgcat::mc {Multiple WCS}] -state normal
+
+ foreach ll {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ if {[$var(frame) has wcs "wcs${ll}"]} {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $ll" -state normal
+ } else {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $ll" -state disabled
+ }
+ }
+
+ switch -- $other {
+ 1 {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ $w entryconfig [msgcat::mc {Physical}] -state normal
+ $w entryconfig [msgcat::mc {Amplifier}] -state normal
+ $w entryconfig [msgcat::mc {Detector}] -state normal
+ }
+ 2 {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ }
+ }
+
+ if {$sky != {}} {
+ if {[$var(frame) has wcs equatorial $var($system)]} {
+ $w entryconfig [msgcat::mc {FK4}] -state normal
+ $w entryconfig [msgcat::mc {FK5}] -state normal
+ $w entryconfig [msgcat::mc {ICRS}] -state normal
+ $w entryconfig [msgcat::mc {Galactic}] -state normal
+ $w entryconfig [msgcat::mc {Ecliptic}] -state normal
+ } else {
+ $w entryconfig [msgcat::mc {FK4}] -state disabled
+ $w entryconfig [msgcat::mc {FK5}] -state disabled
+ $w entryconfig [msgcat::mc {ICRS}] -state disabled
+ $w entryconfig [msgcat::mc {Galactic}] -state disabled
+ $w entryconfig [msgcat::mc {Ecliptic}] -state disabled
+ }
+ }
+
+ if {$skyformat != {}} {
+ if {[$var(frame) has wcs celestrial $var($system)]} {
+ $w entryconfig [msgcat::mc {Degrees}] -state normal
+ $w entryconfig {Sexagesimal} -state normal
+ } else {
+ $w entryconfig [msgcat::mc {Degrees}] -state disabled
+ $w entryconfig {Sexagesimal} -state disabled
+ }
+ }
+}
+
+proc CoordMenuReset {w varname system other sky skyformat} {
+ upvar #0 $varname var
+ global $varname
+
+ $w entryconfig [msgcat::mc {WCS}] -state normal
+ $w entryconfig [msgcat::mc {Multiple WCS}] -state normal
+
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $l" -state normal
+ }
+
+ switch -- $other {
+ 1 {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ $w entryconfig [msgcat::mc {Physical}] -state normal
+ $w entryconfig [msgcat::mc {Amplifier}] -state normal
+ $w entryconfig [msgcat::mc {Detector}] -state normal
+ }
+ 2 {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ }
+ }
+
+ if {$sky != {}} {
+ $w entryconfig [msgcat::mc {FK4}] -state normal
+ $w entryconfig [msgcat::mc {FK5}] -state normal
+ $w entryconfig [msgcat::mc {ICRS}] -state normal
+ $w entryconfig [msgcat::mc {Galactic}] -state normal
+ $w entryconfig [msgcat::mc {Ecliptic}] -state normal
+ }
+
+ if {$skyformat != {}} {
+ $w entryconfig [msgcat::mc {Degrees}] -state normal
+ $w entryconfig {Sexagesimal} -state normal
+ }
+}
+
+# DistMenu
+proc DistMenu {w varname system other format cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label [msgcat::mc {WCS}] \
+ -variable ${varname}($system) -value wcs -command $cmd
+ $w add cascade -label [msgcat::mc {Multiple WCS}] \
+ -menu $w.wcs
+ menu $w.wcs
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $w.wcs add radiobutton -label "[msgcat::mc {WCS}] $l" \
+ -variable ${varname}($system) -value "wcs$l" -command $cmd
+ }
+
+ if {$other} {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Image}] \
+ -variable ${varname}($system) -value image -command $cmd
+ $w add radiobutton -label [msgcat::mc {Physical}] \
+ -variable ${varname}($system) -value physical -command $cmd
+ $w add radiobutton -label [msgcat::mc {Amplifier}] \
+ -variable ${varname}($system) -value amplifier -command $cmd
+ $w add radiobutton -label [msgcat::mc {Detector}] \
+ -variable ${varname}($system) -value detector -command $cmd
+ }
+
+ if {$format != {}} {
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Degrees}] \
+ -variable ${varname}($format) -value degrees -command $cmd
+ $w add radiobutton -label [msgcat::mc {ArcMin}] \
+ -variable ${varname}($format) -value arcmin -command $cmd
+ $w add radiobutton -label [msgcat::mc {ArcSec}] \
+ -variable ${varname}($format) -value arcsec -command $cmd
+ }
+}
+
+proc DistMenuButton {w varname system other format cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ DistMenuButtonCmd $varname $system $format {}
+ ttk::menubutton $w -textvariable ${varname}($system,msg) -menu $w.menu
+ DistMenu $w.menu $varname $system $other $format \
+ [list DistMenuButtonCmd $varname $system $format $cmd]
+}
+
+proc DistMenuButtonCmd {varname system format cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ set ${varname}($system,msg) [msgcat::mc $var($system)]
+
+ if {$format != {}} {
+ switch -- $var($system) {
+ image -
+ physical -
+ amplifier -
+ detector {}
+ default {
+ if {[info exists var(frame)]} {
+ if {$var(frame) != {}} {
+ if {[$var(frame) has wcs equatorial $var($system)]} {
+ set ${varname}($system,msg) [msgcat::mc $var($format)]
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if {$cmd != {}} {
+ eval $cmd
+ }
+}
+
+proc DistMenuEnable {w varname system other format} {
+ upvar #0 $varname var
+ global $varname
+
+ if {![info exists var(frame)]} {
+ return
+ }
+
+ if {$var(frame) == {}} {
+ return
+ }
+
+ if {[$var(frame) has wcs wcs]} {
+ $w entryconfig [msgcat::mc {WCS}] -state normal
+ } else {
+ $w entryconfig [msgcat::mc {WCS}] -state disabled
+ }
+
+ $w entryconfig [msgcat::mc {Multiple WCS}] -state normal
+
+ foreach ll {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ if {[$var(frame) has wcs "wcs${ll}"]} {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $ll" -state normal
+ } else {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $ll" -state disabled
+ }
+ }
+
+ if {$other} {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ $w entryconfig [msgcat::mc {Physical}] -state normal
+ $w entryconfig [msgcat::mc {Amplifier}] -state normal
+ $w entryconfig [msgcat::mc {Detector}] -state normal
+ }
+
+ if {$format != {}} {
+ if {[$var(frame) has wcs celestrial $var($system)]} {
+ $w entryconfig [msgcat::mc {Degrees}] -state normal
+ $w entryconfig [msgcat::mc {ArcMin}] -state normal
+ $w entryconfig [msgcat::mc {ArcSec}] -state normal
+ } else {
+ $w entryconfig [msgcat::mc {Degrees}] -state disabled
+ $w entryconfig [msgcat::mc {ArcMin}] -state disabled
+ $w entryconfig [msgcat::mc {ArcSec}] -state disabled
+ }
+ }
+}
+
+proc DistMenuReset {w varname system other format} {
+ upvar #0 $varname var
+ global $varname
+
+ $w entryconfig [msgcat::mc {WCS}] -state normal
+ $w entryconfig [msgcat::mc {Multiple WCS}] -state normal
+
+ foreach ll {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $w.wcs entryconfig "[msgcat::mc {WCS}] $ll" -state normal
+ }
+
+ if {$other} {
+ $w entryconfig [msgcat::mc {Image}] -state normal
+ $w entryconfig [msgcat::mc {Physical}] -state normal
+ $w entryconfig [msgcat::mc {Amplifier}] -state normal
+ $w entryconfig [msgcat::mc {Detector}] -state normal
+ }
+
+ if {$format != {}} {
+ $w entryconfig [msgcat::mc {Degrees}] -state normal
+ $w entryconfig [msgcat::mc {ArcMin}] -state normal
+ $w entryconfig [msgcat::mc {ArcSec}] -state normal
+ }
+}
+
+# EditMenu
+proc EditMenu {mb varname} {
+ upvar #0 $varname var
+ global $varname
+ global ds9
+
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -command "EntryCut $var(top)" -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command "EntryCopy $var(top)" -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -command "EntryPaste $var(top)" -accelerator "${ds9(ctrl)}V"
+}
+
+# ColorMenu
+proc ColorMenu {w varname color cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label [msgcat::mc {Black}] \
+ -variable ${varname}($color) -value black -command $cmd
+ $w add radiobutton -label [msgcat::mc {White}] \
+ -variable ${varname}($color) -value white -command $cmd
+ $w add radiobutton -label [msgcat::mc {Red}] \
+ -variable ${varname}($color) -value red -command $cmd
+ $w add radiobutton -label [msgcat::mc {Green}] \
+ -variable ${varname}($color) -value green -command $cmd
+ $w add radiobutton -label [msgcat::mc {Blue}] \
+ -variable ${varname}($color) -value blue -command $cmd
+ $w add radiobutton -label [msgcat::mc {Cyan}] \
+ -variable ${varname}($color) -value cyan -command $cmd
+ $w add radiobutton -label [msgcat::mc {Magenta}] \
+ -variable ${varname}($color) -value magenta -command $cmd
+ $w add radiobutton -label [msgcat::mc {Yellow}] \
+ -variable ${varname}($color) -value yellow -command $cmd
+ $w add separator
+ $w add command -label "[msgcat::mc {Other Color}]..." \
+ -command [list ColorMenuOther $varname $color $cmd]
+}
+
+proc ColorMenuOther {varname color cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[EntryDialog [msgcat::mc {Color}] [msgcat::mc {Enter Color}] 20 ${varname}($color)]} {
+ eval $cmd
+ }
+}
+
+proc ColorMenuButton {w varname color cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ ttk::menubutton $w -textvariable ${varname}($color) -menu $w.menu
+ ColorMenu $w.menu $varname $color $cmd
+}
+
+# FontMenu
+proc FontMenu {w varname font size weight slant cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label {Times} -variable ${varname}($font) \
+ -value times -command $cmd
+ $w add radiobutton -label {Helvetica} -variable ${varname}($font) \
+ -value helvetica -command $cmd
+ $w add radiobutton -label {Courier} -variable ${varname}($font) \
+ -value courier -command $cmd
+ $w add separator
+ $w add radiobutton -label {9} -variable ${varname}($size) \
+ -value 9 -command $cmd
+ $w add radiobutton -label {10} -variable ${varname}($size) \
+ -value 10 -command $cmd
+ $w add radiobutton -label {12} -variable ${varname}($size) \
+ -value 12 -command $cmd
+ $w add radiobutton -label {14} -variable ${varname}($size) \
+ -value 14 -command $cmd
+ $w add radiobutton -label {16} -variable ${varname}($size) \
+ -value 16 -command $cmd
+ $w add radiobutton -label {20} -variable ${varname}($size) \
+ -value 20 -command $cmd
+ $w add radiobutton -label {24} -variable ${varname}($size) \
+ -value 24 -command $cmd
+ $w add radiobutton -label {30} -variable ${varname}($size) \
+ -value 30 -command $cmd
+ $w add radiobutton -label {36} -variable ${varname}($size) \
+ -value 36 -command $cmd
+ $w add radiobutton -label {72} -variable ${varname}($size) \
+ -value 72 -command $cmd
+ $w add separator
+ $w add command -label "[msgcat::mc {Other Font Size}]..." \
+ -command [list FontMenuSize $varname $size $cmd]
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Normal}] \
+ -variable ${varname}($weight) -value normal -command $cmd
+ $w add radiobutton -label [msgcat::mc {Bold}] \
+ -variable ${varname}($weight) -value bold -command $cmd
+ $w add separator
+ $w add radiobutton -label [msgcat::mc {Roman}] \
+ -variable ${varname}($slant) -value roman -command $cmd
+ $w add radiobutton -label [msgcat::mc {Italic}] \
+ -variable ${varname}($slant) -value italic -command $cmd
+}
+
+proc FontMenuSize {varname size cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[EntryDialog [msgcat::mc {Font Size}] [msgcat::mc {Enter Font Size}] 20 ${varname}($size)]} {
+ eval $cmd
+ }
+}
+
+proc FontMenuButton {w varname font size weight slant cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ ttk::menubutton $w -textvariable ${varname}($font) -menu $w.menu
+ FontMenu $w.menu $varname $font $size $weight $slant $cmd
+}
+
+# WidthDashMenu
+proc WidthDashMenu {w varname width dash cmd1 cmd2} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label {1} -variable ${varname}($width) \
+ -value 1 -command $cmd1
+ $w add radiobutton -label {2} -variable ${varname}($width) \
+ -value 2 -command $cmd1
+ $w add radiobutton -label {3} -variable ${varname}($width) \
+ -value 3 -command $cmd1
+ $w add radiobutton -label {4} -variable ${varname}($width) \
+ -value 4 -command $cmd1
+
+ if {$dash != {}} {
+ $w add separator
+ $w add checkbutton -label [msgcat::mc {Dash}] \
+ -variable ${varname}($dash) -command $cmd2
+ }
+}
+
+proc WidthDashMenuButton {w varname width dash cmd1 cmd2} {
+ upvar #0 $varname var
+ global $varname
+
+ ttk::menubutton $w -textvariable ${varname}($width) -menu $w.menu
+ WidthDashMenu $w.menu $varname $width $dash $cmd1 $cmd2
+}
+
+# Prefs
+proc PrefsDialogMenu {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Menus and Buttons}]
+ lappend dprefs(tabs) [ttk::frame $w.menu]
+
+ PrefsDialogFileMenu $w.menu
+ PrefsDialogEditMenu $w.menu
+ PrefsDialogViewMenu $w.menu
+ PrefsDialogFrameMenu $w.menu
+ PrefsDialogBinMenu $w.menu
+ PrefsDialogZoomMenu $w.menu
+ PrefsDialogScaleMenu $w.menu
+ PrefsDialogColorMenu $w.menu
+ PrefsDialogRegionMenu $w.menu
+ PrefsDialogWCSMenu $w.menu
+ PrefsDialogAnalysisMenu $w.menu
+ PrefsDialogHelpMenu $w.menu
+}
+
diff --git a/ds9/library/mfile.tcl b/ds9/library/mfile.tcl
new file mode 100644
index 0000000..83f0629
--- /dev/null
+++ b/ds9/library/mfile.tcl
@@ -0,0 +1,688 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc FileMainMenu {} {
+ global ds9
+
+ menu $ds9(mb).file
+ $ds9(mb).file add command -label "[msgcat::mc {Open}]..." \
+ -command [list OpenDialog fits] -accelerator "${ds9(ctrl)}O"
+ $ds9(mb).file add cascade -label [msgcat::mc {Open as}] \
+ -menu $ds9(mb).file.open
+ $ds9(mb).file add separator
+ $ds9(mb).file add command -label "[msgcat::mc {Save}]..." \
+ -command [list SaveDialog fits] -accelerator "${ds9(ctrl)}S"
+ $ds9(mb).file add cascade -label [msgcat::mc {Save as}] \
+ -menu $ds9(mb).file.save
+ $ds9(mb).file add separator
+ $ds9(mb).file add cascade -label [msgcat::mc {Import}] \
+ -menu $ds9(mb).file.import
+ $ds9(mb).file add cascade -label [msgcat::mc {Export}] \
+ -menu $ds9(mb).file.export
+ $ds9(mb).file add separator
+ $ds9(mb).file add cascade -label [msgcat::mc {Save Image}] \
+ -menu $ds9(mb).file.saveimage
+ $ds9(mb).file add command -label "[msgcat::mc {Create Movie}]..." \
+ -command MovieDialog
+ $ds9(mb).file add separator
+ $ds9(mb).file add command -label "[msgcat::mc {Backup}]..." \
+ -command BackupDialog
+ $ds9(mb).file add command -label "[msgcat::mc {Restore}]..." \
+ -command RestoreDialog
+ $ds9(mb).file add separator
+ $ds9(mb).file add command -label "[msgcat::mc {Display Header}]..." \
+ -command DisplayHeaderMenu
+ $ds9(mb).file add cascade -label [msgcat::mc {Preserve During Load}] \
+ -menu $ds9(mb).file.preserve
+ $ds9(mb).file add separator
+ $ds9(mb).file add cascade -label [msgcat::mc {XPA}] \
+ -menu $ds9(mb).file.xpa
+ $ds9(mb).file add cascade -label [msgcat::mc {SAMP}] \
+ -menu $ds9(mb).file.samp
+ $ds9(mb).file add separator
+ $ds9(mb).file add command -label "[msgcat::mc {Open TCL Console}]..." \
+ -command OpenConsole
+ $ds9(mb).file add command -label "[msgcat::mc {Source TCL}]..." \
+ -command OpenSource
+ $ds9(mb).file add separator
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(mb).file add command -label "[msgcat::mc {Page Setup}]..." \
+ -command PSPageSetup -accelerator "${ds9(shiftctrl)}P"
+ $ds9(mb).file add command -label "[msgcat::mc {Print}]..." \
+ -command PSPrint -accelerator "${ds9(ctrl)}P"
+ }
+ aqua {
+ # accelerators don't work with dialog box
+ $ds9(mb).file add command -label "[msgcat::mc {Page Setup}]..." \
+ -command PSPageSetup
+ $ds9(mb).file add command -label "[msgcat::mc {Print}]..." \
+ -command PSPrint
+# $ds9(mb).file add command -label "[msgcat::mc {Postscript Page Setup}]..." -command PSPageSetup
+# $ds9(mb).file add command -label "[msgcat::mc {Postscript Print}]..." -command PSPrint
+# $ds9(mb).file add separator
+# $ds9(mb).file add command -label "[msgcat::mc {Page Setup}]..." -command MacOSXPageSetup
+# $ds9(mb).file add command -label "[msgcat::mc {Print}]..." -command MacOSXPrint
+ }
+ }
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(mb).file add separator
+ $ds9(mb).file add command \
+ -label [msgcat::mc {Exit}] -command QuitDS9
+ }
+ aqua {}
+ }
+
+ # File Open Menu
+ menu $ds9(mb).file.open
+ $ds9(mb).file.open add command -label "[msgcat::mc {Slice}]..." \
+ -command [list OpenDialog fits {} slice]
+ $ds9(mb).file.open add separator
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {RGB Image}]..." \
+ -command [list OpenDialog rgbimage]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {RGB Cube}]..."\
+ -command [list OpenDialog rgbcube]
+ $ds9(mb).file.open add separator
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Multiple Extension Cube}]..." \
+ -command [list OpenDialog mecube]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Multiple Extension Frames}]..." \
+ -command [list OpenDialog multiframe]
+ $ds9(mb).file.open add separator
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Mosaic WCS}]..." \
+ -command [list OpenDialog mosaicimagewcs]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Mosaic WCS Segment}]..." \
+ -command [list OpenDialog mosaicwcs]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Mosaic IRAF}]..." \
+ -command [list OpenDialog mosaicimageiraf]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Mosaic IRAF Segment}]..." \
+ -command [list OpenDialog mosaiciraf]
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {Mosaic WFPC2}]..." \
+ -command [list OpenDialog mosaicimagewfpc2]
+ $ds9(mb).file.open add separator
+ $ds9(mb).file.open add command \
+ -label "[msgcat::mc {URL}]..." \
+ -command [list OpenURLFits]
+
+ # File Save Menu
+ menu $ds9(mb).file.save
+ $ds9(mb).file.save add command -label "[msgcat::mc {Slice}]..." \
+ -command [list SaveDialog slice]
+ $ds9(mb).file.save add separator
+ $ds9(mb).file.save add command \
+ -label "[msgcat::mc {RGB Image}]..." \
+ -command [list SaveDialog rgbimage]
+ $ds9(mb).file.save add command \
+ -label "[msgcat::mc {RGB Cube}]..."\
+ -command [list SaveDialog rgbcube]
+ $ds9(mb).file.save add separator
+ $ds9(mb).file.save add command \
+ -label "[msgcat::mc {Multiple Extension Cube}]..." \
+ -command [list SaveDialog mecube]
+ $ds9(mb).file.save add separator
+ $ds9(mb).file.save add command \
+ -label "[msgcat::mc {Mosaic WCS}]..." \
+ -command [list SaveDialog mosaicimagewcs]
+ $ds9(mb).file.save add command \
+ -label "[msgcat::mc {Mosaic WCS Segment}]..." \
+ -command [list SaveDialog mosaicwcs]
+
+ # File Import Menu
+ menu $ds9(mb).file.import
+ $ds9(mb).file.import add cascade -label [msgcat::mc {Slice}] \
+ -menu $ds9(mb).file.import.slice
+ $ds9(mb).file.import add separator
+ $ds9(mb).file.import add command -label "[msgcat::mc {Array}]..." \
+ -command [list ImportDialog array]
+ $ds9(mb).file.import add command -label {NRRD...} \
+ -command [list ImportDialog nrrd]
+ $ds9(mb).file.import add command -label {ENVI...} \
+ -command [list ImportDialog envi]
+ $ds9(mb).file.import add separator
+ $ds9(mb).file.import add command -label "[msgcat::mc {RGB Array}]..." \
+ -command [list ImportDialog rgbarray]
+ $ds9(mb).file.import add separator
+ $ds9(mb).file.import add command -label {GIF...} \
+ -command [list ImportDialog gif]
+ $ds9(mb).file.import add command -label {TIFF...} \
+ -command [list ImportDialog tiff]
+ $ds9(mb).file.import add command -label {JPEG...} \
+ -command [list ImportDialog jpeg]
+ $ds9(mb).file.import add command -label {PNG...} \
+ -command [list ImportDialog png]
+
+ # File Import Slice Menu
+ menu $ds9(mb).file.import.slice
+ $ds9(mb).file.import.slice add command -label {GIF...} \
+ -command [list ImportDialog gif {} slice]
+ $ds9(mb).file.import.slice add command -label {TIFF...} \
+ -command [list ImportDialog tiff {} slice]
+ $ds9(mb).file.import.slice add command -label {JPEG...} \
+ -command [list ImportDialog jpeg {} slice]
+ $ds9(mb).file.import.slice add command -label {PNG...} \
+ -command [list ImportDialog png {} slice]
+
+ # File Export Menu
+ menu $ds9(mb).file.export
+ $ds9(mb).file.export add command -label "[msgcat::mc {Array}]..." \
+ -command [list ExportDialog array]
+ $ds9(mb).file.export add command -label {NRRD...} \
+ -command [list ExportDialog nrrd]
+ $ds9(mb).file.export add command -label {ENVI...} \
+ -command [list ExportDialog envi]
+ $ds9(mb).file.export add separator
+ $ds9(mb).file.export add command -label "[msgcat::mc {RGB Array}]..." \
+ -command [list ExportDialog rgbarray]
+ $ds9(mb).file.export add separator
+ $ds9(mb).file.export add command -label {GIF...} \
+ -command [list ExportDialog gif]
+ $ds9(mb).file.export add command -label {TIFF...} \
+ -command [list ExportDialog tiff]
+ $ds9(mb).file.export add command -label {JPEG...} \
+ -command [list ExportDialog jpeg]
+ $ds9(mb).file.export add command -label {PNG...} \
+ -command [list ExportDialog png]
+
+ # File Saveimage Menu
+ menu $ds9(mb).file.saveimage
+ $ds9(mb).file.saveimage add command -label {FITS...} \
+ -command [list SaveImageDialog fits]
+ $ds9(mb).file.saveimage add command -label {EPS...} \
+ -command [list SaveImageDialog eps]
+ $ds9(mb).file.saveimage add command -label {GIF...} \
+ -command [list SaveImageDialog gif]
+ $ds9(mb).file.saveimage add command -label {TIFF...} \
+ -command [list SaveImageDialog tiff]
+ $ds9(mb).file.saveimage add command -label {JPEG...} \
+ -command [list SaveImageDialog jpeg]
+ $ds9(mb).file.saveimage add command -label {PNG...} \
+ -command [list SaveImageDialog png]
+
+ # File Preserve Menu
+ menu $ds9(mb).file.preserve
+ $ds9(mb).file.preserve add checkbutton -label [msgcat::mc {Pan}] \
+ -variable panzoom(preserve) -command PreservePan
+ $ds9(mb).file.preserve add checkbutton -label [msgcat::mc {Region}] \
+ -variable marker(preserve) -command MarkerPreserve
+
+ menu $ds9(mb).file.samp
+ $ds9(mb).file.samp add command -label [msgcat::mc {Connect}] \
+ -command SAMPConnect
+ $ds9(mb).file.samp add command -label [msgcat::mc {Disconnect}] \
+ -command SAMPDisconnect
+ $ds9(mb).file.samp add separator
+ $ds9(mb).file.samp add cascade -label [msgcat::mc {Image}] \
+ -menu $ds9(mb).file.samp.image
+ $ds9(mb).file.samp add cascade -label [msgcat::mc {Table}] \
+ -menu $ds9(mb).file.samp.table
+
+ menu $ds9(mb).file.samp.image
+ $ds9(mb).file.samp.image add command -label [msgcat::mc {Broadcast}] \
+ -command "SAMPSendImageLoadFits {}"
+ $ds9(mb).file.samp.image add separator
+
+ menu $ds9(mb).file.samp.table
+ $ds9(mb).file.samp.table add command -label [msgcat::mc {Broadcast}] \
+ -command "SAMPSendTableLoadFits {}"
+ $ds9(mb).file.samp.table add separator
+
+ menu $ds9(mb).file.xpa
+ $ds9(mb).file.xpa add command -label "[msgcat::mc {Information}]..." \
+ -command XPAInfo
+ $ds9(mb).file.xpa add separator
+ $ds9(mb).file.xpa add command -label [msgcat::mc {Connect}] \
+ -command XPAConnect
+ $ds9(mb).file.xpa add command -label [msgcat::mc {Disconnect}] \
+ -command XPADisconnect
+
+ # Bindings
+ bind $ds9(top) <<Open>> [list OpenDialog fits]
+ bind $ds9(top) <<Save>> [list SaveDialog fits]
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ bind $ds9(top) <<PageSetup>> PSPageSetup
+ bind $ds9(top) <<Print>> PSPrint
+ }
+ aqua {
+ # Known bug in Tk, can't have dialogs invoked by accelerator
+ }
+ }
+}
+
+proc PrefsDialogFileMenu {w} {
+ set f [ttk::labelframe $w.mfile -text [msgcat::mc {File}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarFile $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add cascade -label [msgcat::mc {Preserve During Load}] \
+ -menu $m.preserve
+
+ global pscale
+ global ppanzoom
+ global pmarker
+ menu $m.preserve
+ $m.preserve add checkbutton -label [msgcat::mc {Pan}] \
+ -variable ppanzoom(preserve)
+ $m.preserve add checkbutton -label [msgcat::mc {Region}] \
+ -variable pmarker(preserve)
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsFileDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ file,open 1
+ file,save 1
+ file,movie 0
+ file,backup 0
+ file,restore 0
+ file,header 1
+ file,xpa,info 0
+ file,samp,image 0
+ file,samp,table 0
+ file,console 0
+ file,tcl 0
+ file,pspage 0
+ file,psprint 0
+ file,page 1
+ file,print 1
+ file,exit 1
+ }
+}
+
+proc CreateButtonsFile {} {
+ global ds9
+ global buttons
+
+ ttk::frame $ds9(buttons).file
+
+ ButtonButton $ds9(buttons).file.open \
+ [string tolower [msgcat::mc {Open}]] \
+ [list OpenDialog fits]
+ ButtonButton $ds9(buttons).file.save \
+ [string tolower [msgcat::mc {Save}]] \
+ [list SaveDialog fits]
+
+ ButtonButton $ds9(buttons).file.movie \
+ [string tolower [msgcat::mc {Create Movie}]] MovieDialog
+
+ ButtonButton $ds9(buttons).file.backup \
+ [string tolower [msgcat::mc {Backup}]] BackupDialog
+ ButtonButton $ds9(buttons).file.restore \
+ [string tolower [msgcat::mc {Restore}]] RestoreDialog
+
+ ButtonButton $ds9(buttons).file.header \
+ [string tolower [msgcat::mc {Header}]] DisplayHeaderMenu
+
+ ButtonButton $ds9(buttons).file.xpainfo \
+ [string tolower {XPA Info}] XPAInfo
+ ButtonButton $ds9(buttons).file.sampimage \
+ [string tolower [msgcat::mc {SAMP Image}]] "SAMPSendImageLoadFits {}"
+ ButtonButton $ds9(buttons).file.samptable \
+ [string tolower [msgcat::mc {SAMP Table}]] "SAMPSendTableLoadFits {}"
+
+ ButtonButton $ds9(buttons).file.console \
+ [string tolower [msgcat::mc {Console}]] OpenConsole
+ ButtonButton $ds9(buttons).file.tcl \
+ [string tolower {TCL}] OpenSource
+
+ ButtonButton $ds9(buttons).file.pspage \
+ [string tolower [msgcat::mc {PS Page Setup}]] PSPageSetup
+ ButtonButton $ds9(buttons).file.psprint \
+ [string tolower [msgcat::mc {PS Print}]] PSPrint
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ ButtonButton $ds9(buttons).file.page \
+ [string tolower [msgcat::mc {Page Setup}]] PSPageSetup
+ ButtonButton $ds9(buttons).file.print \
+ [string tolower [msgcat::mc {Print}]] PSPrint
+ }
+ aqua {
+ ButtonButton $ds9(buttons).file.page \
+ [string tolower [msgcat::mc {Page Setup}]] PSPageSetup
+ ButtonButton $ds9(buttons).file.print \
+ [string tolower [msgcat::mc {Print}]] PSPrint
+# ButtonButton $ds9(buttons).file.page [string tolower [msgcat::mc {Page Setup}]] MacOSXPageSetup
+# ButtonButton $ds9(buttons).file.print [string tolower [msgcat::mc {Print}]] MacOSXPrint
+ }
+ }
+
+ ButtonButton $ds9(buttons).file.exit \
+ [string tolower [msgcat::mc {Exit}]] QuitDS9
+
+ set buttons(file) "
+ $ds9(buttons).file.open pbuttons(file,open)
+ $ds9(buttons).file.save pbuttons(file,save)
+ $ds9(buttons).file.movie pbuttons(file,movie)
+ $ds9(buttons).file.backup pbuttons(file,backup)
+ $ds9(buttons).file.restore pbuttons(file,restore)
+ $ds9(buttons).file.header pbuttons(file,header)
+ $ds9(buttons).file.xpainfo pbuttons(file,xpa,info)
+ $ds9(buttons).file.sampimage pbuttons(file,samp,image)
+ $ds9(buttons).file.samptable pbuttons(file,samp,table)
+ $ds9(buttons).file.console pbuttons(file,console)
+ $ds9(buttons).file.tcl pbuttons(file,tcl)
+ $ds9(buttons).file.pspage pbuttons(file,pspage)
+ $ds9(buttons).file.psprint pbuttons(file,psprint)
+ $ds9(buttons).file.page pbuttons(file,page)
+ $ds9(buttons).file.print pbuttons(file,print)
+ $ds9(buttons).file.exit pbuttons(file,exit)
+ "
+}
+
+proc PrefsDialogButtonbarFile {f} {
+ global buttons
+ global pbuttons
+ global ds9
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label "[msgcat::mc {Open}]..." \
+ -variable pbuttons(file,open) -command {UpdateButtons buttons(file)}
+ $m add checkbutton -label "[msgcat::mc {Save}]..." \
+ -variable pbuttons(file,save) -command {UpdateButtons buttons(file)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Create Movie}]..." \
+ -variable pbuttons(file,movie) -command {UpdateButtons buttons(file)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Backup}]..." \
+ -variable pbuttons(file,backup) -command {UpdateButtons buttons(file)}
+ $m add checkbutton -label "[msgcat::mc {Restore}]..." \
+ -variable pbuttons(file,restore) -command {UpdateButtons buttons(file)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Display Header}]..." \
+ -variable pbuttons(file,header) -command {UpdateButtons buttons(file)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {XPA}] -menu $m.xpa
+ $m add cascade -label [msgcat::mc {SAMP}] -menu $m.samp
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Open TCL Console}]..." \
+ -variable pbuttons(file,console) -command {UpdateButtons buttons(file)}
+ $m add checkbutton -label "[msgcat::mc {Source TCL}]..." \
+ -variable pbuttons(file,tcl) -command {UpdateButtons buttons(file)}
+ $m add separator
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $m add checkbutton \
+ -label "[msgcat::mc {Page Setup}]..." \
+ -variable pbuttons(file,page) \
+ -command {UpdateButtons buttons(file)}
+ $m add checkbutton \
+ -label "[msgcat::mc {Print}]..." \
+ -variable pbuttons(file,print) \
+ -command {UpdateButtons buttons(file)}
+ }
+ aqua {
+ $m add checkbutton \
+ -label "[msgcat::mc {Page Setup}]..." \
+ -variable pbuttons(file,page) \
+ -command {UpdateButtons buttons(file)}
+ $m add checkbutton \
+ -label "[msgcat::mc {Print}]..." \
+ -variable pbuttons(file,print) \
+ -command {UpdateButtons buttons(file)}
+# $m add checkbutton -label "[msgcat::mc {Postscript Page Setup}]..." -variable pbuttons(file,pspage) -command {UpdateButtons buttons(file)}
+# $m add checkbutton -label "[msgcat::mc {Postscript Print}]..." -variable pbuttons(file,psprint) -command {UpdateButtons buttons(file)}
+# $m add separator
+# $m add checkbutton -label "[msgcat::mc {Page Setup}]..." -variable pbuttons(file,page) -command {UpdateButtons buttons(file)}
+# $m add checkbutton -label "[msgcat::mc {Print}]..." -variable pbuttons(file,print) -command {UpdateButtons buttons(file)}
+ }
+ }
+
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Exit}] \
+ -variable pbuttons(file,exit) -command {UpdateButtons buttons(filew)}
+
+ menu $m.xpa
+ $m.xpa add checkbutton -label "[msgcat::mc {Information}]..." \
+ -variable pbuttons(file,xpa,info) \
+ -command {UpdateButtons buttons(file)}
+
+ menu $m.samp
+ $m.samp add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(file,samp,image) \
+ -command {UpdateButtons buttons(file)}
+ $m.samp add checkbutton -label [msgcat::mc {Table}] \
+ -variable pbuttons(file,samp,table) \
+ -command {UpdateButtons buttons(file)}
+}
+
+# Support
+
+proc UpdateFileMenuStatic {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateFileMenuStatic"
+ }
+
+ if {$ds9(active,num) > 0} {
+ $ds9(mb).file entryconfig "[msgcat::mc {Open}]..." \
+ -state normal
+ $ds9(mb).file entryconfig [msgcat::mc {Open as}] \
+ -state normal
+ $ds9(mb).file entryconfig [msgcat::mc {Import}] \
+ -state normal
+
+ $ds9(buttons).file.open configure -state normal
+ } else {
+ $ds9(mb).file entryconfig "[msgcat::mc {Open}]..." \
+ -state disabled
+ $ds9(mb).file entryconfig [msgcat::mc {Open as}] \
+ -state disabled
+ $ds9(mb).file entryconfig [msgcat::mc {Import}] \
+ -state disabled
+
+ $ds9(buttons).file.open configure -state disabled
+ }
+}
+
+proc UpdateFileMenu {} {
+ global ds9
+ global current
+ global samp
+ global xpa
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateFileMenu"
+ }
+
+ set mm $ds9(mb).file
+ set bb $ds9(buttons).file
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ $mm entryconfig "[msgcat::mc {Save}]..." -state normal
+ $mm entryconfig [msgcat::mc {Save as}] -state normal
+ $mm entryconfig [msgcat::mc {Export}] -state normal
+ $mm entryconfig [msgcat::mc {Save Image}] -state normal
+ $mm entryconfig "[msgcat::mc {Create Movie}]..." -state normal
+ $mm entryconfig "[msgcat::mc {Display Header}]..." -state normal
+
+ if {[$current(frame) has fits mosaic]} {
+ $mm.save entryconfig "[msgcat::mc {Mosaic WCS}]..." -state normal
+ $mm.save entryconfig "[msgcat::mc {Mosaic WCS Segment}]..." -state normal
+ } else {
+ $mm.save entryconfig "[msgcat::mc {Mosaic WCS}]..." -state disabled
+ $mm.save entryconfig "[msgcat::mc {Mosaic WCS Segment}]..." -state disabled
+ }
+
+ $bb.save configure -state normal
+ $bb.movie configure -state normal
+ $bb.header configure -state normal
+ } else {
+ $mm entryconfig "[msgcat::mc {Save}]..." -state disabled
+ $mm entryconfig [msgcat::mc {Save as}] -state disabled
+ $mm entryconfig [msgcat::mc {Export}] -state disabled
+ $mm entryconfig [msgcat::mc {Save Image}] -state disabled
+ $mm entryconfig "[msgcat::mc {Create Movie}]..." -state disabled
+ $mm entryconfig "[msgcat::mc {Display Header}]..." -state disabled
+
+ $bb.save configure -state disabled
+ $bb.movie configure -state disabled
+ $bb.header configure -state disabled
+ }
+
+ switch -- [$current(frame) get type] {
+ base {
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state disabled
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state disabled
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state disabled
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state disabled
+ $mm.import entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state disabled
+ $mm.export entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state disabled
+ }
+ rgb {
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state normal
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state normal
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state normal
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state normal
+ $mm.import entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state normal
+ $mm.export entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state normal
+ }
+ 3d {
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state disabled
+ $mm.open entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state disabled
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Image}]..." -state disabled
+ $mm.save entryconfig \
+ "[msgcat::mc {RGB Cube}]..." -state disabled
+ $mm.import entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state disabled
+ $mm.export entryconfig \
+ "[msgcat::mc {RGB Array}]..." -state disabled
+ }
+ }
+
+ if {[info exists samp]} {
+ set ss [expr $ds9(menu,start)+2]
+
+ if {[$current(frame) has fits]} {
+
+ $mm.samp entryconfig [msgcat::mc {Image}] \
+ -state normal
+ if {[$mm.samp.image index end] >= $ss} {
+ $mm.samp.image delete $ss end
+ }
+ foreach args $samp(apps,image) {
+ foreach {id name} $args {
+ $mm.samp.image add command -label $name \
+ -command "SAMPSendImageLoadFits $id"
+ }
+ }
+ $bb.sampimage configure -state normal
+
+ if {[$current(frame) has fits bin]} {
+ $mm.samp entryconfig [msgcat::mc {Table}] -state normal
+ if {[$mm.samp.table index end] >= $ss} {
+ $mm.samp.table delete $ss end
+ }
+ foreach args $samp(apps,table) {
+ foreach {id name} $args {
+ $mm.samp.table add command -label $name \
+ -command "SAMPSendTableLoadFits $id"
+ }
+ }
+ $bb.samptable configure -state normal
+
+ } else {
+ $mm.samp entryconfig [msgcat::mc {Table}] -state disabled
+ $bb.samptable configure -state disabled
+ }
+ } else {
+ $mm.samp entryconfig [msgcat::mc {Image}] -state disabled
+ $mm.samp entryconfig [msgcat::mc {Table}] -state disabled
+ $bb.sampimage configure -state disabled
+ $bb.samptable configure -state disabled
+ }
+ } else {
+ $mm.samp entryconfig [msgcat::mc {Image}] -state disabled
+ $mm.samp entryconfig [msgcat::mc {Table}] -state disabled
+ $bb.sampimage configure -state disabled
+ $bb.samptable configure -state disabled
+ }
+ } else {
+ $mm entryconfig "[msgcat::mc {Save}]..." -state disabled
+ $mm entryconfig [msgcat::mc {Save as}] -state disabled
+ $mm entryconfig [msgcat::mc {Export}] -state disabled
+ $mm entryconfig [msgcat::mc {Save Image}] -state disabled
+ $mm entryconfig "[msgcat::mc {Create Movie}]..." -state disabled
+ $mm entryconfig "[msgcat::mc {Display Header}]..." -state disabled
+
+ $bb.save configure -state disabled
+ $bb.movie configure -state disabled
+ $bb.header configure -state disabled
+
+ $mm.samp entryconfig [msgcat::mc {Image}] -state disabled
+ $mm.samp entryconfig [msgcat::mc {Table}] -state disabled
+ $bb.sampimage configure -state disabled
+ $bb.samptable configure -state disabled
+ }
+
+ # XPA
+ if {[info exists xpa]} {
+ $mm.xpa entryconfig "[msgcat::mc {Information}]..." -state normal
+ $mm.xpa entryconfig [msgcat::mc {Disconnect}] -state normal
+ } else {
+ $mm.xpa entryconfig "[msgcat::mc {Information}]..." -state disabled
+ $mm.xpa entryconfig [msgcat::mc {Disconnect}] -state disabled
+ }
+
+ # SAMP
+ if {[info exists samp]} {
+ $mm.samp entryconfig [msgcat::mc {Connect}] -state disabled
+ $mm.samp entryconfig [msgcat::mc {Disconnect}] -state normal
+ } else {
+ $mm.samp entryconfig [msgcat::mc {Connect}] -state normal
+ $mm.samp entryconfig [msgcat::mc {Disconnect}] -state disabled
+ }
+}
+
diff --git a/ds9/library/mframe.tcl b/ds9/library/mframe.tcl
new file mode 100644
index 0000000..878ecf4
--- /dev/null
+++ b/ds9/library/mframe.tcl
@@ -0,0 +1,1226 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc FrameMainMenu {} {
+ global ds9
+ global current
+
+ menu $ds9(mb).frame
+ $ds9(mb).frame add command -label [msgcat::mc {New Frame}] \
+ -command CreateFrame
+ $ds9(mb).frame add command -label [msgcat::mc {New Frame RGB}] \
+ -command CreateRGBFrame
+ $ds9(mb).frame add command -label [msgcat::mc {New Frame 3D}] \
+ -command Create3DFrame
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add command -label [msgcat::mc {Delete Frame}] \
+ -command DeleteCurrentFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Delete All Frames}] \
+ -command DeleteAllFramesMenu
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add command -label [msgcat::mc {Clear Frame}] \
+ -command ClearCurrentFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Reset Frame}] \
+ -command ResetCurrentFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Refresh Frame}] \
+ -command UpdateCurrentFrame
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add radiobutton -label [msgcat::mc {Single Frame}] \
+ -variable current(display) -value single -command DisplayMode
+ $ds9(mb).frame add radiobutton -label [msgcat::mc {Tile Frames}] \
+ -variable current(display) -value tile -command DisplayMode
+ $ds9(mb).frame add radiobutton -label [msgcat::mc {Blink Frames}] \
+ -variable current(display) -value blink -command DisplayMode
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add cascade -label [msgcat::mc {Match}] \
+ -menu $ds9(mb).frame.match
+ $ds9(mb).frame add cascade -label [msgcat::mc {Lock}] \
+ -menu $ds9(mb).frame.lock
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add cascade -label [msgcat::mc {Goto Frame}] \
+ -menu $ds9(mb).frame.goto
+ $ds9(mb).frame add cascade -label [msgcat::mc {Show/Hide Frames}] \
+ -menu $ds9(mb).frame.active
+ $ds9(mb).frame add cascade -label [msgcat::mc {Move Frame}] \
+ -menu $ds9(mb).frame.move
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add command -label [msgcat::mc {First Frame}] \
+ -command FirstFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Previous Frame}] \
+ -command PrevFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Next Frame}] \
+ -command NextFrame
+ $ds9(mb).frame add command -label [msgcat::mc {Last Frame}] \
+ -command LastFrame
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add command -label "[msgcat::mc {Cube}]..." \
+ -command CubeDialog
+ $ds9(mb).frame add command -label "[msgcat::mc {RGB}]..." \
+ -command RGBDialog
+ $ds9(mb).frame add command -label "[msgcat::mc {3D}]..." \
+ -command 3DDialog
+ $ds9(mb).frame add separator
+ $ds9(mb).frame add cascade -label [msgcat::mc {Frame Parameters}] \
+ -menu $ds9(mb).frame.params
+
+ # match
+ menu $ds9(mb).frame.match
+ $ds9(mb).frame.match add cascade -label [msgcat::mc {Frame}] \
+ -menu $ds9(mb).frame.match.frame
+ $ds9(mb).frame.match add cascade -label [msgcat::mc {Crosshair}] \
+ -menu $ds9(mb).frame.match.crosshair
+ $ds9(mb).frame.match add cascade -label [msgcat::mc {Crop}] \
+ -menu $ds9(mb).frame.match.crop
+ $ds9(mb).frame.match add cascade -label [msgcat::mc {Slice}] \
+ -menu $ds9(mb).frame.match.cube
+ $ds9(mb).frame.match add command -label [msgcat::mc {Bin}] \
+ -command MatchBinCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Axes Order}] \
+ -command MatchAxesCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Scale}] \
+ -command MatchScaleCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Scale and Limits}] \
+ -command MatchScaleLimitsCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Colorbar}] \
+ -command MatchColorCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Block}] \
+ -command MatchBlockCurrent
+ $ds9(mb).frame.match add command -label [msgcat::mc {Smooth}] \
+ -command MatchSmoothCurrent
+
+ menu $ds9(mb).frame.match.frame
+ $ds9(mb).frame.match.frame add command -label [msgcat::mc {WCS}] \
+ -command {MatchFrameCurrent wcs}
+ $ds9(mb).frame.match.frame add separator
+ $ds9(mb).frame.match.frame add command -label [msgcat::mc {Image}] \
+ -command {MatchFrameCurrent image}
+ $ds9(mb).frame.match.frame add command -label [msgcat::mc {Physical}] \
+ -command {MatchFrameCurrent physical}
+ $ds9(mb).frame.match.frame add command -label [msgcat::mc {Amplifier}] \
+ -command {MatchFrameCurrent amplifier}
+ $ds9(mb).frame.match.frame add command -label [msgcat::mc {Detector}] \
+ -command {MatchFrameCurrent detector}
+
+ menu $ds9(mb).frame.match.crosshair
+ $ds9(mb).frame.match.crosshair add command -label [msgcat::mc {WCS}] \
+ -command {MatchCrosshairCurrent wcs}
+ $ds9(mb).frame.match.crosshair add separator
+ $ds9(mb).frame.match.crosshair add command -label [msgcat::mc {Image}] \
+ -command {MatchCrosshairCurrent image}
+ $ds9(mb).frame.match.crosshair add command -label [msgcat::mc {Physical}] \
+ -command {MatchCrosshairCurrent physical}
+ $ds9(mb).frame.match.crosshair add command -label [msgcat::mc {Amplifier}] \
+ -command {MatchCrosshairCurrent amplifier}
+ $ds9(mb).frame.match.crosshair add command -label [msgcat::mc {Detector}] \
+ -command {MatchCrosshairCurrent detector}
+
+ menu $ds9(mb).frame.match.crop
+ $ds9(mb).frame.match.crop add command -label [msgcat::mc {WCS}] \
+ -command {MatchCropCurrent wcs}
+ $ds9(mb).frame.match.crop add separator
+ $ds9(mb).frame.match.crop add command -label [msgcat::mc {Image}] \
+ -command {MatchCropCurrent image}
+ $ds9(mb).frame.match.crop add command -label [msgcat::mc {Physical}] \
+ -command {MatchCropCurrent physical}
+ $ds9(mb).frame.match.crop add command -label [msgcat::mc {Amplifier}] \
+ -command {MatchCropCurrent amplifier}
+ $ds9(mb).frame.match.crop add command -label [msgcat::mc {Detector}] \
+ -command {MatchCropCurrent detector}
+
+ menu $ds9(mb).frame.match.cube
+ $ds9(mb).frame.match.cube add command -label [msgcat::mc {WCS}] \
+ -command {MatchCubeCurrent wcs}
+ $ds9(mb).frame.match.cube add separator
+ $ds9(mb).frame.match.cube add command -label [msgcat::mc {Image}] \
+ -command {MatchCubeCurrent image}
+
+ # lock
+ menu $ds9(mb).frame.lock
+ $ds9(mb).frame.lock add cascade -label [msgcat::mc {Frame}] \
+ -menu $ds9(mb).frame.lock.frame
+ $ds9(mb).frame.lock add cascade -label [msgcat::mc {Crosshair}] \
+ -menu $ds9(mb).frame.lock.crosshair
+ $ds9(mb).frame.lock add cascade -label [msgcat::mc {Crop}] \
+ -menu $ds9(mb).frame.lock.crop
+ $ds9(mb).frame.lock add cascade -label [msgcat::mc {Slice}] \
+ -menu $ds9(mb).frame.lock.cube
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Bin}] \
+ -variable bin(lock) -command {LockBinCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Axes Order}] \
+ -variable cube(lock,axes) -command {LockAxesCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Scale}] \
+ -variable scale(lock) -command {LockScaleCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Scale and Limits}] \
+ -variable scale(lock,limits) -command {LockScaleLimitsCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable colorbar(lock) -command {LockColorCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Block}] \
+ -variable block(lock) -command {LockBlockCurrent}
+ $ds9(mb).frame.lock add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable smooth(lock) -command {LockSmoothCurrent}
+
+ menu $ds9(mb).frame.lock.frame
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {None}] \
+ -variable panzoom(lock) -value none -command LockFrameCurrent
+ $ds9(mb).frame.lock.frame add separator
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {WCS}] \
+ -variable panzoom(lock) -value wcs -command LockFrameCurrent
+ $ds9(mb).frame.lock.frame add separator
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {Image}] \
+ -variable panzoom(lock) -value image -command LockFrameCurrent
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {Physical}] \
+ -variable panzoom(lock) -value physical -command LockFrameCurrent
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {Amplifier}] \
+ -variable panzoom(lock) -value amplifier -command LockFrameCurrent
+ $ds9(mb).frame.lock.frame add radiobutton -label [msgcat::mc {Detector}] \
+ -variable panzoom(lock) -value detector -command LockFrameCurrent
+
+ menu $ds9(mb).frame.lock.crosshair
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {None}] -variable crosshair(lock) \
+ -value none -command LockCrosshairCurrent
+ $ds9(mb).frame.lock.crosshair add separator
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {WCS}] -variable crosshair(lock) \
+ -value wcs -command LockCrosshairCurrent
+ $ds9(mb).frame.lock.crosshair add separator
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {Image}] -variable crosshair(lock) \
+ -value image -command LockCrosshairCurrent
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {Physical}] -variable crosshair(lock) \
+ -value physical -command LockCrosshairCurrent
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {Amplifier}] -variable crosshair(lock) \
+ -value amplifier -command LockCrosshairCurrent
+ $ds9(mb).frame.lock.crosshair add radiobutton \
+ -label [msgcat::mc {Detector}] -variable crosshair(lock) \
+ -value detector -command LockCrosshairCurrent
+
+ menu $ds9(mb).frame.lock.crop
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {None}] \
+ -variable crop(lock) -value none -command LockCropCurrent
+ $ds9(mb).frame.lock.crop add separator
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {WCS}] \
+ -variable crop(lock) -value wcs -command LockCropCurrent
+ $ds9(mb).frame.lock.crop add separator
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {Image}] \
+ -variable crop(lock) -value image -command LockCropCurrent
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {Physical}] \
+ -variable crop(lock) -value physical -command LockCropCurrent
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {Amplifier}] \
+ -variable crop(lock) -value amplifier -command LockCropCurrent
+ $ds9(mb).frame.lock.crop add radiobutton -label [msgcat::mc {Detector}] \
+ -variable crop(lock) -value detector -command LockCropCurrent
+
+ menu $ds9(mb).frame.lock.cube
+ $ds9(mb).frame.lock.cube add radiobutton -label [msgcat::mc {None}] \
+ -variable cube(lock) -value none -command LockCubeCurrent
+ $ds9(mb).frame.lock.cube add separator
+ $ds9(mb).frame.lock.cube add radiobutton -label [msgcat::mc {WCS}] \
+ -variable cube(lock) -value wcs -command LockCubeCurrent
+ $ds9(mb).frame.lock.cube add separator
+ $ds9(mb).frame.lock.cube add radiobutton -label [msgcat::mc {Image}] \
+ -variable cube(lock) -value image -command LockCubeCurrent
+
+ # active
+ menu $ds9(mb).frame.active
+ $ds9(mb).frame.active add command -label [msgcat::mc {Show All}] \
+ -command ActiveFrameAll
+ $ds9(mb).frame.active add command -label [msgcat::mc {Hide All}] \
+ -command ActiveFrameNone
+ $ds9(mb).frame.active add separator
+
+ # move
+ menu $ds9(mb).frame.move
+ $ds9(mb).frame.move add command -label [msgcat::mc {First}] \
+ -command MoveFirstFrame
+ $ds9(mb).frame.move add command -label [msgcat::mc {Back}] \
+ -command MovePrevFrame
+ $ds9(mb).frame.move add command -label [msgcat::mc {Forward}] \
+ -command MoveNextFrame
+ $ds9(mb).frame.move add command -label [msgcat::mc {Last}] \
+ -command MoveLastFrame
+
+ menu $ds9(mb).frame.goto
+
+ # params
+ menu $ds9(mb).frame.params
+ $ds9(mb).frame.params add cascade -label [msgcat::mc {Tile}] \
+ -menu $ds9(mb).frame.params.tile
+ $ds9(mb).frame.params add cascade -label [msgcat::mc {Blink Interval}] \
+ -menu $ds9(mb).frame.params.blink
+ $ds9(mb).frame.params add command -label [msgcat::mc {Display Size}] \
+ -command DisplayDefaultDialog
+
+ menu $ds9(mb).frame.params.tile
+ $ds9(mb).frame.params.tile add radiobutton -label [msgcat::mc {Grid}] \
+ -variable tile(mode) -value grid -command DisplayMode
+ $ds9(mb).frame.params.tile add radiobutton -label [msgcat::mc {Columns}] \
+ -variable tile(mode) -value column -command DisplayMode
+ $ds9(mb).frame.params.tile add radiobutton -label [msgcat::mc {Rows}] \
+ -variable tile(mode) -value row -command DisplayMode
+ $ds9(mb).frame.params.tile add separator
+ $ds9(mb).frame.params.tile add command \
+ -label "[msgcat::mc {Tile Parameters}]..." -command TileDialog
+
+ menu $ds9(mb).frame.params.blink
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label ".125 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 125
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label ".25 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 250
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label ".5 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 500
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label "1 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 1000
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label "2 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 2000
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label "4 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 4000
+ $ds9(mb).frame.params.blink add radiobutton \
+ -label "8 [msgcat::mc {Seconds}]" \
+ -variable blink(interval) -value 8000
+}
+
+proc PrefsDialogFrameMenu {w} {
+ set f [ttk::labelframe $w.mframe -text [msgcat::mc {Frame}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarFrame $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {Single Frame}] \
+ -variable pcurrent(display) -value single
+ $m add radiobutton -label [msgcat::mc {Tile Frames}] \
+ -variable pcurrent(display) -value tile
+ $m add radiobutton -label [msgcat::mc {Blink Frames}] \
+ -variable pcurrent(display) -value blink
+ $m add separator
+ $m add cascade -label [msgcat::mc {Frame Parameters}] \
+ -menu $m.params
+
+ menu $m.params
+ $m.params add cascade -label [msgcat::mc {Tile}] \
+ -menu $m.params.tile
+ $m.params add cascade -label [msgcat::mc {Blink Interval}] \
+ -menu $m.params.blink
+
+ menu $m.params.tile
+ $m.params.tile add radiobutton -label [msgcat::mc {Grid}] \
+ -variable ptile(mode) -value grid
+ $m.params.tile add radiobutton -label [msgcat::mc {Columns}] \
+ -variable ptile(mode) -value column
+ $m.params.tile add radiobutton -label [msgcat::mc {Rows}] \
+ -variable ptile(mode) -value row
+
+ menu $m.params.blink
+ $m.params.blink add radiobutton -label ".125 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 125
+ $m.params.blink add radiobutton -label ".25 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 250
+ $m.params.blink add radiobutton -label ".5 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 500
+ $m.params.blink add radiobutton -label "1 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 1000
+ $m.params.blink add radiobutton -label "2 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 2000
+ $m.params.blink add radiobutton -label "4 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 4000
+ $m.params.blink add radiobutton -label "8 [msgcat::mc {Seconds}]" \
+ -variable pblink(interval) -value 8000
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsFrameDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ frame,new 1
+ frame,newrgb 1
+ frame,new3d 1
+ frame,delete 1
+ frame,deleteall 0
+ frame,clear 1
+ frame,reset 0
+ frame,refresh 0
+ frame,single 1
+ frame,tile 1
+ frame,blink 1
+
+ frame,match,bin 0
+ frame,match,axes 0
+ frame,match,scale 0
+ frame,match,scalelimits 0
+ frame,match,color 0
+ frame,match,smooth 0
+
+ frame,match,frame,wcs 0
+ frame,match,frame,image 0
+ frame,match,frame,physical 0
+ frame,match,frame,detector 0
+ frame,match,frame,amplifier 0
+
+ frame,match,crosshair,wcs 0
+ frame,match,crosshair,image 0
+ frame,match,crosshair,physical 0
+ frame,match,crosshair,detector 0
+ frame,match,crosshair,amplifier 0
+
+ frame,match,crop,wcs 0
+ frame,match,crop,image 0
+ frame,match,crop,physical 0
+ frame,match,crop,detector 0
+ frame,match,crop,amplifier 0
+
+ frame,match,cube,wcs 0
+ frame,match,cube,image 0
+
+ frame,lock,bin 0
+ frame,lock,axes 0
+ frame,lock,scale 0
+ frame,lock,scalelimits 0
+ frame,lock,color 0
+ frame,lock,smooth 0
+
+ frame,lock,frame,none 0
+ frame,lock,frame,wcs 0
+ frame,lock,frame,image 0
+ frame,lock,frame,physical 0
+ frame,lock,frame,detector 0
+ frame,lock,frame,amplifier 0
+
+ frame,lock,crosshair,none 0
+ frame,lock,crosshair,wcs 0
+ frame,lock,crosshair,image 0
+ frame,lock,crosshair,physical 0
+ frame,lock,crosshair,detector 0
+ frame,lock,crosshair,amplifier 0
+
+ frame,lock,crop,none 0
+ frame,lock,crop,wcs 0
+ frame,lock,crop,image 0
+ frame,lock,crop,physical 0
+ frame,lock,crop,detector 0
+ frame,lock,crop,amplifier 0
+
+ frame,lock,cube,none 0
+ frame,lock,cube,wcs 0
+ frame,lock,cube,image 0
+
+ frame,movefirst 0
+ frame,moveprev 0
+ frame,movenext 0
+ frame,movelast 0
+ frame,first 1
+ frame,prev 1
+ frame,next 1
+ frame,last 1
+ frame,cube 0
+ frame,rgb 0
+ frame,3d 0
+ frame,size 0
+ }
+}
+
+proc CreateButtonsFrame {} {
+ global buttons
+ global ds9
+ global current
+
+ ttk::frame $ds9(buttons).frame
+
+ ButtonButton $ds9(buttons).frame.new \
+ [string tolower [msgcat::mc {New}]] CreateFrame
+ ButtonButton $ds9(buttons).frame.newrgb \
+ [string tolower [msgcat::mc {RGB}]] CreateRGBFrame
+ ButtonButton $ds9(buttons).frame.new3d \
+ [string tolower [msgcat::mc {3D}]] Create3DFrame
+
+ ButtonButton $ds9(buttons).frame.delete \
+ [string tolower [msgcat::mc {Delete}]] DeleteCurrentFrame
+ ButtonButton $ds9(buttons).frame.deleteall \
+ [string tolower [msgcat::mc {Delete All}]] DeleteAllFramesMenu
+
+ ButtonButton $ds9(buttons).frame.clear \
+ [string tolower [msgcat::mc {Clear}]] ClearCurrentFrame
+ ButtonButton $ds9(buttons).frame.reset \
+ [string tolower [msgcat::mc {Reset}]] ResetCurrentFrame
+ ButtonButton $ds9(buttons).frame.refresh \
+ [string tolower [msgcat::mc {Refresh}]] UpdateCurrentFrame
+
+ RadioButton $ds9(buttons).frame.single \
+ [string tolower [msgcat::mc {Single}]] \
+ current(display) single DisplayMode
+ RadioButton $ds9(buttons).frame.tile \
+ [string tolower [msgcat::mc {Tile}]] \
+ current(display) tile DisplayMode
+ RadioButton $ds9(buttons).frame.blink \
+ [string tolower [msgcat::mc {Blink}]] \
+ current(display) blink DisplayMode
+
+ ButtonButton $ds9(buttons).frame.matchbin \
+ [string tolower [msgcat::mc {Match Bin}]] MatchBinCurrent
+ ButtonButton $ds9(buttons).frame.matchaxes \
+ [string tolower [msgcat::mc {Match Axes}]] MatchAxesCurrent
+ ButtonButton $ds9(buttons).frame.matchscale \
+ [string tolower [msgcat::mc {Match Scale}]] MatchScaleCurrent
+ ButtonButton $ds9(buttons).frame.matchscalelimits \
+ [string tolower [msgcat::mc {Match Limits}]] \
+ MatchScaleLimitsCurrent
+ ButtonButton $ds9(buttons).frame.matchcolor \
+ [string tolower [msgcat::mc {Match Color}]] MatchColorCurrent
+ ButtonButton $ds9(buttons).frame.matchsmooth \
+ [string tolower [msgcat::mc {Match Smooth}]] MatchSmoothCurrent
+
+ ButtonButton $ds9(buttons).frame.matchframewcs \
+ [string tolower [msgcat::mc {Match Frame WCS}]] \
+ {MatchFrameCurrent wcs}
+ ButtonButton $ds9(buttons).frame.matchframeimage \
+ [string tolower [msgcat::mc {Match Frame Image}]] \
+ {MatchFrameCurrent image}
+ ButtonButton $ds9(buttons).frame.matchframephysical \
+ [string tolower [msgcat::mc {Match Frame Physical}]] \
+ {MatchFrameCurrent physical}
+ ButtonButton $ds9(buttons).frame.matchframedetector \
+ [string tolower [msgcat::mc {Match Frame Detector}]] \
+ {MatchFrameCurrent detector}
+ ButtonButton $ds9(buttons).frame.matchframeamplifier \
+ [string tolower [msgcat::mc {Match Frame Amplifier}]] \
+ {MatchFrameCurrent amplifier}
+
+ ButtonButton $ds9(buttons).frame.matchcrosshairwcs \
+ [string tolower [msgcat::mc {Match Crosshair WCS}]] \
+ {MatchCrosshairCurrent wcs}
+ ButtonButton $ds9(buttons).frame.matchcrosshairimage \
+ [string tolower [msgcat::mc {Match Crosshair Image}]] \
+ {MatchCrosshairCurrent image}
+ ButtonButton $ds9(buttons).frame.matchcrosshairphysical \
+ [string tolower [msgcat::mc {Match Crosshair Physical}]] \
+ {MatchCrosshairCurrent physical}
+ ButtonButton $ds9(buttons).frame.matchcrosshairdetector \
+ [string tolower [msgcat::mc {Match Crosshair Detector}]] \
+ {MatchCrosshairCurrent detector}
+ ButtonButton $ds9(buttons).frame.matchcrosshairamplifier \
+ [string tolower [msgcat::mc {Match Crosshair Amplifier}]] \
+ {MatchCrosshairCurrent amplifier}
+
+ ButtonButton $ds9(buttons).frame.matchcropwcs \
+ [string tolower [msgcat::mc {Match Crop WCS}]] \
+ {MatchCropCurrent wcs}
+ ButtonButton $ds9(buttons).frame.matchcropimage \
+ [string tolower [msgcat::mc {Match Crop Image}]] \
+ {MatchCropCurrent image}
+ ButtonButton $ds9(buttons).frame.matchcropphysical \
+ [string tolower [msgcat::mc {Match Crop Physical}]] \
+ {MatchCropCurrent physical}
+ ButtonButton $ds9(buttons).frame.matchcropdetector \
+ [string tolower [msgcat::mc {Match Crop Detector}]] \
+ {MatchCropCurrent detector}
+ ButtonButton $ds9(buttons).frame.matchcropamplifier \
+ [string tolower [msgcat::mc {Match Crop Amplifier}]] \
+ {MatchCropCurrent amplifier}
+
+ ButtonButton $ds9(buttons).frame.matchcubewcs \
+ [string tolower [msgcat::mc {Match Slice WCS}]] \
+ {MatchCubeCurrent wcs}
+ ButtonButton $ds9(buttons).frame.matchcubeimage \
+ [string tolower [msgcat::mc {Match Slice Image}]] \
+ {MatchCubeCurrent image}
+
+ CheckButton $ds9(buttons).frame.lockbin \
+ [string tolower [msgcat::mc {Lock Bin}]] bin(lock) LockBinCurrent
+ CheckButton $ds9(buttons).frame.lockaxes \
+ [string tolower [msgcat::mc {Lock Axes}]] \
+ cube(lock,axes) LockAxesCurrent
+ CheckButton $ds9(buttons).frame.lockscale \
+ [string tolower [msgcat::mc {Lock Scale}]] scale(lock) LockScaleCurrent
+ CheckButton $ds9(buttons).frame.lockscalelimits \
+ [string tolower [msgcat::mc {Lock Limits}]] \
+ scale(lock,limits) LockScaleLimitsCurrent
+ CheckButton $ds9(buttons).frame.lockcolor \
+ [string tolower [msgcat::mc {Lock Color}]] color(lock) LockColorCurrent
+ CheckButton $ds9(buttons).frame.locksmooth \
+ [string tolower [msgcat::mc {Lock Smooth}]] \
+ smooth(lock) LockSmoothCurrent
+
+ RadioButton $ds9(buttons).frame.lockframenone \
+ [string tolower [msgcat::mc {Lock Frame None}]] \
+ panzoom(lock) none LockFrameCurrent
+ RadioButton $ds9(buttons).frame.lockframewcs \
+ [string tolower [msgcat::mc {Lock Frame WCS}]] \
+ panzoom(lock) wcs LockFrameCurrent
+ RadioButton $ds9(buttons).frame.lockframeimage \
+ [string tolower [msgcat::mc {Lock Frame Image}]] \
+ panzoom(lock) image LockFrameCurrent
+ RadioButton $ds9(buttons).frame.lockframephysical \
+ [string tolower [msgcat::mc {Lock Frame Physical}]] \
+ panzoom(lock) physical LockFrameCurrent
+ RadioButton $ds9(buttons).frame.lockframedetector \
+ [string tolower [msgcat::mc {Lock Frame Detector}]] \
+ panzoom(lock) detector LockFrameCurrent
+ RadioButton $ds9(buttons).frame.lockframeamplifier \
+ [string tolower [msgcat::mc {Lock Frame Amplifier}]] \
+ panzoom(lock) amplifier LockFrameCurrent
+
+ RadioButton $ds9(buttons).frame.lockcrosshairnone \
+ [string tolower [msgcat::mc {Lock Crosshair None}]] \
+ crosshair(lock) none LockCrosshairCurrent
+ RadioButton $ds9(buttons).frame.lockcrosshairwcs \
+ [string tolower [msgcat::mc {Lock Crosshair WCS}]] \
+ crosshair(lock) wcs LockCrosshairCurrent
+ RadioButton $ds9(buttons).frame.lockcrosshairimage \
+ [string tolower [msgcat::mc {Lock Crosshair Image}]] \
+ crosshair(lock) image LockCrosshairCurrent
+ RadioButton $ds9(buttons).frame.lockcrosshairphysical \
+ [string tolower [msgcat::mc {Lock Crosshair Physical}]] \
+ crosshair(lock) physical LockCrosshairCurrent
+ RadioButton $ds9(buttons).frame.lockcrosshairdetector \
+ [string tolower [msgcat::mc {Lock Crosshair Detector}]] \
+ crosshair(lock) detector LockCrosshairCurrent
+ RadioButton $ds9(buttons).frame.lockcrosshairamplifier \
+ [string tolower [msgcat::mc {Lock Crosshair Amplifier}]] \
+ crosshair(lock) amplifier LockCrosshairCurrent
+
+ RadioButton $ds9(buttons).frame.lockcropnone \
+ [string tolower [msgcat::mc {Lock Crop None}]] \
+ crop(lock) none LockCropCurrent
+ RadioButton $ds9(buttons).frame.lockcropwcs \
+ [string tolower [msgcat::mc {Lock Crop WCS}]] \
+ crop(lock) wcs LockCropCurrent
+ RadioButton $ds9(buttons).frame.lockcropimage \
+ [string tolower [msgcat::mc {Lock Crop Image}]] \
+ crop(lock) image LockCropCurrent
+ RadioButton $ds9(buttons).frame.lockcropphysical \
+ [string tolower [msgcat::mc {Lock Crop Physical}]] \
+ crop(lock) physical LockCropCurrent
+ RadioButton $ds9(buttons).frame.lockcropdetector \
+ [string tolower [msgcat::mc {Lock Crop Detector}]] \
+ crop(lock) detector LockCropCurrent
+ RadioButton $ds9(buttons).frame.lockcropamplifier \
+ [string tolower [msgcat::mc {Lock Crop Amplifier}]] \
+ crop(lock) amplifier LockCropCurrent
+
+ RadioButton $ds9(buttons).frame.lockcubenone \
+ [string tolower [msgcat::mc {Lock Slice None}]] \
+ cube(lock) none LockCubeCurrent
+ RadioButton $ds9(buttons).frame.lockcubewcs \
+ [string tolower [msgcat::mc {Lock Slice WCS}]] \
+ cube(lock) wcs LockCubeCurrent
+ RadioButton $ds9(buttons).frame.lockcubeimage \
+ [string tolower [msgcat::mc {Lock Slice Image}]] \
+ cube(lock) image LockCubeCurrent
+
+ ButtonButton $ds9(buttons).frame.movefirst \
+ [string tolower [msgcat::mc {Move First}]] MoveFirstFrame
+ ButtonButton $ds9(buttons).frame.moveprev \
+ [string tolower [msgcat::mc {Move Back}]] MovePrevFrame
+ ButtonButton $ds9(buttons).frame.movenext \
+ [string tolower [msgcat::mc {Move Forward}]] MoveNextFrame
+ ButtonButton $ds9(buttons).frame.movelast \
+ [string tolower [msgcat::mc {Move Last}]] MoveLastFrame
+
+ ButtonButton $ds9(buttons).frame.first \
+ [string tolower [msgcat::mc {First}]] FirstFrame
+ ButtonButton $ds9(buttons).frame.prev \
+ [string tolower [msgcat::mc {Prev}]] PrevFrame
+ ButtonButton $ds9(buttons).frame.next \
+ [string tolower [msgcat::mc {Next}]] NextFrame
+ ButtonButton $ds9(buttons).frame.last \
+ [string tolower [msgcat::mc {Last}]] LastFrame
+
+ ButtonButton $ds9(buttons).frame.cube \
+ [string tolower "[msgcat::mc {Cube}]..."] CubeDialog
+ ButtonButton $ds9(buttons).frame.rgb \
+ [string tolower "[msgcat::mc {RGB}]..."] RGBDialog
+ ButtonButton $ds9(buttons).frame.3d \
+ [string tolower "[msgcat::mc {3D}]..."] 3DDialog
+
+ ButtonButton $ds9(buttons).frame.size \
+ [string tolower [msgcat::mc {Size}]] DisplayDefaultDialog
+
+ set buttons(frame) "
+ $ds9(buttons).frame.new pbuttons(frame,new)
+ $ds9(buttons).frame.newrgb pbuttons(frame,newrgb)
+ $ds9(buttons).frame.new3d pbuttons(frame,new3d)
+ $ds9(buttons).frame.delete pbuttons(frame,delete)
+ $ds9(buttons).frame.deleteall pbuttons(frame,deleteall)
+ $ds9(buttons).frame.clear pbuttons(frame,clear)
+ $ds9(buttons).frame.reset pbuttons(frame,reset)
+ $ds9(buttons).frame.refresh pbuttons(frame,refresh)
+ $ds9(buttons).frame.single pbuttons(frame,single)
+ $ds9(buttons).frame.tile pbuttons(frame,tile)
+ $ds9(buttons).frame.blink pbuttons(frame,blink)
+
+ $ds9(buttons).frame.matchbin pbuttons(frame,match,bin)
+ $ds9(buttons).frame.matchaxes pbuttons(frame,match,axes)
+ $ds9(buttons).frame.matchscale pbuttons(frame,match,scale)
+ $ds9(buttons).frame.matchscalelimits pbuttons(frame,match,scalelimits)
+ $ds9(buttons).frame.matchcolor pbuttons(frame,match,color)
+ $ds9(buttons).frame.matchsmooth pbuttons(frame,match,smooth)
+
+ $ds9(buttons).frame.matchframewcs pbuttons(frame,match,frame,wcs)
+ $ds9(buttons).frame.matchframeimage pbuttons(frame,match,frame,image)
+ $ds9(buttons).frame.matchframephysical pbuttons(frame,match,frame,physical)
+ $ds9(buttons).frame.matchframedetector pbuttons(frame,match,frame,detector)
+ $ds9(buttons).frame.matchframeamplifier pbuttons(frame,match,frame,amplifier)
+
+ $ds9(buttons).frame.matchcrosshairwcs pbuttons(frame,match,crosshair,wcs)
+ $ds9(buttons).frame.matchcrosshairimage pbuttons(frame,match,crosshair,image)
+ $ds9(buttons).frame.matchcrosshairphysical pbuttons(frame,match,crosshair,physical)
+ $ds9(buttons).frame.matchcrosshairdetector pbuttons(frame,match,crosshair,detector)
+ $ds9(buttons).frame.matchcrosshairamplifier pbuttons(frame,match,crosshair,amplifier)
+
+ $ds9(buttons).frame.matchcropwcs pbuttons(frame,match,crop,wcs)
+ $ds9(buttons).frame.matchcropimage pbuttons(frame,match,crop,image)
+ $ds9(buttons).frame.matchcropphysical pbuttons(frame,match,crop,physical)
+ $ds9(buttons).frame.matchcropdetector pbuttons(frame,match,crop,detector)
+ $ds9(buttons).frame.matchcropamplifier pbuttons(frame,match,crop,amplifier)
+
+ $ds9(buttons).frame.matchcubewcs pbuttons(frame,match,cube,wcs)
+ $ds9(buttons).frame.matchcubeimage pbuttons(frame,match,cube,image)
+
+ $ds9(buttons).frame.lockbin pbuttons(frame,lock,bin)
+ $ds9(buttons).frame.lockaxes pbuttons(frame,lock,axes)
+ $ds9(buttons).frame.lockscale pbuttons(frame,lock,scale)
+ $ds9(buttons).frame.lockscalelimits pbuttons(frame,lock,scalelimits)
+ $ds9(buttons).frame.lockcolor pbuttons(frame,lock,color)
+ $ds9(buttons).frame.locksmooth pbuttons(frame,lock,smooth)
+
+ $ds9(buttons).frame.lockframenone pbuttons(frame,lock,frame,none)
+ $ds9(buttons).frame.lockframewcs pbuttons(frame,lock,frame,wcs)
+ $ds9(buttons).frame.lockframeimage pbuttons(frame,lock,frame,image)
+ $ds9(buttons).frame.lockframephysical pbuttons(frame,lock,frame,physical)
+ $ds9(buttons).frame.lockframedetector pbuttons(frame,lock,frame,detector)
+ $ds9(buttons).frame.lockframeamplifier pbuttons(frame,lock,frame,amplifier)
+
+ $ds9(buttons).frame.lockcrosshairnone pbuttons(frame,lock,crosshair,none)
+ $ds9(buttons).frame.lockcrosshairwcs pbuttons(frame,lock,crosshair,wcs)
+ $ds9(buttons).frame.lockcrosshairimage pbuttons(frame,lock,crosshair,image)
+ $ds9(buttons).frame.lockcrosshairphysical pbuttons(frame,lock,crosshair,physical)
+ $ds9(buttons).frame.lockcrosshairdetector pbuttons(frame,lock,crosshair,detector)
+ $ds9(buttons).frame.lockcrosshairamplifier pbuttons(frame,lock,crosshair,amplifier)
+
+ $ds9(buttons).frame.lockcropnone pbuttons(frame,lock,crop,none)
+ $ds9(buttons).frame.lockcropwcs pbuttons(frame,lock,crop,wcs)
+ $ds9(buttons).frame.lockcropimage pbuttons(frame,lock,crop,image)
+ $ds9(buttons).frame.lockcropphysical pbuttons(frame,lock,crop,physical)
+ $ds9(buttons).frame.lockcropdetector pbuttons(frame,lock,crop,detector)
+ $ds9(buttons).frame.lockcropamplifier pbuttons(frame,lock,crop,amplifier)
+
+ $ds9(buttons).frame.lockcubenone pbuttons(frame,lock,cube,none)
+ $ds9(buttons).frame.lockcubewcs pbuttons(frame,lock,cube,wcs)
+ $ds9(buttons).frame.lockcubeimage pbuttons(frame,lock,cube,image)
+
+ $ds9(buttons).frame.movefirst pbuttons(frame,movefirst)
+ $ds9(buttons).frame.moveprev pbuttons(frame,moveprev)
+ $ds9(buttons).frame.movenext pbuttons(frame,movenext)
+ $ds9(buttons).frame.movelast pbuttons(frame,movelast)
+ $ds9(buttons).frame.first pbuttons(frame,first)
+ $ds9(buttons).frame.prev pbuttons(frame,prev)
+ $ds9(buttons).frame.next pbuttons(frame,next)
+ $ds9(buttons).frame.last pbuttons(frame,last)
+ $ds9(buttons).frame.cube pbuttons(frame,cube)
+ $ds9(buttons).frame.rgb pbuttons(frame,rgb)
+ $ds9(buttons).frame.3d pbuttons(frame,3d)
+ $ds9(buttons).frame.size pbuttons(frame,size)
+ "
+}
+
+proc PrefsDialogButtonbarFrame {f} {
+ global buttons
+ global pbuttons
+ global ds9
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {New Frame}] \
+ -variable pbuttons(frame,new) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {New Frame RGB}] \
+ -variable pbuttons(frame,newrgb) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {New Frame 3D}] \
+ -variable pbuttons(frame,new3d) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Delete Frame}] \
+ -variable pbuttons(frame,delete) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Delete All Frames}] \
+ -variable pbuttons(frame,deleteall) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Clear Frame}] \
+ -variable pbuttons(frame,clear) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Reset Frame}] \
+ -variable pbuttons(frame,reset) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Refresh Frame}] \
+ -variable pbuttons(frame,refresh) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Single Frame}] \
+ -variable pbuttons(frame,single) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Tile Frames}] \
+ -variable pbuttons(frame,tile) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Blink Frames}] \
+ -variable pbuttons(frame,blink) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {Match}] -menu $m.match
+ $m add cascade -label [msgcat::mc {Lock}] -menu $m.lock
+ $m add separator
+ $m add cascade -label [msgcat::mc {Move Frame}] -menu $m.move
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {First Frame}] \
+ -variable pbuttons(frame,first) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Previous Frame}] \
+ -variable pbuttons(frame,prev) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Next Frame}] \
+ -variable pbuttons(frame,next) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label [msgcat::mc {Last Frame}] \
+ -variable pbuttons(frame,last) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Cube}]..." \
+ -variable pbuttons(frame,cube) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label "[msgcat::mc {RGB}]..." \
+ -variable pbuttons(frame,rgb) -command {UpdateButtons buttons(frame)}
+ $m add checkbutton -label "[msgcat::mc {3D}]..." \
+ -variable pbuttons(frame,3d) -command {UpdateButtons buttons(frame)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {Frame Parameters}] -menu $m.params
+
+ # match
+ menu $m.match
+ $m.match add cascade -label [msgcat::mc {Frame}] \
+ -menu $m.match.frame
+ $m.match add cascade -label [msgcat::mc {Crosshair}] \
+ -menu $m.match.crosshair
+ $m.match add cascade -label [msgcat::mc {Crop}] \
+ -menu $m.match.crop
+ $m.match add cascade -label [msgcat::mc {Slice}] \
+ -menu $m.match.cube
+ $m.match add checkbutton -label [msgcat::mc {Bin}] \
+ -variable pbuttons(frame,match,bin) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match add checkbutton -label [msgcat::mc {Axes Order}] \
+ -variable pbuttons(frame,match,axes) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match add checkbutton -label [msgcat::mc {Scale}] \
+ -variable pbuttons(frame,match,scale) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match add checkbutton -label [msgcat::mc {Scale and Limits}] \
+ -variable pbuttons(frame,match,scalelimits) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match add checkbutton -label [msgcat::mc {Color}] \
+ -variable pbuttons(frame,match,color) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable pbuttons(frame,match,smooth) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.match.frame
+ $m.match.frame add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,match,frame,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.frame add separator
+ $m.match.frame add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,match,frame,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.frame add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,match,frame,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.frame add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,match,frame,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.frame add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,match,frame,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.match.crosshair
+ $m.match.crosshair add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,match,crosshair,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crosshair add separator
+ $m.match.crosshair add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,match,crosshair,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crosshair add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,match,crosshair,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crosshair add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,match,crosshair,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crosshair add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,match,crosshair,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.match.crop
+ $m.match.crop add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,match,crop,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crop add separator
+ $m.match.crop add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,match,crop,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crop add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,match,crop,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crop add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,match,crop,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.crop add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,match,crop,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+
+ menu $m.match.cube
+ $m.match.cube add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,match,cube,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.match.cube add separator
+ $m.match.cube add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,match,cube,image) \
+ -command {UpdateButtons buttons(frame)}
+
+ # lock
+ menu $m.lock
+ $m.lock add cascade -label [msgcat::mc {Frame}] \
+ -menu $m.lock.frame
+ $m.lock add cascade -label [msgcat::mc {Crosshair}] \
+ -menu $m.lock.crosshair
+ $m.lock add cascade -label [msgcat::mc {Crop}] \
+ -menu $m.lock.crop
+ $m.lock add cascade -label [msgcat::mc {Slice}] \
+ -menu $m.lock.cube
+ $m.lock add checkbutton -label [msgcat::mc {Bin}] \
+ -variable pbuttons(frame,lock,bin) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock add checkbutton -label [msgcat::mc {Axes Order}] \
+ -variable pbuttons(frame,lock,axes) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock add checkbutton -label [msgcat::mc {Scale}] \
+ -variable pbuttons(frame,lock,scale) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock add checkbutton -label [msgcat::mc {Scale and Limits}] \
+ -variable pbuttons(frame,lock,scalelimits) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock add checkbutton -label [msgcat::mc {Color}] \
+ -variable pbuttons(frame,lock,color) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable pbuttons(frame,lock,smooth) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.lock.frame
+ $m.lock.frame add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(frame,lock,frame,none) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.frame add separator
+ $m.lock.frame add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,lock,frame,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.frame add separator
+ $m.lock.frame add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,lock,frame,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.frame add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,lock,frame,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.frame add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,lock,frame,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.frame add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,lock,frame,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.lock.crosshair
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(frame,lock,crosshair,none) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crosshair add separator
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,lock,crosshair,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crosshair add separator
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,lock,crosshair,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,lock,crosshair,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,lock,crosshair,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crosshair add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,lock,crosshair,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+ menu $m.lock.crop
+ $m.lock.crop add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(frame,lock,crop,none) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crop add separator
+ $m.lock.crop add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,lock,crop,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crop add separator
+ $m.lock.crop add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,lock,crop,image) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crop add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(frame,lock,crop,physical) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crop add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(frame,lock,crop,detector) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.crop add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(frame,lock,crop,amplifier) \
+ -command {UpdateButtons buttons(frame)}
+
+
+ menu $m.lock.cube
+ $m.lock.cube add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(frame,lock,cube,none) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.cube add separator
+ $m.lock.cube add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(frame,lock,cube,wcs) \
+ -command {UpdateButtons buttons(frame)}
+ $m.lock.cube add separator
+ $m.lock.cube add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(frame,lock,cube,image) \
+ -command {UpdateButtons buttons(frame)}
+
+ # move
+ menu $m.move
+ $m.move add checkbutton -label [msgcat::mc {First}] \
+ -variable pbuttons(frame,movefirst) \
+ -command {UpdateButtons buttons(frame)}
+ $m.move add checkbutton -label [msgcat::mc {Back}] \
+ -variable pbuttons(frame,moveprev) \
+ -command {UpdateButtons buttons(frame)}
+ $m.move add checkbutton -label [msgcat::mc {Forward}] \
+ -variable pbuttons(frame,movenext) \
+ -command {UpdateButtons buttons(frame)}
+ $m.move add checkbutton -label [msgcat::mc {Last}] \
+ -variable pbuttons(frame,movelast) \
+ -command {UpdateButtons buttons(frame)}
+
+ # params
+ menu $m.params
+ $m.params add checkbutton -label [msgcat::mc {Display Size}] \
+ -variable pbuttons(frame,size) -command {UpdateButtons buttons(frame)}
+}
+
+# Support
+
+proc UpdateFrameMenuStatic {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateFrameMenuStatic"
+ }
+
+ $ds9(mb).frame entryconfig [msgcat::mc {New Frame RGB}] -state normal
+ $ds9(buttons).frame.newrgb configure -state normal
+
+ if {$ds9(active,num) > 0} {
+ $ds9(mb).frame entryconfig [msgcat::mc {Delete Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Delete All Frames}] -state normal
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Clear Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Reset Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Refresh Frame}] -state normal
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Single Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Tile Frames}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Blink Frames}] -state normal
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Match}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Lock}] -state normal
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Move Frame}] -state normal
+
+ $ds9(mb).frame entryconfig [msgcat::mc {First Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Previous Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Next Frame}] -state normal
+ $ds9(mb).frame entryconfig [msgcat::mc {Last Frame}] -state normal
+
+ $ds9(buttons).frame.delete configure -state normal
+ $ds9(buttons).frame.deleteall configure -state normal
+
+ $ds9(buttons).frame.clear configure -state normal
+ $ds9(buttons).frame.reset configure -state normal
+ $ds9(buttons).frame.refresh configure -state normal
+
+ $ds9(buttons).frame.single configure -state normal
+ $ds9(buttons).frame.tile configure -state normal
+ $ds9(buttons).frame.blink configure -state normal
+
+ $ds9(buttons).frame.movefirst configure -state normal
+ $ds9(buttons).frame.moveprev configure -state normal
+ $ds9(buttons).frame.movenext configure -state normal
+ $ds9(buttons).frame.movelast configure -state normal
+
+ $ds9(buttons).frame.first configure -state normal
+ $ds9(buttons).frame.prev configure -state normal
+ $ds9(buttons).frame.next configure -state normal
+ $ds9(buttons).frame.last configure -state normal
+ } else {
+ $ds9(mb).frame entryconfig [msgcat::mc {Delete Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Delete All Frames}] -state disabled
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Clear Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Reset Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Refresh Frame}] -state disabled
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Single Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Tile Frames}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Blink Frames}] -state disabled
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Match}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Lock}] -state disabled
+
+ $ds9(mb).frame entryconfig [msgcat::mc {Move Frame}] -state disabled
+
+ $ds9(mb).frame entryconfig [msgcat::mc {First Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Previous Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Next Frame}] -state disabled
+ $ds9(mb).frame entryconfig [msgcat::mc {Last Frame}] -state disabled
+
+ $ds9(buttons).frame.delete configure -state disabled
+ $ds9(buttons).frame.deleteall configure -state disabled
+
+ $ds9(buttons).frame.clear configure -state disabled
+ $ds9(buttons).frame.reset configure -state disabled
+ $ds9(buttons).frame.refresh configure -state disabled
+
+ $ds9(buttons).frame.single configure -state disabled
+ $ds9(buttons).frame.tile configure -state disabled
+ $ds9(buttons).frame.blink configure -state disabled
+
+ $ds9(buttons).frame.movefirst configure -state disabled
+ $ds9(buttons).frame.moveprev configure -state disabled
+ $ds9(buttons).frame.movenext configure -state disabled
+ $ds9(buttons).frame.movelast configure -state disabled
+
+ $ds9(buttons).frame.first configure -state disabled
+ $ds9(buttons).frame.prev configure -state disabled
+ $ds9(buttons).frame.next configure -state disabled
+ $ds9(buttons).frame.last configure -state disabled
+ }
+}
+
+proc UpdateFrameMenu {} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateFrameMenu"
+ }
+
+ if {$current(frame) != {}} {
+ $ds9(mb).frame entryconfig "[msgcat::mc {Cube}]..." \
+ -state normal
+ $ds9(buttons).frame.cube configure -state normal
+
+ switch -- [$current(frame) get type] {
+ base {
+ $ds9(mb).frame entryconfig "[msgcat::mc {RGB}]..." \
+ -state disabled
+ $ds9(mb).frame entryconfig "[msgcat::mc {3D}]..." \
+ -state normal
+ $ds9(buttons).frame.rgb configure -state disabled
+ $ds9(buttons).frame.3d configure -state normal
+ }
+ rgb {
+ $ds9(mb).frame entryconfig "[msgcat::mc {RGB}]..." \
+ -state normal
+ $ds9(mb).frame entryconfig "[msgcat::mc {3D}]..." \
+ -state disabled
+ $ds9(buttons).frame.rgb configure -state normal
+ $ds9(buttons).frame.3d configure -state disabled
+ }
+ 3d {
+ $ds9(mb).frame entryconfig "[msgcat::mc {RGB}]..." \
+ -state disabled
+ $ds9(mb).frame entryconfig "[msgcat::mc {3D}]..." \
+ -state normal
+ $ds9(buttons).frame.rgb configure -state disabled
+ $ds9(buttons).frame.3d configure -state normal
+ }
+ }
+ } else {
+ $ds9(mb).frame entryconfig "[msgcat::mc {Cube}]..." \
+ -state disabled
+ $ds9(mb).frame entryconfig "[msgcat::mc {RGB}]..." \
+ -state disabled
+ $ds9(mb).frame entryconfig "[msgcat::mc {3D}]..." \
+ -state disabled
+ $ds9(buttons).frame.cube configure -state disabled
+ $ds9(buttons).frame.rgb configure -state disabled
+ $ds9(buttons).frame.3d configure -state disabled
+ }
+}
+
+proc UpdateFrameMenuItems {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateFrameMenuItems"
+ }
+
+ # Goto Frame Menu
+ if {[$ds9(mb).frame.goto index end] >= $ds9(menu,size,frame,goto)} {
+ $ds9(mb).frame.goto delete $ds9(menu,size,frame,goto) end
+ }
+
+ set cnt $ds9(menu,size,frame,goto)
+ foreach f $ds9(frames) {
+ set which "[msgcat::mc {Frame}] [string range $f 5 end]"
+ $ds9(mb).frame.goto add radiobutton -label $which \
+ -variable ds9(next) -value $f -command GotoFrame
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 1
+ $ds9(mb).frame.goto entryconfig $which -columnbreak 1
+ }
+ }
+
+ # Active Frame Menu
+ if {[$ds9(mb).frame.active index end] >= $ds9(menu,size,frame,active)} {
+ $ds9(mb).frame.active delete $ds9(menu,size,frame,active) end
+ }
+
+ set cnt $ds9(menu,size,frame,active)
+ foreach f $ds9(frames) {
+ set which "[msgcat::mc {Frame}] [string range $f 5 end]"
+ $ds9(mb).frame.active add checkbutton -label $which \
+ -variable active($f) -command UpdateActiveFrames
+
+ # wrap if needed
+ incr cnt
+ if {$cnt>=$ds9(menu,size,wrap)} {
+ set cnt 1
+ $ds9(mb).frame.active entryconfig $which -columnbreak 1
+ }
+ }
+}
+
diff --git a/ds9/library/mhelp.tcl b/ds9/library/mhelp.tcl
new file mode 100644
index 0000000..a44c3d5
--- /dev/null
+++ b/ds9/library/mhelp.tcl
@@ -0,0 +1,165 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menu
+
+proc HelpMainMenu {} {
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {
+ # window menu
+ menu $ds9(mb).window
+ $ds9(mb) add cascade -label [msgcat::mc {Window}] \
+ -menu $ds9(mb).window
+ }
+ }
+
+ $ds9(mb) add cascade -label [msgcat::mc {Help}] -menu $ds9(mb).help
+ menu $ds9(mb).help
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(mb).help add command -label [msgcat::mc {Reference Manual}]\
+ -command HelpRef
+ }
+ aqua {}
+ }
+ $ds9(mb).help add command -label [msgcat::mc {User Manual}]\
+ -command HelpUser
+ $ds9(mb).help add command -label [msgcat::mc {Mouse and Keyboard}] \
+ -command HelpKeyboard
+ $ds9(mb).help add separator
+ $ds9(mb).help add command -label [msgcat::mc {FAQ}] \
+ -command HelpFAQ
+ $ds9(mb).help add command -label [msgcat::mc {New Features}] \
+ -command HelpNew
+ $ds9(mb).help add command -label [msgcat::mc {Release Notes}] \
+ -command HelpRelease
+ $ds9(mb).help add command -label [msgcat::mc {Help Desk}] \
+ -command HelpDesk
+ $ds9(mb).help add separator
+ $ds9(mb).help add command -label [msgcat::mc {Story of SAOImage DS9}] \
+ -command HelpStory
+ $ds9(mb).help add command -label [msgcat::mc {Acknowledgment}] \
+ -command HelpAck
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(mb).help add separator
+ $ds9(mb).help add command \
+ -label "[msgcat::mc {About SAOImage DS9}]..." \
+ -command AboutBox
+ }
+ aqua {}
+ }
+}
+
+proc PrefsDialogHelpMenu {w} {
+ set f [ttk::labelframe $w.mhelp -text [msgcat::mc {Help}]]
+
+ PrefsDialogButtonbarHelp $f.buttonbar
+
+ grid $f.buttonbar -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsHelpDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ help,ref 1
+ help,user 1
+ help,keyboard 1
+ help,faq 0
+ help,new 0
+ help,release 1
+ help,desk 1
+ help,story 0
+ help,ack 1
+ help,about 1
+ }
+}
+
+proc CreateButtonsHelp {} {
+ global buttons
+ global ds9
+
+ ttk::frame $ds9(buttons).help
+
+ ButtonButton $ds9(buttons).help.ref \
+ [string tolower [msgcat::mc {Reference}]] HelpRef
+ ButtonButton $ds9(buttons).help.user \
+ [string tolower [msgcat::mc {User}]] HelpUser
+ ButtonButton $ds9(buttons).help.keyboard \
+ [string tolower [msgcat::mc {Keyboard}]] HelpKeyboard
+ ButtonButton $ds9(buttons).help.faq \
+ [string tolower [msgcat::mc {FAQ}]] HelpFAQ
+ ButtonButton $ds9(buttons).help.new \
+ [string tolower [msgcat::mc {New Features}]] HelpNew
+ ButtonButton $ds9(buttons).help.release \
+ [string tolower [msgcat::mc {Release}]] HelpRelease
+ ButtonButton $ds9(buttons).help.desk \
+ [string tolower [msgcat::mc {Help Desk}]] HelpDesk
+ ButtonButton $ds9(buttons).help.story \
+ [string tolower [msgcat::mc {Story}]] HelpStory
+ ButtonButton $ds9(buttons).help.ack \
+ [string tolower [msgcat::mc {Acknowledgment}]] HelpAck
+ ButtonButton $ds9(buttons).help.about \
+ [string tolower [msgcat::mc {About}]] AboutBox
+
+ set buttons(help) "
+ $ds9(buttons).help.ref pbuttons(help,ref)
+ $ds9(buttons).help.user pbuttons(help,user)
+ $ds9(buttons).help.keyboard pbuttons(help,keyboard)
+ $ds9(buttons).help.faq pbuttons(help,faq)
+ $ds9(buttons).help.new pbuttons(help,new)
+ $ds9(buttons).help.release pbuttons(help,release)
+ $ds9(buttons).help.desk pbuttons(help,desk)
+ $ds9(buttons).help.story pbuttons(help,story)
+ $ds9(buttons).help.ack pbuttons(help,ack)
+ $ds9(buttons).help.about pbuttons(help,about)
+ "
+}
+
+proc PrefsDialogButtonbarHelp {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Reference Manual}]\
+ -variable pbuttons(help,ref) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {User Manual}]\
+ -variable pbuttons(help,user) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {Mouse and Keyboard}] \
+ -variable pbuttons(help,keyboard) -command {UpdateButtons buttons(help)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {FAQ}] \
+ -variable pbuttons(help,faq) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {New Features}] \
+ -variable pbuttons(help,new) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {Release Notes}] \
+ -variable pbuttons(help,release) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {Help Desk}] \
+ -variable pbuttons(help,desk) -command {UpdateButtons buttons(help)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Story of SAOImage DS9}] \
+ -variable pbuttons(help,story) -command {UpdateButtons buttons(help)}
+ $m add checkbutton -label [msgcat::mc {Acknowledgment}] \
+ -variable pbuttons(help,ack) -command {UpdateButtons buttons(help)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {About SAOImage DS9}]..." \
+ -variable pbuttons(help,about) -command {UpdateButtons buttons(help)}
+}
diff --git a/ds9/library/mosaic.tcl b/ds9/library/mosaic.tcl
new file mode 100644
index 0000000..cd9f57e
--- /dev/null
+++ b/ds9/library/mosaic.tcl
@@ -0,0 +1,34 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ProcessMosaicCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvar $var
+ set ii $i
+
+ switch -- [string tolower [lindex $var $i]] {
+ iraf {
+ incr ii
+ ProcessMosaicIRAFCmd vvar ii $sock $fn
+ }
+ wfpc2 {}
+ default {ProcessMosaicWCSCmd vvar ii $sock $fn}
+ }
+}
+
+proc ProcessSendMosaicCmd {proc id param sock fn} {
+ switch -- [string tolower [lindex $param 0]] {
+ iraf {}
+ wfpc2 {}
+ wcs {
+ set param [lindex $param 1 end]
+ ProcessSendMosaicWCSCmd $proc $id $param $sock $fn
+ }
+ default {ProcessSendMosaicWCSCmd $proc $id $param $sock $fn}
+ }
+}
diff --git a/ds9/library/mosaicimage.tcl b/ds9/library/mosaicimage.tcl
new file mode 100644
index 0000000..38ee35f
--- /dev/null
+++ b/ds9/library/mosaicimage.tcl
@@ -0,0 +1,37 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ProcessMosaicImageCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvar $var
+ set ii $i
+
+ switch -- [string tolower [lindex $var $i]] {
+ iraf {
+ incr ii
+ ProcessMosaicImageIRAFCmd vvar ii $sock $fn
+ }
+ wfpc2 {
+ incr ii
+ ProcessMosaicImageWFPC2Cmd vvar ii $sock $fn
+ }
+ default {ProcessMosaicImageWCSCmd vvar ii $sock $fn}
+ }
+}
+
+proc ProcessSendMosaicImageCmd {proc id param sock fn} {
+ switch -- [string tolower [lindex $param 0]] {
+ iraf {}
+ wfpc2 {}
+ wcs {
+ set param [lindex $param 1 end]
+ ProcessSendMosaicImageWCSCmd $proc $id $param $sock $fn
+ }
+ default {ProcessSendMosaicImageWCSCmd $proc $id $param $sock $fn}
+ }
+}
diff --git a/ds9/library/mosaicimageiraf.tcl b/ds9/library/mosaicimageiraf.tcl
new file mode 100644
index 0000000..436a7f4
--- /dev/null
+++ b/ds9/library/mosaicimageiraf.tcl
@@ -0,0 +1,87 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMosaicImageIRAFFile {fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image iraf}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMosaicImageIRAFAlloc {path fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image iraf}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadMosaicImageIRAFSocket {sock fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image iraf}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc ProcessMosaicImageIRAFCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMosaicImageIRAFSocket $sock $param $layer]} {
+ InitError xpa
+ LoadMosaicImageIRAFFile $param $layer
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMosaicImageIRAFAlloc $fn $param $layer
+ } else {
+ LoadMosaicImageIRAFFile $param $layer
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/mosaicimagewcs.tcl b/ds9/library/mosaicimagewcs.tcl
new file mode 100644
index 0000000..1c6f9a7
--- /dev/null
+++ b/ds9/library/mosaicimagewcs.tcl
@@ -0,0 +1,141 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMosaicImageWCSFile {fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic image $sys]
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMosaicImageWCSAlloc {path fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic image $sys]
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadMosaicImageWCSSocket {sock fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic image $sys]
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc SaveMosaicImageWCSFile {fn} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits mosaic image file "\{$fn\}"
+}
+
+proc SaveMosaicImageWCSSocket {sock} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits mosaic image socket $sock
+}
+
+proc ProcessMosaicImageWCSCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ if {[string range [lindex $var $i] 0 2] == {wcs}} {
+ set opt [lindex $var $i]
+ incr i
+ } else {
+ set opt wcs
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMosaicImageWCSSocket $sock $param $layer $opt]} {
+ InitError xpa
+ LoadMosaicImageWCSFile $param $layer $opt
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMosaicImageWCSAlloc $fn $param $layer $opt
+ } else {
+ LoadMosaicImageWCSFile $param $layer $opt
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendMosaicImageWCSCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {$sock != {}} {
+ # xpa
+ SaveMosaicImageWCSSocket $sock
+ } elseif {$fn != {}} {
+ # comm
+ SaveMosaicImageWCSFile $fn
+ $proc $id {} $fn
+ }
+}
+
+
diff --git a/ds9/library/mosaicimagewfpc2.tcl b/ds9/library/mosaicimagewfpc2.tcl
new file mode 100644
index 0000000..ed2d8a8
--- /dev/null
+++ b/ds9/library/mosaicimagewfpc2.tcl
@@ -0,0 +1,93 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMosaicImageWFPC2File {fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image wfpc2}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMosaicImageWFPC2Alloc {path fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image wfpc2}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc LoadMosaicImageWFPC2Socket {sock fn} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic image wfpc2}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ return [ProcessLoad 0]
+}
+
+proc ProcessMosaicImageWFPC2Cmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMosaicImageWFPC2Socket $sock $param]} {
+ InitError xpa
+ LoadMosaicImageWFPC2File $param
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMosaicImageWFPC2Alloc $fn $param
+ } else {
+ LoadMosaicImageWFPC2File $param
+ }
+ }
+ FinishLoad
+}
+
+
diff --git a/ds9/library/mosaiciraf.tcl b/ds9/library/mosaiciraf.tcl
new file mode 100644
index 0000000..8f719bb
--- /dev/null
+++ b/ds9/library/mosaiciraf.tcl
@@ -0,0 +1,87 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMosaicIRAFFile {fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMosaicIRAFAlloc {path fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadMosaicIRAFSocket {sock fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc ProcessMosaicIRAFCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMosaicIRAFSocket $sock $param $layer]} {
+ InitError xpa
+ LoadMosaicIRAFFile $param $layer
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMosaicIRAFAlloc $fn $param $layer
+ } else {
+ LoadMosaicIRAFFile $param $layer
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/mosaicwcs.tcl b/ds9/library/mosaicwcs.tcl
new file mode 100644
index 0000000..5485813
--- /dev/null
+++ b/ds9/library/mosaicwcs.tcl
@@ -0,0 +1,148 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMosaicWCSFile {fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic $sys]
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+ set loadParam(load,layer) $layer
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadMosaicWCSAlloc {path fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic $sys]
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadMosaicWCSSocket {sock fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic $sys]
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc SaveMosaicWCSFile {fn opt} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {$opt == {}} {
+ set opt 1
+ }
+
+ $current(frame) save fits mosaic file "\{$fn\}" $opt
+}
+
+proc SaveMosaicWCSSocket {sock opt} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {$opt == {}} {
+ set opt 1
+ }
+
+ $current(frame) save fits mosaic socket $sock $opt
+}
+
+proc ProcessMosaicWCSCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ if {[string range [lindex $var $i] 0 2] == {wcs}} {
+ set opt [lindex $var $i]
+ incr i
+ } else {
+ set opt wcs
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadMosaicWCSSocket $sock $param $layer $opt]} {
+ InitError xpa
+ LoadMosaicWCSFile $param $layer $opt
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMosaicWCSAlloc $fn $param $layer $opt
+ } else {
+ LoadMosaicWCSFile $param $layer $opt
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendMosaicWCSCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set opt [lindex $param 0]
+ if {$sock != {}} {
+ # xpa
+ SaveMosaicWCSSocket $sock $opt
+ } elseif {$fn != {}} {
+ # comm
+ SaveMosaicWCSFile $fn $opt
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/movie.tcl b/ds9/library/movie.tcl
new file mode 100644
index 0000000..36a0047
--- /dev/null
+++ b/ds9/library/movie.tcl
@@ -0,0 +1,534 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc MovieDef {} {
+ global imovie
+ global movie
+
+ global tcl_platform
+
+ set imovie(top) .moviestatus
+ set imovie(mb) .moviestatusmb
+
+ set movie(action) slice
+ # must be >=5, or sometimes will generate bad data
+ set movie(quality) 5
+ set movie(num) 24
+ set movie(az,from) 45
+ set movie(az,to) -45
+ set movie(el,from) 30
+ set movie(el,to) 30
+ set movie(sl,from) 1
+ set movie(sl,to) 1
+ set movie(repeat) oscillate
+ set movie(repeat,num) 0
+
+ set movie(status) 0
+ set movie(abort) 0
+
+ set aa [msgcat::mc {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}]
+ set bb [msgcat::mc {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}]
+ switch $tcl_platform(os) {
+ Darwin {
+ switch [lindex [split $tcl_platform(osVersion) {.}] 0] {
+ 10 -
+ 11 {set movie(error) $bb}
+ 8 -
+ 9 -
+ default {set movie(error) $aa}
+ }
+ }
+ default {set movie(error) $aa}
+ }
+}
+
+proc MovieDialog {} {
+ global movie
+ global mpegfbox
+ global ed
+ global current
+
+ set w {.movie}
+
+ set ed(ok) 0
+ set ed(action) $movie(action)
+
+ DialogCreate $w [msgcat::mc {Create Movie}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.title -text [msgcat::mc {Format}]
+ ttk::radiobutton $f.slice -text {Slice Movie} \
+ -variable ed(action) -value slice
+ ttk::radiobutton $f.frame -text {Frames Movie} \
+ -variable ed(action) -value frame
+ ttk::radiobutton $f.3d -text {3D Movie} \
+ -variable ed(action) -value 3d
+
+ grid $f.slice -padx 2 -pady 2 -sticky w
+ grid $f.frame -padx 2 -pady 2 -sticky w
+ grid $f.3d -padx 2 -pady 2 -sticky w
+
+ switch [$current(frame) get type] {
+ base -
+ rgb {$f.3d configure -state disabled}
+ 3d {$f.3d configure -state normal}
+ }
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set movie(action) $ed(action)
+ set fn [SaveFileDialog mpegfbox]
+
+ if {$fn != {}} {
+ set ok 1
+ switch $movie(action) {
+ slice -
+ frame {}
+ 3d {set ok [Movie3dDialog]}
+ }
+
+ if {$ok} {
+ Movie $fn
+ }
+ }
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc Movie {fn} {
+ global ds9
+ global movie
+ global current
+ global saveimage
+
+ if {$fn == {} || ![$current(frame) has fits]} {
+ return
+ }
+
+ switch $ds9(wm) {
+ x11 {}
+ aqua -
+ win32 {
+ Error $saveimage(error)
+ return
+ }
+ }
+
+ # besure we are on top
+ raise $ds9(top)
+
+ # we need single mode
+ if {$ds9(display) != {single}} {
+ set modesav $ds9(display)
+ set current(display) single
+ DisplayMode
+ }
+
+ switch $movie(action) {
+ slice {MovieSlice $fn}
+ frame {MovieFrame $fn}
+ 3d {Movie3d $fn}
+ }
+
+ if {[info exists modesav]} {
+ set current(display) $modesav
+ DisplayMode
+ }
+}
+
+proc MovieSlice {fn} {
+ global current
+ global movie
+ global cube
+
+ set depth [$current(frame) get fits depth $cube(axis)]
+ set slice [$current(frame) get fits slice $cube(axis)]
+
+ if {$cube(axis)==2} {
+ set ss [$current(frame) get crop 3d image]
+ set from [lindex $ss 0]
+ set to [lindex $ss 1]
+ } else {
+ set from 1
+ set to [$current(frame) get fits depth $cube(axis)]
+ }
+
+ # loop thru cube
+ set movie(first) 1
+ for {set ii $from} {$ii <= $to} {incr ii} {
+ $current(frame) update fits slice $cube(axis) $ii
+ if {[MoviePhoto $fn]} {
+ break
+ }
+ }
+ mpeg close
+
+ # reset current slice
+ $current(frame) update fits slice $cube(axis) $slice
+}
+
+proc MovieFrame {fn} {
+ global ds9
+ global current
+ global movie
+
+ # loop thru all active frames
+ set movie(first) 1
+ set framesav $current(frame)
+
+ foreach ff $ds9(active) {
+ set ds9(next) $ff
+ GotoFrame
+ if {[MoviePhoto $fn]} {
+ break
+ }
+ }
+ mpeg close
+
+ set ds9(next) $framesav
+ GotoFrame
+}
+
+proc Movie3d {fn} {
+ global movie
+ global current
+ global cube
+
+ set slice [$current(frame) get fits slice $cube(axis)]
+ set vp [$current(frame) get 3d view]
+
+ set azincr [expr 1.*($movie(az,to)-$movie(az,from))/$movie(num)]
+ set elincr [expr 1.*($movie(el,to)-$movie(el,from))/$movie(num)]
+ set slincr [expr 1.*($movie(sl,to)-$movie(sl,from))/$movie(num)]
+
+ # loop over az/el/slice
+ set movie(status) 0
+ set movie(abort) 0
+ set movie(first) 1
+
+ set az $movie(az,from)
+ set el $movie(el,from)
+ set sl $movie(sl,from)
+
+ for {set rr 0} {$rr<=$movie(repeat,num)} {incr rr} {
+ for {set nn 0} {$nn<=$movie(num)} {incr nn} {
+ MovieStatusDialog
+
+ if {$movie(abort)} {
+ break
+ }
+ set movie(status) [expr 1.*$nn/$movie(num)*100]
+ update idletasks
+
+ $current(frame) 3d view $az $el
+ $current(frame) update fits slice $cube(axis) [expr int($sl)]
+ if {[MoviePhoto $fn]} {
+ break
+ }
+ set az [expr $az+$azincr]
+ set el [expr $el+$elincr]
+ set sl [expr $sl+$slincr]
+ }
+ switch $movie(repeat) {
+ repeat {
+ set az $movie(az,from)
+ set el $movie(el,from)
+ set sl $movie(sl,from)
+ }
+ oscillate {
+ set azincr [expr -$azincr]
+ set elincr [expr -$elincr]
+ set slincr [expr -$slincr]
+ }
+ }
+ }
+ mpeg close
+
+ MovieStatusDestroyDialog
+
+ # reset
+ $current(frame) 3d view $vp
+ $current(frame) update fits slice $cube(axis) $slice
+ Update3DDialog
+ UpdateCubeDialog
+}
+
+# Support
+
+proc MoviePhoto {fn} {
+ global ds9
+ global movie
+ global current
+
+ # yes, we need this
+ UpdateDS9
+ RealizeDS9 1
+
+ set rr [catch {image create photo -format window -data $ds9(canvas)} ph]
+ if {$rr} {
+ Error $movie(error)
+ return $rr
+ }
+
+ if {$movie(first)} {
+ set w [image width $ph]
+ set h [image height $ph]
+ mpeg create "$fn" $w $h 25 1 $movie(quality)
+ set movie(first) 0
+ }
+ mpeg add $ph
+
+ image delete $ph
+ return 0
+}
+
+proc Movie3dDialog {} {
+ global movie
+ global ed2
+ global current
+ global cube
+
+ set w {.movie3d}
+
+ set ed2(ok) 0
+ set ed2(num) $movie(num)
+ set ed2(az,from) $movie(az,from)
+ set ed2(az,to) $movie(az,to)
+ set ed2(el,from) $movie(el,from)
+ set ed2(el,to) $movie(el,to)
+ set ed2(sl,from) [$current(frame) get fits slice $cube(axis)]
+ set ed2(sl,to) $ed2(sl,from)
+ set ed2(repeat) $movie(repeat)
+ set ed2(repeat,num) $movie(repeat,num)
+
+ DialogCreate $w [msgcat::mc {Save 3D Movie}] ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.tnum -text [msgcat::mc {Number}]
+ ttk::entry $f.num -textvariable ed2(num) -width 7
+ ttk::label $f.tframes -text [msgcat::mc {Frames}]
+
+ ttk::label $f.taz -text [msgcat::mc {Azimuth}]
+ ttk::label $f.tazfrom -text [msgcat::mc {From}]
+ ttk::entry $f.azfrom -textvariable ed2(az,from) -width 7
+ ttk::label $f.tazto -text [msgcat::mc {To}]
+ ttk::entry $f.azto -textvariable ed2(az,to) -width 7
+
+ ttk::label $f.tel -text [msgcat::mc {Elevation}]
+ ttk::label $f.telfrom -text [msgcat::mc {From}]
+ ttk::entry $f.elfrom -textvariable ed2(el,from) -width 7
+ ttk::label $f.telto -text [msgcat::mc {To}]
+ ttk::entry $f.elto -textvariable ed2(el,to) -width 7
+
+ ttk::label $f.tsl -text [msgcat::mc {Slice}]
+ ttk::label $f.tslfrom -text [msgcat::mc {From}]
+ ttk::entry $f.slfrom -textvariable ed2(sl,from) -width 7
+ ttk::label $f.tslto -text [msgcat::mc {To}]
+ ttk::entry $f.slto -textvariable ed2(sl,to) -width 7
+
+ ttk::radiobutton $f.repeat -text [msgcat::mc {Repeat}] \
+ -variable ed2(repeat) -value repeat
+ ttk::radiobutton $f.oscillate -text [msgcat::mc {Oscillate}] \
+ -variable ed2(repeat) -value oscillate
+ ttk::entry $f.repeatnum -textvariable ed2(repeat,num) -width 7
+ ttk::label $f.ttimes -text [msgcat::mc {Times}]
+
+ grid $f.tnum x $f.num $f.tframes -padx 2 -pady 2 -sticky w
+ grid $f.taz $f.tazfrom $f.azfrom $f.tazto $f.azto -padx 2 -pady 2 -sticky w
+ grid $f.tel $f.telfrom $f.elfrom $f.telto $f.elto -padx 2 -pady 2 -sticky w
+ grid $f.tsl $f.tslfrom $f.slfrom $f.tslto $f.slto -padx 2 -pady 2 -sticky w
+ grid $f.oscillate x $f.repeatnum $f.ttimes -padx 2 -pady 2 -sticky w
+ grid $f.repeat -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set movie(num) $ed2(num)
+ set movie(az,from) $ed2(az,from)
+ set movie(az,to) $ed2(az,to)
+ set movie(el,from) $ed2(el,from)
+ set movie(el,to) $ed2(el,to)
+ set movie(sl,from) $ed2(sl,from)
+ set movie(sl,to) $ed2(sl,to)
+ set movie(repeat) $ed2(repeat)
+ set movie(repeat,num) $ed2(repeat,num)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc MovieStatusDialog {} {
+ global imovie
+ global movie
+
+ # see if we already have a window visible
+ if {[winfo exists $imovie(top)]} {
+ raise $imovie(top)
+ return
+ }
+
+ # create the 3d window
+ set w $imovie(top)
+ set mb $imovie(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Movie}] MovieStatusDestroyDialog
+ raise $imovie(top)
+
+ # Status
+ set f [ttk::frame $w.param]
+ ttk::label $f.tstatus -text [msgcat::mc {Status}]
+ ttk::progressbar $f.status -variable movie(status) -length 350
+ grid $f.tstatus $f.status -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.abort -text [msgcat::mc {Abort}] \
+ -command MovieStatusAbortDialog
+ pack $f.abort -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill x
+}
+
+proc MovieStatusDestroyDialog {} {
+ global movie
+ global imovie
+
+ if {[winfo exists $imovie(top)]} {
+ destroy $imovie(top)
+ destroy $imovie(mb)
+ }
+}
+
+proc MovieStatusAbortDialog {} {
+ global movie
+ set movie(abort) 1
+}
+
+# Process Cmds
+
+proc ProcessMovieCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global movie
+
+ # we need to be realized
+ # already implemented
+ # ProcessRealizeDS9
+
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ slice -
+ frame -
+ 3d {
+ set movie(action) $item
+ incr i
+ }
+ default {
+ # backward compatibility
+ set movie(action) frame
+ }
+ }
+
+ set fn [lindex $var $i]
+
+ set go 1
+ while {$go} {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ number {
+ incr i
+ set movie(num) [lindex $var $i]
+ }
+ azfrom {
+ incr i
+ set movie(az,from) [lindex $var $i]
+ }
+ azto {
+ incr i
+ set movie(az,to) [lindex $var $i]
+ }
+ elfrom {
+ incr i
+ set movie(el,from) [lindex $var $i]
+ }
+ elto {
+ incr i
+ set movie(el,to) [lindex $var $i]
+ }
+ slfrom {
+ incr i
+ set movie(sl,from) [lindex $var $i]
+ }
+ slto {
+ incr i
+ set movie(sl,to) [lindex $var $i]
+ }
+ oscillate {
+ incr i
+ set movie(repeat) oscillate
+ set movie(repeat,num) [lindex $var $i]
+ }
+ repeat {
+ incr i
+ set movie(repeat) repeat
+ set movie(repeat,num) [lindex $var $i]
+ }
+ default {
+ incr i -1
+ set go 0
+ }
+ }
+ }
+
+ Movie $fn
+}
+
+
diff --git a/ds9/library/mregion.tcl b/ds9/library/mregion.tcl
new file mode 100644
index 0000000..12ea847
--- /dev/null
+++ b/ds9/library/mregion.tcl
@@ -0,0 +1,1103 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc RegionMainMenu {} {
+ global ds9
+ global marker
+
+ menu $ds9(mb).region
+ $ds9(mb).region add command -label "[msgcat::mc {Get Information}]..." \
+ -command MarkerInfo
+ $ds9(mb).region add separator
+ $ds9(mb).region add cascade -label [msgcat::mc {Shape}] \
+ -menu $ds9(mb).region.shape
+ $ds9(mb).region add cascade -label [msgcat::mc {Composite Region}] \
+ -menu $ds9(mb).region.composite
+ $ds9(mb).region add cascade -label [msgcat::mc {Instrument FOV}] \
+ -menu $ds9(mb).region.fov
+ $ds9(mb).region add cascade -label [msgcat::mc {Template}] \
+ -menu $ds9(mb).region.template
+ $ds9(mb).region add separator
+ $ds9(mb).region add cascade -label [msgcat::mc {Color}] \
+ -menu $ds9(mb).region.color
+ $ds9(mb).region add cascade -label [msgcat::mc {Width}] \
+ -menu $ds9(mb).region.width
+ $ds9(mb).region add cascade -label [msgcat::mc {Properties}] \
+ -menu $ds9(mb).region.properties
+ $ds9(mb).region add cascade -label [msgcat::mc {Font}] \
+ -menu $ds9(mb).region.font
+ $ds9(mb).region add separator
+ $ds9(mb).region add command -label [msgcat::mc {Centroid}] \
+ -command MarkerCentroid
+ $ds9(mb).region add command -label [msgcat::mc {Move to Front}] \
+ -command MarkerFront
+ $ds9(mb).region add command -label [msgcat::mc {Move to Back}] \
+ -command MarkerBack
+ $ds9(mb).region add separator
+ $ds9(mb).region add command -label [msgcat::mc {Select All}] \
+ -command MarkerSelectAll -accelerator "${ds9(ctrl)}A"
+ $ds9(mb).region add command -label [msgcat::mc {Select None}] \
+ -command MarkerUnselectAll
+ $ds9(mb).region add command -label [msgcat::mc {Invert Selection}] \
+ -command MarkerSelectInvert
+ $ds9(mb).region add separator
+ $ds9(mb).region add command -label [msgcat::mc {Delete Selected Regions}] \
+ -command MarkerDeleteSelect
+ $ds9(mb).region add command -label [msgcat::mc {Delete All Regions}] \
+ -command MarkerDeleteAllMenu
+ $ds9(mb).region add separator
+ $ds9(mb).region add command -label [msgcat::mc {New Group}] \
+ -command GroupCreate
+ $ds9(mb).region add command -label "[msgcat::mc {Groups}]..." \
+ -command GroupDialog
+ $ds9(mb).region add separator
+ $ds9(mb).region add command -label "[msgcat::mc {List Regions}]..." \
+ -command MarkerList
+ $ds9(mb).region add command -label "[msgcat::mc {Load Regions}]..." \
+ -command MarkerLoad
+ $ds9(mb).region add command -label "[msgcat::mc {Save Regions}]..." \
+ -command MarkerSave
+ $ds9(mb).region add separator
+ $ds9(mb).region add cascade -label [msgcat::mc {Region Parameters}] \
+ -menu $ds9(mb).region.params
+
+ menu $ds9(mb).region.shape
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Circle}] \
+ -variable marker(shape) -value circle
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable marker(shape) -value ellipse
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Box}] \
+ -variable marker(shape) -value box
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Polygon}] \
+ -variable marker(shape) -value polygon
+ $ds9(mb).region.shape add separator
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Line}] \
+ -variable marker(shape) -value line
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Vector}] \
+ -variable marker(shape) -value vector
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Projection}] \
+ -variable marker(shape) -value projection
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Segment}] \
+ -variable marker(shape) -value segment
+ $ds9(mb).region.shape add separator
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Text}] \
+ -variable marker(shape) -value text
+ $ds9(mb).region.shape add cascade -label [msgcat::mc {Point}] \
+ -menu $ds9(mb).region.shape.point
+ $ds9(mb).region.shape add separator
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Ruler}] \
+ -variable marker(shape) -value ruler
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Compass}] \
+ -variable marker(shape) -value compass
+ $ds9(mb).region.shape add separator
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Annulus}] \
+ -variable marker(shape) -value annulus
+ $ds9(mb).region.shape add radiobutton \
+ -label [msgcat::mc {Elliptical Annulus}] \
+ -variable marker(shape) -value ellipseannulus
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Box Annulus}] \
+ -variable marker(shape) -value boxannulus
+ $ds9(mb).region.shape add separator
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Panda}] \
+ -variable marker(shape) -value panda
+ $ds9(mb).region.shape add radiobutton \
+ -label [msgcat::mc {Elliptical Panda}]\
+ -variable marker(shape) -value epanda
+ $ds9(mb).region.shape add radiobutton -label [msgcat::mc {Box Panda}] \
+ -variable marker(shape) -value bpanda
+
+ menu $ds9(mb).region.shape.point
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {Circle}] \
+ -variable marker(shape) -value {circle point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {Box}] \
+ -variable marker(shape) -value {box point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable marker(shape) -value {diamond point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {Cross}] \
+ -variable marker(shape) -value {cross point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {X}] \
+ -variable marker(shape) -value {x point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable marker(shape) -value {arrow point}
+ $ds9(mb).region.shape.point add radiobutton -label [msgcat::mc {BoxCircle}]\
+ -variable marker(shape) -value {boxcircle point}
+
+ menu $ds9(mb).region.composite
+ $ds9(mb).region.composite add command -label [msgcat::mc {Create}] \
+ -command CompositeCreate
+ $ds9(mb).region.composite add command -label [msgcat::mc {Dissolve}] \
+ -command CompositeDelete
+
+ CreateFOVMenu
+
+ menu $ds9(mb).region.template
+ $ds9(mb).region.template add command -label "[msgcat::mc {Load}]..." \
+ -command OpenTemplateMarker
+ $ds9(mb).region.template add command -label "[msgcat::mc {Save}]..." \
+ -command SaveAsTemplateMarker
+
+ ColorMenu $ds9(mb).region.color marker color MarkerColor
+ WidthDashMenu $ds9(mb).region.width marker width dash \
+ MarkerWidth [list MarkerProp dash]
+
+ menu $ds9(mb).region.properties
+ $ds9(mb).region.properties add checkbutton \
+ -label [msgcat::mc {Fixed in Size}] \
+ -variable marker(fixed) -command {MarkerProp fixed}
+ $ds9(mb).region.properties add separator
+ $ds9(mb).region.properties add checkbutton \
+ -label [msgcat::mc {Can Edit}] \
+ -variable marker(edit) -command {MarkerProp edit}
+ $ds9(mb).region.properties add checkbutton \
+ -label [msgcat::mc {Can Move}] \
+ -variable marker(move) -command {MarkerProp move}
+ $ds9(mb).region.properties add checkbutton \
+ -label [msgcat::mc {Can Rotate}] \
+ -variable marker(rotate) -command {MarkerProp rotate}
+ $ds9(mb).region.properties add checkbutton \
+ -label [msgcat::mc {Can Delete}] \
+ -variable marker(delete) -command {MarkerProp delete}
+ $ds9(mb).region.properties add separator
+ $ds9(mb).region.properties add radiobutton \
+ -label [msgcat::mc {Include}] \
+ -variable marker(include) -value 1 -command {MarkerProp include}
+ $ds9(mb).region.properties add radiobutton \
+ -label [msgcat::mc {Exclude}] \
+ -variable marker(include) -value 0 -command {MarkerProp include}
+ $ds9(mb).region.properties add separator
+ $ds9(mb).region.properties add radiobutton \
+ -label [msgcat::mc {Source}] \
+ -variable marker(source) -value 1 -command {MarkerProp source}
+ $ds9(mb).region.properties add radiobutton \
+ -label [msgcat::mc {Background}] \
+ -variable marker(source) -value 0 -command {MarkerProp source}
+
+ FontMenu $ds9(mb).region.font marker font font,size font,weight \
+ font,slant MarkerFont
+
+ menu $ds9(mb).region.params
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Show}] \
+ -variable marker(show) -command MarkerShow
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Show Text}] \
+ -variable marker(show,text) -command MarkerShowText
+ $ds9(mb).region.params add separator
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Auto Plot 2D}] -variable marker(plot2d)
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Auto Plot 3D}] -variable marker(plot3d)
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Auto Plot Statistics}] -variable marker(stats)
+ $ds9(mb).region.params add separator
+ $ds9(mb).region.params add checkbutton \
+ -label [msgcat::mc {Auto Centroid}] \
+ -variable marker(centroid,auto) -command MarkerCentroidAuto
+ $ds9(mb).region.params add command \
+ -label "[msgcat::mc {Centroid Parameters}]..." \
+ -command CentroidDialog
+
+ # Bindings
+ bind $ds9(top) <<SelectAll>> MarkerSelectAll
+}
+
+proc PrefsDialogRegionMenu {w} {
+ set f [ttk::labelframe $w.mregion -text [msgcat::mc {Region}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarRegion $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2 -sticky w
+
+ set m $f.menu.menu
+ menu $m
+ $m add cascade -label [msgcat::mc {Shape}] -menu $m.shape
+ $m add separator
+ $m add cascade -label [msgcat::mc {Color}] -menu $m.color
+ $m add cascade -label [msgcat::mc {Width}] -menu $m.width
+ $m add cascade -label [msgcat::mc {Properties}] -menu $m.properties
+ $m add cascade -label [msgcat::mc {Font}] -menu $m.font
+ $m add separator
+ $m add cascade -label [msgcat::mc {Region Parameters}] -menu $m.params
+
+ menu $m.shape
+ $m.shape add radiobutton -label [msgcat::mc {Circle}] \
+ -variable pmarker(shape) -value circle
+ $m.shape add radiobutton -label [msgcat::mc {Ellipse}] \
+ -variable pmarker(shape) -value ellipse
+ $m.shape add radiobutton -label [msgcat::mc {Box}] \
+ -variable pmarker(shape) -value box
+ $m.shape add radiobutton -label [msgcat::mc {Polygon}] \
+ -variable pmarker(shape) -value polygon
+ $m.shape add separator
+ $m.shape add radiobutton -label [msgcat::mc {Line}] \
+ -variable pmarker(shape) -value line
+ $m.shape add radiobutton -label [msgcat::mc {Vector}] \
+ -variable pmarker(shape) -value vector
+ $m.shape add radiobutton -label [msgcat::mc {Projection}] \
+ -variable pmarker(shape) -value projection
+ $m.shape add radiobutton -label [msgcat::mc {Segment}] \
+ -variable pmarker(shape) -value segment
+ $m.shape add separator
+ $m.shape add radiobutton -label [msgcat::mc {Text}] \
+ -variable pmarker(shape) -value text
+ $m.shape add cascade -label [msgcat::mc {Point}] \
+ -menu $m.shape.point
+ $m.shape add separator
+ $m.shape add radiobutton -label [msgcat::mc {Ruler}] \
+ -variable pmarker(shape) -value ruler
+ $m.shape add radiobutton -label [msgcat::mc {Compass}] \
+ -variable pmarker(shape) -value compass
+ $m.shape add separator
+ $m.shape add radiobutton -label [msgcat::mc {Annulus}] \
+ -variable pmarker(shape) -value annulus
+ $m.shape add radiobutton -label [msgcat::mc {Elliptical Annulus}] \
+ -variable pmarker(shape) -value ellipseannulus
+ $m.shape add radiobutton -label [msgcat::mc {Box Annulus}] \
+ -variable pmarker(shape) -value boxannulus
+ $m.shape add separator
+ $m.shape add radiobutton -label [msgcat::mc {Panda}] \
+ -variable pmarker(shape) -value panda
+ $m.shape add radiobutton -label [msgcat::mc {Elliptical Panda}] \
+ -variable pmarker(shape) -value epanda
+ $m.shape add radiobutton -label [msgcat::mc {Box Panda}] \
+ -variable pmarker(shape) -value bpanda
+
+ menu $m.shape.point
+ $m.shape.point add radiobutton -label [msgcat::mc {Circle}] \
+ -variable pmarker(shape) -value {circle point}
+ $m.shape.point add radiobutton -label [msgcat::mc {Box}] \
+ -variable pmarker(shape) -value {box point}
+ $m.shape.point add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable pmarker(shape) -value {diamond point}
+ $m.shape.point add radiobutton -label [msgcat::mc {Cross}] \
+ -variable pmarker(shape) -value {cross point}
+ $m.shape.point add radiobutton -label [msgcat::mc {X}] \
+ -variable pmarker(shape) -value {x point}
+ $m.shape.point add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable pmarker(shape) -value {arrow point}
+ $m.shape.point add radiobutton -label [msgcat::mc {BoxCircle}]\
+ -variable pmarker(shape) -value {boxcircle point}
+
+ ColorMenu $m.color pmarker color {}
+ WidthDashMenu $m.width pmarker width dash {} {}
+
+ menu $m.properties
+ $m.properties add checkbutton -label [msgcat::mc {Fixed in Size}] \
+ -variable pmarker(fixed)
+ $m.properties add separator
+ $m.properties add checkbutton -label [msgcat::mc {Can Edit}] \
+ -variable pmarker(edit)
+ $m.properties add checkbutton -label [msgcat::mc {Can Move}] \
+ -variable pmarker(move)
+ $m.properties add checkbutton -label [msgcat::mc {Can Rotate}] \
+ -variable pmarker(rotate)
+ $m.properties add checkbutton -label [msgcat::mc {Can Delete}] \
+ -variable pmarker(delete)
+ $m.properties add separator
+ $m.properties add radiobutton -label [msgcat::mc {Include}] \
+ -variable pmarker(include) -value 1
+ $m.properties add radiobutton -label [msgcat::mc {Exclude}] \
+ -variable pmarker(include) -value 0
+ $m.properties add separator
+ $m.properties add radiobutton -label [msgcat::mc {Source}] \
+ -variable pmarker(source) -value 1
+ $m.properties add radiobutton -label [msgcat::mc {Background}] \
+ -variable pmarker(source) -value 0
+
+ FontMenu $m.font pmarker font font,size font,weight font,slant {}
+
+ menu $m.params
+ $m.params add checkbutton -label [msgcat::mc {Show}] \
+ -variable pmarker(show)
+ $m.params add checkbutton -label [msgcat::mc {Show Text}] \
+ -variable pmarker(show,text)
+ $m.params add separator
+ $m.params add checkbutton -label [msgcat::mc {Auto Centroid}] \
+ -variable pmarker(centroid,auto)
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogRegion {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Region}]
+ lappend dprefs(tabs) [ttk::frame $w.region]
+
+ # Format
+ set f [ttk::labelframe $w.region.format -text [msgcat::mc {Default Format}]]
+
+ ttk::menubutton $f.format -textvariable pmarker(format) \
+ -menu $f.format.menu
+
+ grid $f.format -padx 2 -pady 2 -sticky w
+
+ menu $f.format.menu
+ $f.format.menu add radiobutton -label {DS9/Funtools} \
+ -variable pmarker(format) -value ds9
+ $f.format.menu add radiobutton -label {XML} \
+ -variable pmarker(format) -value xml
+ $f.format.menu add radiobutton -label {CIAO} \
+ -variable pmarker(format) -value ciao
+ $f.format.menu add radiobutton -label {SAOtng} \
+ -variable pmarker(format) -value saotng
+ $f.format.menu add radiobutton -label {SAOimage} \
+ -variable pmarker(format) -value saoimage
+ $f.format.menu add radiobutton -label {IRAF PROS} \
+ -variable pmarker(format) -value pros
+ $f.format.menu add radiobutton -label {X Y} \
+ -variable pmarker(format) -value xy
+
+ # Length
+ set f [ttk::labelframe $w.region.dformat \
+ -text [msgcat::mc {Default Length}]]
+
+ ttk::menubutton $f.dformat -textvariable pmarker(dformat) \
+ -menu $f.dformat.menu
+
+ grid $f.dformat -padx 2 -pady 2 -sticky w
+
+ menu $f.dformat.menu
+ $f.dformat.menu add radiobutton -label {Degrees} \
+ -variable pmarker(dformat) -value degrees
+ $f.dformat.menu add radiobutton -label {ArcMin} \
+ -variable pmarker(dformat) -value arcmin
+ $f.dformat.menu add radiobutton -label {ArcSec} \
+ -variable pmarker(dformat) -value arcsec
+
+ # Epsilon
+ set f [ttk::labelframe $w.region.epsilon \
+ -text [msgcat::mc {Mouse Click Epsilon}]]
+
+ ttk::label $f.title -text [msgcat::mc {Pixels}]
+ ttk::menubutton $f.epsilon -textvariable pmarker(epsilon) \
+ -menu $f.epsilon.menu
+
+ grid $f.title $f.epsilon -padx 2 -pady 2 -sticky w
+
+ menu $f.epsilon.menu
+ $f.epsilon.menu add radiobutton -label {2} -variable pmarker(epsilon) \
+ -value 2 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {3} -variable pmarker(epsilon) \
+ -value 3 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {4} -variable pmarker(epsilon) \
+ -value 4 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {5} -variable pmarker(epsilon) \
+ -value 5 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {6} -variable pmarker(epsilon) \
+ -value 6 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {8} -variable pmarker(epsilon) \
+ -value 8 -command MarkerEpsilon
+ $f.epsilon.menu add radiobutton -label {10} -variable pmarker(epsilon) \
+ -value 10 -command MarkerEpsilon
+
+ grid $f.title $f.epsilon -padx 2 -pady 2 -sticky w
+
+ # Centroid
+ set f [ttk::labelframe $w.region.centroid -text [msgcat::mc {Centroid}]]
+
+ ttk::label $f.ititle -text [msgcat::mc {Iteration}]
+ ttk::entry $f.iteration -textvariable pmarker(centroid,iteration) -width 10
+ ttk::label $f.rtitle -text [msgcat::mc {Radius}]
+ ttk::entry $f.radius -textvariable pmarker(centroid,radius) -width 10
+
+ grid $f.ititle $f.iteration $f.rtitle $f.radius -padx 2 -pady 2 -sticky w
+ # Plots
+ set f [ttk::labelframe $w.region.plot -text [msgcat::mc {Auto Plot}]]
+ ttk::checkbutton $f.2d -text [msgcat::mc {2D}] -variable pmarker(plot2d)
+ ttk::checkbutton $f.3d -text [msgcat::mc {3D}] -variable pmarker(plot3d)
+ ttk::checkbutton $f.stats -text [msgcat::mc {Statistics}] \
+ -variable pmarker(stats)
+
+ grid $f.2d $f.3d -padx 2 -pady 2 -sticky w
+ grid $f.stats -padx 2 -pady 2 -sticky w
+
+ # Circle
+ set f [ttk::labelframe $w.region.circle -text [msgcat::mc {Circle}]]
+
+ ttk::label $f.title -text [msgcat::mc {Radius}]
+ ttk::entry $f.radius -textvariable pmarker(circle,radius) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ grid $f.title $f.radius $f.unit -padx 2 -pady 2 -sticky w
+
+ # Ellipse
+ set f [ttk::labelframe $w.region.ellipse -text [msgcat::mc {Ellipse}]]
+
+ ttk::label $f.title -text "Radius 1"
+ ttk::entry $f.radius1 -textvariable pmarker(ellipse,radius1) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.title2 -text "Radius 2"
+ ttk::entry $f.radius2 -textvariable pmarker(ellipse,radius2) -width 10
+ ttk::label $f.unit2 -text [msgcat::mc {Image}]
+
+ grid $f.title $f.radius1 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.title2 $f.radius2 $f.unit2 -padx 2 -pady 2 -sticky w
+
+ # Box
+ set f [ttk::labelframe $w.region.box -text [msgcat::mc {Box}]]
+
+ ttk::label $f.title -text "Size 1"
+ ttk::entry $f.radius1 -textvariable pmarker(box,radius1) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.title2 -text "Size 2"
+ ttk::entry $f.radius2 -textvariable pmarker(box,radius2) -width 10
+ ttk::label $f.unit2 -text [msgcat::mc {Image}]
+
+ grid $f.title $f.radius1 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.title2 $f.radius2 $f.unit2 -padx 2 -pady 2 -sticky w
+
+ # Projection
+ set f [ttk::labelframe $w.region.projection -text [msgcat::mc {Projection}]]
+
+ ttk::label $f.title -text [msgcat::mc {Thickness}]
+ ttk::entry $f.thick -textvariable pmarker(projection,thick) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ grid $f.title $f.thick $f.unit -padx 2 -pady 2 -sticky w
+
+ # Point
+ set f [ttk::labelframe $w.region.point -text [msgcat::mc {Point}]]
+
+ ttk::label $f.title -text [msgcat::mc {Size}]
+ ttk::entry $f.size -textvariable pmarker(point,size) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Pixels}]
+
+ grid $f.title $f.size $f.unit -padx 2 -pady 2 -sticky w
+
+ pack $w.region.format $w.region.dformat $w.region.epsilon \
+ $w.region.centroid $w.region.plot \
+ $w.region.circle $w.region.ellipse \
+ $w.region.box $w.region.projection $w.region.point \
+ -side top -fill both -expand true
+}
+
+proc PrefsDialogAnnulus {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Annulus}]
+ lappend dprefs(tabs) [ttk::frame $w.annulus]
+
+ # Annulus
+ set f [ttk::labelframe $w.annulus.annulus -text [msgcat::mc {Annulus}]]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::label $f.radiusTitle -text [msgcat::mc {Radius}]
+ ttk::entry $f.inner -textvariable pmarker(annulus,inner) -width 10
+ ttk::entry $f.outer -textvariable pmarker(annulus,outer) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(annulus,annuli) -width 10
+
+ grid x $f.innerTitle $f.outerTitle -padx 2 -pady 2 -sticky w
+ grid $f.radiusTitle $f.inner $f.outer $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ # Ellipse Annulus
+ set f [ttk::labelframe $w.annulus.ellipseannulus \
+ -text [msgcat::mc {Elliptical Annulus}]]
+
+ ttk::label $f.majorTitle -text [msgcat::mc {Major}]
+ ttk::label $f.minorTitle -text [msgcat::mc {Minor}]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::entry $f.radius1 -textvariable pmarker(ellipseannulus,radius1) \
+ -width 10
+ ttk::entry $f.radius2 -textvariable pmarker(ellipseannulus,radius2) \
+ -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::entry $f.radius3 -textvariable pmarker(ellipseannulus,radius3) \
+ -width 10
+
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(ellipseannulus,annuli) -width 10
+
+ grid x $f.majorTitle $f.minorTitle -padx 2 -pady 2 -sticky w
+ grid $f.innerTitle $f.radius1 $f.radius2 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.outerTitle $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ # Box Annulus
+ set f [ttk::labelframe $w.annulus.boxannulus \
+ -text [msgcat::mc {Box Annulus}]]
+
+ ttk::label $f.majorTitle -text [msgcat::mc {Width}]
+ ttk::label $f.minorTitle -text [msgcat::mc {Height}]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::entry $f.radius1 -textvariable pmarker(boxannulus,radius1) -width 10
+ ttk::entry $f.radius2 -textvariable pmarker(boxannulus,radius2) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::entry $f.radius3 -textvariable pmarker(boxannulus,radius3) -width 10
+
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(boxannulus,annuli) -width 10
+
+ grid x $f.majorTitle $f.minorTitle -padx 2 -pady 2 -sticky w
+ grid $f.innerTitle $f.radius1 $f.radius2 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.outerTitle $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ pack $w.annulus.annulus $w.annulus.ellipseannulus $w.annulus.boxannulus \
+ -side top -fill both -expand true
+}
+
+proc PrefsDialogPanda {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Panda}]
+ lappend dprefs(tabs) [ttk::frame $w.panda]
+
+ # Panda
+ set f [ttk::labelframe $w.panda.panda -text [msgcat::mc {Panda}]]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::label $f.radiusTitle -text [msgcat::mc {Radius}]
+ ttk::entry $f.inner -textvariable pmarker(panda,inner) -width 10
+ ttk::entry $f.outer -textvariable pmarker(panda,outer) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(panda,annuli) -width 10
+
+ grid x $f.innerTitle $f.outerTitle -padx 2 -pady 2 -sticky w
+ grid $f.radiusTitle $f.inner $f.outer $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ ttk::label $f.ang1Title -text [msgcat::mc {Start}]
+ ttk::label $f.ang2Title -text [msgcat::mc {Stop}]
+ ttk::label $f.angTitle -text [msgcat::mc {Angles}]
+ ttk::entry $f.ang1 -textvariable pmarker(panda,ang1) -width 10
+ ttk::entry $f.ang2 -textvariable pmarker(panda,ang2) -width 10
+ ttk::label $f.angunit -text [msgcat::mc {Degrees}]
+ ttk::label $f.angnumTitle -text [msgcat::mc {Number}]
+ ttk::entry $f.angnum -textvariable pmarker(panda,angnum) -width 10
+
+ grid x $f.ang1Title $f.ang2Title -padx 2 -pady 2 -sticky w
+ grid $f.angTitle $f.ang1 $f.ang2 $f.angunit -padx 2 -pady 2 -sticky w
+ grid $f.angnumTitle $f.angnum -padx 2 -pady 2 -sticky w
+
+ # Elliptical Panda
+ set f [ttk::labelframe $w.panda.epanda \
+ -text [msgcat::mc {Elliptical Panda}]]
+
+ ttk::label $f.majorTitle -text [msgcat::mc {Major}]
+ ttk::label $f.minorTitle -text [msgcat::mc {Minor}]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::entry $f.radius1 -textvariable pmarker(epanda,radius1) -width 10
+ ttk::entry $f.radius2 -textvariable pmarker(epanda,radius2) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::entry $f.radius3 -textvariable pmarker(epanda,radius3) -width 10
+
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(epanda,annuli) -width 10
+
+ grid x $f.majorTitle $f.minorTitle -padx 2 -pady 2 -sticky w
+ grid $f.innerTitle $f.radius1 $f.radius2 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.outerTitle $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ ttk::label $f.ang1Title -text [msgcat::mc {Start}]
+ ttk::label $f.ang2Title -text [msgcat::mc {Stop}]
+ ttk::label $f.angTitle -text [msgcat::mc {Angles}]
+ ttk::entry $f.ang1 -textvariable pmarker(epanda,ang1) -width 10
+ ttk::entry $f.ang2 -textvariable pmarker(epanda,ang2) -width 10
+ ttk::label $f.angunit -text [msgcat::mc {Degrees}]
+ ttk::label $f.angnumTitle -text [msgcat::mc {Number}]
+ ttk::entry $f.angnum -textvariable pmarker(epanda,angnum) -width 10
+
+ grid x $f.ang1Title $f.ang2Title -padx 2 -pady 2 -sticky w
+ grid $f.angTitle $f.ang1 $f.ang2 $f.angunit -padx 2 -pady 2 -sticky w
+ grid $f.angnumTitle $f.angnum -padx 2 -pady 2 -sticky w
+
+ # Default Box Panda
+ set f [ttk::labelframe $w.panda.bpanda -text [msgcat::mc {Box Panda}]]
+
+ ttk::label $f.majorTitle -text [msgcat::mc {Major}]
+ ttk::label $f.minorTitle -text [msgcat::mc {Minor}]
+
+ ttk::label $f.innerTitle -text [msgcat::mc {Inner}]
+ ttk::entry $f.radius1 -textvariable pmarker(bpanda,radius1) -width 10
+ ttk::entry $f.radius2 -textvariable pmarker(bpanda,radius2) -width 10
+ ttk::label $f.unit -text [msgcat::mc {Image}]
+
+ ttk::label $f.outerTitle -text [msgcat::mc {Outer}]
+ ttk::entry $f.radius3 -textvariable pmarker(bpanda,radius3) -width 10
+
+ ttk::label $f.annuliTitle -text [msgcat::mc {Annuli}]
+ ttk::entry $f.annuli -textvariable pmarker(bpanda,annuli) -width 10
+
+ grid x $f.majorTitle $f.minorTitle -padx 2 -pady 2 -sticky w
+ grid $f.innerTitle $f.radius1 $f.radius2 $f.unit -padx 2 -pady 2 -sticky w
+ grid $f.outerTitle $f.radius3 -padx 2 -pady 2 -sticky w
+ grid $f.annuliTitle $f.annuli -padx 2 -pady 2 -sticky w
+
+ ttk::label $f.ang1Title -text [msgcat::mc {Start}]
+ ttk::label $f.ang2Title -text [msgcat::mc {Stop}]
+ ttk::label $f.angTitle -text [msgcat::mc {Angles}]
+ ttk::entry $f.ang1 -textvariable pmarker(bpanda,ang1) -width 10
+ ttk::entry $f.ang2 -textvariable pmarker(bpanda,ang2) -width 10
+ ttk::label $f.angunit -text [msgcat::mc {Degrees}]
+ ttk::label $f.angnumTitle -text [msgcat::mc {Number}]
+ ttk::entry $f.angnum -textvariable pmarker(bpanda,angnum) -width 10
+
+ grid x $f.ang1Title $f.ang2Title -padx 2 -pady 2 -sticky w
+ grid $f.angTitle $f.ang1 $f.ang2 $f.angunit -padx 2 -pady 2 -sticky w
+ grid $f.angnumTitle $f.angnum -padx 2 -pady 2 -sticky w
+
+ pack $w.panda.panda $w.panda.epanda $w.panda.bpanda \
+ -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsRegionDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ region,info 1
+ region,circle 0
+ region,ellipse 0
+ region,box 0
+ region,polygon 0
+ region,line 0
+ region,vector 0
+ region,projection 0
+ region,segment 0
+ region,text 0
+ region,point 0
+ region,ruler 0
+ region,compass 0
+ region,annulus 0
+ region,ellipseannulus 0
+ region,boxannulus 0
+ region,panda 0
+ region,epanda 0
+ region,bpanda 0
+ region,create 0
+ region,dissolve 0
+ region,loadtemplate 0
+ region,savetemplate 0
+ region,centroid 0
+ region,front 1
+ region,back 1
+ region,all 1
+ region,none 1
+ region,invert 0
+ region,delete 1
+ region,deleteall 0
+ region,newgroup 0
+ region,group 0
+ region,list 1
+ region,load 1
+ region,save 1
+ region,show 0
+ region,showtext 0
+ region,autocentroid 0
+ }
+}
+
+proc CreateButtonsRegion {} {
+ global buttons
+ global ds9
+
+ ttk::frame $ds9(buttons).region
+
+ ButtonButton $ds9(buttons).region.info \
+ [string tolower [msgcat::mc {Information}]] MarkerInfo
+
+ RadioButton $ds9(buttons).region.circle \
+ [string tolower [msgcat::mc {Circle}]] \
+ marker(shape) circle {}
+ RadioButton $ds9(buttons).region.ellipse \
+ [string tolower [msgcat::mc {Ellipse}]] \
+ marker(shape) ellipse {}
+ RadioButton $ds9(buttons).region.box \
+ [string tolower [msgcat::mc {Box}]] \
+ marker(shape) box {}
+ RadioButton $ds9(buttons).region.polygon \
+ [string tolower [msgcat::mc {Polygon}]] \
+ marker(shape) polygon {}
+ RadioButton $ds9(buttons).region.line \
+ [string tolower [msgcat::mc {Line}]] \
+ marker(shape) line {}
+ RadioButton $ds9(buttons).region.vector \
+ [string tolower [msgcat::mc {Vector}]] \
+ marker(shape) vector {}
+ RadioButton $ds9(buttons).region.projection \
+ [string tolower [msgcat::mc {Projection}]] \
+ marker(shape) projection {}
+ RadioButton $ds9(buttons).region.segment \
+ [string tolower [msgcat::mc {Segment}]] \
+ marker(shape) segment {}
+ RadioButton $ds9(buttons).region.text \
+ [string tolower [msgcat::mc {Text}]] \
+ marker(shape) text {}
+ RadioButton $ds9(buttons).region.point \
+ [string tolower [msgcat::mc {Point}]] \
+ marker(shape) {circle point} {}
+ RadioButton $ds9(buttons).region.ruler \
+ [string tolower [msgcat::mc {Ruler}]] \
+ marker(shape) ruler {}
+ RadioButton $ds9(buttons).region.compass \
+ [string tolower [msgcat::mc {Compass}]] \
+ marker(shape) compass {}
+ RadioButton $ds9(buttons).region.annulus \
+ [string tolower [msgcat::mc {Annulus}]] \
+ marker(shape) annulus {}
+ RadioButton $ds9(buttons).region.ellipseannulus \
+ [string tolower [msgcat::mc {Elliptical Annulus}]] \
+ marker(shape) ellipseannulus {}
+ RadioButton $ds9(buttons).region.boxannulus \
+ [string tolower [msgcat::mc {Box Annulus}]] \
+ marker(shape) boxannulus {}
+ RadioButton $ds9(buttons).region.panda \
+ [string tolower [msgcat::mc {Panda}]] \
+ marker(shape) panda {}
+ RadioButton $ds9(buttons).region.epanda \
+ [string tolower [msgcat::mc {Ellipse Panda}]] \
+ marker(shape) epanda {}
+ RadioButton $ds9(buttons).region.bpanda \
+ [string tolower [msgcat::mc {Box Panda}]] \
+ marker(shape) bpanda {}
+
+ ButtonButton $ds9(buttons).region.create \
+ [string tolower [msgcat::mc {Composite}]] CompositeCreate
+ ButtonButton $ds9(buttons).region.dissolve \
+ [string tolower [msgcat::mc {Dissolve}]] CompositeDelete
+
+ ButtonButton $ds9(buttons).region.loadtemplate \
+ [string tolower [msgcat::mc {Load Template}]] OpenTemplateMarker
+ ButtonButton $ds9(buttons).region.savetemplate \
+ [string tolower [msgcat::mc {Save Template}]] SaveAsTemplateMarker
+
+ ButtonButton $ds9(buttons).region.centroid \
+ [string tolower [msgcat::mc {Centroid}]] MarkerCentroid
+ ButtonButton $ds9(buttons).region.front \
+ [string tolower [msgcat::mc {Front}]] MarkerFront
+ ButtonButton $ds9(buttons).region.back \
+ [string tolower [msgcat::mc {Back}]] MarkerBack
+
+ ButtonButton $ds9(buttons).region.all \
+ [string tolower [msgcat::mc {All}]] MarkerSelectAll
+ ButtonButton $ds9(buttons).region.none \
+ [string tolower [msgcat::mc {None}]] MarkerUnselectAll
+ ButtonButton $ds9(buttons).region.invert \
+ [string tolower [msgcat::mc {Invert}]] MarkerSelectInvert
+ ButtonButton $ds9(buttons).region.delete \
+ [string tolower [msgcat::mc {Delete}]] MarkerDeleteSelect
+ ButtonButton $ds9(buttons).region.deleteall \
+ [string tolower [msgcat::mc {Delete All}]] MarkerDeleteAllMenu
+
+ ButtonButton $ds9(buttons).region.newgroup \
+ [string tolower [msgcat::mc {New Group}]] GroupCreate
+ ButtonButton $ds9(buttons).region.group \
+ [string tolower [msgcat::mc {Groups}]] GroupDialog
+
+ ButtonButton $ds9(buttons).region.list \
+ [string tolower [msgcat::mc {List}]] MarkerList
+ ButtonButton $ds9(buttons).region.load \
+ [string tolower [msgcat::mc {Load}]] MarkerLoad
+ ButtonButton $ds9(buttons).region.save \
+ [string tolower [msgcat::mc {Save}]] MarkerSave
+
+ CheckButton $ds9(buttons).region.show \
+ [string tolower [msgcat::mc {Show}]] \
+ marker(show) MarkerShow
+ CheckButton $ds9(buttons).region.showtext \
+ [string tolower [msgcat::mc {Show Text}]] \
+ marker(show,text) MarkerShowText
+ CheckButton $ds9(buttons).region.autocentroid \
+ [string tolower [msgcat::mc {Auto Centroid}]] \
+ marker(centroid,auto) MarkerCentroidAuto
+
+ set buttons(region) "
+ $ds9(buttons).region.info pbuttons(region,info)
+ $ds9(buttons).region.circle pbuttons(region,circle)
+ $ds9(buttons).region.ellipse pbuttons(region,ellipse)
+ $ds9(buttons).region.box pbuttons(region,box)
+ $ds9(buttons).region.polygon pbuttons(region,polygon)
+ $ds9(buttons).region.line pbuttons(region,line)
+ $ds9(buttons).region.vector pbuttons(region,vector)
+ $ds9(buttons).region.projection pbuttons(region,projection)
+ $ds9(buttons).region.segment pbuttons(region,segment)
+ $ds9(buttons).region.text pbuttons(region,text)
+ $ds9(buttons).region.point pbuttons(region,point)
+ $ds9(buttons).region.ruler pbuttons(region,ruler)
+ $ds9(buttons).region.compass pbuttons(region,compass)
+ $ds9(buttons).region.annulus pbuttons(region,annulus)
+ $ds9(buttons).region.ellipseannulus pbuttons(region,ellipseannulus)
+ $ds9(buttons).region.boxannulus pbuttons(region,boxannulus)
+ $ds9(buttons).region.panda pbuttons(region,panda)
+ $ds9(buttons).region.epanda pbuttons(region,epanda)
+ $ds9(buttons).region.bpanda pbuttons(region,bpanda)
+ $ds9(buttons).region.create pbuttons(region,create)
+ $ds9(buttons).region.dissolve pbuttons(region,dissolve)
+ $ds9(buttons).region.loadtemplate pbuttons(region,loadtemplate)
+ $ds9(buttons).region.savetemplate pbuttons(region,savetemplate)
+ $ds9(buttons).region.centroid pbuttons(region,centroid)
+ $ds9(buttons).region.front pbuttons(region,front)
+ $ds9(buttons).region.back pbuttons(region,back)
+ $ds9(buttons).region.all pbuttons(region,all)
+ $ds9(buttons).region.none pbuttons(region,none)
+ $ds9(buttons).region.invert pbuttons(region,invert)
+ $ds9(buttons).region.delete pbuttons(region,delete)
+ $ds9(buttons).region.deleteall pbuttons(region,deleteall)
+ $ds9(buttons).region.newgroup pbuttons(region,newgroup)
+ $ds9(buttons).region.group pbuttons(region,group)
+ $ds9(buttons).region.list pbuttons(region,list)
+ $ds9(buttons).region.load pbuttons(region,load)
+ $ds9(buttons).region.save pbuttons(region,save)
+ $ds9(buttons).region.show pbuttons(region,show)
+ $ds9(buttons).region.showtext pbuttons(region,showtext)
+ $ds9(buttons).region.autocentroid pbuttons(region,autocentroid)
+ "
+}
+
+proc PrefsDialogButtonbarRegion {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label "[msgcat::mc {Get Information}]..." \
+ -variable pbuttons(region,info) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {Shape}] -menu $m.shape
+ $m add cascade -label [msgcat::mc {Composite Region}] -menu $m.composite
+ $m add cascade -label [msgcat::mc {Template}] -menu $m.template
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Centroid}] \
+ -variable pbuttons(region,centroid) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label [msgcat::mc {Move to Front}] \
+ -variable pbuttons(region,front) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label [msgcat::mc {Move to Back}] \
+ -variable pbuttons(region,back) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Select All}] \
+ -variable pbuttons(region,all) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label [msgcat::mc {Select None}] \
+ -variable pbuttons(region,none) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label [msgcat::mc {Invert Selection}] \
+ -variable pbuttons(region,invert) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Delete Selected Regions}] \
+ -variable pbuttons(region,delete) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label [msgcat::mc {Delete All Regions}] \
+ -variable pbuttons(region,deleteall) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {New Group}] \
+ -variable pbuttons(region,newgroup) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label "[msgcat::mc {Groups}]..." \
+ -variable pbuttons(region,group) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {List Regions}]..." \
+ -variable pbuttons(region,list) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label "[msgcat::mc {Load Regions}]..." \
+ -variable pbuttons(region,load) \
+ -command {UpdateButtons buttons(region)}
+ $m add checkbutton -label "[msgcat::mc {Save Regions}]..." \
+ -variable pbuttons(region,save) \
+ -command {UpdateButtons buttons(region)}
+ $m add separator
+ $m add cascade -label [msgcat::mc {Region Parameters}] -menu $m.params
+
+ menu $m.shape
+ $m.shape add checkbutton -label [msgcat::mc {Circle}] \
+ -variable pbuttons(region,circle) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Ellipse}] \
+ -variable pbuttons(region,ellipse) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Box}] \
+ -variable pbuttons(region,box) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Polygon}] \
+ -variable pbuttons(region,polygon) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add separator
+ $m.shape add checkbutton -label [msgcat::mc {Line}] \
+ -variable pbuttons(region,line) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Vector}] \
+ -variable pbuttons(region,vector) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Projection}] \
+ -variable pbuttons(region,projection) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Segment}] \
+ -variable pbuttons(region,segment) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add separator
+ $m.shape add checkbutton -label [msgcat::mc {Text}] \
+ -variable pbuttons(region,text) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Point}] \
+ -variable pbuttons(region,point) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add separator
+ $m.shape add checkbutton -label [msgcat::mc {Ruler}] \
+ -variable pbuttons(region,ruler) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Compass}] \
+ -variable pbuttons(region,compass) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add separator
+ $m.shape add checkbutton -label [msgcat::mc {Annulus}] \
+ -variable pbuttons(region,annulus) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Elliptical Annulus}] \
+ -variable pbuttons(region,ellipseannulus) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Box Annulus}] \
+ -variable pbuttons(region,boxannulus) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Panda}] \
+ -variable pbuttons(region,panda) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Elliptical Panda}]\
+ -variable pbuttons(region,epanda) \
+ -command {UpdateButtons buttons(region)}
+ $m.shape add checkbutton -label [msgcat::mc {Box Panda}] \
+ -variable pbuttons(region,bpanda) \
+ -command {UpdateButtons buttons(region)}
+
+ menu $m.composite
+ $m.composite add checkbutton -label [msgcat::mc {Create}] \
+ -variable pbuttons(region,create) \
+ -command {UpdateButtons buttons(region)}
+ $m.composite add checkbutton -label [msgcat::mc {Dissolve}] \
+ -variable pbuttons(region,dissolve) \
+ -command {UpdateButtons buttons(region)}
+
+ menu $m.template
+ $m.template add checkbutton -label "[msgcat::mc {Load}]..." \
+ -variable pbuttons(region,loadtemplate) \
+ -command {UpdateButtons buttons(region)}
+ $m.template add checkbutton -label "[msgcat::mc {Save}]..." \
+ -variable pbuttons(region,savetemplate) \
+ -command {UpdateButtons buttons(region)}
+
+ menu $m.params
+ $m.params add checkbutton -label [msgcat::mc {Show}] \
+ -variable pbuttons(region,show) \
+ -command {UpdateButtons buttons(region)}
+ $m.params add checkbutton -label [msgcat::mc {Show Text}] \
+ -variable pbuttons(region,showtext) \
+ -command {UpdateButtons buttons(region)}
+ $m.params add separator
+ $m.params add checkbutton -label [msgcat::mc {Auto Centroid}] \
+ -variable pbuttons(region,autocentroid) \
+ -command {UpdateButtons buttons(region)}
+}
+
+# Support
+
+proc UpdateRegionMenu {} {
+ global current
+ global marker
+ global pmarker
+ global ds9
+
+ if {$current(frame) != {}} {
+ $ds9(mb) entryconfig [msgcat::mc {Region}] -state normal
+
+ set marker(show) [$current(frame) get marker show]
+ set marker(show,text) [$current(frame) get marker show text]
+ set marker(centroid,auto) [$current(frame) get marker centroid auto]
+ set marker(centroid,radius) [$current(frame) get marker centroid radius]
+ set marker(centroid,iteration) \
+ [$current(frame) get marker centroid iteration]
+ set marker(preserve) [$current(frame) get marker preserve]
+
+ switch -- $current(mode) {
+ pointer -
+ region {
+ if {[$current(frame) get marker select number] == 1} {
+ set marker(color) \
+ [$current(frame) get marker color]
+ set marker(width) \
+ [$current(frame) get marker width]
+ set marker(dash) \
+ [$current(frame) get marker property dash]
+ set marker(fixed) \
+ [$current(frame) get marker property fixed]
+ set marker(edit) \
+ [$current(frame) get marker property edit]
+ set marker(move) \
+ [$current(frame) get marker property move]
+ set marker(rotate) \
+ [$current(frame) get marker property rotate]
+ set marker(delete) \
+ [$current(frame) get marker property delete]
+ set marker(include) \
+ [$current(frame) get marker property include]
+ set marker(source) \
+ [$current(frame) get marker property source]
+
+ set f [$current(frame) get marker font]
+
+ set marker(font) [lindex $f 0]
+ set marker(font,size) [lindex $f 1]
+ set marker(font,weight) [lindex $f 2]
+ set marker(font,slant) [lindex $f 3]
+ } else {
+ # defaults
+ set marker(color) $pmarker(color)
+ set marker(width) $pmarker(width)
+ set marker(dash) $pmarker(dash)
+ set marker(fixed) $pmarker(fixed)
+ set marker(edit) $pmarker(edit)
+ set marker(move) $pmarker(move)
+ set marker(rotate) $pmarker(rotate)
+ set marker(delete) $pmarker(delete)
+ set marker(include) $pmarker(include)
+ set marker(source) $pmarker(source)
+
+ set marker(font) $pmarker(font)
+ set marker(font,size) $pmarker(font,size)
+ set marker(font,weight) $pmarker(font,weight)
+ set marker(font,slant) $pmarker(font,slant)
+ }
+ }
+ }
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Region}] -state disabled
+ }
+}
diff --git a/ds9/library/mscale.tcl b/ds9/library/mscale.tcl
new file mode 100644
index 0000000..df6b248
--- /dev/null
+++ b/ds9/library/mscale.tcl
@@ -0,0 +1,441 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menu
+
+proc ScaleMainMenu {} {
+ global ds9
+
+ menu $ds9(mb).scale
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Linear}] \
+ -variable scale(type) -command ChangeScale -value linear
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Log}] \
+ -variable scale(type) -command ChangeScale -value log
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Power}] \
+ -variable scale(type) -command ChangeScale -value pow
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Square Root}] \
+ -variable scale(type) -command ChangeScale -value sqrt
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Squared}] \
+ -variable scale(type) -command ChangeScale -value squared
+ $ds9(mb).scale add radiobutton -label {ASINH} \
+ -variable scale(type) -command ChangeScale -value asinh
+ $ds9(mb).scale add radiobutton -label {SINH} \
+ -variable scale(type) -command ChangeScale -value sinh
+ $ds9(mb).scale add radiobutton \
+ -label [msgcat::mc {Histogram Equalization}] \
+ -variable scale(type) -command ChangeScale -value histequ
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add command -label "[msgcat::mc {Log Exponent}]..." \
+ -command ScaleLogDialog
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Min Max}] \
+ -variable scale(mode) -command ChangeScaleMode -value minmax
+ $ds9(mb).scale add radiobutton -label {99.5%} \
+ -variable scale(mode) -command ChangeScaleMode -value 99.5
+ $ds9(mb).scale add radiobutton -label {99%} \
+ -variable scale(mode) -command ChangeScaleMode -value 99
+ $ds9(mb).scale add radiobutton -label {98%} \
+ -variable scale(mode) -command ChangeScaleMode -value 98
+ $ds9(mb).scale add radiobutton -label {97%} \
+ -variable scale(mode) -command ChangeScaleMode -value 97
+ $ds9(mb).scale add radiobutton -label {96%} \
+ -variable scale(mode) -command ChangeScaleMode -value 96
+ $ds9(mb).scale add radiobutton -label {95%} \
+ -variable scale(mode) -command ChangeScaleMode -value 95
+ $ds9(mb).scale add radiobutton -label {92.5%} \
+ -variable scale(mode) -command ChangeScaleMode -value 92.5
+ $ds9(mb).scale add radiobutton -label {90%} \
+ -variable scale(mode) -command ChangeScaleMode -value 90
+ $ds9(mb).scale add radiobutton -label {ZScale} \
+ -variable scale(mode) -command ChangeScaleMode -value zscale
+ $ds9(mb).scale add radiobutton -label {ZMax} \
+ -variable scale(mode) -command ChangeScaleMode -value zmax
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {User}] \
+ -variable scale(mode) -command ChangeScaleMode -value user
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Global}] \
+ -variable scale(scope) -command ChangeScaleScope -value global
+ $ds9(mb).scale add radiobutton -label [msgcat::mc {Local}] \
+ -variable scale(scope) -command ChangeScaleScope -value local
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add cascade -label [msgcat::mc {Min Max}] \
+ -menu $ds9(mb).scale.minmax
+ $ds9(mb).scale add command -label {ZScale...} -command ZScaleDialog
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add checkbutton -label "[msgcat::mc {Use}] DATASEC" \
+ -variable scale(datasec) -command ChangeDATASEC
+ $ds9(mb).scale add separator
+ $ds9(mb).scale add command -label "[msgcat::mc {Scale Parameters}]..." \
+ -command ScaleDialog
+
+ menu $ds9(mb).scale.minmax
+ $ds9(mb).scale.minmax add radiobutton -label [msgcat::mc {Scan}] \
+ -variable minmax(mode) -value scan -command ChangeMinMax
+ $ds9(mb).scale.minmax add radiobutton -label [msgcat::mc {Sample}] \
+ -variable minmax(mode) -value sample -command ChangeMinMax
+ $ds9(mb).scale.minmax add radiobutton -label {DATAMIN DATAMAX} \
+ -variable minmax(mode) -value datamin -command ChangeMinMax
+ $ds9(mb).scale.minmax add radiobutton -label {IRAF-MIN IRAF-MAX} \
+ -variable minmax(mode) -value irafmin -command ChangeMinMax
+ $ds9(mb).scale.minmax add separator
+ $ds9(mb).scale.minmax add command \
+ -label "[msgcat::mc {Sample Parameters}]..." -command MinMaxDialog
+}
+
+proc PrefsDialogScaleMenu {w} {
+ set f [ttk::labelframe $w.mscale -text [msgcat::mc {Scale}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarScale $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2 -sticky w
+
+ set m $f.menu.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {Linear}] \
+ -variable pscale(type) -value linear
+ $m add radiobutton -label [msgcat::mc {Log}] \
+ -variable pscale(type) -value log
+ $m add radiobutton -label [msgcat::mc {Power}] \
+ -variable pscale(type) -value pow
+ $m add radiobutton -label [msgcat::mc {Square Root}]\
+ -variable pscale(type) -value sqrt
+ $m add radiobutton -label [msgcat::mc {Squared}] \
+ -variable pscale(type) -value squared
+ $m add radiobutton -label {ASINH} \
+ -variable pscale(type) -value asinh
+ $m add radiobutton -label {SINH} \
+ -variable pscale(type) -value sinh
+ $m add radiobutton -label [msgcat::mc {Histogram Equalization}] \
+ -variable pscale(type) -value histequ
+ $m add separator
+ $m add radiobutton -label [msgcat::mc {Min Max}] \
+ -variable pscale(mode) -value minmax
+ $m add radiobutton -label {99.5%} -variable pscale(mode) -value 99.5
+ $m add radiobutton -label {99%} -variable pscale(mode) -value 99
+ $m add radiobutton -label {98%} -variable pscale(mode) -value 98
+ $m add radiobutton -label {97%} -variable pscale(mode) -value 97
+ $m add radiobutton -label {96%} -variable pscale(mode) -value 96
+ $m add radiobutton -label {95%} -variable pscale(mode) -value 95
+ $m add radiobutton -label {92.5%} -variable pscale(mode) -value 92.5
+ $m add radiobutton -label {90%} -variable pscale(mode) -value 90
+ $m add radiobutton -label {ZScale} -variable pscale(mode) -value zscale
+ $m add radiobutton -label {ZMax} -variable pscale(mode) -value zmax
+ $m add radiobutton -label [msgcat::mc {User}] \
+ -variable pscale(mode) -value user
+ $m add separator
+ $m add radiobutton -label [msgcat::mc {Global}] \
+ -variable pscale(scope) -value global
+ $m add radiobutton -label [msgcat::mc {Local}] \
+ -variable pscale(scope) -value local
+ $m add separator
+ $m add cascade -label [msgcat::mc {Min Max}] -menu $m.minmax
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Use}] DATASEC" \
+ -variable pscale(datasec)
+
+ menu $m.minmax
+ $m.minmax add radiobutton -label [msgcat::mc {Scan}] \
+ -variable pminmax(mode) -value scan
+ $m.minmax add radiobutton -label [msgcat::mc {Sample}] \
+ -variable pminmax(mode) -value sample
+ $m.minmax add radiobutton -label {DATAMIN DATAMAX} \
+ -variable pminmax(mode) -value datamin
+ $m.minmax add radiobutton -label {IRAF-MIN IRAF-MAX} \
+ -variable pminmax(mode) -value irafmin
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogScale {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Scale}]
+ lappend dprefs(tabs) [ttk::frame $w.scale]
+
+ # Log
+ set f [ttk::labelframe $w.scale.log -text [msgcat::mc {Log Exponent}]]
+
+ ttk::entry $f.log -textvariable pscale(log) -width 10
+
+ grid $f.log -padx 2 -pady 2 -sticky w
+
+ # MinMax
+ set f [ttk::labelframe $w.scale.minmax \
+ -text [msgcat::mc {Min Max Parameters}]]
+
+ slider $f.ssample 0 1000 [msgcat::mc {Sample Increment}] \
+ pminmax(sample) {}
+
+ grid $f.ssample -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Zscale
+ set f [ttk::labelframe $w.scale.zscale \
+ -text [msgcat::mc {ZScale Parameters}]]
+
+ slider $f.scontrast 0. 1. [msgcat::mc {Contrast}] \
+ pzscale(contrast) {}
+ slider $f.ssize 0 1000 [msgcat::mc {Number of Samples}] \
+ pzscale(sample) {}
+ slider $f.sline 0 500 [msgcat::mc {Samples per Line}] \
+ pzscale(line) {}
+
+ grid $f.scontrast -padx 2 -pady 2 -sticky ew
+ grid $f.ssize -padx 2 -pady 2 -sticky ew
+ grid $f.sline -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ pack $w.scale.log $w.scale.minmax $w.scale.zscale -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsScaleDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ scale,linear 1
+ scale,log 1
+ scale,pow 1
+ scale,sqrt 1
+ scale,squared 1
+ scale,asinh 1
+ scale,sinh 1
+ scale,hist 1
+ scale,minmax 1
+ scale,995 0
+ scale,99 0
+ scale,98 0
+ scale,97 0
+ scale,96 0
+ scale,95 0
+ scale,925 0
+ scale,90 0
+ scale,zscale 1
+ scale,zmax 0
+ scale,user 0
+ scale,global 0
+ scale,local 0
+ scale,datasec 0
+ scale,params 0
+ }
+}
+
+proc CreateButtonsScale {} {
+ global buttons
+ global ds9
+ global scale
+
+ ttk::frame $ds9(buttons).scale
+ RadioButton $ds9(buttons).scale.linear \
+ [string tolower [msgcat::mc {Linear}]] \
+ scale(type) linear ChangeScale
+ RadioButton $ds9(buttons).scale.log \
+ [string tolower [msgcat::mc {Log}]] \
+ scale(type) log ChangeScale
+ RadioButton $ds9(buttons).scale.pow \
+ [string tolower [msgcat::mc {Power}]] \
+ scale(type) pow ChangeScale
+ RadioButton $ds9(buttons).scale.sqrt \
+ [string tolower [msgcat::mc {Sqrt}]] \
+ scale(type) sqrt ChangeScale
+ RadioButton $ds9(buttons).scale.squared \
+ [string tolower [msgcat::mc {Squared}]] \
+ scale(type) squared ChangeScale
+ RadioButton $ds9(buttons).scale.asinh \
+ [string tolower {ASINH}] \
+ scale(type) asinh ChangeScale
+ RadioButton $ds9(buttons).scale.sinh \
+ [string tolower {SINH}] \
+ scale(type) sinh ChangeScale
+ RadioButton $ds9(buttons).scale.hist \
+ [string tolower [msgcat::mc {Histogram}]] \
+ scale(type) histequ ChangeScale
+
+ RadioButton $ds9(buttons).scale.minmax \
+ [string tolower [msgcat::mc {Min Max}]] \
+ scale(mode) minmax ChangeScaleMode
+ RadioButton $ds9(buttons).scale.995 {99.5%} scale(mode) 99.5 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.99 {99%} scale(mode) 99 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.98 {98%} scale(mode) 98 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.97 {97%} scale(mode) 97 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.96 {96%} scale(mode) 96 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.95 {95%} scale(mode) 95 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.925 {92.5%} scale(mode) 92.5 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.90 {90%} scale(mode) 90 ChangeScaleMode
+ RadioButton $ds9(buttons).scale.zscale {zscale} \
+ scale(mode) zscale ChangeScaleMode
+ RadioButton $ds9(buttons).scale.zmax {zmax} \
+ scale(mode) zmax ChangeScaleMode
+ RadioButton $ds9(buttons).scale.user \
+ [string tolower [msgcat::mc {User}]] \
+ scale(mode) user ChangeScaleMode
+
+ RadioButton $ds9(buttons).scale.global \
+ [string tolower [msgcat::mc {Global}]] \
+ scale(scope) global ChangeScaleScope
+ RadioButton $ds9(buttons).scale.local \
+ [string tolower [msgcat::mc {Local}]] \
+ scale(scope) local ChangeScaleScope
+
+ CheckButton $ds9(buttons).scale.datasec {datasec} \
+ scale(datasec) ChangeDATASEC
+
+ ButtonButton $ds9(buttons).scale.params \
+ [string tolower [msgcat::mc {Parameters}]] ScaleDialog
+
+ set buttons(scale) "
+ $ds9(buttons).scale.linear pbuttons(scale,linear)
+ $ds9(buttons).scale.log pbuttons(scale,log)
+ $ds9(buttons).scale.pow pbuttons(scale,pow)
+ $ds9(buttons).scale.sqrt pbuttons(scale,sqrt)
+ $ds9(buttons).scale.squared pbuttons(scale,squared)
+ $ds9(buttons).scale.asinh pbuttons(scale,asinh)
+ $ds9(buttons).scale.sinh pbuttons(scale,sinh)
+ $ds9(buttons).scale.hist pbuttons(scale,hist)
+ $ds9(buttons).scale.minmax pbuttons(scale,minmax)
+ $ds9(buttons).scale.995 pbuttons(scale,995)
+ $ds9(buttons).scale.99 pbuttons(scale,99)
+ $ds9(buttons).scale.98 pbuttons(scale,98)
+ $ds9(buttons).scale.97 pbuttons(scale,97)
+ $ds9(buttons).scale.96 pbuttons(scale,96)
+ $ds9(buttons).scale.95 pbuttons(scale,95)
+ $ds9(buttons).scale.925 pbuttons(scale,925)
+ $ds9(buttons).scale.90 pbuttons(scale,90)
+ $ds9(buttons).scale.zscale pbuttons(scale,zscale)
+ $ds9(buttons).scale.zmax pbuttons(scale,zmax)
+ $ds9(buttons).scale.user pbuttons(scale,user)
+ $ds9(buttons).scale.global pbuttons(scale,global)
+ $ds9(buttons).scale.local pbuttons(scale,local)
+ $ds9(buttons).scale.datasec pbuttons(scale,datasec)
+ $ds9(buttons).scale.params pbuttons(scale,params)
+ "
+}
+
+proc PrefsDialogButtonbarScale {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Linear}] \
+ -variable pbuttons(scale,linear) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Log}] \
+ -variable pbuttons(scale,log) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Power}] \
+ -variable pbuttons(scale,pow) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Square Root}] \
+ -variable pbuttons(scale,sqrt) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Squared}] \
+ -variable pbuttons(scale,squared) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {ASINH} \
+ -variable pbuttons(scale,asinh) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {SINH} \
+ -variable pbuttons(scale,sinh) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Histogram Equalization}] \
+ -variable pbuttons(scale,hist) -command {UpdateButtons buttons(scale)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Min Max}] \
+ -variable pbuttons(scale,minmax) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {99.5%} \
+ -variable pbuttons(scale,995) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {99%} \
+ -variable pbuttons(scale,99) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {98%} \
+ -variable pbuttons(scale,98) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {97%} \
+ -variable pbuttons(scale,97) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {96%} \
+ -variable pbuttons(scale,96) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {95%} \
+ -variable pbuttons(scale,95) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {92.5%} \
+ -variable pbuttons(scale,925) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {90%} \
+ -variable pbuttons(scale,90) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {ZScale} \
+ -variable pbuttons(scale,zscale) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label {ZMax} \
+ -variable pbuttons(scale,zmax) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {User}] \
+ -variable pbuttons(scale,user) -command {UpdateButtons buttons(scale)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Global}] \
+ -variable pbuttons(scale,global) -command {UpdateButtons buttons(scale)}
+ $m add checkbutton -label [msgcat::mc {Local}] \
+ -variable pbuttons(scale,local) -command {UpdateButtons buttons(scale)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Use}] DATASEC" \
+ -variable pbuttons(scale,datasec) -command {UpdateButtons buttons(scale)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Scale Parameters}]..." \
+ -variable pbuttons(scale,params) -command {UpdateButtons buttons(scale)}
+}
+
+# Support
+
+proc UpdateScaleMenu {} {
+ global ds9
+ global current
+ global scale
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateScaleMenu"
+ }
+
+ if {$current(frame) != {}} {
+ if {![$current(frame) has iis]} {
+ $ds9(mb) entryconfig [msgcat::mc {Scale}] -state normal
+
+ set scale(type) [$current(frame) get colorscale]
+ set scale(log) [$current(frame) get colorscale log]
+ set scale(scope) [$current(frame) get clip scope]
+ set scale(mode) [$current(frame) get clip mode]
+ set scale(datasec) [$current(frame) get datasec]
+ set minmax(sample) [$current(frame) get clip minmax sample]
+ set minmax(mode) [$current(frame) get clip minmax mode]
+ set zscale(contrast) [$current(frame) get clip zscale contrast]
+ set zscale(sample) [$current(frame) get clip zscale sample]
+ set zscale(line) [$current(frame) get clip zscale line]
+
+ # DATAMIN/MAX IRAFMIN/MAX
+ if {[$current(frame) has fits]} {
+ if {[$current(frame) has datamin]} {
+ $ds9(mb).scale.minmax entryconfig {DATAMIN DATAMAX} \
+ -state normal
+ } else {
+ $ds9(mb).scale.minmax entryconfig {DATAMIN DATAMAX} \
+ -state disabled
+ }
+
+ if {[$current(frame) has irafmin]} {
+ $ds9(mb).scale.minmax entryconfig {IRAF-MIN IRAF-MAX} \
+ -state normal
+ } else {
+ $ds9(mb).scale.minmax entryconfig {IRAF-MIN IRAF-MAX} \
+ -state disabled
+ }
+ } else {
+ $ds9(mb).scale.minmax entryconfig {DATAMIN DATAMAX} \
+ -state normal
+ $ds9(mb).scale.minmax entryconfig {IRAF-MIN IRAF-MAX} \
+ -state normal
+ }
+
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Scale}] -state disabled
+ }
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Scale}] -state disabled
+ }
+}
+
diff --git a/ds9/library/multiframe.tcl b/ds9/library/multiframe.tcl
new file mode 100644
index 0000000..3fad8e7
--- /dev/null
+++ b/ds9/library/multiframe.tcl
@@ -0,0 +1,179 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadMultiFrameFile {fn} {
+ set path {}
+ if {[string range $fn 0 4] == "stdin" ||
+ [string range $fn 0 4] == "STDIN" ||
+ [string range $fn 0 0] == "-"} {
+ set path [tmpnam {.fits}]
+ catch {
+ set ch [open "$path" w]
+ fconfigure stdin -translation binary -encoding binary
+ fconfigure $ch -translation binary -encoding binary
+ puts -nonewline $ch [read stdin]
+ close $ch
+ }
+ }
+
+ LoadMultiFrameAlloc $path $fn
+}
+
+proc LoadMultiFrameSocket {sock fn} {
+ set path [tmpnam {.fits}]
+ catch {
+ set ch [open "$path" w]
+ fconfigure $ch -translation binary -encoding binary
+ fconfigure $sock -translation binary -encoding binary
+ puts -nonewline $ch [read $sock]
+ close $ch
+ }
+
+ set rr [LoadMultiFrameAlloc $path $fn]
+ if {!$rr} {
+ if {$path != {}} {
+ catch {file delete -force $path}
+ }
+ }
+ return $rr
+}
+
+proc LoadMultiFrameAlloc {path fn} {
+ global loadParam
+ global current
+ global ds9
+
+ set ext 0
+ set cnt 0
+ set did 0
+ set need 0
+
+ # start with new frame?
+ if {$current(frame) != {}} {
+ switch -- [$current(frame) get type] {
+ base {
+ if {[$current(frame) has fits]} {
+ CreateFrame
+ set did 1
+ }
+ }
+ rgb -
+ 3d {
+ CreateFrame
+ set did 1
+ }
+ }
+ } else {
+ CreateFrame
+ }
+
+ while {1} {
+
+ # create a new frame
+ if {$need} {
+ CreateFrame
+ set did 1
+ }
+
+ # ProcessLoad will clear loadParam each time
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {}
+ if {$path != {}} {
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) "stdin\[$ext\]"
+ set loadParam(file,fn) "$path\[$ext\]"
+ } else {
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) "$fn\[$ext\]"
+ }
+ set loadParam(load,layer) {}
+
+ if {![ProcessLoad 0]} {
+ if {$ext} {
+ InitError xpa
+
+ if {$did} {
+ DeleteCurrentFrame
+ incr ds9(next,num) -1
+ }
+ if {!$cnt} {
+ Error "[msgcat::mc {Unable to load}] $loadParam(file,type) $loadParam(file,mode) $loadParam(file,name)"
+ return 0
+ }
+ break;
+ }
+ } else {
+ # ignore any bin tables
+ if {![$current(frame) has fits bin]} {
+ incr cnt
+ set need 1
+ } else {
+ set need 0
+ }
+ }
+
+ incr ext
+ }
+
+ if {$path != {}} {
+ catch {file delete -force $path}
+ }
+
+ # go into tile mode if more than one
+ if {$cnt && $current(display) != "tile"} {
+ set current(display) tile
+ DisplayMode
+ }
+
+ return 1
+}
+
+proc ProcessMultiFrameCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ # not supported
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {
+ if {![LoadMultiFrameSocket $sock $param]} {
+ InitError xpa
+ LoadMultiFrameFile $param
+ }
+ }
+ {Windows NT} {LoadMultiFrameFile $param}
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadMultiFrameAlloc $fn $param
+ } else {
+ LoadMultiFrameFile $param
+ }
+ }
+ FinishLoad
+}
+
diff --git a/ds9/library/mview.tcl b/ds9/library/mview.tcl
new file mode 100644
index 0000000..401b887
--- /dev/null
+++ b/ds9/library/mview.tcl
@@ -0,0 +1,358 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc ViewMainMenu {} {
+ global ds9
+
+ menu $ds9(mb).view
+ $ds9(mb).view add radiobutton -label [msgcat::mc {Horizontal Layout}] \
+ -variable view(layout) -value horizontal -command {ViewHorzCmd}
+ $ds9(mb).view add radiobutton -label [msgcat::mc {Vertical Layout}] \
+ -variable view(layout) -value vertical -command {ViewVertCmd}
+ $ds9(mb).view add separator
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Information Panel}] \
+ -variable view(info) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Panner}] \
+ -variable view(panner) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Magnifier}] \
+ -variable view(magnifier) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Buttons}] \
+ -variable view(buttons) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable view(colorbar) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Horizontal Graph}] \
+ -variable view(graph,horz) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Vertical Graph}] \
+ -variable view(graph,vert) -command UpdateView
+ $ds9(mb).view add separator
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Filename}] \
+ -variable view(info,filename) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Object}] \
+ -variable view(info,object) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Keyword}] \
+ -variable view(info,keyword) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Min Max}] \
+ -variable view(info,minmax) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Low High}] \
+ -variable view(info,lowhigh) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Units}] \
+ -variable view(info,bunit) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {WCS}] \
+ -variable view(info,wcs) -command UpdateView
+ $ds9(mb).view add cascade -label [msgcat::mc {Multiple WCS}] \
+ -menu $ds9(mb).view.mwcs
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Image}] \
+ -variable view(info,image) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Physical}] \
+ -variable view(info,physical) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable view(info,amplifier) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Detector}] \
+ -variable view(info,detector) -command UpdateView
+ $ds9(mb).view add checkbutton -label [msgcat::mc {Frame Information}] \
+ -variable view(info,frame) -command UpdateView
+
+ # View Info Panel WCS
+ menu $ds9(mb).view.mwcs
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $ds9(mb).view.mwcs add checkbutton \
+ -label "[msgcat::mc {WCS}] $l" \
+ -variable "view(info,wcs$l)" \
+ -command UpdateView
+ }
+}
+
+proc PrefsDialogViewMenu {w} {
+ set f [ttk::labelframe $w.mview -text [msgcat::mc {View}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarView $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add radiobutton -label [msgcat::mc {Horizontal Layout}] \
+ -variable pview(layout) -value horizontal
+ $m add radiobutton -label [msgcat::mc {Vertical Layout}] \
+ -variable pview(layout) -value vertical
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Information Panel}] \
+ -variable pview(info)
+ $m add checkbutton -label [msgcat::mc {Panner}] \
+ -variable pview(panner)
+ $m add checkbutton -label [msgcat::mc {Magnifier}] \
+ -variable pview(magnifier)
+ $m add checkbutton -label [msgcat::mc {Buttons}] \
+ -variable pview(buttons)
+ $m add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable pview(colorbar)
+ $m add checkbutton -label [msgcat::mc {Horizontal Graph}] \
+ -variable pview(graph,horz)
+ $m add checkbutton -label [msgcat::mc {Vertical Graph}] \
+ -variable pview(graph,vert)
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Filename}] \
+ -variable pview(info,filename)
+ $m add checkbutton -label [msgcat::mc {Object}] \
+ -variable pview(info,object)
+ $m add checkbutton -label [msgcat::mc {Keyword}] \
+ -variable pview(info,keyword)
+ $m add checkbutton -label [msgcat::mc {Min Max}] \
+ -variable pview(info,minmax)
+ $m add checkbutton -label [msgcat::mc {Low High}] \
+ -variable pview(info,lowhigh)
+ $m add checkbutton -label [msgcat::mc {Units}] \
+ -variable pview(info,bunit)
+ $m add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pview(info,wcs)
+ $m add cascade -label [msgcat::mc {Multiple WCS}] -menu $m.wcs
+ $m add checkbutton -label [msgcat::mc {Image}] \
+ -variable pview(info,image)
+ $m add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pview(info,physical)
+ $m add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pview(info,amplifier)
+ $m add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pview(info,detector)
+ $m add checkbutton -label [msgcat::mc {Frame Information}]\
+ -variable pview(info,frame)
+
+ menu $m.wcs
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $m.wcs add checkbutton -label "[msgcat::mc {WCS}] $l" \
+ -variable "pview(info,wcs$l)"
+ }
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogGraph {} {
+ global dprefs
+ global ds9
+ global pds9
+ global pmagnifier
+ global current
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Graphs}]
+ lappend dprefs(tabs) [ttk::frame $w.graph]
+
+ set f [ttk::labelframe $w.graph.horz -text [msgcat::mc {Horizontal}]]
+
+ ttk::label $f.htitle -text [msgcat::mc {Default}]
+ ttk::checkbutton $f.hgrid -text [msgcat::mc {Grid}] \
+ -variable pgraph(horz,grid) -command UpdateGraphGrid
+ ttk::radiobutton $f.hlinear -text [msgcat::mc {Linear}] \
+ -variable pgraph(horz,log) -value false \
+ -command "UpdateGraphYAxis $current(frame)"
+ ttk::radiobutton $f.hlog -text [msgcat::mc {Log}] \
+ -variable pgraph(horz,log) -value true \
+ -command "UpdateGraphYAxis $current(frame)"
+
+ grid $f.htitle $f.hgrid $f.hlinear $f.hlog -padx 2 -pady 2 -sticky w
+
+ set f [ttk::labelframe $w.graph.vert -text [msgcat::mc {Vertical}]]
+
+ ttk::label $f.vtitle -text [msgcat::mc {Default}]
+ ttk::checkbutton $f.vgrid -text [msgcat::mc {Grid}] \
+ -variable pgraph(vert,grid) -command UpdateGraphGrid
+ ttk::radiobutton $f.vlinear -text [msgcat::mc {Linear}] \
+ -variable pgraph(vert,log) -value false \
+ -command "UpdateGraphYAxis $current(frame)"
+ ttk::radiobutton $f.vlog -text [msgcat::mc {Log}] \
+ -variable pgraph(vert,log) -value true \
+ -command "UpdateGraphYAxis $current(frame)"
+
+ grid $f.vtitle $f.vgrid $f.vlinear $f.vlog -padx 2 -pady 2 -sticky w
+
+ pack $w.graph.horz $w.graph.vert -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsViewDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ view,horizontal 0
+ view,vertical 0
+ view,info 1
+ view,panner 1
+ view,magnifier 1
+ view,buttons 1
+ view,colorbar 1
+ view,graphhorz 1
+ view,graphvert 1
+ view,filename 0
+ view,object 0
+ view,minmax 0
+ view,lowhigh 0
+ view,bunit 0
+ view,wcs 0
+ view,image 0
+ view,physical 0
+ view,amplifier 0
+ view,detector 0
+ view,frame 0
+ }
+}
+
+proc CreateButtonsView {} {
+ global buttons
+ global ds9
+ global view
+
+ ttk::frame $ds9(buttons).view
+
+ RadioButton $ds9(buttons).view.horizontal \
+ [string tolower [msgcat::mc {Layout Horz}]] \
+ view(layout) horizontal {ViewHorzCmd}
+ RadioButton $ds9(buttons).view.vertical \
+ [string tolower [msgcat::mc {Layout Vert}]] \
+ view(layout) vertical {ViewVertCmd}
+
+ CheckButton $ds9(buttons).view.info \
+ [string tolower [msgcat::mc {Information}]] \
+ view(info) UpdateView
+ CheckButton $ds9(buttons).view.panner \
+ [string tolower [msgcat::mc {Panner}]] \
+ view(panner) UpdateView
+ CheckButton $ds9(buttons).view.magnifier \
+ [string tolower [msgcat::mc {Magnifier}]] \
+ view(magnifier) UpdateView
+ CheckButton $ds9(buttons).view.buttons \
+ [string tolower [msgcat::mc {Buttons}]] \
+ view(buttons) UpdateView
+ CheckButton $ds9(buttons).view.colorbar \
+ [string tolower [msgcat::mc {Colorbar}]] \
+ view(colorbar) UpdateView
+ CheckButton $ds9(buttons).view.graphhorz \
+ [string tolower [msgcat::mc {Graph Horz}]] \
+ view(graph,horz) UpdateView
+ CheckButton $ds9(buttons).view.graphvert \
+ [string tolower [msgcat::mc {Graph Vert}]] \
+ view(graph,vert) UpdateView
+
+ CheckButton $ds9(buttons).view.filename \
+ [string tolower [msgcat::mc {Filename}]] \
+ view(info,filename) UpdateView
+ CheckButton $ds9(buttons).view.object \
+ [string tolower [msgcat::mc {Object}]] \
+ view(info,object) UpdateView
+ CheckButton $ds9(buttons).view.keyword \
+ [string tolower [msgcat::mc {Keyword}]] \
+ view(info,keyword) UpdateView
+ CheckButton $ds9(buttons).view.minmax \
+ [string tolower [msgcat::mc {Min Max}]] \
+ view(info,minmax) UpdateView
+ CheckButton $ds9(buttons).view.lowhigh \
+ [string tolower [msgcat::mc {Low High}]] \
+ view(info,lowhigh) UpdateView
+ CheckButton $ds9(buttons).view.bunit \
+ [string tolower [msgcat::mc {Units}]] \
+ view(info,bunit) UpdateView
+ CheckButton $ds9(buttons).view.wcs \
+ [string tolower [msgcat::mc {WCS}]] \
+ view(info,wcs) UpdateView
+ CheckButton $ds9(buttons).view.image \
+ [string tolower [msgcat::mc {Image}]] \
+ view(info,image) UpdateView
+ CheckButton $ds9(buttons).view.physical \
+ [string tolower [msgcat::mc {Physical}]] \
+ view(info,physical) UpdateView
+ CheckButton $ds9(buttons).view.amplifier \
+ [string tolower [msgcat::mc {Amplifier}]] \
+ view(info,amplifier) UpdateView
+ CheckButton $ds9(buttons).view.detector \
+ [string tolower [msgcat::mc {Detector}]] \
+ view(info,detector) UpdateView
+ CheckButton $ds9(buttons).view.frame \
+ [string tolower [msgcat::mc {Frame}]] \
+ view(info,frame) UpdateView
+
+ set buttons(view) "
+ $ds9(buttons).view.horizontal pbuttons(view,horizontal)
+ $ds9(buttons).view.vertical pbuttons(view,vertical)
+ $ds9(buttons).view.info pbuttons(view,info)
+ $ds9(buttons).view.panner pbuttons(view,panner)
+ $ds9(buttons).view.magnifier pbuttons(view,magnifier)
+ $ds9(buttons).view.buttons pbuttons(view,buttons)
+ $ds9(buttons).view.colorbar pbuttons(view,colorbar)
+ $ds9(buttons).view.graphhorz pbuttons(view,graphhorz)
+ $ds9(buttons).view.graphvert pbuttons(view,graphvert)
+ $ds9(buttons).view.filename pbuttons(view,filename)
+ $ds9(buttons).view.object pbuttons(view,object)
+ $ds9(buttons).view.minmax pbuttons(view,minmax)
+ $ds9(buttons).view.lowhigh pbuttons(view,lowhigh)
+ $ds9(buttons).view.bunit pbuttons(view,bunit)
+ $ds9(buttons).view.wcs pbuttons(view,wcs)
+ $ds9(buttons).view.image pbuttons(view,image)
+ $ds9(buttons).view.physical pbuttons(view,physical)
+ $ds9(buttons).view.amplifier pbuttons(view,amplifier)
+ $ds9(buttons).view.detector pbuttons(view,detector)
+ $ds9(buttons).view.frame pbuttons(view,frame)
+ "
+}
+
+proc PrefsDialogButtonbarView {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Horizontal Layout}] \
+ -variable pbuttons(view,horizontal) \
+ -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Vertical Layout}] \
+ -variable pbuttons(view,vertical) \
+ -command {UpdateButtons buttons(view)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Information Panel}] \
+ -variable pbuttons(view,info) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Panner}] \
+ -variable pbuttons(view,panner) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Magnifier}] \
+ -variable pbuttons(view,magnifier) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Buttons}] \
+ -variable pbuttons(view,buttons) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable pbuttons(view,colorbar) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Horizontal Graph}] \
+ -variable pbuttons(view,graphhorz) \
+ -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Vertical Graph}] \
+ -variable pbuttons(view,graphvert) \
+ -command {UpdateButtons buttons(view)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Filename}] \
+ -variable pbuttons(view,filename) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Object}] \
+ -variable pbuttons(view,object) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Min Max}] \
+ -variable pbuttons(view,minmax) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Low High}] \
+ -variable pbuttons(view,lowhigh) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Unists}] \
+ -variable pbuttons(view,bunit) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {WCS}] \
+ -variable pbuttons(view,wcs) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Image}] \
+ -variable pbuttons(view,image) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Physical}] \
+ -variable pbuttons(view,physical) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Amplifier}] \
+ -variable pbuttons(view,amplifier) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Detector}] \
+ -variable pbuttons(view,detector) -command {UpdateButtons buttons(view)}
+ $m add checkbutton -label [msgcat::mc {Frame Information}] \
+ -variable pbuttons(view,frame) -command {UpdateButtons buttons(view)}
+}
diff --git a/ds9/library/mwcs.tcl b/ds9/library/mwcs.tcl
new file mode 100644
index 0000000..94b881f
--- /dev/null
+++ b/ds9/library/mwcs.tcl
@@ -0,0 +1,140 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menu
+
+proc WCSMainMenu {} {
+ global ds9
+ global wcs
+
+ CoordMenu $ds9(mb).wcs wcs system 0 sky skyformat UpdateWCS
+ $ds9(mb).wcs add separator
+ $ds9(mb).wcs add command -label "[msgcat::mc {WCS Parameters}]..." \
+ -command WCSDialog
+}
+
+proc UpdateWCSMenu {} {
+ global wcs
+ global ds9
+ global current
+ global bin
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateWCSMenu"
+ }
+
+ if {$current(frame) != {}} {
+ $ds9(mb) entryconfig [msgcat::mc {WCS}] -state normal
+
+ set ww [$current(frame) get wcs]
+ set wcs(system) [lindex $ww 0]
+ set wcs(sky) [lindex $ww 1]
+ set wcs(skyformat) [lindex $ww 2]
+
+ set wcs(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ CoordMenuEnable $ds9(mb).wcs wcs system 0 sky skyformat
+ } else {
+ CoordMenuReset $ds9(mb).wcs wcs system 0 sky skyformat
+ }
+ UpdateWCSInfoBox $current(frame)
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {WCS}] -state disabled
+ }
+}
+
+proc PrefsDialogWCSMenu {w} {
+ set f [ttk::labelframe $w.mwcs -text [msgcat::mc {WCS}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarWCS $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2 -sticky w
+
+ CoordMenu $f.menu.menu pwcs system 0 sky skyformat {}
+
+ pack $f -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsWCSDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ wcs,fk4 1
+ wcs,fk5 1
+ wcs,icrs 1
+ wcs,galactic 1
+ wcs,ecliptic 1
+ wcs,degrees 1
+ wcs,sexagesimal 1
+ }
+}
+
+proc CreateButtonsWCS {} {
+ global buttons
+ global ds9
+ global wcs
+
+ ttk::frame $ds9(buttons).wcs
+
+ RadioButton $ds9(buttons).wcs.fk4 {fk4} \
+ wcs(sky) fk4 UpdateWCS
+ RadioButton $ds9(buttons).wcs.fk5 {fk5} \
+ wcs(sky) fk5 UpdateWCS
+ RadioButton $ds9(buttons).wcs.icrs \
+ [string tolower [msgcat::mc {ICRS}]] \
+ wcs(sky) icrs UpdateWCS
+ RadioButton $ds9(buttons).wcs.galactic \
+ [string tolower [msgcat::mc {Galactic}]] \
+ wcs(sky) galactic UpdateWCS
+ RadioButton $ds9(buttons).wcs.ecliptic \
+ [string tolower [msgcat::mc {Ecliptic}]] \
+ wcs(sky) ecliptic UpdateWCS
+ RadioButton $ds9(buttons).wcs.degrees \
+ [string tolower [msgcat::mc {Degrees}]] \
+ wcs(skyformat) degrees UpdateWCS
+ RadioButton $ds9(buttons).wcs.sexagesimal {sexagesimal} \
+ wcs(skyformat) sexagesimal UpdateWCS
+
+ set buttons(wcs) "
+ $ds9(buttons).wcs.fk4 pbuttons(wcs,fk4)
+ $ds9(buttons).wcs.fk5 pbuttons(wcs,fk5)
+ $ds9(buttons).wcs.icrs pbuttons(wcs,icrs)
+ $ds9(buttons).wcs.galactic pbuttons(wcs,galactic)
+ $ds9(buttons).wcs.ecliptic pbuttons(wcs,ecliptic)
+ $ds9(buttons).wcs.degrees pbuttons(wcs,degrees)
+ $ds9(buttons).wcs.sexagesimal pbuttons(wcs,sexagesimal)
+ "
+}
+
+proc PrefsDialogButtonbarWCS {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {FK4}] \
+ -variable pbuttons(wcs,fk4) -command {UpdateButtons buttons(wcs)}
+ $m add checkbutton -label [msgcat::mc {FK5}] \
+ -variable pbuttons(wcs,fk5) -command {UpdateButtons buttons(wcs)}
+ $m add checkbutton -label [msgcat::mc {ICRS}] \
+ -variable pbuttons(wcs,icrs) -command {UpdateButtons buttons(wcs)}
+ $m add checkbutton -label [msgcat::mc {Galactic}] \
+ -variable pbuttons(wcs,galactic) -command {UpdateButtons buttons(wcs)}
+ $m add checkbutton -label [msgcat::mc {Ecliptic}] \
+ -variable pbuttons(wcs,ecliptic) -command {UpdateButtons buttons(wcs)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Degrees}] \
+ -variable pbuttons(wcs,degrees) -command {UpdateButtons buttons(wcs)}
+ $m add checkbutton -label [msgcat::mc {Sexagesimal}] \
+ -variable pbuttons(wcs,sexagesimal) -command {UpdateButtons buttons(wcs)}
+}
+
diff --git a/ds9/library/mzoom.tcl b/ds9/library/mzoom.tcl
new file mode 100644
index 0000000..de9959f
--- /dev/null
+++ b/ds9/library/mzoom.tcl
@@ -0,0 +1,412 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# Menus
+
+proc ZoomMainMenu {} {
+ global ds9
+
+ menu $ds9(mb).zoom
+ $ds9(mb).zoom add command -label [msgcat::mc {Center Image}] \
+ -command CenterCurrentFrame
+ $ds9(mb).zoom add checkbutton -label [msgcat::mc {Align}] \
+ -variable current(align) -command AlignWCSFrame
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add command -label [msgcat::mc {Zoom In}] \
+ -command {Zoom 2 2}
+ $ds9(mb).zoom add command -label [msgcat::mc {Zoom Out}] \
+ -command {Zoom .5 .5}
+ $ds9(mb).zoom add command -label [msgcat::mc {Zoom Fit}] \
+ -command ZoomToFit
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/32" \
+ -variable current(zoom) -value { 0.03125 0.03125 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/16" \
+ -variable current(zoom) -value { 0.0625 0.0625 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/8" \
+ -variable current(zoom) -value { 0.125 0.125 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/4" \
+ -variable current(zoom) -value { 0.25 0.25 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/2" \
+ -variable current(zoom) -value { 0.5 0.5 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 1" \
+ -variable current(zoom) -value { 1 1 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 2" \
+ -variable current(zoom) -value { 2 2 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 4" \
+ -variable current(zoom) -value { 4 4 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 8" \
+ -variable current(zoom) -value { 8 8 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 16" \
+ -variable current(zoom) -value { 16 16 } -command ChangeZoom
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Zoom}] 32" \
+ -variable current(zoom) -value { 32 32 } -command ChangeZoom
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add radiobutton -label [msgcat::mc {None}] \
+ -variable current(orient) -value none -command ChangeOrient
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Invert}] X" \
+ -variable current(orient) -value x -command ChangeOrient
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Invert}] Y" \
+ -variable current(orient) -value y -command ChangeOrient
+ $ds9(mb).zoom add radiobutton -label "[msgcat::mc {Invert}] XY" \
+ -variable current(orient) -value xy -command ChangeOrient
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add radiobutton -label "0 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 0 -command ChangeRotate
+ $ds9(mb).zoom add radiobutton -label "90 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 90 -command ChangeRotate
+ $ds9(mb).zoom add radiobutton -label "180 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 180 -command ChangeRotate
+ $ds9(mb).zoom add radiobutton -label "270 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 270 -command ChangeRotate
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add command -label "[msgcat::mc {Crop Parameters}]..." \
+ -command CropDialog
+ $ds9(mb).zoom add separator
+ $ds9(mb).zoom add command \
+ -label "[msgcat::mc {Pan Zoom Rotate Parameters}]..." \
+ -command PanZoomDialog
+}
+
+proc PrefsDialogZoomMenu {w} {
+ set f [ttk::labelframe $w.mzoom -text [msgcat::mc {Zoom}]]
+
+ ttk::menubutton $f.menu -text [msgcat::mc {Menu}] -menu $f.menu.menu
+ PrefsDialogButtonbarZoom $f.buttonbar
+
+ grid $f.menu $f.buttonbar -padx 2 -pady 2
+
+ set m $f.menu.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Align}] \
+ -variable pcurrent(align)
+ $m add separator
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1/32" \
+ -variable pcurrent(zoom) -value { 0.03125 0.03125 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1/16" \
+ -variable pcurrent(zoom) -value { 0.0625 0.0625 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1/8" \
+ -variable pcurrent(zoom) -value { 0.125 0.125 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1/4" \
+ -variable pcurrent(zoom) -value { 0.25 0.25 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1/2" \
+ -variable pcurrent(zoom) -value { 0.5 0.5 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 1" \
+ -variable pcurrent(zoom) -value { 1 1 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 2" \
+ -variable pcurrent(zoom) -value { 2 2 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 4" \
+ -variable pcurrent(zoom) -value { 4 4 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 8" \
+ -variable pcurrent(zoom) -value { 8 8 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 16" \
+ -variable pcurrent(zoom) -value { 16 16 }
+ $m add radiobutton -label "[msgcat::mc {Zoom}] 32" \
+ -variable pcurrent(zoom) -value { 32 32 }
+ $m add separator
+ $m add radiobutton -label [msgcat::mc {None}] \
+ -variable pcurrent(orient) -value none
+ $m add radiobutton -label "[msgcat::mc {Invert}] X" \
+ -variable pcurrent(orient) -value x
+ $m add radiobutton -label "[msgcat::mc {Invert}] Y" \
+ -variable pcurrent(orient) -value y
+ $m add radiobutton -label "[msgcat::mc {Invert}] XY" \
+ -variable pcurrent(orient) -value xy
+ $m add separator
+ $m add radiobutton -label "0 [msgcat::mc {Degrees}]" \
+ -variable pcurrent(rotate) -value 0
+ $m add radiobutton -label "90 [msgcat::mc {Degrees}]" \
+ -variable pcurrent(rotate) -value 90
+ $m add radiobutton -label "180 [msgcat::mc {Degrees}]" \
+ -variable pcurrent(rotate) -value 180
+ $m add radiobutton -label "270 [msgcat::mc {Degrees}]" \
+ -variable pcurrent(rotate) -value 270
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogZoom {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Zoom}]
+ lappend dprefs(tabs) [ttk::frame $w.zoom]
+
+ # PanZoom
+ set f [ttk::labelframe $w.zoom.panzoom -text [msgcat::mc {Pan Zoom}]]
+
+ ttk::radiobutton $f.click -text [msgcat::mc {Click to Center}] \
+ -variable ppanzoom(mode) -value click
+ ttk::radiobutton $f.drag -text [msgcat::mc {Drag to Center}] \
+ -variable ppanzoom(mode) -value drag
+ ttk::radiobutton $f.panzoom -text [msgcat::mc {Pan then Zoom}] \
+ -variable ppanzoom(mode) -value panzoom
+
+ grid $f.click $f.drag $f.panzoom -padx 2 -pady 2 -sticky w
+
+ # Mouse
+ set f [ttk::labelframe $w.zoom.mouse -text [msgcat::mc {Mouse Wheel Zoom}]]
+
+ ttk::checkbutton $f.click -text [msgcat::mc {Enable}] \
+ -variable ppanzoom(wheel)
+ ttk::label $f.title2 -text [msgcat::mc {Factor}]
+ ttk::entry $f.factor -textvariable ppanzoom(wheel,factor) -width 10
+
+ grid $f.click $f.title2 $f.factor -padx 2 -pady 2 -sticky w
+
+ pack $w.zoom.panzoom $w.zoom.mouse -side top -fill both -expand true
+}
+
+# Buttons
+
+proc ButtonsZoomDef {} {
+ global pbuttons
+
+ array set pbuttons {
+ zoom,center 0
+ zoom,align 0
+
+ zoom,in 1
+ zoom,out 1
+ zoom,fit 1
+ zoom,i32 0
+ zoom,i16 0
+ zoom,i8 0
+ zoom,i4 1
+ zoom,i2 1
+ zoom,1 1
+ zoom,2 1
+ zoom,4 1
+ zoom,8 0
+ zoom,16 0
+ zoom,32 0
+
+ zoom,none 0
+ zoom,x 0
+ zoom,y 0
+ zoom,xy 0
+
+ zoom,0 0
+ zoom,90 0
+ zoom,180 0
+ zoom,270 0
+
+ zoom,crop 0
+ zoom,params 0
+ }
+}
+
+proc CreateButtonsZoom {} {
+ global buttons
+ global ds9
+
+ ttk::frame $ds9(buttons).zoom
+
+ ButtonButton $ds9(buttons).zoom.center \
+ [string tolower [msgcat::mc {Center}]] CenterCurrentFrame
+ CheckButton $ds9(buttons).zoom.align \
+ [msgcat::mc {Align}] current(align) AlignWCSFrame
+
+ ButtonButton $ds9(buttons).zoom.in \
+ [string tolower [msgcat::mc {Zoom In}]] {Zoom 2 2}
+ ButtonButton $ds9(buttons).zoom.out \
+ [string tolower [msgcat::mc {Zoom Out}]] {Zoom .5 .5}
+ ButtonButton $ds9(buttons).zoom.fit \
+ [string tolower [msgcat::mc {Zoom Fit}]] ZoomToFit
+ RadioButton $ds9(buttons).zoom.i32 \
+ "[string tolower [msgcat::mc {Zoom}]] 1/32" \
+ current(zoom) { 0.03125 0.03125 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.i16 \
+ "[string tolower [msgcat::mc {Zoom}]] 1/16" \
+ current(zoom) { 0.0625 0.0625 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.i8 \
+ "[string tolower [msgcat::mc {Zoom}]] 1/8" \
+ current(zoom) { 0.125 0.125 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.i4 \
+ "[string tolower [msgcat::mc {Zoom}]] 1/4" \
+ current(zoom) { 0.25 0.25 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.i2 \
+ "[string tolower [msgcat::mc {Zoom}]] 1/2" \
+ current(zoom) { 0.5 0.5 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.1 \
+ "[string tolower [msgcat::mc {Zoom}]] 1" \
+ current(zoom) { 1 1 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.2 \
+ "[string tolower [msgcat::mc {Zoom}]] 2" \
+ current(zoom) { 2 2 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.4 \
+ "[string tolower [msgcat::mc {Zoom}]] 4" \
+ current(zoom) { 4 4 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.8 \
+ "[string tolower [msgcat::mc {Zoom}]] 8" \
+ current(zoom) { 8 8 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.16 \
+ "[string tolower [msgcat::mc {Zoom}]] 16" \
+ current(zoom) { 16 16 } ChangeZoom
+ RadioButton $ds9(buttons).zoom.32 \
+ "[string tolower [msgcat::mc {Zoom}]] 32" \
+ current(zoom) { 32 32 } ChangeZoom
+
+ RadioButton $ds9(buttons).zoom.none \
+ [string tolower [msgcat::mc {None}]] \
+ current(orient) none ChangeOrient
+ RadioButton $ds9(buttons).zoom.x {x} current(orient) x ChangeOrient
+ RadioButton $ds9(buttons).zoom.y {y} current(orient) y ChangeOrient
+ RadioButton $ds9(buttons).zoom.xy {xy} current(orient) xy ChangeOrient
+
+ RadioButton $ds9(buttons).zoom.0 {0} current(rotate) 0 ChangeRotate
+ RadioButton $ds9(buttons).zoom.90 {90} current(rotate) 90 ChangeRotate
+ RadioButton $ds9(buttons).zoom.180 {180} current(rotate) 180 ChangeRotate
+ RadioButton $ds9(buttons).zoom.270 {270} current(rotate) 270 ChangeRotate
+
+ ButtonButton $ds9(buttons).zoom.crop \
+ [string tolower [msgcat::mc {Crop}]] CropDialog
+ ButtonButton $ds9(buttons).zoom.params \
+ [string tolower [msgcat::mc {Parameters}]] PanZoomDialog
+
+ set buttons(zoom) "
+ $ds9(buttons).zoom.center pbuttons(zoom,center)
+ $ds9(buttons).zoom.align pbuttons(zoom,align)
+
+ $ds9(buttons).zoom.in pbuttons(zoom,in)
+ $ds9(buttons).zoom.out pbuttons(zoom,out)
+ $ds9(buttons).zoom.fit pbuttons(zoom,fit)
+ $ds9(buttons).zoom.i32 pbuttons(zoom,i32)
+ $ds9(buttons).zoom.i16 pbuttons(zoom,i16)
+ $ds9(buttons).zoom.i8 pbuttons(zoom,i8)
+ $ds9(buttons).zoom.i4 pbuttons(zoom,i4)
+ $ds9(buttons).zoom.i2 pbuttons(zoom,i2)
+ $ds9(buttons).zoom.1 pbuttons(zoom,1)
+ $ds9(buttons).zoom.2 pbuttons(zoom,2)
+ $ds9(buttons).zoom.4 pbuttons(zoom,4)
+ $ds9(buttons).zoom.8 pbuttons(zoom,8)
+ $ds9(buttons).zoom.16 pbuttons(zoom,16)
+ $ds9(buttons).zoom.32 pbuttons(zoom,32)
+
+ $ds9(buttons).zoom.none pbuttons(zoom,none)
+ $ds9(buttons).zoom.x pbuttons(zoom,x)
+ $ds9(buttons).zoom.y pbuttons(zoom,y)
+ $ds9(buttons).zoom.xy pbuttons(zoom,xy)
+
+ $ds9(buttons).zoom.0 pbuttons(zoom,0)
+ $ds9(buttons).zoom.90 pbuttons(zoom,90)
+ $ds9(buttons).zoom.180 pbuttons(zoom,180)
+ $ds9(buttons).zoom.270 pbuttons(zoom,270)
+
+ $ds9(buttons).zoom.crop pbuttons(zoom,crop)
+ $ds9(buttons).zoom.params pbuttons(zoom,params)
+ "
+}
+
+proc PrefsDialogButtonbarZoom {f} {
+ global buttons
+ global pbuttons
+
+ ttk::menubutton $f -text [msgcat::mc {Buttonbar}] -menu $f.menu
+
+ set m $f.menu
+ menu $m
+ $m add checkbutton -label [msgcat::mc {Center Image}] \
+ -variable pbuttons(zoom,center) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label [msgcat::mc {Align}] \
+ -variable pbuttons(zoom,align) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {Zoom In}] \
+ -variable pbuttons(zoom,in) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label [msgcat::mc {Zoom Out}] \
+ -variable pbuttons(zoom,out) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label [msgcat::mc {Zoom Fit}] \
+ -variable pbuttons(zoom,fit) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1/32" \
+ -variable pbuttons(zoom,i32) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1/16" \
+ -variable pbuttons(zoom,i16) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1/8" \
+ -variable pbuttons(zoom,i8) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1/4" \
+ -variable pbuttons(zoom,i4) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1/2" \
+ -variable pbuttons(zoom,i2) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 1" \
+ -variable pbuttons(zoom,1) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 2" \
+ -variable pbuttons(zoom,2) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 4" \
+ -variable pbuttons(zoom,4) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 8" \
+ -variable pbuttons(zoom,8) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 16" \
+ -variable pbuttons(zoom,16) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Zoom}] 32" \
+ -variable pbuttons(zoom,32) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label [msgcat::mc {None}] \
+ -variable pbuttons(zoom,none) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Invert}] X" \
+ -variable pbuttons(zoom,x) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Invert}] Y" \
+ -variable pbuttons(zoom,y) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "[msgcat::mc {Invert}] XY" \
+ -variable pbuttons(zoom,xy) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label "0 [msgcat::mc {Degrees}]" \
+ -variable pbuttons(zoom,0) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "90 [msgcat::mc {Degrees}]" \
+ -variable pbuttons(zoom,90) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "180 [msgcat::mc {Degrees}]" \
+ -variable pbuttons(zoom,180) -command {UpdateButtons buttons(zoom)}
+ $m add checkbutton -label "270 [msgcat::mc {Degrees}]" \
+ -variable pbuttons(zoom,270) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Crop Parameters}]..." \
+ -variable pbuttons(zoom,crop) -command {UpdateButtons buttons(zoom)}
+ $m add separator
+ $m add checkbutton -label "[msgcat::mc {Pan Zoom Rotate Parameters}]..." \
+ -variable pbuttons(zoom,params) -command {UpdateButtons buttons(zoom)}
+}
+
+# Support
+
+proc UpdateZoomMenuStatic {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateZoomMenuStatic"
+ }
+
+ if {$ds9(active,num) > 0} {
+ $ds9(mb) entryconfig [msgcat::mc {Zoom}] -state normal
+ } else {
+ $ds9(mb) entryconfig [msgcat::mc {Zoom}] -state disabled
+ }
+}
+
+proc UpdateZoomMenu {} {
+ global ds9
+ global current
+ global panzoom
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateZoomMenu"
+ }
+
+ if {$current(frame) == {}} {
+ $ds9(mb).zoom entryconfig [msgcat::mc {Align}] -state disabled
+ } else {
+ $ds9(mb).zoom entryconfig [msgcat::mc {Align}] -state normal
+
+ set panzoom(preserve) [$current(frame) get pan preserve]
+ set current(zoom) [$current(frame) get zoom]
+ set current(rotate) [$current(frame) get rotate]
+ set current(orient) [$current(frame) get orient]
+ set current(align) [$current(frame) get wcs align]
+ }
+}
+
diff --git a/ds9/library/nameres.tcl b/ds9/library/nameres.tcl
new file mode 100644
index 0000000..c4b32bb
--- /dev/null
+++ b/ds9/library/nameres.tcl
@@ -0,0 +1,254 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc NRESDef {} {
+ global nres
+ global inres
+ global pnres
+
+ set inres(top) .nres
+ set inres(mb) .nresmb
+
+ # set via wcs()
+ set nres(system) wcs
+ set nres(sky) fk5
+ set nres(skyformat) degrees
+
+ # prefs only
+ set pnres(server) simbad-cds
+}
+
+proc NRESApply {varname sync} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(sync) $sync
+ ARApply $varname
+ if {$var(name)!={}} {
+ NSVRServer $varname
+ } else {
+ ARError $varname "Please specify an Object Name"
+ }
+}
+
+proc NRESDialog {} {
+ global nres
+ global inres
+
+ global ds9
+ global pds9
+
+ if {[winfo exists $inres(top)]} {
+ raise $inres(top)
+ return
+ }
+
+ set varname dnres
+ upvar #0 $varname var
+ global $varname
+
+ # AR variables
+ ARInit $varname {}
+
+ # Variables
+ set var(top) $inres(top)
+ set var(mb) $inres(mb)
+ set var(system) $nres(system)
+ set var(sky) $nres(sky)
+ set var(skyformat) $nres(skyformat)
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Name Resolution}] "ARDestroy $varname"
+
+ # file
+ $mb add cascade -label File -menu $mb.file
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Retrieve}] \
+ -command "NRESApply $varname 0"
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Pan To}] \
+ -command "NRESPan $varname"
+ $mb.file add command -label [msgcat::mc {Crosshair To}] \
+ -command "NRESCrosshair $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "ARDestroy $varname"
+
+ # edit
+ AREditMenu $varname
+
+ # name server
+ NSVRServerMenu $varname
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.nametitle -text [msgcat::mc {Object}]
+ ttk::entry $f.name -textvariable ${varname}(name) -width 48
+ ttk::label $f.sky -textvariable ${varname}(sky) -anchor w
+ set var(xname) [ttk::label $f.xtitle -text {} -width 1]
+ ttk::label $f.x -textvariable ${varname}(x) -width 14 -relief groove
+ set var(yname) [ttk::label $f.ytitle -text {} -width 1]
+ ttk::label $f.y -textvariable ${varname}(y) -width 14 -relief groove
+ ARSkyFormat $f.skyformat $varname
+ grid $f.nametitle x $f.name - - - - -padx 2 -pady 2 -sticky w
+ grid $f.sky $f.xtitle $f.x $f.ytitle $f.y $f.skyformat \
+ -padx 2 -pady 2 -sticky w
+
+ # Status
+ set f [ttk::frame $w.status]
+ ttk::label $f.tstatus -text [msgcat::mc {Status}]
+ ttk::label $f.status -textvariable ${varname}(status)
+ grid $f.tstatus $f.status -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ set var(apply) [ttk::button $f.apply -text [msgcat::mc {Retrieve}] \
+ -command "NRESApply $varname 0"]
+ set var(cancel) [ttk::button $f.cancel -text [msgcat::mc {Cancel}] \
+ -command "ARCancel $varname" -state disabled]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "ARDestroy $varname"
+ pack $f.apply $f.cancel $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ ttk::separator $w.sep2 -orient horizontal
+ pack $w.buttons $w.sep $w.status $w.sep2 -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ ARCoord $varname
+ ARStatus $varname {}
+}
+
+proc NRESPan {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {($var(x) != {}) && ($var(y) != {})} {
+ PanTo $var(x) $var(y) $var(system) $var(sky)
+ }
+}
+
+proc NRESCrosshair {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global current
+
+ if {($current(frame) != {})} {
+ if {[$current(frame) has wcs equatorial $var(system)]} {
+ if {($var(x) != {}) && ($var(y) != {})} {
+ set current(mode) crosshair
+ ChangeMode
+ $current(frame) crosshair \
+ $var(system) $var(sky) $var(x) $var(y)
+ }
+ }
+ }
+}
+
+# Prefs
+
+proc PrefsDialogNRES {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Name Server}]
+ lappend dprefs(tabs) [ttk::frame $w.namesvr]
+
+ set f [ttk::labelframe $w.namesvr.params -text [msgcat::mc {Name Server}]]
+
+ ttk::label $f.tsvr -text [msgcat::mc {Default}]
+ ttk::menubutton $f.svr -textvariable pnres(server) -menu $f.svr.menu
+
+ menu $f.svr.menu
+ NSVRServerMenuItems $f.svr.menu
+
+ grid $f.tsvr $f.svr -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+# Process Cmds
+
+proc ProcessNRESCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvarname dnres
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ global nres
+ global pnres
+
+ NRESDialog
+
+ switch -- [string tolower [lindex $var $i]] {
+ {} -
+ open {}
+ close {ARDestroy $vvarname}
+ server {
+ incr i
+ set pnres(server) [lindex $var $i]
+ }
+ pan {NRESPan $vvarname}
+ crosshair {NRESCrosshair $vvarname}
+ format -
+ skyformat {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ deg -
+ degree -
+ degrees {
+ set vvar(skyformat) degrees
+ set vvar(skyformat,msg) $vvar(skyformat)
+ }
+ default {
+ set vvar(skyformat) [string tolower [lindex $var $i]]
+ set vvar(skyformat,msg) $vvar(skyformat)
+ }
+ }
+ }
+ name {
+ incr i
+ set vvar(name) [lindex $var $i]
+ NRESApply $vvarname 1
+ }
+ default {
+ set vvar(name) [lindex $var $i]
+ NRESApply $vvarname 1
+ }
+ }
+}
+
+proc ProcessSendNRESCmd {proc id param} {
+ global nres
+ global pnres
+ global dnres
+
+ NRESDialog
+
+ switch -- [string tolower [lindex $param 0]] {
+ server {$proc $id "$pnres(server)\n"}
+ format -
+ skyformat {$proc $id "$dnres(skyformat)\n"}
+ name -
+ {} {$proc $id "$dnres(name)\n"}
+ default {
+ set dnres(name) [lindex $param 0]
+ NRESApply dnres 1
+ $proc $id "$dnres(x) $dnres(y)\n"
+ }
+ }
+}
+
diff --git a/ds9/library/nrrd.tcl b/ds9/library/nrrd.tcl
new file mode 100644
index 0000000..cae05bc
--- /dev/null
+++ b/ds9/library/nrrd.tcl
@@ -0,0 +1,142 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ImportNRRDFile {fn layer} {
+ global loadParam
+
+ set loadParam(file,type) nrrd
+ set loadParam(file,mode) {}
+ set loadParam(load,layer) $layer
+
+ # find stdin
+ if {[string range $fn 0 4] == "stdin" ||
+ [string range $fn 0 4] == "STDIN" ||
+ [string range $fn 0 0] == "-"} {
+ set loadParam(load,type) alloc
+ set loadParam(file,name) stdin
+ set loadParam(file,fn) $loadParam(file,name)
+ } else {
+ set loadParam(load,type) mmap
+ set loadParam(file,name) $fn
+ }
+
+ ProcessLoad
+}
+
+proc ImportNRRDAlloc {path fn layer} {
+ global loadParam
+
+ set loadParam(file,type) nrrd
+ set loadParam(file,mode) {}
+ set loadParam(load,type) alloc
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc ImportNRRDSocket {sock fn layer} {
+ global loadParam
+
+ set loadParam(file,type) nrrd
+ set loadParam(file,mode) {}
+ set loadParam(load,type) socket
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+ set loadParam(load,layer) $layer
+
+ return [ProcessLoad 0]
+}
+
+proc ExportNRRDFile {fn opt} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save nrrd file "\{$fn\}" $opt
+}
+
+proc ExportNRRDSocket {sock opt} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save nrrd socket $sock $opt
+}
+
+proc ProcessNRRDCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![ImportNRRDSocket $sock $param $layer]} {
+ InitError xpa
+ ImportNRRDFile $param $layer
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ ImportNRRDAlloc $fn $param $layer
+ } else {
+ ImportNRRDFile $param $layer
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendNRRDCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set opt [string tolower [lindex $param 0]]
+ if {$sock != {}} {
+ # xpa
+ ExportNRRDSocket $sock $opt
+ } elseif {$fn != {}} {
+ # comm
+ ExportNRRDFile $fn $opt
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/nsvr.tcl b/ds9/library/nsvr.tcl
new file mode 100644
index 0000000..22f6699
--- /dev/null
+++ b/ds9/library/nsvr.tcl
@@ -0,0 +1,287 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc NSVRServer {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRServer $varname"
+ }
+
+ global nres
+ global pnres
+
+ ARStatus $varname "Looking up $var(name)"
+
+ set ss [split $pnres(server) {-}]
+ switch -- [lindex $ss 1] {
+ eso -
+ sao {set var(url) {http://vizier.cfa.harvard.edu/viz-bin/nph-sesame}}
+ cds {set var(url) {http://cdsweb.u-strasbg.fr/cgi-bin/nph-sesame}}
+ }
+ append ${varname}(url) {/-ox}
+ switch -- [lindex $ss 0] {
+ ned {append ${varname}(url) {/N}}
+ simbad {append ${varname}(url) {/S}}
+ vizier {append ${varname}(url) {/V}}
+ }
+
+ set var(query) [http::formatQuery $var(name)]
+
+ NSVRGetURL $varname $var(url)
+}
+
+proc NSVRGetURL {varname url} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRGetURL $varname $url $var(query)"
+ }
+
+ set var(ra) {}
+ set var(dec) {}
+ set var(pos) {}
+
+ global ihttp
+ # -query will not work, do it manually
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $url?$var(query) \
+ -timeout $ihttp(timeout) \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ NSVRGetURLFinish $varname $var(token)
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $url"
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $url?$var(query) \
+ -timeout $ihttp(timeout) \
+ -command \
+ [list NSVRGetURLFinish $varname] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ ARError $varname "[msgcat::mc {Unable to locate URL}] $url"
+ }
+ }
+}
+
+proc NSVRGetURLFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRGetURLFinish $varname"
+ }
+
+ if {!($var(active))} {
+ ARCancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set code [http::ncode $token]
+
+ # Meta
+ set meta $t(meta)
+
+ # Log it
+ HTTPLog $token
+
+ # Result?
+ switch -- $code {
+ 200 -
+ 203 -
+ 404 -
+ 503 {NSVRSESAME $varname}
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRGetURLFinish redirect $code to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ # strip query from url
+ set value [lindex [split $value {?}] 0]
+
+ NSVRGetURL $varname $value
+ }
+ }
+ }
+
+ default {ARError $varname "[msgcat::mc {Error code was returned}] $code"}
+ }
+}
+
+proc NSVRSESAME {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRSESAME $varname"
+ }
+
+ set pp [xml::parser \
+ -characterdatacommand [list NSVRSESAMECharCB $varname]\
+ -elementstartcommand [list NSVRSESAMEElemStartCB $varname] \
+ -elementendcommand [list NSVRSESAMEElemEndCB $varname] \
+ -ignorewhitespace 1 \
+ ]
+
+ set var(parse) {}
+
+ if {[catch {$pp parse [http::data $var(token)]} err]} {
+ $pp free
+ NSVRParse $varname {} {}
+ return
+ }
+
+ switch -- $var(skyformat) {
+ degrees {
+ if {$var(ra) != {} && $var(dec) != {}} {
+ NSVRParse $varname $var(ra) $var(dec)
+ } else {
+ NSVRParse $varname {} {}
+ }
+ }
+ sexagesimal {
+ if {$var(pos) != {}} {
+ # can have extra space chars, must clean up
+ set ss [split [string trim $var(pos)]]
+ NSVRParse $varname [lindex $ss 0] [lindex $ss end]
+ } else {
+ NSVRParse $varname {} {}
+ }
+ }
+ }
+}
+
+proc NSVRSESAMECharCB {t data} {
+ upvar #0 $t T
+ global $t
+
+ set state [lindex $T(parse) end]
+ set prev [lindex $T(parse) end-1]
+
+ switch -- $state {
+ jpos {
+ set T(pos) $data
+ }
+ jradeg {
+ set T(ra) $data
+ }
+ jdedeg {
+ set T(dec) $data
+ }
+ }
+ return {}
+}
+
+proc NSVRSESAMEElemStartCB {t name attlist args} {
+ upvar #0 $t T
+ global $t
+
+ lappend ${t}(parse) $name
+ return {}
+}
+
+proc NSVRSESAMEElemEndCB {t name args} {
+ upvar #0 $t T
+ global $t
+
+ set ${t}(parse) [lreplace $T(parse) end end]
+ return {}
+}
+
+proc NSVRParse {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "NSVRParse $varname $x $y"
+ }
+
+ set var(x) $x
+ set var(y) $y
+
+ if {($var(x) == {}) || ($var(y) == {})} {
+ set var(x) {}
+ set var(y) {}
+
+ ARStatus $varname "$var(name) not found"
+ ARReset $varname
+ } else {
+ if {$var(proc,next) != {}} {
+ if {[info exists var(token)]} {
+ http::cleanup $var(token)
+ unset var(token)
+ }
+
+ eval $var(proc,next) $varname
+ } else {
+ ARDone $varname
+ }
+ }
+}
+
+proc NSVRServerMenu {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(mb) add cascade -label [msgcat::mc {Name Server}] -menu $var(mb).name
+ menu $var(mb).name
+
+ NSVRServerMenuItems $var(mb).name
+}
+
+proc NSVRServerMenuItems {mm} {
+ global nres
+
+ $mm add radiobutton -label {NED@SAO} -variable pnres(server) \
+ -value ned-sao
+ $mm add radiobutton -label {NED@CDS} -variable pnres(server) \
+ -value ned-cds
+ $mm add separator
+ $mm add radiobutton -label {SIMBAD@SAO} -variable pnres(server) \
+ -value simbad-sao
+ $mm add radiobutton -label {SIMBAD@CDS} -variable pnres(server) \
+ -value simbad-cds
+ $mm add separator
+ $mm add radiobutton -label {VIZIER@SAO} -variable pnres(server) \
+ -value vizier-sao
+ $mm add radiobutton -label {VIZIER@CDS} -variable pnres(server) \
+ -value vizier-cds
+}
diff --git a/ds9/library/nvss.tcl b/ds9/library/nvss.tcl
new file mode 100644
index 0000000..2f1aab1
--- /dev/null
+++ b/ds9/library/nvss.tcl
@@ -0,0 +1,162 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc NVSSDef {} {
+ global nvss
+ global invss
+
+ set invss(top) .nvss
+ set invss(mb) .nvssmb
+
+ set nvss(sky) fk5
+ set nvss(rformat) arcmin
+ set nvss(width) 15
+ set nvss(height) 15
+ set nvss(mode) new
+ set nvss(save) 0
+ set nvss(survey) nvss
+}
+
+proc NVSSDialog {} {
+ global nvss
+ global invss
+ global wcs
+
+ if {[winfo exists $invss(top)]} {
+ raise $invss(top)
+ return
+ }
+
+ set varname dnvss
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $invss(top)
+ set var(mb) $invss(mb)
+ set var(sky) $nvss(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $nvss(rformat)
+ set var(width) $nvss(width)
+ set var(height) $nvss(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $nvss(mode)
+ set var(save) $nvss(save)
+ set var(survey) $nvss(survey)
+
+ set w $var(top)
+ IMGSVRInit $varname "NVSS [msgcat::mc {Server}]" \
+ NVSSExec NVSSAck ARDone ARError
+
+ IMGSVRUpdate $varname
+}
+
+proc NVSSExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set var(fn) [tmpnam {.fits}]
+ }
+
+ # skyformat
+ switch -- $var(skyformat) {
+ degrees {
+ set xx [uformat d h: $var(x)]
+ set yy [uformat d d: $var(y)]
+ }
+ sexagesimal {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ }
+ regsub -all {:} $xx { } xx
+ regsub -all {:} $yy { } yy
+
+ # size - degrees
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)]
+ set hh [expr $var(height)]
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+
+ set var(query) [http::formatQuery submit Submit! Equinox J2000 PolType I RA $xx Dec $yy Size "$ww $hh" Cells "15.0 15.0" MAPROJ SIN Type image/x-fits rotate "0.0"]
+
+# set var(query) [http::formatQuery .submit "Extract the Cutout" RA "$xx $yy" Equinox J2000 ImageSize $rr MaxInt 10 .cgifields ImageType ImageType "FITS Image"]
+ set url "http://www.cv.nrao.edu/cgi-bin/postage.pl"
+ IMGSVRGetURL $varname $url
+}
+
+proc NVSSAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the NRAO VLA Sky Survey
+
+This major undertaking has received the generous technical and
+scientific support of many individuals. The NRAO staff has provided
+extremely valuable assistance in many aspects of the observations
+themselves and in the area of software support; in particular, we are
+grateful to Rick Perley, Ken Sowinski, Barry Clark, and Bill Cotton in
+this regard. The support of the NRAO Director, Paul van den Bout, and
+the yeoman service provided by Frazer Owen as Chair of the Survey
+Oversight Committee are also greatly appreciated. We also thank the
+members of the Oversight Committee (Ken Chambers, Eric Feigelson,
+Jackie Hewitt, Gillian Knapp, and Rogier Windhorst) for their time and
+wise counsel in this enterprise.
+
+Acknowledgment is also due our colleagues who are involved in the
+ongoing NVSS effort, including Richard McMahon and Isobel Hook. This
+work is supported in part under the auspices of the Department of
+Energy by Lawrence Livermore National Laboratory under contract
+No. W-7405-ENG-48 and the Institute for Geophysics and Planetary
+Physics, whose director Charles Alcock has been particularly
+supportive. We also acknowledge a generous planning grant from the
+CalSpace Institute; support from the STScI archive group, STScI
+director Bob Williams, and the STScI Director's Discretionary Research
+Fund; computing resources from Columbia University; a grant from the
+National Science Foundation; a gift of computing equipment from Sun
+Microsystems; a NATO travel grant to support our collaboration with
+Richard McMahon; and an award from the National Geographic Society
+which, in the spirit of their support 40 years ago for the Palomar
+Observatory Sky Survey, will be providing funds to continue our
+charting of the Universe.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessNVSSCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ NVSSDialog
+ IMGSVRProcessCmd $varname $iname dnvss
+}
+
+proc ProcessSendNVSSCmd {proc id param} {
+ NVSSDialog
+ IMGSVRProcessSendCmd $proc $id $param dnvss
+}
diff --git a/ds9/library/open.tcl b/ds9/library/open.tcl
new file mode 100644
index 0000000..223bf87
--- /dev/null
+++ b/ds9/library/open.tcl
@@ -0,0 +1,119 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc Open {fn format layer mode sys} {
+ if {$fn == {}} {
+ return
+ }
+
+ StartLoad
+ switch -- $format {
+ fits {LoadFitsFile $fn $layer $mode}
+ mosaicimagewcs {LoadMosaicImageWCSFile $fn $layer $sys}
+ mosaicimageiraf {LoadMosaicImageIRAFFile $fn $layer}
+ mosaicimagewfpc2 {LoadMosaicImageWFPC2File $fn}
+ mosaicwcs {LoadMosaicWCSFile $fn $layer $sys}
+ mosaiciraf {LoadMosaicIRAFFile $fn $layer}
+ mecube {LoadMECubeFile $fn}
+ multiframe {LoadMultiFrameFile $fn}
+ rgbimage {LoadRGBImageFile $fn}
+ rgbcube {LoadRGBCubeFile $fn}
+ }
+ FinishLoad
+}
+
+# Support
+
+proc OpenDialog {format {layer {}} {mode {}}} {
+ global current
+ global fitsfbox
+
+ set fn [OpenFileDialog fitsfbox]
+
+ # just in case (could be invoked via a menu keyshortcut)
+ if {$current(frame) == {}} {
+ CreateFrame
+ }
+
+ set sys wcs
+ if {$fn != {}} {
+ set ok 1
+ switch -- $format {
+ mosaicimagewcs {set ok [MosaicWCSDialog sys]}
+ mosaicwcs {set ok [MosaicWCSDialog sys]}
+ }
+
+ if {$ok} {
+ switch -- $layer {
+ mask {set ok [MaskLoad]}
+ }
+ }
+
+ if {$ok} {
+ Open $fn $format $layer $mode $sys
+ }
+ }
+}
+
+proc MosaicWCSDialog {varname} {
+ upvar $varname var
+ global ed
+
+ set w {.wcs}
+
+ set ed(ok) 0
+ set ed(sys) wcs
+ set ed(label) WCS
+
+ DialogCreate $w [msgcat::mc {Load Mosaic}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.title -text [msgcat::mc {Select Coordinate System }]
+ ttk::menubutton $f.sys -textvariable ed(label) \
+ -menu $f.sys.m -width 10
+
+ menu $f.sys.m
+ $f.sys.m add radiobutton -label [msgcat::mc {WCS}] \
+ -variable ed(sys) -value "wcs" -command [list set ed(label) WCS]
+ $f.sys.m add separator
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $f.sys.m add radiobutton -variable ed(sys) \
+ -label "[msgcat::mc {WCS}] $l" \
+ -value "wcs$l" \
+ -command [list set ed(label) "[msgcat::mc {WCS}] $l"]
+ }
+
+ grid $f.title $f.sys
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set var $ed(sys)
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
diff --git a/ds9/library/pagesetup.tcl b/ds9/library/pagesetup.tcl
new file mode 100644
index 0000000..c24c58d
--- /dev/null
+++ b/ds9/library/pagesetup.tcl
@@ -0,0 +1,208 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PSPageSetup {} {
+ global ps
+ global ed
+
+ set ed(ok) 0
+ array set ed [array get ps]
+
+ set w {.pagesetup}
+
+ DialogCreate $w [msgcat::mc {Page Setup}] ed(ok)
+
+ # Layout
+ set f [ttk::labelframe $w.layout -text {Layout}]
+
+ ttk::label $f.torient -text [msgcat::mc {Orientation}]
+ ttk::radiobutton $f.portrait -text [msgcat::mc {Portrait}] \
+ -variable ed(orient) -value portrait
+ ttk::radiobutton $f.landscape -text [msgcat::mc {Landscape}] \
+ -variable ed(orient) -value landscape
+ ttk::label $f.tscale -text [msgcat::mc {Scale}]
+ ttk::entry $f.scale -textvariable ed(scale) -width 7
+ ttk::label $f.uscale -text {%}
+
+ grid $f.torient $f.portrait $f.landscape -padx 2 -pady 2 -sticky w
+ grid $f.tscale $f.scale $f.uscale -padx 2 -pady 2 -sticky w
+
+ # Page Size
+ set f [ttk::labelframe $w.size -text {Page Size}]
+
+ ttk::radiobutton $f.letter -text "[msgcat::mc {Letter}](8.5 x 11 in)"\
+ -variable ed(size) -value letter
+ ttk::radiobutton $f.legal -text "[msgcat::mc {Legal}](8.5 x 14 in)"\
+ -variable ed(size) -value legal
+ ttk::radiobutton $f.tabloid -text "[msgcat::mc {Tabloid}](11 x 17 in)"\
+ -variable ed(size) -value tabloid
+ ttk::radiobutton $f.poster -text "[msgcat::mc {Poster}](36 x 48 in)"\
+ -variable ed(size) -value poster
+ ttk::radiobutton $f.a4 -text {A4(210 x 297 mm)} \
+ -variable ed(size) -value a4
+ ttk::radiobutton $f.other -text "[msgcat::mc {Other}] (inches)" \
+ -variable ed(size) -value other
+ ttk::radiobutton $f.othermm -text "[msgcat::mc {Other}] (mm)" \
+ -variable ed(size) -value othermm
+ ttk::label $f.title3 -text [msgcat::mc {Width}]
+ ttk::entry $f.width -textvariable ed(width) -width 10
+ ttk::label $f.title4 -text [msgcat::mc {Height}]
+ ttk::entry $f.height -textvariable ed(height) -width 10
+
+ grid $f.letter -padx 2 -pady 2 -sticky w
+ grid $f.legal -padx 2 -pady 2 -sticky w
+ grid $f.tabloid -padx 2 -pady 2 -sticky w
+ grid $f.poster -padx 2 -pady 2 -sticky w
+ grid $f.a4 -padx 2 -pady 2 -sticky w
+ grid $f.other $f.title3 $f.width -padx 2 -pady 2 -sticky w
+ grid $f.othermm $f.title4 $f.height -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ grid $w.layout -sticky news
+ grid $w.size -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ array set ps [array get ed]
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PrefsDialogPageSetup {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Page Setup}]
+ lappend dprefs(tabs) [ttk::frame $w.pagesetup]
+
+ # Layout
+ set f [ttk::labelframe $w.pagesetup.layout -text {Layout}]
+
+ ttk::label $f.torient -text [msgcat::mc {Orientation}]
+ ttk::radiobutton $f.portrait -text [msgcat::mc {Portrait}] \
+ -variable pps(orient) -value portrait
+ ttk::radiobutton $f.landscape -text [msgcat::mc {Landscape}] \
+ -variable pps(orient) -value landscape
+ ttk::label $f.tscale -text [msgcat::mc {Scale}]
+ ttk::entry $f.scale -textvariable pps(scale) -width 7
+ ttk::label $f.uscale -text {%}
+
+ grid $f.torient $f.portrait $f.landscape -padx 2 -pady 2 -sticky w
+ grid $f.tscale $f.scale $f.uscale -padx 2 -pady 2 -sticky w
+
+ # Page Size
+ set f [ttk::labelframe $w.pagesetup.size -text {Page Size}]
+
+ ttk::radiobutton $f.letter -text "[msgcat::mc {Letter}](8.5 x 11 in)"\
+ -variable pps(size) -value letter
+ ttk::radiobutton $f.legal -text "[msgcat::mc {Legal}](8.5 x 14 in)"\
+ -variable pps(size) -value legal
+ ttk::radiobutton $f.tabloid -text "[msgcat::mc {Tabloid}](11 x 17 in)"\
+ -variable pps(size) -value tabloid
+ ttk::radiobutton $f.poster -text "[msgcat::mc {Poster}](36 x 48 in)"\
+ -variable pps(size) -value poster
+ ttk::radiobutton $f.a4 -text {A4(210 x 297 mm)} \
+ -variable pps(size) -value a4
+ ttk::radiobutton $f.other -text "[msgcat::mc {Other}] (inches)" \
+ -variable pps(size) -value other
+ ttk::radiobutton $f.othermm -text "[msgcat::mc {Other}] (mm)" \
+ -variable pps(size) -value othermm
+
+ ttk::label $f.title3 -text [msgcat::mc {Width}]
+ ttk::entry $f.width -textvariable pps(width) -width 10
+
+ ttk::label $f.title4 -text [msgcat::mc {Height}]
+ ttk::entry $f.height -textvariable pps(height) -width 10
+
+ grid $f.letter -padx 2 -pady 2 -sticky w
+ grid $f.legal -padx 2 -pady 2 -sticky w
+ grid $f.tabloid -padx 2 -pady 2 -sticky w
+ grid $f.poster -padx 2 -pady 2 -sticky w
+ grid $f.a4 -padx 2 -pady 2 -sticky w
+ grid $f.other $f.title3 $f.width -padx 2 -pady 2 -sticky w
+ grid $f.othermm $f.title4 $f.height -padx 2 -pady 2 -sticky w
+
+ pack $w.pagesetup.layout $w.pagesetup.size \
+ -side top -fill both -expand true
+}
+
+# Process Cmds
+
+proc ProcessPageSetupCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {ProcessPSPageSetupCmd var i}
+ aqua {
+ ProcessPSPageSetupCmd var i
+# MacOSXPageSetup
+ }
+ wwin32 {Win32PageSetup}
+ }
+}
+
+proc ProcessSendPageSetupCmd {proc id param} {
+ global ds9
+
+ switch $ds9(wm) {
+ x11 {ProcessSendPSPageSetupCmd $proc $id $param}
+ aqua -
+ win32 {}
+ }
+}
+
+proc ProcessPSPageSetupCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ps
+
+ switch -- [string tolower [lindex $var $i]] {
+ orientation -
+ orient {incr i; set ps(orient) [string tolower [lindex $var $i]]}
+ pagescale -
+ scale {incr i; set ps(scale) [lindex $var $i]}
+ pagesize -
+ size {incr i; set ps(size) [string tolower [lindex $var $i]] }
+ }
+}
+
+proc ProcessSendPSPageSetupCmd {proc id param} {
+ global ps
+
+ switch -- [string tolower $param] {
+ orientation -
+ orient {$proc $id "$ps(orient)\n"}
+ pagescale -
+ scale {$proc $id "$ps(scale)\n"}
+ pagesize -
+ size {$proc $id "$ps(size)\n"}
+ }
+}
+
diff --git a/ds9/library/panner.tcl b/ds9/library/panner.tcl
new file mode 100644
index 0000000..5ff5e7a
--- /dev/null
+++ b/ds9/library/panner.tcl
@@ -0,0 +1,296 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CreatePanner {} {
+ global ipanner
+ global ds9
+
+ set ds9(panner) [canvas $ds9(panel).pan -width $ipanner(size) \
+ -height $ipanner(size) \
+ -relief groove \
+ -borderwidth 2 \
+ -highlightthickness 0 \
+ -insertofftime 0 \
+ -takefocus 0]
+ $ds9(panner) create panner$ds9(visual) \
+ -width $ipanner(size) \
+ -height $ipanner(size) \
+ -command panner \
+ -tag panner \
+ -helvetica $ds9(helvetica) \
+ -courier $ds9(courier) \
+ -times $ds9(times)
+}
+
+proc PannerDef {} {
+ global ipanner
+ global ppanner
+
+ set ipanner(size) 128
+
+ # prefs only
+ set ppanner(compass) 1
+}
+
+proc InitPanner {} {
+ global ds9
+ global ppanner
+
+ # other bindings
+ BindEventsPanner
+
+ bind $ds9(panner) <Tab> [list NextFrame]
+ bind $ds9(panner) <Shift-Tab> [list PrevFrame]
+
+ switch $ds9(wm) {
+ x11 {bind $ds9(panner) <ISO_Left_Tab> [list PrevFrame]}
+ aqua -
+ win32 {}
+ }
+
+ switch $ds9(wm) {
+ x11 -
+ aqua {
+ bind $ds9(panner) <Enter> [list focus $ds9(panner)]
+ bind $ds9(panner) <Leave> [list focus {}]
+ }
+ win32 {}
+ }
+
+ # compass
+ panner compass $ppanner(compass)
+}
+
+proc BindEventsPanner {} {
+ global ds9
+
+ $ds9(panner) bind panner <Enter> [list EnterPanner %x %y]
+ $ds9(panner) bind panner <Leave> [list LeavePanner]
+ $ds9(panner) bind panner <Motion> [list MotionPanner %x %y]
+ $ds9(panner) bind panner <Button-1> [list Button1Panner %x %y]
+ $ds9(panner) bind panner <B1-Motion> [list Motion1Panner %x %y]
+ $ds9(panner) bind panner <ButtonRelease-1> [list Release1Panner %x %y]
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $ds9(panner) bind panner <ButtonRelease-2> \
+ [list Release2Panner %x %y]
+ }
+ aqua {
+ $ds9(panner) bind panner <ButtonRelease-3> \
+ [list Release2Panner %x %y]
+ }
+ }
+
+
+ $ds9(panner) bind panner <Up> [list ArrowKeyPanner 0 -1]
+ $ds9(panner) bind panner <Down> [list ArrowKeyPanner 0 1]
+ $ds9(panner) bind panner <Left> [list ArrowKeyPanner -1 0]
+ $ds9(panner) bind panner <Right> [list ArrowKeyPanner 1 0]
+}
+
+proc UnBindEventsPanner {} {
+ global ds9
+
+ $ds9(panner) bind panner <Enter> {}
+ $ds9(panner) bind panner <Leave> {}
+ $ds9(panner) bind panner <Motion> {}
+ $ds9(panner) bind panner <Button-1> {}
+ $ds9(panner) bind panner <B1-Motion> {}
+ $ds9(panner) bind panner <ButtonRelease-1> {}
+
+ switch $ds9(wm) {
+ x11 -
+ win32 {$ds9(panner) bind panner <ButtonRelease-2> {}}
+ aqua {$ds9(panner) bind panner <ButtonRelease-3> {}}
+ }
+
+ $ds9(panner) bind panner <Up> {}
+ $ds9(panner) bind panner <Down> {}
+ $ds9(panner) bind panner <Left> {}
+ $ds9(panner) bind panner <Right> {}
+}
+
+proc EnterPanner {x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "EnterPanner"
+ }
+
+ switch $ds9(wm) {
+ x11 -
+ aqua {
+ focus $ds9(panner)
+ $ds9(panner) focus panner
+ }
+ win32 {}
+ }
+
+ if {$current(frame) != {}} {
+ EnterInfoBox $current(frame)
+ UpdateInfoBox $current(frame) $x $y panner
+ UpdatePixelTableDialog $current(frame) $x $y panner
+ UpdateGraph $current(frame) $x $y panner
+ }
+}
+
+proc LeavePanner {} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "LeavePanner"
+ }
+
+ panner highlite off
+ switch $ds9(wm) {
+ x11 -
+ aqua {
+ $ds9(panner) focus {}
+ focus {}
+ }
+ win32 {}
+ }
+
+ LeaveInfoBox
+ PixelTableClearDialog
+ ClearGraphData
+}
+
+proc MotionPanner {x y} {
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "MotionPanner"
+ }
+
+ panner highlite $x $y
+ if {$current(frame) != {}} {
+ UpdateColormapLevelMosaic $current(frame) $x $y panner
+ UpdateInfoBox $current(frame) $x $y panner
+ UpdatePixelTableDialog $current(frame) $x $y panner
+ UpdateGraph $current(frame) $x $y panner
+ }
+}
+
+proc Button1Panner {x y} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Button1Panner"
+ }
+
+ panner pan begin $x $y
+}
+
+proc Motion1Panner {x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Motion1Panner"
+ }
+
+ panner pan motion $x $y
+ if {$current(frame) != {}} {
+ UpdateColormapLevelMosaic $current(frame) $x $y panner
+ UpdateInfoBox $current(frame) $x $y panner
+ UpdatePixelTableDialog $current(frame) $x $y panner
+ UpdateGraph $current(frame) $x $y panner
+ }
+}
+
+proc Release1Panner {x y} {
+ global ds9
+ global current
+
+ global debug
+ if {$debug(tcl,events)} {
+ puts stderr "Release1Panner"
+ }
+
+ if {$current(frame) != {}} {
+ panner pan end $x $y
+ $current(frame) pan bbox [panner get bbox]
+
+ UpdateColormapLevelMosaic $current(frame) $x $y panner
+ UpdateInfoBox $current(frame) $x $y panner
+ UpdatePixelTableDialog $current(frame) $x $y panner
+ UpdateGraph $current(frame) $x $y panner
+
+ LockFrameCurrent
+ UpdateGraphXAxis $current(frame)
+ UpdatePanZoomDialog
+ SAMPSendCoordPointAtSkyCmd $current(frame)
+ }
+}
+
+proc Release2Panner {x y} {
+ global ds9
+ global current
+
+ if {$current(frame) != {}} {
+ panner pan to $x $y
+ $current(frame) pan bbox [panner get bbox]
+
+ UpdateColormapLevelMosaic $current(frame) $x $y panner
+ UpdateInfoBox $current(frame) $x $y panner
+ UpdatePixelTableDialog $current(frame) $x $y panner
+ UpdateGraph $current(frame) $x $y panner
+
+ LockFrameCurrent
+ UpdateGraphXAxis $current(frame)
+ UpdatePanZoomDialog
+ SAMPSendCoordPointAtSkyCmd $current(frame)
+ }
+}
+
+proc ArrowKeyPanner {x y} {
+ global current
+
+ panner warp $x $y
+ SAMPSendCoordPointAtSkyCmd $current(frame)
+}
+
+proc PannerBackup {ch} {
+ global ppanner
+
+ puts $ch "panner compass $ppanner(compass)"
+}
+
+# Prefs
+
+proc PrefsDialogPanner {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Panner}]
+ lappend dprefs(tabs) [ttk::frame $w.panner]
+
+ set f [ttk::labelframe $w.panner.param -text [msgcat::mc {Panner}]]
+
+ ttk::checkbutton $f.compass \
+ -text [msgcat::mc {Show Compass}] \
+ -variable ppanner(compass) -command PrefsPannerCompass
+
+ grid $f.compass -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsPannerCompass {} {
+ global ppanner
+
+ panner compass $ppanner(compass)
+}
diff --git a/ds9/library/panzoom.tcl b/ds9/library/panzoom.tcl
new file mode 100644
index 0000000..7c843d7
--- /dev/null
+++ b/ds9/library/panzoom.tcl
@@ -0,0 +1,823 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PanZoomDef {} {
+ global panzoom
+ global ipanzoom
+ global ppanzoom
+ global tcl_platform
+
+ set ipanzoom(top) .pz
+ set ipanzoom(mb) .pzmb
+ set ipanzoom(speed) 512
+ set ipanzoom(x) 0
+ set ipanzoom(last) {0 0}
+ set ipanzoom(state) 1
+
+ set panzoom(preserve) 0
+ set panzoom(lock) none
+
+ # set via wcs()
+ set panzoom(system) wcs
+ set panzoom(sky) fk5
+ set panzoom(skyformat) degrees
+
+ set ppanzoom(preserve) $panzoom(preserve)
+
+ # prefs only
+ set ppanzoom(mode) click
+ set ppanzoom(wheel) 1
+ set ppanzoom(wheel,factor) 1.2
+ # special case
+ switch -- $tcl_platform(os) {
+ Darwin {
+ switch [lindex [split $tcl_platform(osVersion) {.}] 0] {
+ 11 {set ppanzoom(wheel,factor) 1.01}
+ }
+ }
+ }
+}
+
+# Pan
+
+proc CenterCurrentFrame {} {
+ global current
+
+ CenterFrame $current(frame)
+}
+
+proc CenterAllFrame {} {
+ global ds9
+
+ foreach ff $ds9(frames) {
+ CenterFrame $ff
+ }
+}
+
+proc CenterFrame {which} {
+ if {$which != {}} {
+ $which center
+
+ UpdatePan $which
+ UpdateZoomMenu
+ }
+}
+
+proc Pan {x y sys {sky {}}} {
+ global current
+
+ if {$current(frame) != {}} {
+ switch -- $sys {
+ canvas {$current(frame) pan $x $y}
+ default {$current(frame) pan $sys $sky $x $y}
+ }
+
+ UpdatePan $current(frame)
+ }
+}
+
+proc PanTo {x y sys sky} {
+ global current
+
+ PanToFrame $current(frame) $x $y $sys $sky
+}
+
+proc PanToFrame {which x y sys sky} {
+ global current
+
+ if {$which != {}} {
+ $which pan to $sys $sky $x $y
+ UpdatePan $which
+ }
+}
+
+proc PanButton {which x y} {
+ global ppanzoom
+
+ switch -- $ppanzoom(mode) {
+ click {}
+ drag {$which pan motion begin $x $y}
+ panzoom {}
+ }
+}
+
+proc PanMotion {which x y} {
+ global ppanzoom
+
+ switch -- $ppanzoom(mode) {
+ click {}
+ drag {$which pan motion $x $y}
+ panzoom {}
+ }
+}
+
+proc PanRelease {which x y} {
+ global panzoom
+ global ipanzoom
+ global ppanzoom
+ global current
+
+ switch -- $ppanzoom(mode) {
+ click {$which pan to $x $y}
+ drag {$which pan motion end $x $y}
+ panzoom {
+ if {$ipanzoom(last) != "$x $y"} {
+ set ipanzoom(state) 1
+ }
+ switch -- $ipanzoom(state) {
+ 1 {
+ $which pan to $x $y
+ $which update now
+ set cc [$which get cursor canvas]
+ set xx [expr int([lindex $cc 0])]
+ set yy [expr int([lindex $cc 1])]
+ $which warp to $xx $yy
+ set ipanzoom(last) "$xx $yy"
+
+ set z [$current(frame) get zoom]
+ if {$z < 2} {
+ set ipanzoom(state) 2
+ } elseif {$z < 4} {
+ set ipanzoom(state) 3
+ } elseif {$z < 8} {
+ set ipanzoom(state) 4
+ } else {
+ set ipanzoom(state) 5
+ }
+ }
+ 2 {
+ $which zoom to 2 2 about $x $y
+ set ipanzoom(state) 3
+ }
+ 3 {
+ $which zoom to 4 4 about $x $y
+ set ipanzoom(state) 4
+ }
+ 4 {
+ $which zoom to 8 8 about $x $y
+ set ipanzoom(state) 5
+ }
+ 5 {
+ $which zoom to 1 1 about $x $y
+ set ipanzoom(state) 2
+ }
+ }
+ if {$which == $current(frame)} {
+ set current(zoom) [$current(frame) get zoom]
+ }
+ }
+ }
+
+ UpdatePan $which
+}
+
+proc PreservePan {} {
+ global current
+ global panzoom
+
+ if {$current(frame) != {}} {
+ $current(frame) pan preserve $panzoom(preserve)
+ }
+}
+
+proc UpdatePan {which} {
+ LockFrame $which
+ UpdateGraphXAxis $which
+ UpdatePanZoomDialog
+ SAMPSendCoordPointAtSkyCmd $which
+}
+
+# Zoom
+
+proc ZoomToFit {} {
+ global current
+ global grid
+
+ if {$current(frame) != {}} {
+ # we need to update the grid because titles are zoom dependant
+ if {$grid(view) && $grid(type) == "publication"} {
+ # recalculate to make room for labels
+ $current(frame) zoom to fit .8
+ set current(zoom) [$current(frame) get zoom]
+ } else {
+ $current(frame) zoom to fit
+ set current(zoom) [$current(frame) get zoom]
+ }
+ UpdateZoom $current(frame)
+ }
+}
+
+proc ChangeZoom {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) zoom to $current(zoom)
+ UpdateZoom $current(frame)
+ }
+}
+
+proc Zoom {zx zy} {
+ global current
+
+ if {$current(frame) != {}} {
+ ZoomFrame $current(frame) $zx $zy
+ }
+}
+
+proc ZoomFrame {which zx zy} {
+ global current
+
+ $which zoom $zx $zy
+ if {$which == $current(frame)} {
+ set current(zoom) [$current(frame) get zoom]
+ }
+ UpdateZoom $which
+}
+
+proc ZoomButton {which x y} {
+ global current
+
+ $which zoom 2 2 about $x $y
+ if {$current(frame) == $which} {
+ set current(zoom) [$current(frame) get zoom]
+ }
+ UpdateZoom $which
+}
+
+proc ZoomShift {which} {
+ global current
+
+ $which zoom .5 .5
+ if {$current(frame) == $which} {
+ set current(zoom) [$current(frame) get zoom]
+ }
+ UpdateZoom $which
+}
+
+proc UpdateZoom {which} {
+ LockFrame $which
+ UpdateGraphXAxis $which
+ UpdatePanZoomDialog
+ GridUpdateZoom
+ RefreshInfoBox $which
+}
+
+# Orient
+
+proc ChangeOrient {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) orient $current(orient)
+ UpdateRotate $current(frame)
+ }
+}
+
+# Rotate
+
+proc Rotate {value} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) rotate $value
+ set current(rotate) [$current(frame) get rotate]
+ UpdateRotate $current(frame)
+ }
+}
+
+proc ChangeRotate {} {
+ global current
+
+ if {$current(frame) != {}} {
+ $current(frame) rotate to $current(rotate)
+ UpdateRotate $current(frame)
+ }
+}
+
+proc RotateButton {which x y} {
+ global ipanzoom
+
+ $which rotate motion begin
+ set ipanzoom(x) $x
+}
+
+proc RotateMotion {which x y} {
+ global current
+ global ipanzoom
+ global icursor
+
+ $which rotate motion [expr double($ipanzoom(x)-$x)/$ipanzoom(speed) * 180.]
+ if {$current(frame) == $which} {
+ set current(rotate) [$which get rotate]
+ }
+ RefreshInfoBox $which
+}
+
+proc RotateRelease {which x y} {
+ global current
+
+ $which rotate motion end
+ if {$current(frame) == $which} {
+ set current(rotate) [$which get rotate]
+ }
+ UpdateRotate $which
+}
+
+proc UpdateRotate {which} {
+ LockFrame $which
+ UpdateGraphXAxis $which
+ UpdatePanZoomDialog
+ RefreshInfoBox $which
+}
+
+proc PanZoomDialog {} {
+ global panzoom
+ global ipanzoom
+ global dpanzoom
+ global ds9
+ global current
+
+ # see if we already have a window visible
+ if {[winfo exists $ipanzoom(top)]} {
+ raise $ipanzoom(top)
+ return
+ }
+
+ # create the window
+ set w $ipanzoom(top)
+ set mb $ipanzoom(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Pan Zoom Rotate Parameters}] \
+ PanZoomDestroyDialog
+
+ # for CoordMenuButton
+ set panzoom(frame) $current(frame)
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Pan}] -menu $mb.pan
+ $mb add cascade -label [msgcat::mc {Zoom}] -menu $mb.zoom
+ $mb add cascade -label [msgcat::mc {Orientation}] -menu $mb.orient
+ $mb add cascade -label [msgcat::mc {Rotate}] -menu $mb.rotate
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command PanZoomApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command PanZoomDestroyDialog
+
+ EditMenu $mb ipanzoom
+
+ menu $mb.pan
+ $mb.pan add command -label [msgcat::mc {Center Image}] \
+ -command CenterCurrentFrame
+ $mb.pan add checkbutton -label [msgcat::mc {Align}] \
+ -variable current(align) -command AlignWCSFrame
+
+ menu $mb.zoom
+ $mb.zoom add command -label [msgcat::mc {Zoom In}] -command {Zoom 2 2}
+ $mb.zoom add command -label [msgcat::mc {Zoom Out}] -command {Zoom .5 .5}
+ $mb.zoom add command -label [msgcat::mc {Zoom Fit}] -command ZoomToFit
+ $mb.zoom add separator
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/32" \
+ -variable current(zoom) -value { 0.03125 0.03125 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/16" \
+ -variable current(zoom) -value { 0.0625 0.0625 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/8" \
+ -variable current(zoom) -value { 0.125 0.125 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/4" \
+ -variable current(zoom) -value { 0.25 0.25 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1/2" \
+ -variable current(zoom) -value { 0.5 0.5 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 1" \
+ -variable current(zoom) -value { 1 1 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 2" \
+ -variable current(zoom) -value { 2 2 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 4" \
+ -variable current(zoom) -value { 4 4 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 8" \
+ -variable current(zoom) -value { 8 8 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 16" \
+ -variable current(zoom) -value { 16 16 } -command ChangeZoom
+ $mb.zoom add radiobutton -label "[msgcat::mc {Zoom}] 32" \
+ -variable current(zoom) -value { 32 32 } -command ChangeZoom
+
+ menu $mb.orient
+ $mb.orient add radiobutton -label [msgcat::mc {None}] \
+ -variable current(orient) -value none -command ChangeOrient
+ $mb.orient add radiobutton -label "[msgcat::mc {Invert}] X" \
+ -variable current(orient) -value x -command ChangeOrient
+ $mb.orient add radiobutton -label "[msgcat::mc {Invert}] Y" \
+ -variable current(orient) -value y -command ChangeOrient
+ $mb.orient add radiobutton -label "[msgcat::mc {Invert}] XY" \
+ -variable current(orient) -value xy -command ChangeOrient
+
+ menu $mb.rotate
+ $mb.rotate add radiobutton -label "0 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 0 -command ChangeRotate
+ $mb.rotate add radiobutton -label "90 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 90 -command ChangeRotate
+ $mb.rotate add radiobutton -label "180 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 180 -command ChangeRotate
+ $mb.rotate add radiobutton -label "270 [msgcat::mc {Degrees}]" \
+ -variable current(rotate) -value 270 -command ChangeRotate
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.zoomtitle -text [msgcat::mc {Zoom}]
+ ttk::entry $f.zoomx -textvariable dpanzoom(zoom,x) -width 14
+ ttk::entry $f.zoomy -textvariable dpanzoom(zoom,y) -width 14
+
+ ttk::label $f.rottitle -text [msgcat::mc {Rotate}]
+ ttk::entry $f.rotvalue -textvariable dpanzoom(rotate) -width 14
+ ttk::label $f.rottitle2 -text [msgcat::mc {Degrees}]
+
+ ttk::label $f.pantitle -text [msgcat::mc {Pan}]
+ ttk::entry $f.panx -textvariable dpanzoom(x) -width 14
+ ttk::entry $f.pany -textvariable dpanzoom(y) -width 14
+ set dpanzoom(cb) $f.pansystem
+ CoordMenuButton $dpanzoom(cb) panzoom system 1 sky skyformat \
+ UpdatePanZoomDialog
+
+ grid $f.zoomtitle $f.zoomx $f.zoomy -padx 2 -pady 2
+ grid $f.rottitle $f.rotvalue $f.rottitle2 -padx 2 -pady 2 -sticky w
+ grid $f.pantitle $f.panx $f.pany $f.pansystem -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command PanZoomApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command PanZoomDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ $w.param.zoomx select range 0 end
+
+ UpdatePanZoomDialog
+}
+
+proc PanZoomApplyDialog {} {
+ global panzoom
+ global ipanzoom
+ global dpanzoom
+ global current
+
+ if {$current(frame) != {}} {
+ set current(zoom) "$dpanzoom(zoom,x) $dpanzoom(zoom,y)"
+ set current(rotate) $dpanzoom(rotate)
+
+ $current(frame) zoom to $current(zoom) about \
+ $panzoom(system) $panzoom(sky) $dpanzoom(x) $dpanzoom(y)
+ $current(frame) rotate to $current(rotate)
+
+ LockFrameCurrent
+ UpdateGraphXAxis $current(frame)
+ UpdatePanZoomDialog
+ GridUpdateZoom
+ RefreshInfoBox $current(frame)
+ UpdateZoomMenu
+ SAMPSendCoordPointAtSkyCmd $current(frame)
+ }
+}
+
+proc PanZoomDestroyDialog {} {
+ global ipanzoom
+ global dpanzoom
+
+ if {[winfo exists $ipanzoom(top)]} {
+ destroy $ipanzoom(top)
+ destroy $ipanzoom(mb)
+ }
+
+ unset dpanzoom
+}
+
+proc UpdatePanZoomMenu {} {
+ # can be changed by wcs
+ SetCoordSystem panzoom system sky skyformat
+}
+
+proc UpdatePanZoomDialog {} {
+ global panzoom
+ global ipanzoom
+ global dpanzoom
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdatePanZoomDialog"
+ }
+
+ if {![winfo exists $ipanzoom(top)]} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ set panzoom(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ # now make sure we have the coord systems
+ AdjustCoordSystem panzoom system
+ CoordMenuEnable $dpanzoom(cb).menu panzoom system 1 sky skyformat
+ CoordMenuButtonCmd panzoom system sky {}
+ } else {
+ CoordMenuReset $dpanzoom(cb).menu panzoom system 1 sky skyformat
+ }
+ }
+
+ if {$current(frame) != {}} {
+ set zz [$current(frame) get zoom]
+ set dpanzoom(zoom,x) [lindex $zz 0]
+ set dpanzoom(zoom,y) [lindex $zz 1]
+ set dpanzoom(rotate) [$current(frame) get rotate]
+
+ set coord [$current(frame) get cursor $panzoom(system) \
+ $panzoom(sky) $panzoom(skyformat)]
+ set dpanzoom(x) [lindex $coord 0]
+ set dpanzoom(y) [lindex $coord 1]
+ } else {
+ set dpanzoom(zoom,x) {}
+ set dpanzoom(zoom,y) {}
+ set dpanzoom(rotate) {}
+
+ set dpanzoom(x) {}
+ set dpanzoom(y) {}
+ }
+}
+
+# Other
+
+proc AlignWCSFrame {} {
+ global current
+ global ds9
+
+ if {$current(frame) != {}} {
+ $current(frame) wcs align $current(align)
+
+ LockFrameCurrent
+ UpdateGraphXAxis $current(frame)
+ UpdatePanZoomDialog
+ }
+}
+
+proc MatchFrameCurrent {sys} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchFrame $current(frame) $sys
+ }
+}
+
+proc MatchFrame {which sys} {
+ global ds9
+ global current
+
+ # NO-make sure matrices have been updated
+ # really messes up mousewheel events, just assume all is good
+ # RealizeDS9
+
+ switch -- $sys {
+ image -
+ physical -
+ amplifier -
+ detector {
+ set current(align) 0
+ $which wcs align 0
+
+ set pan [$which get cursor $sys]
+ set zoom [$which get zoom]
+ set rotate [$which get rotate]
+ set orient [$which get orient]
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ $ff pan to $sys $pan
+ $ff zoom to $zoom
+ $ff rotate to $rotate
+ $ff orient $orient
+
+ $ff wcs align 0
+ }
+ }
+ }
+ wcs {
+ set www [$which get wcs]
+ set sys [lindex $www 0]
+ set sky [lindex $www 1]
+ if {[$which has wcs $sys]} {
+ set current(align) 1
+ $which wcs align 1
+ set align [$which get wcs align pointer]
+ set pan [$which get cursor $sys FK5]
+ set zoom [$which get zoom]
+ set rotate [$which get rotate]
+ set orient [$which get orient]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ if {[$ff has wcs $sys]} {
+ $ff pan to $sys FK5 $pan
+ $ff zoom to $zoom
+ $ff rotate to $rotate
+ $ff orient $orient
+
+ $ff wcs align $align
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+proc LockFrameCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockFrame $current(frame)
+ }
+}
+
+proc LockFrame {which} {
+ global panzoom
+
+ switch -- $panzoom(lock) {
+ none {}
+ default {MatchFrame $which $panzoom(lock)}
+ }
+}
+
+# Backup
+
+proc PanZoomBackup {ch which} {
+ puts $ch "$which pan preserve [$which get pan preserve]"
+ puts $ch "$which pan to physical [$which get cursor physical]"
+ puts $ch "$which zoom to [$which get zoom]"
+ puts $ch "$which rotate to [$which get rotate]"
+ puts $ch "$which orient [$which get orient]"
+ puts $ch "$which wcs align [$which get wcs align]"
+}
+
+# Process Cmds
+
+proc ProcessPanCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {PanZoomDialog}
+ close {PanZoomDestroyDialog}
+ to {
+ set x [lindex $var [expr $i+1]]
+ set y [lindex $var [expr $i+2]]
+ set sys [lindex $var [expr $i+3]]
+ set sky [lindex $var [expr $i+4]]
+ set format {}
+
+ incr i 2
+ incr i [FixSpec sys sky format physical fk5 degrees]
+ PanTo $x $y $sys $sky
+ }
+ default {
+ set x [lindex $var [expr $i+0]]
+ set y [lindex $var [expr $i+1]]
+ set sys [lindex $var [expr $i+2]]
+ set sky [lindex $var [expr $i+3]]
+ set format {}
+
+ incr i 1
+ incr i [FixSpec sys sky format physical fk5 degrees]
+ Pan $x $y $sys $sky
+ }
+ }
+}
+
+proc ProcessSendPanCmd {proc id param} {
+ global current
+
+ set sys [lindex $param 0]
+ set sky [lindex $param 1]
+ set format [lindex $param 2]
+ FixSpec sys sky format physical fk5 degrees
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get cursor $sys $sky $format]\n"
+ }
+}
+
+proc ProcessZoomCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global current
+ switch -- [string tolower [lindex $var $i]] {
+ open {PanZoomDialog}
+ close {PanZoomDestroyDialog}
+ in {Zoom 2 2}
+ out {Zoom .5 .5}
+ to {
+ switch -- [string tolower [lindex $var [expr $i+1]]] {
+ fit {
+ ZoomToFit
+ incr i
+ }
+ default {
+ set z1 [lindex $var [expr $i+1]]
+ set z2 [lindex $var [expr $i+2]]
+ if {[string is double $z2] && $z2 != {}} {
+ set current(zoom) " $z1 $z2 "
+ incr i 2
+ } else {
+ set current(zoom) " $z1 $z1 "
+ incr i
+ }
+ ChangeZoom
+ }
+ }
+ }
+ default {
+ set z1 [lindex $var $i]
+ set z2 [lindex $var [expr $i+1]]
+ if {[string is double $z2] && $z2 != {}} {
+ Zoom $z1 $z2
+ incr i
+ } else {
+ Zoom $z1 $z1
+ }
+ }
+ }
+}
+
+proc ProcessSendZoomCmd {proc id param} {
+ global current
+
+ set z1 [lindex $current(zoom) 0]
+ set z2 [lindex $current(zoom) 1]
+ if {$z1 != $z2} {
+ $proc $id "$current(zoom)\n"
+ } else {
+ $proc $id "$z1\n"
+ }
+}
+
+proc ProcessOrientCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global current
+ switch -- [string tolower [lindex $var $i]] {
+ open {PanZoomDialog}
+ close {PanZoomDestroyDialog}
+ default {
+ set current(orient) [string tolower [lindex $var $i]]
+ ChangeOrient
+ }
+ }
+}
+
+proc ProcessSendOrientCmd {proc id param} {
+ global current
+ $proc $id "$current(orient)\n"
+}
+
+proc ProcessRotateCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ global current
+ switch -- [string tolower [lindex $var $i]] {
+ open {PanZoomDialog}
+ close {PanZoomDestroyDialog}
+ to {
+ set current(rotate) [lindex $var [expr $i+1]]
+ ChangeRotate
+ incr i
+ }
+ default {Rotate [lindex $var $i]}
+ }
+}
+
+proc ProcessSendRotateCmd {proc id param} {
+ global current
+ $proc $id "$current(rotate)\n"
+}
+
diff --git a/ds9/library/photo.tcl b/ds9/library/photo.tcl
new file mode 100644
index 0000000..fe70891
--- /dev/null
+++ b/ds9/library/photo.tcl
@@ -0,0 +1,300 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ImportPhotoFile {fn mode} {
+ global loadParam
+
+ set loadParam(file,type) photo
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) photo
+
+ # find stdin
+ if {[string range $fn 0 4] == "stdin" ||
+ [string range $fn 0 4] == "STDIN" ||
+ [string range $fn 0 0] == "-"} {
+
+ fconfigure stdin -translation binary -encoding binary
+ if {[catch {image create photo -data [read -nonewline stdin]} ph]} {
+ Error [msgcat::mc {An error has occurred while reading image.}]
+ return
+ }
+ set loadParam(file,name) stdin
+ } else {
+ if {[catch {image create photo -file $fn} ph]} {
+ Error [msgcat::mc {An error has occurred while reading image.}]
+ return
+ }
+ set loadParam(file,name) $fn
+ }
+ set loadParam(var,name) $ph
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+
+ image delete $ph
+}
+
+proc ImportPhotoAlloc {path fn mode} {
+ global loadParam
+
+ set loadParam(file,type) photo
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) photo
+
+ if {[catch {image create photo -file $path} ph]} {
+ Error [msgcat::mc {An error has occurred while reading image.}]
+ return
+ }
+ set loadParam(file,name) $fn
+ set loadParam(var,name) $ph
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+
+ image delete $ph
+}
+
+proc ImportPhotoSocket {ch fn mode} {
+ global loadParam
+
+ set loadParam(file,type) photo
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) photo
+ set loadParam(file,name) $fn
+
+ fconfigure $ch -translation binary -encoding binary
+ if {[catch {image create photo -data [read $ch]} ph]} {
+ Error [msgcat::mc {An error has occurred while reading image.}]
+ return 0
+ }
+ set loadParam(var,name) $ph
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ set rr [ProcessLoad 0]
+
+ image delete $ph
+ return $rr
+}
+
+proc ExportPhotoFile {fn format opt} {
+ global export
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {[catch {image create photo} ph]} {
+ Error [msgcat::mc {An error has occurred while creating image.}]
+ return
+ }
+
+ $current(frame) save photo $ph
+ set ff $format
+ switch -- $format {
+ jpeg {
+ if {$opt == {}} {
+ set opt $export(jpeg,quality)
+ }
+ set ff [list $format -quality $opt]
+ }
+ tiff {
+ if {$opt == {}} {
+ set opt $export(tiff,compress)
+ }
+ set ff [list $format -compression $opt]
+ }
+ }
+ if {[catch {$ph write $fn -format $ff}]} {
+ Error [msgcat::mc {An error has occurred while writing image.}]
+ }
+
+ image delete $ph
+}
+
+proc ExportPhotoSocket {ch format opt} {
+ global export
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ if {[catch {image create photo} ph]} {
+ Error [msgcat::mc {An error has occurred while creating image.}]
+ return
+ }
+
+ $current(frame) save photo $ph
+
+ fconfigure $ch -translation binary -encoding binary
+ set ff $format
+ switch -- $format {
+ jpeg {
+ if {$opt == {}} {
+ set opt $export(jpeg,quality)
+ }
+ set ff [list $format -quality $opt]
+ }
+ tiff {
+ if {$opt == {}} {
+ set opt $export(tiff,compress)
+ }
+ set ff [list $format -compression $opt]
+ }
+ }
+ if {[catch {$ph data -format $ff} data]} {
+ Error [msgcat::mc {An error has occurred while writing image.}]
+ return
+ }
+ puts -nonewline $ch [base64::decode $data]
+
+ image delete $ph
+}
+
+# Process Cmds
+
+proc ProcessGIFCmd {varname iname ch fn} {
+ upvar $varname var
+ upvar $iname i
+
+ ProcessPhotoCmd $varname $iname $ch $fn
+}
+
+proc ProcessJPEGCmd {varname iname ch fn} {
+ upvar $varname var
+ upvar $iname i
+
+ ProcessPhotoCmd $varname $iname $ch $fn
+}
+
+proc ProcessPNGCmd {varname iname ch fn} {
+ upvar $varname var
+ upvar $iname i
+
+ ProcessPhotoCmd $varname $iname $ch $fn
+}
+
+proc ProcessTIFFCmd {varname iname ch fn} {
+ upvar $varname var
+ upvar $iname i
+
+ ProcessPhotoCmd $varname $iname $ch $fn
+}
+
+proc ProcessPhotoCmd {varname iname ch fn} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ global loadParam
+ global current
+
+ set mode {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ set mode slice
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$ch != {}} {
+ # xpa
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {
+ if {![ImportPhotoSocket $ch $param $mode]} {
+ InitError xpa
+ ImportPhotoFile $param $mode
+ }
+ }
+ {Windows NT} {ImportPhotoFile $param $mode}
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ ImportPhotoAlloc $fn $param $mode
+ } else {
+ ImportPhotoFile $param $mode
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendGIFCmd {proc id param ch fn} {
+ global current
+
+ ProcessSendPhotoCmd gif $proc $id $param $ch $fn
+}
+
+proc ProcessSendJPEGCmd {proc id param ch fn} {
+ global current
+
+ ProcessSendPhotoCmd jpeg $proc $id $param $ch $fn
+}
+
+proc ProcessSendPNGCmd {proc id param ch fn} {
+ global current
+
+ ProcessSendPhotoCmd png $proc $id $param $ch $fn
+}
+
+proc ProcessSendTIFFCmd {proc id param ch fn} {
+ global current
+
+ ProcessSendPhotoCmd tiff $proc $id $param $ch $fn
+}
+
+proc ProcessSendPhotoCmd {format proc id param ch fn} {
+ global current
+ global export
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set opt [string tolower [lindex $param 0]]
+ if {$ch != {}} {
+ # xpa
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ExportPhotoSocket $ch $format $opt}
+ {Windows NT} {}
+ }
+ } elseif {$fn != {}} {
+ # comm
+ ExportPhotoFile $fn $format $opt
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/pixel.tcl b/ds9/library/pixel.tcl
new file mode 100644
index 0000000..cbca655
--- /dev/null
+++ b/ds9/library/pixel.tcl
@@ -0,0 +1,295 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PixelDef {} {
+ global pixel
+ global ipixel
+ global dpixel
+ global ppixel
+
+ set ipixel(top) .pixel
+ set ipixel(mb) .pixelmb
+ set ipixel(max) 13
+
+ set pixel(size) 5
+ array set ppixel [array get pixel]
+
+ set dpixel(copy) {}
+ set dpixel(tbl) {}
+}
+
+proc UpdatePixelTableDialog {which x y sys} {
+ global pixel
+ global ipixel
+ global dpixel
+
+ if {[winfo exists $ipixel(top)]} {
+ $which get pixel table $sys $x $y $pixel(size) $pixel(size) dpixel
+ }
+}
+
+proc PixelTableDialog {} {
+ global pixel
+ global ipixel
+ global dpixel
+
+ global ds9
+
+ if {[winfo exists $ipixel(top)]} {
+ raise $ipixel(top)
+ return
+ }
+
+ # create the pixel table window
+ set w $ipixel(top)
+ set mb $ipixel(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Pixel Table}] PixelTableDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Size}] -menu $mb.size
+
+ menu $mb.file
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command PixelTableSaveDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command PixelTableDestroyDialog
+
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -state disabled -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command PixelTableCopyDialog -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -state disabled -accelerator "${ds9(ctrl)}V"
+
+ menu $mb.size
+ for {set ii 3} {$ii<=$ipixel(max)} {incr ii 2} {
+ $mb.size add radiobutton -label "${ii}x${ii}" -variable pixel(size) \
+ -value $ii -command PixelTableConfigure
+ }
+
+ set f [ttk::frame $w.tbl]
+ set dpixel(tbl) [table $f.t \
+ -state disabled \
+ -anchor w \
+ -font [font actual TkDefaultFont] \
+ -variable dpixel \
+ -usecommand 0 \
+ -maxwidth 1200 \
+ ]
+
+ $dpixel(tbl) tag col coord 0
+ $dpixel(tbl) tag row coord 0
+ $dpixel(tbl) tag configure coord -foreground blue
+ $dpixel(tbl) tag configure center -foreground red
+
+ grid $f.t -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ set f [ttk::frame $w.buttons]
+ ttk::button $w.buttons.close -text [msgcat::mc {Close}] \
+ -command PixelTableDestroyDialog
+ pack $w.buttons.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.tbl -side top -fill both -expand true
+
+ selection handle $w PixelTableExportSelection
+
+ PixelTableConfigure
+
+ # dummy info
+ for {set jj 0} {$jj<=$pixel(size)} {incr jj} {
+ for {set ii 0} {$ii<=$pixel(size)} {incr ii} {
+ set dpixel($ii,$jj) {}
+ }
+ }
+}
+
+proc PixelTableDestroyDialog {} {
+ global ipixel
+ global dpixel
+
+ if {[winfo exists $ipixel(top)]} {
+ destroy $ipixel(top)
+ destroy $ipixel(mb)
+ }
+
+ if {[info exists dpixel]} {
+ unset dpixel
+ }
+}
+
+proc PixelTableCopyDialog {} {
+ global ipixel
+ global dpixel
+
+ set dpixel(copy) [PixelTableRender]
+
+ selection own -command PixelTableLostSelection $ipixel(top)
+
+ clipboard clear
+ clipboard append $dpixel(copy)
+}
+
+proc PixelTableClearDialog {} {
+ global pixel
+ global ipixel
+ global dpixel
+ global dpixel
+
+ if {[winfo exists $ipixel(top)]} {
+ for {set jj 0} {$jj<=$pixel(size)} {incr jj} {
+ for {set ii 0} {$ii<=$pixel(size)} {incr ii} {
+ set dpixel($ii,$jj) {}
+ }
+ }
+ }
+}
+
+proc PixelTableSaveDialog {} {
+ set filename [SaveFileDialog pixelfbox]
+
+ if {$filename != {}} {
+ set file [open $filename w]
+ puts -nonewline $file [PixelTableRender]
+ close $file
+ }
+}
+
+# support
+
+proc PixelTableConfigure {} {
+ global pixel
+ global ipixel
+ global dpixel
+
+ set ss [expr $pixel(size)+1]
+ $dpixel(tbl) configure -rows $ss -cols $ss
+ for {set ii 1} {$ii<=$ipixel(max)} {incr ii} {
+ $dpixel(tbl) tag cell {} $ii,$ii
+ }
+ set hh [expr int($ss/2.)]
+ $dpixel(tbl) tag cell center $hh,$hh
+}
+
+proc PixelTableRender {} {
+ global pixel
+ global dpixel
+
+ set rr {}
+ # col header
+ append rr " "
+ for {set ii 1} {$ii<=$pixel(size)} {incr ii} {
+ set msg [format "%12s" $dpixel(0,${ii})]
+ append rr "$msg"
+ }
+ append rr "\n"
+
+ append rr " "
+ for {set ii 1} {$ii<=$pixel(size)} {incr ii} {
+ append rr " -----------"
+ }
+ append rr "\n"
+
+ # body
+ for {set jj 1} {$jj<=$pixel(size)} {incr jj} {
+ set msg [format "%10s" $dpixel(${jj},0)]
+ append rr "$msg |"
+ for {set ii 1} {$ii<=$pixel(size)} {incr ii} {
+ set msg [format "%12.11s" $dpixel($jj,$ii)]
+ append rr "$msg"
+ }
+ append rr "\n"
+ }
+
+ return $rr
+}
+
+proc PixelTableExportSelection {offset bytes} {
+ global dpixel
+
+ if {$dpixel(copy) != {}} {
+ return [string range $dpixel(copy) $offset [expr $offset+$bytes]]
+ }
+}
+
+proc PixelTableLostSelection {} {
+ global dpixel
+
+ set dpixel(copy) {}
+}
+
+proc PrefsDialogPixelTable {} {
+ global dprefs
+ global ppixel
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Pixel Table}]
+ lappend dprefs(tabs) [ttk::frame $w.pixel]
+
+ set f [ttk::labelframe $w.pixel.param -text [msgcat::mc {Pixel Table}]]
+
+ ttk::label $f.tsize -text [msgcat::mc {Size}]
+
+ PrefsDialogPixelTableButtonCmd $ppixel(size)
+ ttk::menubutton $f.size -textvariable dprefs(pixeltable,msg) \
+ -menu $f.size.menu
+
+ global ipixel
+ set m $f.size.menu
+ menu $m
+ for {set ii 3} {$ii<=$ipixel(max)} {incr ii 2} {
+ $m add radiobutton -label "${ii}x${ii}" -variable ppixel(size) \
+ -value $ii -command [list PrefsDialogPixelTableButtonCmd $ii]
+ }
+ grid $f.tsize $f.size -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+proc PrefsDialogPixelTableButtonCmd {ii} {
+ global dprefs
+ global pixel
+
+ set dprefs(pixeltable,msg) "${ii}x${ii}"
+}
+
+proc ProcessPixelTableCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ open -
+ yes -
+ true -
+ on -
+ 1 {PixelTableDialog}
+
+ close -
+ no -
+ false -
+ off -
+ 0 {PixelTableDestroyDialog}
+
+ default {
+ PixelTableDialog
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendPixelTableCmd {proc id param sock fn} {
+ PixelTableDialog
+ ProcessSend $proc $id $sock $fn {.txt} [PixelTableRender]
+}
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl
new file mode 100644
index 0000000..fdd167d
--- /dev/null
+++ b/ds9/library/plot.tcl
@@ -0,0 +1,1360 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PlotDef {} {
+ global pap
+ global iap
+
+ set iap(tt) {ap}
+ set iap(windows) {}
+ set iap(unique) 0
+
+ set pap(graph,title) {}
+ set pap(graph,title,family) helvetica
+ set pap(graph,title,size) 12
+ set pap(graph,title,weight) normal
+ set pap(graph,title,slant) roman
+
+ set pap(legend) 0
+ set pap(legend,title) Legend
+ set pap(legend,position) right
+ set pap(legend,title,family) helvetica
+ set pap(legend,title,size) 10
+ set pap(legend,title,weight) normal
+ set pap(legend,title,slant) roman
+ set pap(legend,font,family) helvetica
+ set pap(legend,font,size) 9
+ set pap(legend,font,weight) normal
+ set pap(legend,font,slant) roman
+
+ set pap(axis,x,title) {}
+ set pap(axis,x,grid) 1
+ set pap(axis,x,log) 0
+ set pap(axis,x,flip) 0
+ set pap(axis,x,auto) 1
+ set pap(axis,x,min) {}
+ set pap(axis,x,max) {}
+ set pap(axis,x,format) {}
+
+ set pap(axis,y,title) {}
+ set pap(axis,y,grid) 1
+ set pap(axis,y,log) 0
+ set pap(axis,y,flip) 0
+ set pap(axis,y,auto) 1
+ set pap(axis,y,min) {}
+ set pap(axis,y,max) {}
+ set pap(axis,y,format) {}
+
+ set pap(axis,title,family) helvetica
+ set pap(axis,title,size) 9
+ set pap(axis,title,weight) normal
+ set pap(axis,title,slant) roman
+
+ set pap(axis,font,family) helvetica
+ set pap(axis,font,size) 9
+ set pap(axis,font,weight) normal
+ set pap(axis,font,slant) roman
+
+ set pap(show) 1
+ set pap(shape,symbol) none
+ set pap(shape,fill) 1
+ set pap(shape,color) red
+ set pap(smooth) linear
+ set pap(color) black
+ set pap(fill) 0
+ set pap(fill,color) black
+ set pap(width) 1
+ set pap(dash) 0
+
+ set pap(error) 1
+ set pap(error,cap) 0
+ set pap(error,color) red
+ set pap(error,width) 1
+
+ set pap(bar,relief) raised
+ set pap(bar,mode) normal
+}
+
+proc PlotAxisFormat {varname axis w nn} {
+ upvar #0 $varname var
+ global $varname
+
+ return [format $var(axis,$axis,format) $nn]
+}
+
+proc PlotClearData {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ # first set can be external
+ set clear $var(1,manage)
+
+ for {set nn 1} {$nn<=$var(data,total)} {incr nn} {
+ if {$var($nn,manage)} {
+ # delete elements
+ foreach el [$var(graph) element names] {
+ set f [split $el -]
+ if {[lindex $f 1] == $nn} {
+ $var(graph) element delete $el
+ }
+ }
+
+ # destroy vectors
+ blt::vector destroy $var($nn,xdata) $var($nn,ydata)
+ switch $var($nn,dim) {
+ xy {}
+ xyex {blt::vector destroy $var($nn,xedata)}
+ xyey {blt::vector destroy $var($nn,yedata)}
+ xyexey {blt::vector destroy $var($nn,xedata) $var($nn,yedata)}
+ }
+
+ foreach x [array names $varname] {
+ set f [split $x ,]
+ if {([lindex $f 0] == $nn)} {
+ unset ${varname}($x)
+ }
+ }
+ }
+ }
+
+ if {$clear} {
+ set var(data,total) 0
+ set var(data,current) 0
+
+ set var(name) {}
+ set var(xdata) {}
+ set var(ydata) {}
+ set var(xedata) {}
+ set var(yedata) {}
+
+ # reset other variables
+ set var(axis,x,auto) 1
+ set var(axis,x,min) {}
+ set var(axis,x,max) {}
+ set var(axis,x,format) {}
+
+ set var(axis,y,auto) 1
+ set var(axis,y,min) {}
+ set var(axis,y,max) {}
+ set var(axis,y,format) {}
+
+ $var(mb).select delete $ds9(menu,start) end
+
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+ } else {
+ set var(data,total) 1
+ set var(data,current) 1
+
+ $var(mb).select delete [expr $ds9(menu,start)+1] end
+ PlotCurrentData $varname
+ $var(proc,updategraph) $varname
+ }
+}
+
+proc PlotCurrentData {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(data,total) > 0} {
+ set nn $var(data,current)
+
+ set var(manage) $var($nn,manage)
+ set var(dim) $var($nn,dim)
+
+ set var(xdata) $var($nn,xdata)
+ set var(ydata) $var($nn,ydata)
+ set var(xedata) $var($nn,xedata)
+ set var(yedata) $var($nn,yedata)
+
+ PlotSetVar $varname $nn
+ }
+
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotDataSet {varname dim data} {
+ upvar #0 $varname var
+ global $varname
+
+ switch -- $dim {
+ 4 {
+ # first data set
+ PlotDataSetOne $varname "4.1" $data
+
+ # set color
+ set cc $var(color)
+ set var(color) [PlotNextColor $var(color)]
+
+ # second data set
+ PlotDataSetOne $varname "4.2" $data
+ set var(color) $cc
+ }
+ 5 {
+ # first data set
+ PlotDataSetOne $varname "5.1" $data
+
+ # set color
+ set cc $var(color)
+ set var(color) [PlotNextColor $var(color)]
+
+ # second data set
+ PlotDataSetOne $varname "5.2" $data
+ set var(color) $cc
+ }
+ default {PlotDataSetOne $varname $dim $data}
+ }
+}
+
+proc PlotDataSetOne {varname dim data} {
+ upvar #0 $varname var
+ global $varname
+
+ # look for no data
+ if {[string length $data] == 0} {
+ return
+ }
+
+ # total length
+ set ll [llength $data]
+ set ii 0
+
+ while {$ii<$ll} {
+ # incr count
+ incr ${varname}(data,total)
+ set nn $var(data,total)
+ set var(data,current) $nn
+
+ # new vector names
+ set xdata ap${varname}xx${nn}
+ set ydata ap${varname}yy${nn}
+ set xedata ap${varname}xe${nn}
+ set yedata ap${varname}ye${nn}
+
+ # basics xy
+ set var(manage) 1
+ set var(name) "Dataset $nn"
+ set var(xdata) $xdata
+ set var(ydata) $ydata
+ global $var(xdata) $var(ydata)
+ blt::vector create $var(xdata) $var(ydata)
+
+ # substitute all separtors
+ regsub -all {[\n\r\t, ]+} $data { } data
+ # remove all non-numeric data
+ regsub -all {[^0-9.e\- ]+} $data {} data
+
+ set ox [lindex $data $ii]
+ set x {}
+ set y {}
+ set xe {}
+ set ye {}
+ switch -- $dim {
+ 2 -
+ xy {
+ set var(dim) xy
+ set var(xedata) {}
+ set var(yedata) {}
+
+ for {} {$ii<$ll} {incr ii 2} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ }
+
+ xyex {
+ set var(dim) xyex
+ set var(xedata) $xedata
+ set var(yedata) {}
+
+ global $var(xedata)
+ blt::vector create $var(xedata)
+
+ for {} {$ii<$ll} {incr ii 3} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend xe [lindex $data [expr $ii+2]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend xe [lindex $data [expr $ii+2]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(xedata) set $xe
+ }
+
+ 3 -
+ xyey {
+ set var(dim) xyey
+ set var(xedata) {}
+ set var(yedata) $yedata
+
+ global $var(yedata)
+ blt::vector create $var(yedata)
+
+ for {} {$ii<$ll} {incr ii 3} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(yedata) set $ye
+ }
+
+ xyexey {
+ set var(dim) xyexey
+ set var(xedata) $xedata
+ set var(yedata) $yedata
+
+ global $var(xedata) $var(yedata)
+ blt::vector create $var(xedata) $var(yedata)
+
+ for {} {$ii<$ll} {incr ii 4} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend xe [lindex $data [expr $ii+2]]
+ lappend ye [lindex $data [expr $ii+3]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend xe [lindex $data [expr $ii+2]]
+ lappend ye [lindex $data [expr $ii+3]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(xedata) set $xe
+ $var(yedata) set $ye
+ }
+
+ 4.1 {
+ set var(dim) xyey
+ set var(xedata) {}
+ set var(yedata) $yedata
+
+ global $var(yedata)
+ blt::vector create $var(yedata)
+
+ for {} {$ii<$ll} {incr ii 4} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(yedata) set $ye
+ }
+
+ 4.2 {
+ set var(dim) xy
+ set var(xedata) {}
+ set var(yedata) {}
+
+ for {} {$ii<$ll} {incr ii 4} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+3]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+3]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ }
+
+ 5.1 {
+ set var(dim) xyey
+ set var(xedata) {}
+ set var(yedata) $yedata
+
+ global $var(yedata)
+ blt::vector create $var(yedata)
+
+ for {} {$ii<$ll} {incr ii 5} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+1]]
+ lappend ye [lindex $data [expr $ii+2]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(yedata) set $ye
+ }
+
+ 5.2 {
+ set var(dim) xyey
+ set var(xedata) {}
+ set var(yedata) $yedata
+
+ global $var(yedata)
+ blt::vector create $var(yedata)
+
+ for {} {$ii<$ll} {incr ii 5} {
+ set tx [lindex $data $ii]
+ if {$var(seq)} {
+ if {$ox<=$tx} {
+ set ox $tx
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+3]]
+ lappend ye [lindex $data [expr $ii+4]]
+ } else {
+ break
+ }
+ } else {
+ lappend x $tx
+ lappend y [lindex $data [expr $ii+3]]
+ lappend ye [lindex $data [expr $ii+4]]
+ }
+ }
+ $var(xdata) set $x
+ $var(ydata) set $y
+ $var(yedata) set $ye
+ }
+ }
+
+ set var($nn,manage) 1
+ set var($nn,dim) $var(dim)
+
+ set var($nn,xdata) $var(xdata)
+ set var($nn,ydata) $var(ydata)
+ set var($nn,xedata) $var(xedata)
+ set var($nn,yedata) $var(yedata)
+
+ PlotGetVar $varname $nn
+
+ # update data set menu
+ $var(mb).select add radiobutton -label "$var(name)" \
+ -variable ${varname}(data,current) -value $nn \
+ -command [list PlotCurrentData $varname]
+
+ PlotCreateElement $varname
+ $var(proc,updateelement) $varname
+ }
+}
+
+proc PlotDupData {varname mm} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ # incr count
+ incr ${varname}(data,total)
+ set nn $var(data,total)
+ set pp [expr $nn-1]
+
+ # new vector names
+ set var($nn,name) "Dataset $nn"
+ set var($nn,xdata) ap${varname}xx${nn}
+ set var($nn,ydata) ap${varname}yy${nn}
+ set var($nn,xedata) ap${varname}xe${nn}
+ set var($nn,yedata) ap${varname}ye${nn}
+ global $var($mm,xdata) $var($mm,ydata) $var($mm,xedata) $var($mm,yedata)
+ global $var($nn,xdata) $var($nn,ydata) $var($nn,xedata) $var($nn,yedata)
+
+ $var($mm,xdata) dup $var($nn,xdata)
+ $var($mm,ydata) dup $var($nn,ydata)
+ if {$var($mm,xedata) != {}} {
+ $var($mm,xedata) dup $var($nn,xedata)
+ } else {
+ set var($nn,xedata) {}
+ }
+ if {$var($mm,yedata) != {}} {
+ $var($mm,yedata) dup $var($nn,yedata)
+ } else {
+ set var($nn,yedata) {}
+ }
+
+ set var($nn,manage) 1
+ set var($nn,dim) $var($mm,dim)
+
+ set var($nn,show) $var($mm,show)
+ set var($nn,shape,symbol) $var($mm,shape,symbol)
+ set var($nn,shape,fill) $var($mm,shape,fill)
+ set var($nn,shape,color) $var($mm,shape,color)
+ set var($nn,smooth) $var($mm,smooth)
+ set var($nn,color) [PlotNextColor $var($mm,color)]
+ set var($nn,fill) $var($mm,fill)
+ set var($nn,fill,color) [PlotNextColor $var($mm,fill,color)]
+ set var($nn,width) $var($mm,width)
+ set var($nn,dash) $var($mm,dash)
+ set var($nn,error) $var($mm,error)
+ set var($nn,error,cap) $var($mm,error,cap)
+ set var($nn,error,color) $var($mm,error,color)
+ set var($nn,error,width) $var($mm,error,width)
+ set var($nn,bar,relief) $var($mm,bar,relief)
+
+ # update data set menu
+ $var(mb).select add radiobutton -label "$var($nn,name)" \
+ -variable ${varname}(data,current) -value $nn \
+ -command [list PlotCurrentData $varname]
+
+ # make current
+ set var(data,current) $nn
+
+ set var(manage) $var($nn,manage)
+ set var(dim) $var($nn,dim)
+
+ set var(xdata) $var($nn,xdata)
+ set var(ydata) $var($nn,ydata)
+ set var(xedata) $var($nn,xedata)
+ set var(yedata) $var($nn,yedata)
+
+ PlotSetVar $varname $nn
+
+ PlotCreateElement $varname
+ $var(proc,updateelement) $varname
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotDestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global iap
+
+ # see if it still is around
+ if {![PlotPing $varname]} {
+ return
+ }
+
+ for {set nn 1} {$nn<=$var(data,total)} {incr nn} {
+ switch $var($nn,dim) {
+ xy {
+ blt::vector destroy $var($nn,xdata) $var($nn,ydata)
+ }
+ xyex {
+ blt::vector destroy $var($nn,xdata) $var($nn,ydata) \
+ $var($nn,xedata)
+ }
+ xyey {
+ blt::vector destroy $var($nn,xdata) $var($nn,ydata) \
+ $var($nn,yedata)
+ }
+ xyexey {
+ blt::vector destroy $var($nn,xdata) $var($nn,ydata) \
+ $var($nn,xedata) $var($nn,yedata)
+ }
+ }
+ }
+
+ destroy $var(top)
+ destroy $var(mb)
+
+ # stats window?
+ if {$var(stats)} {
+ SimpleTextDestroy "${varname}stats"
+ }
+
+ # list window?
+ if {$var(list)} {
+ SimpleTextDestroy "${varname}list"
+ }
+
+ # delete it from the xpa list
+ set ii [lsearch $iap(windows) $varname]
+ if {$ii>=0} {
+ set iap(windows) [lreplace $iap(windows) $ii $ii]
+ }
+
+ unset $varname
+}
+
+proc PlotExternal {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # incr count
+ incr ${varname}(data,total)
+ set nn $var(data,total)
+ set var(data,current) $nn
+
+ set var(name) "Dataset $nn"
+
+ set var($nn,manage) $var(manage)
+ set var($nn,dim) $var(dim)
+
+ set var($nn,xdata) $var(xdata)
+ set var($nn,ydata) $var(ydata)
+ set var($nn,xedata) $var(xedata)
+ set var($nn,yedata) $var(yedata)
+
+ PlotGetVar $varname $nn
+
+ # update data set menu
+ $var(mb).select add radiobutton -label "[msgcat::mc {Dataset}] $nn" \
+ -variable ${varname}(data,current) -value $nn \
+ -command "PlotCurrentData $varname"
+
+ PlotCreateElement $varname
+}
+
+proc PlotList {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {!$var(list)} {
+ return
+ }
+
+ set rr [PlotListGenerate $varname]
+ SimpleTextDialog "${varname}list" [msgcat::mc {Data}] \
+ 40 20 insert top $rr PlotListDestroyCB $varname
+}
+
+proc PlotListGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set rr {}
+ if {$var(xdata) != {}} {
+ global $var(xdata) $var(ydata) $var(xedata) $var(yedata)
+ set ll [$var(xdata) length]
+ set xx [$var(xdata) range]
+ set yy [$var(ydata) range]
+
+ switch $var(dim) {
+ xy {
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ append rr "[lindex $xx $ii] [lindex $yy $ii]\n"
+ }
+ }
+ xyex {
+ set xe [$var(xedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ append rr "[lindex $xx $ii] [lindex $yy $ii] [lindex $xe $ii]\n"
+ }
+ }
+ xyey {
+ set ye [$var(yedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ append rr "[lindex $xx $ii] [lindex $yy $ii] [lindex $ye $ii]\n"
+ }
+ }
+ xyexey {
+ set xe [$var(xedata) range]
+ set ye [$var(yedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ append rr "[lindex $xx $ii] [lindex $yy $ii] [lindex $xe $ii] [lindex $ye $ii]\n"
+ }
+ }
+ }
+ }
+
+ return $rr
+}
+
+proc PlotListDestroyCB {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(list) 0
+}
+
+proc PlotLoadConfig {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotLoadConfigFile $varname [OpenFileDialog apconfigfbox]
+}
+
+# used by backup
+proc PlotLoadConfigFile {varname filename} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$filename != {}} {
+ source $filename
+ array set $varname [array get analysisplot]
+ unset analysisplot
+
+ # backward compatibility
+ FixVar ${varname}(axis,x,grid) ${varname}(graph,x,grid)
+ FixVar ${varname}(axis,x,log) ${varname}(graph,x,log)
+ FixVar ${varname}(axis,x,flip) ${varname}(graph,x,flip)
+ FixVar ${varname}(axis,y,grid) ${varname}(graph,y,grid)
+ FixVar ${varname}(axis,y,log) ${varname}(graph,y,log)
+ FixVar ${varname}(axis,y,flip) ${varname}(graph,y,flip)
+
+ FixVar ${varname}(graph,title,family) ${varname}(titleFont)
+ FixVar ${varname}(graph,title,size) ${varname}(titleSize)
+ FixVar ${varname}(graph,title,weight) ${varname}(titleWeight)
+ FixVar ${varname}(graph,title,slant) ${varname}(titleSlant)
+
+ FixVar ${varname}(axis,title,family) ${varname}(textlabFont)
+ FixVar ${varname}(axis,title,size) ${varname}(textlabSize)
+ FixVar ${varname}(axis,title,weight) ${varname}(textlabWeight)
+ FixVar ${varname}(axis,title,slant) ${varname}(textlabSlant)
+
+ FixVar ${varname}(axis,font,family) ${varname}(numlabFont)
+ FixVar ${varname}(axis,font,size) ${varname}(numlabSize)
+ FixVar ${varname}(axis,font,weight) ${varname}(numlabWeight)
+ FixVar ${varname}(axis,font,slant) ${varname}(numlabSlant)
+
+ FixVar ${varname}(show) ${varname}(linear)
+ FixVar ${varname}(shape,color) ${varname}(discrete,color)
+ FixVar ${varname}(shape,fill) ${varname}(discrete,fill)
+ FixVar ${varname}(width) ${varname}(linear,width)
+ FixVar ${varname}(color) ${varname}(linear,color)
+ if {[info exists ${varname}(linear,dash)]} {
+ set var(linear,dash) [FromYesNo $var(linear,dash)]
+ }
+ FixVar ${varname}(dash) ${varname}(linear,dash)
+
+ if {[info exists ${varname}(discrete)]} {
+ if {$var(discrete)} {
+ FixVar ${varname}(shape,symbol) ${varname}(discrete,symbol)
+ } else {
+ FixVarRm ${varname}(discrete,symbol)
+ }
+ }
+
+ FixVarRm ${varname}(bar)
+ FixVarRm ${varname}(bar,color)
+
+ FixVarRm ${varname}(discrete)
+
+ FixVarRm ${varname}(quadratic)
+ FixVarRm ${varname}(quadratic,width)
+ FixVarRm ${varname}(quadratic,color)
+ FixVarRm ${varname}(quadratic,dash)
+
+ FixVarRm ${varname}(step)
+ FixVarRm ${varname}(step,color)
+ FixVarRm ${varname}(step,dash)
+ FixVarRm ${varname}(step,width)
+
+ if {[info exists var(grid)]} {
+ set var(axis,x,grid) $var(grid)
+ set var(axis,y,grid) $var(grid)
+ unset var(grid)
+ }
+ if {[info exists var(format)]} {
+ set var(graph,format) $var(format)
+ set var(axis,x,format) $var(format,x)
+ set var(axis,y,format) $var(format,y)
+ unset var(format)
+ unset var(format,x)
+ unset var(format,y)
+ }
+
+ if {[info exists var(grid,log)]} {
+ switch $var(grid,log) {
+ linearlinear {
+ set var(axis,x,log) 0
+ set var(axis,y,log) 0
+ }
+ linearlog {
+ set var(axis,x,log) 0
+ set var(axis,y,log) 1
+ }
+ loglinear {
+ set var(axis,x,log) 1
+ set var(axis,y,log) 0
+ }
+ loglog {
+ set var(axis,x,log) 1
+ set var(axis,y,log) 1
+ }
+ }
+ unset var(grid,log)
+ }
+
+ $var(proc,updategraph) $varname
+ $var(proc,updateelement) $varname
+ }
+}
+
+proc PlotLoadData {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set filename [OpenFileDialog apdatafbox]
+ if {$filename != {}} {
+ set dim xy
+ if {[PlotDataFormatDialog dim]} {
+ PlotLoadDataFile $varname $filename $dim
+ }
+ }
+}
+
+# used by backup
+proc PlotLoadDataFile {varname filename dim} {
+ upvar #0 $varname var
+ global $varname
+
+ set ch [open $filename]
+ set data [read $ch]
+ close $ch
+
+ PlotRaise $varname
+
+ PlotDataSet $varname $dim $data
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotNextColor {which} {
+ switch -- $which {
+ black {return red}
+ red {return green}
+ green {return blue}
+ blue {return cyan}
+ cyan {return magenta}
+ magenta {return yellow}
+ yellow {return black}
+ white {return white}
+ default {return red}
+ }
+}
+
+proc PlotPing {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[info exists var(top)]} {
+ if {[winfo exists $var(top)]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+proc PlotRaise {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[PlotPing $varname]} {
+ raise $var(top)
+ return 1
+ }
+ return 0
+}
+
+proc PlotSaveConfig {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotSaveConfigFile $varname [SaveFileDialog apconfigfbox]
+}
+
+proc PlotSaveConfigFile {varname filename} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$filename == {}} {
+ return
+ }
+
+ set ch [open $filename w]
+
+ set analysisplot(graph,title) $var(graph,title)
+ set analysisplot(graph,title,family) $var(graph,title,family)
+ set analysisplot(graph,title,size) $var(graph,title,size)
+ set analysisplot(graph,title,weight) $var(graph,title,weight)
+ set analysisplot(graph,title,slant) $var(graph,title,slant)
+
+ set analysisplot(legend) $var(legend)
+ set analysisplot(legend,title) $var(legend,title)
+ set analysisplot(legend,position) $var(legend,position)
+ set analysisplot(legend,title,family) $var(legend,title,family)
+ set analysisplot(legend,title,size) $var(legend,title,size)
+ set analysisplot(legend,title,weight) $var(legend,title,weight)
+ set analysisplot(legend,title,slant) $var(legend,title,slant)
+ set analysisplot(legend,font,family) $var(legend,font,family)
+ set analysisplot(legend,font,size) $var(legend,font,size)
+ set analysisplot(legend,font,weight) $var(legend,font,weight)
+ set analysisplot(legend,font,slant) $var(legend,font,slant)
+
+ set analysisplot(axis,x,title) $var(axis,x,title)
+ set analysisplot(axis,x,grid) $var(axis,x,grid)
+ set analysisplot(axis,x,log) $var(axis,x,log)
+ set analysisplot(axis,x,flip) $var(axis,x,flip)
+ set analysisplot(axis,x,auto) $var(axis,x,auto)
+ set analysisplot(axis,x,min) $var(axis,x,min)
+ set analysisplot(axis,x,max) $var(axis,x,max)
+ set analysisplot(axis,x,format) $var(axis,x,format)
+
+ set analysisplot(axis,y,title) $var(axis,y,title)
+ set analysisplot(axis,y,grid) $var(axis,y,grid)
+ set analysisplot(axis,y,log) $var(axis,y,log)
+ set analysisplot(axis,y,flip) $var(axis,y,flip)
+ set analysisplot(axis,y,auto) $var(axis,y,auto)
+ set analysisplot(axis,y,min) $var(axis,y,min)
+ set analysisplot(axis,y,max) $var(axis,y,max)
+ set analysisplot(axis,y,format) $var(axis,y,format)
+
+ set analysisplot(axis,title,family) $var(axis,title,family)
+ set analysisplot(axis,title,size) $var(axis,title,size)
+ set analysisplot(axis,title,weight) $var(axis,title,weight)
+ set analysisplot(axis,title,slant) $var(axis,title,slant)
+
+ set analysisplot(axis,font,family) $var(axis,font,family)
+ set analysisplot(axis,font,size) $var(axis,font,size)
+ set analysisplot(axis,font,weight) $var(axis,font,weight)
+ set analysisplot(axis,font,slant) $var(axis,font,slant)
+
+ set analysisplot(show) $var(show)
+ set analysisplot(shape,symbol) $var(shape,symbol)
+ set analysisplot(shape,fill) $var(shape,fill)
+ set analysisplot(shape,color) $var(shape,color)
+ set analysisplot(smooth) $var(smooth)
+ set analysisplot(color) $var(color)
+ set analysisplot(fill) $var(fill)
+ set analysisplot(fill,color) $var(fill,color)
+ set analysisplot(width) $var(width)
+ set analysisplot(dash) $var(dash)
+
+ set analysisplot(error) $var(error)
+ set analysisplot(error,cap) $var(error,cap)
+ set analysisplot(error,color) $var(error,color)
+ set analysisplot(error,width) $var(error,width)
+
+ set analysisplot(bar,relief) $var(bar,relief)
+ set analysisplot(bar,mode) $var(bar,mode)
+
+ puts $ch "array set analysisplot \{ [array get analysisplot] \}"
+ close $ch
+}
+
+proc PlotSaveData {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(xdata) == {}} {
+ return
+ }
+
+ PlotSaveDataFile $varname [SaveFileDialog apdatafbox]
+}
+
+proc PlotSaveDataFile {varname filename} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(xdata) == {}} {
+ return
+ }
+
+ if {$filename == {}} {
+ return
+ }
+
+ global $var(xdata) $var(ydata) $var(xedata) $var(yedata)
+ set ll [$var(xdata) length]
+ set xx [$var(xdata) range]
+ set yy [$var(ydata) range]
+
+ set ch [open $filename w]
+ switch $var(dim) {
+ xy {
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ puts $ch "[lindex $xx $ii] [lindex $yy $ii]"
+ }
+ }
+ xyex {
+ set xe [$var(xedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ puts $ch "[lindex $xx $ii] [lindex $yy $ii] [lindex $xe $ii]"
+ }
+ }
+ xyey {
+ set ye [$var(yedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ puts $ch "[lindex $xx $ii] [lindex $yy $ii] [lindex $ye $ii]"
+ }
+ }
+ xyexey {
+ set xe [$var(xedata) range]
+ set ye [$var(yedata) range]
+ for {set ii 0} {$ii<$ll} {incr ii} {
+ puts $ch "[lindex $xx $ii] [lindex $yy $ii] [lindex $xe $ii] [lindex $ye $ii]"
+ }
+ }
+ }
+ close $ch
+
+ PlotRaise $varname
+}
+
+proc PlotStats {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {!$var(stats)} {
+ return
+ }
+
+ set rr [PlotStatsGenerate $varname]
+ SimpleTextDialog "${varname}stats" [msgcat::mc {Statistics}] \
+ 40 20 insert top $rr PlotStatsDestroyCB $varname
+}
+
+proc PlotStatsGenerate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set min {}
+ set max {}
+ set mean {}
+ set median {}
+ set varr {}
+ set sdev {}
+
+ if {$var(ydata) != {}} {
+ if {[$var(ydata) length] > 0} {
+ set min [format "%6.3f" [blt::vector expr min($var(ydata))]]
+ set max [format "%6.3f" [blt::vector expr max($var(ydata))]]
+ set mean [format "%6.3f" [blt::vector expr mean($var(ydata))]]
+ set median [format "%6.3f" [blt::vector expr median($var(ydata))]]
+ set varr [format "%6.3f" [expr [blt::vector expr var($var(ydata))]]]
+ set sdev [format "%6.3f" [expr [blt::vector expr sdev($var(ydata))]]]
+ }
+ }
+
+ set rr {}
+ append rr "min $min\n"
+ append rr "max $max\n"
+ append rr "mean $mean\n"
+ append rr "median $median\n"
+ append rr "var $varr\n"
+ append rr "sdev $sdev\n"
+ return $rr
+}
+
+proc PlotStatsDestroyCB {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(stats) 0
+}
+
+proc PlotTitle {varname title xaxis yaxis} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(graph,title) "$title"
+ set var(axis,x,title) "$xaxis"
+ set var(axis,y,title) "$yaxis"
+}
+
+proc PlotUpdateGraph {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ if {$var(axis,x,auto)} {
+ set xmin {}
+ set xmax {}
+ } else {
+ set xmin $var(axis,x,min)
+ set xmax $var(axis,x,max)
+ }
+
+ if {$var(axis,y,auto)} {
+ set ymin {}
+ set ymax {}
+ } else {
+ set ymin $var(axis,y,min)
+ set ymax $var(axis,y,max)
+ }
+
+ $var(graph) xaxis configure -min $xmin -max $xmax \
+ -descending $var(axis,x,flip)
+ $var(graph) yaxis configure -min $ymin -max $ymax \
+ -descending $var(axis,y,flip)
+
+ if {$var(graph,format)} {
+ if {$var(axis,x,format) != {}} {
+ $var(graph) xaxis configure \
+ -command [list PlotAxisFormat $varname x]
+ } else {
+ $var(graph) xaxis configure -command {}
+ }
+ if {$var(axis,y,format) != {}} {
+ $var(graph) yaxis configure \
+ -command [list PlotAxisFormat $varname y]
+ } else {
+ $var(graph) yaxis configure -command {}
+ }
+ }
+
+ # Menus
+ if {$var(xdata) != {}} {
+ $var(mb).file entryconfig "[msgcat::mc {Save Data}]..." -state normal
+ $var(mb).file entryconfig [msgcat::mc {Clear Data}] -state normal
+ $var(mb).file entryconfig [msgcat::mc {Statistics}] -state normal
+ $var(mb).file entryconfig [msgcat::mc {List Data}] -state normal
+
+ if {$var(1,manage)} {
+ $var(mb).file entryconfig [msgcat::mc {Duplicate Data}] \
+ -state disabled
+ } else {
+ $var(mb).file entryconfig [msgcat::mc {Duplicate Data}] \
+ -state normal
+ }
+ } else {
+ $var(mb).file entryconfig "[msgcat::mc {Save Data}]..." -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Clear Data}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Duplicate Data}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {Statistics}] -state disabled
+ $var(mb).file entryconfig [msgcat::mc {List Data}] -state disabled
+ }
+
+ # Graph
+ $var(graph) configure -plotpadx 0 -plotpady 0 \
+ -title $var(graph,title) \
+ -font "{$ds9($var(graph,title,family))} $var(graph,title,size) $var(graph,title,weight) $var(graph,title,slant)"
+
+ $var(graph) xaxis configure \
+ -grid $var(axis,x,grid) -logscale $var(axis,x,log) \
+ -title $var(axis,x,title) \
+ -tickfont "{$ds9($var(axis,font,family))} $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "{$ds9($var(axis,title,family))} $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+ $var(graph) yaxis configure \
+ -grid $var(axis,y,grid) -logscale $var(axis,y,log) \
+ -title $var(axis,y,title) \
+ -tickfont "{$ds9($var(axis,font,family))} $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "{$ds9($var(axis,title,family))} $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+
+ $var(graph) legend configure -hide [expr !$var(legend)] \
+ -position $var(legend,position) -title $var(legend,title) \
+ -font "{$ds9($var(legend,font,family))} $var(legend,font,size) $var(legend,font,weight) $var(legend,font,slant)" \
+ -titlefont "{$ds9($var(legend,title,family))} $var(legend,title,size) $var(legend,title,weight) $var(legend,title,slant)"
+}
+
+proc PlotCreateElement {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # warning: uses current vars
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ # delete current elements
+ set nn $var(data,current)
+ foreach el [$var(graph) element names] {
+ set f [split $el -]
+ if {[lindex $f 1] == $nn} {
+ $var(graph) element delete $el
+ }
+ }
+
+ global $var(xdata) $var(ydata)
+ $var(graph) element create "d-${nn}" -xdata $var(xdata) -ydata $var(ydata)
+ if {$var(xedata) != {}} {
+ if {[$var(xedata) length] != 0} {
+ $var(graph) element configure "d-${nn}" -xerror $var(xedata)
+ }
+ }
+ if {$var(yedata) != {}} {
+ if {[$var(yedata) length] != 0} {
+ $var(graph) element configure "d-${nn}" -yerror $var(yedata)
+ }
+ }
+}
+
+proc PlotColorMenu {w varname color cmd} {
+ upvar #0 $varname var
+ global $varname
+
+ menu $w
+ $w add radiobutton -label [msgcat::mc {Black}] \
+ -variable ${varname}($color) -value black -command $cmd
+ $w add radiobutton -label [msgcat::mc {White}] \
+ -variable ${varname}($color) -value white -command $cmd
+ $w add radiobutton -label [msgcat::mc {Red}] \
+ -variable ${varname}($color) -value red -command $cmd
+ $w add radiobutton -label [msgcat::mc {Green}] \
+ -variable ${varname}($color) -value green -command $cmd
+ $w add radiobutton -label [msgcat::mc {Blue}] \
+ -variable ${varname}($color) -value blue -command $cmd
+ $w add radiobutton -label [msgcat::mc {Cyan}] \
+ -variable ${varname}($color) -value cyan -command $cmd
+ $w add radiobutton -label [msgcat::mc {Magenta}] \
+ -variable ${varname}($color) -value magenta -command $cmd
+ $w add radiobutton -label [msgcat::mc {Yellow}] \
+ -variable ${varname}($color) -value yellow -command $cmd
+ $w add separator
+ $w add command -label "[msgcat::mc {Other Color}]..." \
+ -command [list ColorMenuOther $varname $color $cmd]
+}
+
+proc PlotSetVar {varname nn} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(name) $var($nn,name)
+ set var(show) $var($nn,show)
+ set var(shape,symbol) $var($nn,shape,symbol)
+ set var(shape,fill) $var($nn,shape,fill)
+ set var(shape,color) $var($nn,shape,color)
+ set var(smooth) $var($nn,smooth)
+ set var(color) $var($nn,color)
+ set var(fill) $var($nn,fill)
+ set var(fill,color) $var($nn,fill,color)
+ set var(width) $var($nn,width)
+ set var(dash) $var($nn,dash)
+ set var(error) $var($nn,error)
+ set var(error,cap) $var($nn,error,cap)
+ set var(error,color) $var($nn,error,color)
+ set var(error,width) $var($nn,error,width)
+ set var(bar,relief) $var($nn,bar,relief)
+}
+
+proc PlotGetVar {varname nn} {
+ upvar #0 $varname var
+ global $varname
+
+ set var($nn,name) $var(name)
+ set var($nn,show) $var(show)
+ set var($nn,shape,symbol) $var(shape,symbol)
+ set var($nn,shape,fill) $var(shape,fill)
+ set var($nn,shape,color) $var(shape,color)
+ set var($nn,smooth) $var(smooth)
+ set var($nn,color) $var(color)
+ set var($nn,fill) $var(fill)
+ set var($nn,fill,color) $var(fill,color)
+ set var($nn,width) $var(width)
+ set var($nn,dash) $var(dash)
+ set var($nn,error) $var(error)
+ set var($nn,error,cap) $var(error,cap)
+ set var($nn,error,color) $var(error,color)
+ set var($nn,error,width) $var(error,width)
+ set var($nn,bar,relief) $var(bar,relief)
+}
+
+proc PlotBackup {ch dir} {
+ global iap
+
+ set rdir "./[lindex [file split $dir] end]"
+
+ # only save ap plots
+ foreach tt $iap(windows) {
+ if {[string range $tt 0 1] == {ap}} {
+ set fdir [file join $dir $tt]
+
+ set varname $tt
+ upvar #0 $varname var
+ global $varname
+
+ # create dir if needed
+ if {![file isdirectory $fdir]} {
+ if {[catch {file mkdir $fdir}]} {
+ Error [msgcat::mc {An error has occurred during backup}]
+ return
+ }
+ }
+
+ switch $var(type) {
+ line {puts $ch "PlotLineTool"}
+ bar {puts $ch "PlotBarTool"}
+ scatter {puts $ch "PlotScatterTool"}
+ }
+
+ set save $var(data,current)
+ for {set ii 1} {$ii<=$var(data,total)} {incr ii} {
+ set ${varname}(data,current) $ii
+ PlotCurrentData $varname
+
+ PlotSaveDataFile $varname "$fdir/plot$ii.dat"
+ PlotSaveConfigFile $varname "$fdir/plot$ii.plt"
+
+ puts $ch "PlotLoadDataFile $varname $fdir/plot$ii.dat $var(dim)"
+ puts $ch "PlotLoadConfigFile $varname $fdir/plot$ii.plt"
+ }
+ set ${varname}(data,current) $save
+ PlotCurrentData $varname
+ }
+ }
+}
diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl
new file mode 100644
index 0000000..136e34a
--- /dev/null
+++ b/ds9/library/plotbar.tcl
@@ -0,0 +1,201 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used by backup
+proc PlotBarTool {} {
+ global iap
+ PlotBar $iap(tt) [msgcat::mc {Bar Plot Tool}] {} {} {} 2 {}
+}
+
+proc PlotBar {tt wtt title xaxis yaxis dim data} {
+ global iap
+
+ # make the window name unique
+ set ii [lsearch $iap(windows) $tt]
+ if {$ii>=0} {
+ incr iap(unique)
+ append tt $iap(unique)
+ }
+
+ # set the window title if none
+ if {$wtt == {}} {
+ set wtt $tt
+ }
+
+ set varname $tt
+ upvar #0 $varname var
+ global $varname
+
+ PlotBarProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogBar $varname
+
+ PlotDataSet $varname $dim $data
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotBarDialog {varname wtt title xaxis yaxis} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotBarProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogBar $varname
+}
+
+proc PlotBarProc {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(proc,updategraph) PlotBarUpdateGraph
+ set var(proc,updateelement) PlotBarUpdateElement
+ set var(proc,highlite) PlotBarHighliteElement
+ set var(proc,button) PlotBarButton
+}
+
+proc PlotDialogBar {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ set var(seq) 1
+
+ # Graph
+ $var(mb).graph add separator
+ $var(mb).graph add cascade -label "[msgcat::mc {Mode}]..." \
+ -menu $var(mb).graph.mode
+
+ # Graph Mode
+ menu $var(mb).graph.mode
+ $var(mb).graph.mode add radiobutton -label [msgcat::mc {Normal}] \
+ -variable ${varname}(bar,mode) -value normal \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.mode add radiobutton -label [msgcat::mc {Stacked}] \
+ -variable ${varname}(bar,mode) -value stacked \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.mode add radiobutton -label [msgcat::mc {Aligned}] \
+ -variable ${varname}(bar,mode) -value aligned \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.mode add radiobutton -label [msgcat::mc {Overlap}] \
+ -variable ${varname}(bar,mode) -value overlap \
+ -command [list $var(proc,updategraph) $varname]
+
+ # Dataset
+ $var(mb).dataset add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(show) \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset add separator
+ $var(mb).dataset add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.color
+ $var(mb).dataset add cascade -label [msgcat::mc {Relief}] \
+ -menu $var(mb).dataset.relief
+ $var(mb).dataset add cascade -label [msgcat::mc {Error}] \
+ -menu $var(mb).dataset.error
+ $var(mb).dataset add separator
+ $var(mb).dataset add command -label "[msgcat::mc {Name}]..." \
+ -command [list DatasetNameDialog $varname]
+
+ PlotColorMenu $var(mb).dataset.color $varname color \
+ [list PlotBarUpdateElement $varname]
+
+ # Relief
+ menu $var(mb).dataset.relief
+ $var(mb).dataset.relief add radiobutton -label [msgcat::mc {Flat}] \
+ -variable ${varname}(bar,relief) -value flat \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.relief add radiobutton -label [msgcat::mc {Sunken}] \
+ -variable ${varname}(bar,relief) -value sunken \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.relief add radiobutton -label [msgcat::mc {Raised}] \
+ -variable ${varname}(bar,relief) -value raised \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.relief add radiobutton -label [msgcat::mc {Solid}] \
+ -variable ${varname}(bar,relief) -value solid \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.relief add radiobutton -label [msgcat::mc {Groove}] \
+ -variable ${varname}(bar,relief) -value groove \
+ -command [list PlotBarUpdateElement $varname]
+
+ # Error
+ menu $var(mb).dataset.error
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(error) \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Cap}] \
+ -variable ${varname}(error,cap) \
+ -command [list PlotBarUpdateElement $varname]
+ $var(mb).dataset.error add separator
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.error.color
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Width}] \
+ -menu $var(mb).dataset.error.width
+
+ PlotColorMenu $var(mb).dataset.error.color $varname error,color \
+ [list PlotBarUpdateElement $varname]
+ WidthDashMenu $var(mb).dataset.error.width $varname error,width {} \
+ [list PlotBarUpdateElement $varname] {}
+
+ # graph
+ set var(type) bar
+ set var(graph) [blt::barchart $var(top).bar \
+ -width 600 \
+ -height 500 \
+ -highlightthickness 0 \
+ ]
+
+ $var(graph) xaxis configure -grid no -stepsize 0
+ $var(graph) yaxis configure -grid yes
+
+ pack $var(graph) -expand yes -fill both
+ PlotChangeMode $varname
+}
+
+proc PlotBarUpdateGraph {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotUpdateGraph $varname
+ $var(graph) configure -barmode $var(bar,mode)
+}
+
+proc PlotBarUpdateElement {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set nn $var(data,current)
+ PlotGetVar $varname $nn
+
+ if {$var(error)} {
+ set show both
+ } else {
+ set show none
+ }
+
+ if {$var(error,cap)} {
+ set cap [expr $var(error,width)+3]
+ } else {
+ set cap 0
+ }
+
+ $var(graph) element configure "d-${nn}" \
+ -label $var(name) -hide [expr !$var(show)] \
+ -relief $var(bar,relief) -color $var(color) \
+ -showerrorbars $show -errorbarcolor $var(error,color) \
+ -errorbarwidth $var(error,width) -errorbarcap $cap
+}
+
+proc PlotBarButton {varname x y} {
+ upvar #0 $varname var
+ global $varname
+}
+
+proc PlotBarHighliteElement {varname rowlist} {
+ upvar #0 $varname var
+ global $varname
+}
diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl
new file mode 100644
index 0000000..8c6fccb
--- /dev/null
+++ b/ds9/library/plotdialog.tcl
@@ -0,0 +1,511 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PlotDialog {varname wtt title xaxis yaxis} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global pap
+
+ if {[PlotRaise $varname]} {
+ return
+ }
+
+ # add it to our xpa list
+ global iap
+ lappend iap(windows) $varname
+
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+ set var(stats) 0
+ set var(list) 0
+
+ set var(mode) zoom
+ set var(callback) {}
+
+ set var(data,total) 0
+ set var(data,current) 0
+
+ set var(name) {}
+ set var(xdata) {}
+ set var(ydata) {}
+ set var(xedata) {}
+ set var(yedata) {}
+
+ array set $varname [array get pap]
+
+ set var(graph,title) "$title"
+ set var(axis,x,title) "$xaxis"
+ set var(axis,y,title) "$yaxis"
+
+ # can be turned off for external line plots
+ set var(graph,format) 1
+
+ # create window
+ Toplevel $var(top) $var(mb) 7 $wtt [list PlotDestroy $varname]
+
+ $var(mb) add cascade -label [msgcat::mc {File}] -menu $var(mb).file
+ $var(mb) add cascade -label [msgcat::mc {Edit}] -menu $var(mb).edit
+ $var(mb) add cascade -label [msgcat::mc {Graph}] -menu $var(mb).graph
+ $var(mb) add cascade -label [msgcat::mc {Dataset}] -menu $var(mb).dataset
+ $var(mb) add cascade -label [msgcat::mc {Select}] -menu $var(mb).select
+
+ menu $var(mb).file
+ $var(mb).file add command -label "[msgcat::mc {Load Data}]..." \
+ -command [list PlotLoadData $varname]
+ $var(mb).file add command -label "[msgcat::mc {Save Data}]..." \
+ -command [list PlotSaveData $varname]
+ $var(mb).file add command -label [msgcat::mc {Clear Data}] \
+ -command [list PlotClearData $varname]
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Duplicate Data}] \
+ -command [list PlotDupData $varname 1]
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Statistics}] \
+ -command "set ${varname}(stats) 1; PlotStats $varname"
+ $var(mb).file add command -label [msgcat::mc {List Data}] \
+ -command "set ${varname}(list) 1; PlotList $varname"
+ $var(mb).file add separator
+ $var(mb).file add command -label "[msgcat::mc {Load Configuration}]..." \
+ -command [list PlotLoadConfig $varname]
+ $var(mb).file add command -label "[msgcat::mc {Save Configuration}]..." \
+ -command [list PlotSaveConfig $varname]
+ $var(mb).file add separator
+ switch $ds9(wm) {
+ x11 -
+ win32 {
+ $var(mb).file add command \
+ -label "[msgcat::mc {Page Setup}]..." \
+ -command PSPageSetup
+ $var(mb).file add command -label "[msgcat::mc {Print}]..." \
+ -command [list PlotPSPrint $varname]
+ }
+ aqua {
+ $var(mb).file add command \
+ -label "[msgcat::mc {Page Setup}]..." \
+ -command PSPageSetup
+ $var(mb).file add command -label "[msgcat::mc {Print}]..." \
+ -command [list PlotPSPrint $varname]
+# $var(mb).file add command -label "[msgcat::mc {Postscript Page Setup}]..." -command PSPageSetup
+# $var(mb).file add command -label "[msgcat::mc {Postscript Print}]..." -command [list PlotPSPrint $varname]
+ }
+ }
+ $var(mb).file add separator
+ $var(mb).file add command -label [msgcat::mc {Close}] \
+ -command [list PlotDestroy $varname]
+
+ menu $var(mb).edit
+ $var(mb).edit add command -label [msgcat::mc {Cut}] \
+ -state disabled -accelerator "${ds9(ctrl)}X"
+ $var(mb).edit add command -label [msgcat::mc {Copy}] \
+ -state disabled -accelerator "${ds9(ctrl)}C"
+ $var(mb).edit add command -label [msgcat::mc {Paste}] \
+ -state disabled -accelerator "${ds9(ctrl)}V"
+ $var(mb).edit add command -label [msgcat::mc {Clear}] \
+ -state disabled
+ $var(mb).edit add separator
+ $var(mb).edit add radiobutton -label [msgcat::mc {Pointer}] \
+ -variable ${varname}(mode) -value pointer \
+ -command [list PlotChangeMode $varname]
+ $var(mb).edit add radiobutton -label [msgcat::mc {Zoom}] \
+ -variable ${varname}(mode) -value zoom \
+ -command [list PlotChangeMode $varname]
+
+ # Graph
+ menu $var(mb).graph
+ $var(mb).graph add cascade -label [msgcat::mc {Axes}] \
+ -menu $var(mb).graph.axes
+ $var(mb).graph add cascade -label [msgcat::mc {Legend}] \
+ -menu $var(mb).graph.legend
+ $var(mb).graph add cascade -label [msgcat::mc {Font}] \
+ -menu $var(mb).graph.font
+ $var(mb).graph add separator
+ $var(mb).graph add command -label "[msgcat::mc {Title}]..." \
+ -command [list PlotTitleDialog $varname]
+
+ menu $var(mb).graph.axes
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {X Grid}] \
+ -variable ${varname}(axis,x,grid) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \
+ -variable ${varname}(axis,x,log) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \
+ -variable ${varname}(axis,x,flip) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add separator
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Y Grid}] \
+ -variable ${varname}(axis,y,grid) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \
+ -variable ${varname}(axis,y,log) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \
+ -variable ${varname}(axis,y,flip) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.axes add separator
+ $var(mb).graph.axes add command -label "[msgcat::mc {Range}]..." \
+ -command [list PlotRangeDialog $varname]
+
+ menu $var(mb).graph.legend
+ $var(mb).graph.legend add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(legend) \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.legend add separator
+ $var(mb).graph.legend add radiobutton -label [msgcat::mc {Right}] \
+ -variable ${varname}(legend,position) -value right \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.legend add radiobutton -label [msgcat::mc {Left}] \
+ -variable ${varname}(legend,position) -value left \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.legend add radiobutton -label [msgcat::mc {Top}] \
+ -variable ${varname}(legend,position) -value top \
+ -command [list $var(proc,updategraph) $varname]
+ $var(mb).graph.legend add radiobutton -label [msgcat::mc {Bottom}] \
+ -variable ${varname}(legend,position) -value bottom \
+ -command [list $var(proc,updategraph) $varname]
+
+ menu $var(mb).graph.font
+ $var(mb).graph.font add cascade -label [msgcat::mc {Title}] \
+ -menu $var(mb).graph.font.title
+ $var(mb).graph.font add cascade -label [msgcat::mc {Axes Title}] \
+ -menu $var(mb).graph.font.textlab
+ $var(mb).graph.font add cascade -label [msgcat::mc {Axes Number}] \
+ -menu $var(mb).graph.font.numlab
+ $var(mb).graph.font add cascade -label [msgcat::mc {Legend Title}] \
+ -menu $var(mb).graph.font.legendtitle
+ $var(mb).graph.font add cascade -label [msgcat::mc {Legend}] \
+ -menu $var(mb).graph.font.legend
+
+ FontMenu $var(mb).graph.font.title $varname graph,title,family graph,title,size graph,title,weight graph,title,slant [list $var(proc,updategraph) $varname]
+ FontMenu $var(mb).graph.font.textlab $varname axis,title,family axis,title,size axis,title,weight axis,title,slant [list $var(proc,updategraph) $varname]
+ FontMenu $var(mb).graph.font.numlab $varname axis,font,family axis,font,size axis,font,weight axis,font,slant [list $var(proc,updategraph) $varname]
+ FontMenu $var(mb).graph.font.legendtitle $varname legend,title,family legend,title,size legend,title,weight legend,title,slant [list $var(proc,updategraph) $varname]
+ FontMenu $var(mb).graph.font.legend $varname legend,font,family legend,font,size legend,font,weight legend,font,slant [list $var(proc,updategraph) $varname]
+
+ # dataset
+ menu $var(mb).dataset
+
+ # select
+ menu $var(mb).select
+}
+
+proc PlotChangeMode {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ blt::RemoveBindTag $var(graph) zoom-$var(graph)
+ bind $var(graph) <1> {}
+
+ switch $var(mode) {
+ pointer {bind $var(graph) <1> [list PlotButton $varname %x %y]}
+ zoom {
+ switch $ds9(wm) {
+ x11 -
+ win32 {Blt_ZoomStack $var(graph) -mode release}
+ aqua {Blt_ZoomStack $var(graph) -mode release -button "ButtonPress-2"}
+ }
+ }
+ }
+}
+
+proc PlotDataFormatDialog {xarname} {
+ upvar $xarname xar
+ global ed
+
+ set w {.apdata}
+
+ set ed(ok) 0
+ set ed(dim) $xar
+
+ DialogCreate $w [msgcat::mc {Data Format}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.title -text [msgcat::mc {Data Format}]
+ ttk::radiobutton $f.xy -text {X Y} -variable ed(dim) -value xy
+ ttk::radiobutton $f.xyex -text {X Y XErr} -variable ed(dim) -value xyex
+ ttk::radiobutton $f.xyey -text {X Y YErr} -variable ed(dim) -value xyey
+ ttk::radiobutton $f.xyexey -text {X Y XErr YErr} -variable ed(dim) \
+ -value xyexey
+
+ grid $f.title -padx 2 -pady 2 -sticky w
+ grid $f.xy -padx 2 -pady 2 -sticky w
+ grid $f.xyex -padx 2 -pady 2 -sticky w
+ grid $f.xyey -padx 2 -pady 2 -sticky w
+ grid $f.xyexey -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.param.xy
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set xar $ed(dim)
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PlotRangeDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ed
+
+ set w {.aptitle}
+
+ set ed(ok) 0
+
+ set ed(x,auto) $var(axis,x,auto)
+ set ed(x,min) $var(axis,x,min)
+ set ed(x,max) $var(axis,x,max)
+ set ed(x,format) $var(axis,x,format)
+
+ set ed(y,auto) $var(axis,y,auto)
+ set ed(y,min) $var(axis,y,min)
+ set ed(y,max) $var(axis,y,max)
+ set ed(y,format) $var(axis,y,format)
+
+ DialogCreate $w [msgcat::mc {Range}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.t -text [msgcat::mc {Axis}]
+ ttk::label $f.tto -text [msgcat::mc {To}]
+ ttk::label $f.tfrom -text [msgcat::mc {From}]
+ ttk::label $f.tformat -text [msgcat::mc {Format}]
+ ttk::label $f.tauto -text [msgcat::mc {Automatic}]
+
+ ttk::label $f.x -text [msgcat::mc {X}]
+ ttk::entry $f.xmin -textvariable ed(x,min) -width 12
+ ttk::entry $f.xmax -textvariable ed(x,max) -width 12
+ ttk::entry $f.xformat -textvariable ed(x,format) -width 8
+ ttk::checkbutton $f.xauto -variable ed(x,auto)
+
+ ttk::label $f.y -text [msgcat::mc {Y}]
+ ttk::entry $f.ymin -textvariable ed(y,min) -width 12
+ ttk::entry $f.ymax -textvariable ed(y,max) -width 12
+ ttk::entry $f.yformat -textvariable ed(y,format) -width 8
+ ttk::checkbutton $f.yauto -variable ed(y,auto)
+
+ grid $f.t $f.tfrom $f.tto $f.tformat $f.tauto -padx 2 -pady 2 -sticky w
+ grid $f.x $f.xmin $f.xmax $f.xformat $f.xauto -padx 2 -pady 2 -sticky w
+ grid $f.y $f.ymin $f.ymax $f.yformat $f.yauto -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.param.xmin
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set var(axis,x,auto) $ed(x,auto)
+ set var(axis,x,min) $ed(x,min)
+ set var(axis,x,max) $ed(x,max)
+ set var(axis,x,format) $ed(x,format)
+
+ set var(axis,y,auto) $ed(y,auto)
+ set var(axis,y,min) $ed(y,min)
+ set var(axis,y,max) $ed(y,max)
+ set var(axis,y,format) $ed(y,format)
+
+ $var(proc,updategraph) $varname
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PlotTitleDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ed
+
+ set w {.aptitle}
+
+ set ed(ok) 0
+ set ed(graph,title) $var(graph,title)
+ set ed(axis,x,title) $var(axis,x,title)
+ set ed(axis,y,title) $var(axis,y,title)
+ set ed(legend,title) $var(legend,title)
+
+ DialogCreate $w [msgcat::mc {Title}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.label -text [msgcat::mc {Plot Title}]
+ ttk::entry $f.title -textvariable ed(graph,title) -width 30
+ ttk::label $f.xlabel -text [msgcat::mc {X Axis Title}]
+ ttk::entry $f.xtitle -textvariable ed(axis,x,title) -width 30
+ ttk::label $f.ylabel -text [msgcat::mc {Y Axis Title}]
+ ttk::entry $f.ytitle -textvariable ed(axis,y,title) -width 30
+ ttk::label $f.legendlabel -text [msgcat::mc {Legend Title}]
+ ttk::entry $f.legendtitle -textvariable ed(legend,title) -width 30
+
+ grid $f.label $f.title -padx 2 -pady 2 -sticky ew
+ grid $f.xlabel $f.xtitle -padx 2 -pady 2 -sticky ew
+ grid $f.ylabel $f.ytitle -padx 2 -pady 2 -sticky ew
+ grid $f.legendlabel $f.legendtitle -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 1 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.param.title
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ set var(graph,title) $ed(graph,title)
+ set var(axis,x,title) $ed(axis,x,title)
+ set var(axis,y,title) $ed(axis,y,title)
+ set var(legend,title) $ed(legend,title)
+
+ $var(proc,updategraph) $varname
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc DatasetNameDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+ global ed
+
+ set w {.aptitle}
+
+ set ed(ok) 0
+ set ed(name) $var(name)
+
+ DialogCreate $w [msgcat::mc {Dataset}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.label -text [msgcat::mc {Dataset Name}]
+ ttk::entry $f.name -textvariable ed(name) -width 30
+
+ grid $f.label $f.name -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 1 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.param.name
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ $var(mb).select entryconfig "$var(name)" -label "$ed(name)"
+ set var(name) $ed(name)
+ $var(proc,updateelement) $varname
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PlotButton {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(proc,button) $varname $x $y
+}
+
+proc PlotLineShapeMenu {which var} {
+ menu $which
+ $which add radiobutton -label [msgcat::mc {None}] \
+ -variable $var -value none
+ $which add radiobutton -label [msgcat::mc {Circle}] \
+ -variable $var -value circle
+ $which add radiobutton -label [msgcat::mc {Square}] \
+ -variable $var -value square
+ $which add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable $var -value diamond
+ $which add radiobutton -label [msgcat::mc {Plus}] \
+ -variable $var -value plus
+ $which add radiobutton -label [msgcat::mc {Cross}] \
+ -variable $var -value cross
+ $which add radiobutton -label [msgcat::mc {Simple Plus}] \
+ -variable $var -value splus
+ $which add radiobutton -label [msgcat::mc {Simple Cross}] \
+ -variable $var -value scross
+ $which add radiobutton -label [msgcat::mc {Triangle}] \
+ -variable $var -value triangle
+ $which add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable $var -value arrow
+}
+
+proc PlotLineSmoothMenu {which var} {
+ menu $which
+ $which add radiobutton -label [msgcat::mc {Step}] \
+ -variable $var -value step
+ $which add radiobutton -label [msgcat::mc {Linear}] \
+ -variable $var -value linear
+ $which add radiobutton -label [msgcat::mc {Cubic}] \
+ -variable $var -value cubic
+ $which add radiobutton -label [msgcat::mc {Quadratic}] \
+ -variable $var -value quadratic
+ $which add radiobutton -label [msgcat::mc {Catrom}] \
+ -variable $var -value catrom
+}
diff --git a/ds9/library/plotelement.tcl b/ds9/library/plotelement.tcl
new file mode 100644
index 0000000..4fc8e68
--- /dev/null
+++ b/ds9/library/plotelement.tcl
@@ -0,0 +1,17 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PlotHighliteElement {varname rowlist} {
+ upvar #0 $varname var
+ global $varname
+
+ # rowlist starts at 1
+ set result {}
+ foreach rr $rowlist {
+ append result "[expr $rr-1] "
+ }
+ $var(proc,highlite) $varname $result
+}
diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl
new file mode 100644
index 0000000..b6c0fe5
--- /dev/null
+++ b/ds9/library/plotline.tcl
@@ -0,0 +1,281 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used by backup
+proc PlotLineTool {} {
+ global iap
+ PlotLine $iap(tt) [msgcat::mc {Line Plot Tool}] {} {} {} 2 {}
+}
+
+proc PlotLine {tt wtt title xaxis yaxis dim data} {
+ global iap
+
+ # make the window name unique
+ set ii [lsearch $iap(windows) $tt]
+ if {$ii>=0} {
+ incr iap(unique)
+ append tt $iap(unique)
+ }
+
+ # set the window title if none
+ if {$wtt == {}} {
+ set wtt $tt
+ }
+
+ set varname $tt
+ upvar #0 $varname var
+ global $varname
+
+ PlotLineProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogLine $varname
+
+ PlotDataSet $varname $dim $data
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotLineDialog {varname wtt title xaxis yaxis} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotLineProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogLine $varname
+}
+
+proc PlotLineProc {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(proc,updategraph) PlotUpdateGraph
+ set var(proc,updateelement) PlotLineUpdateElement
+ set var(proc,highlite) PlotLineHighliteElement
+ set var(proc,button) PlotLineButton
+}
+
+proc PlotDialogLine {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ set var(seq) 1
+
+ # Dataset
+ $var(mb).dataset add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(show) \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset add separator
+ $var(mb).dataset add cascade -label [msgcat::mc {Shape}] \
+ -menu $var(mb).dataset.shape
+ $var(mb).dataset add cascade -label [msgcat::mc {Smooth}] \
+ -menu $var(mb).dataset.smooth
+ $var(mb).dataset add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.color
+ $var(mb).dataset add cascade -label [msgcat::mc {Width}] \
+ -menu $var(mb).dataset.width
+ $var(mb).dataset add cascade -label [msgcat::mc {Fill}] \
+ -menu $var(mb).dataset.fill
+ $var(mb).dataset add cascade -label [msgcat::mc {Error}] \
+ -menu $var(mb).dataset.error
+ $var(mb).dataset add separator
+ $var(mb).dataset add command -label "[msgcat::mc {Name}]..." \
+ -command [list DatasetNameDialog $varname]
+
+ # Shape
+ menu $var(mb).dataset.shape
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {None}] \
+ -variable ${varname}(shape,symbol) -value none \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Circle}] \
+ -variable ${varname}(shape,symbol) -value circle \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Square}] \
+ -variable ${varname}(shape,symbol) -value square \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Diamond}] \
+ -variable ${varname}(shape,symbol) -value diamond \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Plus}] \
+ -variable ${varname}(shape,symbol) -value plus \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Cross}] \
+ -variable ${varname}(shape,symbol) -value cross \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Simple Plus}] \
+ -variable ${varname}(shape,symbol) -value splus \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Simple Cross}] \
+ -variable ${varname}(shape,symbol) -value scross \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Triangle}] \
+ -variable ${varname}(shape,symbol) -value triangle \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Arrow}] \
+ -variable ${varname}(shape,symbol) -value arrow \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add separator
+ $var(mb).dataset.shape add checkbutton \
+ -label [msgcat::mc {Fill}] \
+ -variable ${varname}(shape,fill) \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.shape add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.shape.color
+
+ PlotColorMenu $var(mb).dataset.shape.color $varname shape,color \
+ [list PlotLineUpdateElement $varname]
+
+ # Smooth
+ menu $var(mb).dataset.smooth
+ $var(mb).dataset.smooth add radiobutton \
+ -label [msgcat::mc {Step}] \
+ -variable ${varname}(smooth) -value step \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.smooth add radiobutton \
+ -label [msgcat::mc {Linear}] \
+ -variable ${varname}(smooth) -value linear \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.smooth add radiobutton \
+ -label [msgcat::mc {Cubic}] \
+ -variable ${varname}(smooth) -value cubic \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.smooth add radiobutton \
+ -label [msgcat::mc {Quadratic}] \
+ -variable ${varname}(smooth) -value quadratic \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.smooth add radiobutton \
+ -label [msgcat::mc {Catrom}] \
+ -variable ${varname}(smooth) -value catrom \
+ -command [list PlotLineUpdateElement $varname]
+
+ # Color
+ PlotColorMenu $var(mb).dataset.color $varname color \
+ [list PlotLineUpdateElement $varname]
+
+ # Width
+ WidthDashMenu $var(mb).dataset.width $varname width dash \
+ [list PlotLineUpdateElement $varname] \
+ [list PlotLineUpdateElement $varname]
+
+ # Fill
+ menu $var(mb).dataset.fill
+ $var(mb).dataset.fill add checkbutton \
+ -label [msgcat::mc {Show}] \
+ -variable ${varname}(fill) \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.fill add separator
+ $var(mb).dataset.fill add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.fill.color
+
+ PlotColorMenu $var(mb).dataset.fill.color $varname fill,color \
+ [list PlotLineUpdateElement $varname]
+
+ # Error
+ menu $var(mb).dataset.error
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(error) \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Cap}] \
+ -variable ${varname}(error,cap) \
+ -command [list PlotLineUpdateElement $varname]
+ $var(mb).dataset.error add separator
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.error.color
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Width}] \
+ -menu $var(mb).dataset.error.width
+
+ PlotColorMenu $var(mb).dataset.error.color $varname error,color \
+ [list PlotLineUpdateElement $varname]
+ WidthDashMenu $var(mb).dataset.error.width $varname error,width {} \
+ [list PlotLineUpdateElement $varname] {}
+
+ # graph
+ set var(type) line
+ set var(graph) [blt::graph $var(top).line \
+ -width 600 \
+ -height 500 \
+ -highlightthickness 0 \
+ ]
+
+ pack $var(graph) -expand yes -fill both
+ PlotChangeMode $varname
+}
+
+proc PlotLineUpdateElement {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # warning: uses current vars
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ set nn $var(data,current)
+ PlotGetVar $varname $nn
+
+ if {$var(fill)} {
+ set fillClr $var(fill,color)
+ } else {
+ set fillClr {}
+ }
+
+ if {$var(shape,fill)} {
+ set clr $var(shape,color)
+ } else {
+ set clr {}
+ }
+
+ if {$var(dash)} {
+ set dash {8 3}
+ } else {
+ set dash { }
+ }
+
+ if {$var(error)} {
+ set show both
+ } else {
+ set show none
+ }
+
+ if {$var(error,cap)} {
+ set cap [expr $var(error,width)+3]
+ } else {
+ set cap 0
+ }
+
+ $var(graph) element configure "d-${nn}" \
+ -label $var(name) -hide [expr !$var(show)] \
+ -symbol $var(shape,symbol) -fill $clr -scalesymbols no \
+ -pixels 5 -outline $var(shape,color) \
+ -smooth $var(smooth) \
+ -color $var(color) -areabackground $fillClr \
+ -linewidth $var(width) -dashes $dash \
+ -showerrorbars $show -errorbarcolor $var(error,color) \
+ -errorbarwidth $var(error,width) -errorbarcap $cap
+}
+
+proc PlotLineButton {varname x y} {
+ upvar #0 $varname var
+ global $varname
+}
+
+proc PlotLineHighliteElement {varname rowlist} {
+ upvar #0 $varname var
+ global $varname
+}
+
diff --git a/ds9/library/plotprint.tcl b/ds9/library/plotprint.tcl
new file mode 100644
index 0000000..ac83384
--- /dev/null
+++ b/ds9/library/plotprint.tcl
@@ -0,0 +1,114 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PlotPSPrint {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {[PlotPrintDialog]} {
+ if {[catch {PlotPostScript $varname} printError]} {
+ Error "[msgcat::mc {An error has occurred while printing}] $printError"
+ }
+ }
+}
+
+proc PlotPostScript {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ps
+ global ds9
+
+ # set postscript fonts
+ $var(graph) configure \
+ -font "$var(graph,title,family) $var(graph,title,size) $var(graph,title,weight) $var(graph,title,slant)"
+
+ $var(graph) xaxis configure \
+ -tickfont "$var(axis,font,family) $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "$var(axis,title,family) $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+
+ $var(graph) yaxis configure \
+ -tickfont "$var(axis,font,family) $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "$var(axis,title,family) $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+
+ $var(graph) legend configure \
+ -font "$var(legend,font,family) $var(legend,font,size) $var(legend,font,weight) $var(legend,font,slant)" \
+ -titlefont "$var(legend,title,family) $var(legend,title,size) $var(legend,title,weight) $var(legend,title,slant)"
+
+ set options "-decorations false"
+
+ # Color
+ switch -- $ps(color) {
+ rgb -
+ cmyk {append options " -greyscale no"}
+ gray {append options " -greyscale yes"}
+ }
+
+ # can't trust 'tk scaling'
+ switch $ds9(wm) {
+ x11 -
+ win32 {set scaling [tk scaling]}
+ aqua {set scaling 1.4}
+ }
+
+ # Size
+ set ww [expr [winfo width $var(top)]*$ps(scale)/100./$scaling]
+ set hh [expr [winfo height $var(top)]*$ps(scale)/100./$scaling]
+ append options " -width $ww -height $hh"
+
+ # Page size
+ switch -- $ps(size) {
+ letter {append options " -paperwidth 8.5i -paperheight 11.i"}
+ legal {append options " -paperwidth 8.5i -paperheight 14.i"}
+ tabloid {append options " -paperwidth 11i -paperheight 17.i"}
+ poster {append options " -paperwidth 36.i -paperheight 48.i"}
+ a4 {append options " -paperwidth 195m -paperheight 282m"}
+ other {
+ if {$ps(width) != {} && $ps(height) != {}} {
+ set pgww "[append ps(width) i]"
+ set pghh "[append ps(height) i]"
+ append options " -paperwidth $pgww -paperheight pghh"
+ }
+ }
+ othermm {
+ if {$ps(width) != {} && $ps(height) != {}} {
+ set pgww "[append ps(width) m]"
+ set pghh "[append ps(height) m]"
+ append options " -paperwidth $pgww -paperheight pghh"
+ }
+ }
+ }
+
+ # Orientation
+ switch -- $ps(orient) {
+ portrait {append options " -landscape false"}
+ landscape {append options " -landscape true"}
+ }
+
+ if {$ps(dest) == "file" && $ps(filename) != {}} {
+ eval $var(graph) postscript output $ps(filename) $options
+ } else {
+ set ch [open "| $ps(cmd)" w]
+ puts $ch [eval $var(graph) postscript output $options]
+ close $ch
+ }
+
+ # reset fonts
+ $var(graph) configure \
+ -font "{$ds9($var(graph,title,family))} $var(graph,title,size) $var(graph,title,weight) $var(graph,title,slant)"
+
+ $var(graph) xaxis configure \
+ -tickfont "{$ds9($var(axis,font,family))} $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "{$ds9($var(axis,title,family))} $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+
+ $var(graph) yaxis configure \
+ -tickfont "{$ds9($var(axis,font,family))} $var(axis,font,size) $var(axis,font,weight) $var(axis,font,slant)" \
+ -titlefont "{$ds9($var(axis,title,family))} $var(axis,title,size) $var(axis,title,weight) $var(axis,title,slant)"
+
+ $var(graph) legend configure \
+ -font "{$ds9($var(legend,font,family))} $var(legend,font,size) $var(legend,font,weight) $var(legend,font,slant)" \
+ -titlefont "{$ds9($var(legend,title,family))} $var(legend,title,size) $var(legend,title,weight) $var(legend,title,slant)"
+}
diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl
new file mode 100644
index 0000000..3b43cd4
--- /dev/null
+++ b/ds9/library/plotprocess.tcl
@@ -0,0 +1,1217 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PrefsDialogPlot {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Plot}]
+ lappend dprefs(tabs) [ttk::frame $w.plot]
+
+ # Grid
+ set f [ttk::labelframe $w.plot.grid -text [msgcat::mc {Grid}]]
+ ttk::label $f.ttitle -text [msgcat::mc {Title}]
+ FontMenuButton $f.title pap graph,title,family graph,title,size graph,title,weight graph,title,slant {}
+
+ grid $f.ttitle $f.title -padx 2 -pady 2 -sticky w
+
+ # Axis
+ set f [ttk::labelframe $w.plot.axis -text [msgcat::mc {Axis}]]
+
+ ttk::label $f.xtitle -text [msgcat::mc {X}]
+ ttk::checkbutton $f.x -text [msgcat::mc {Grid}] -variable pap(axis,x,grid)
+ ttk::radiobutton $f.xlinear -text [msgcat::mc {Linear}] \
+ -variable pap(axis,x,log) -value 0
+ ttk::radiobutton $f.xlog -text [msgcat::mc {Log}] \
+ -variable pap(axis,x,log) -value 1
+
+ ttk::label $f.ytitle -text [msgcat::mc {Y}]
+ ttk::checkbutton $f.y -text [msgcat::mc {Grid}] -variable pap(axis,y,grid)
+ ttk::radiobutton $f.ylinear -text [msgcat::mc {Linear}] \
+ -variable pap(axis,y,log) -value 0
+ ttk::radiobutton $f.ylog -text [msgcat::mc {Log}] \
+ -variable pap(axis,y,log) -value 1
+
+ ttk::label $f.ttextlab -text [msgcat::mc {Axis Title}]
+ FontMenuButton $f.textlab pap axis,title,family axis,title,size axis,title,weight axis,title,slant {}
+ ttk::label $f.tnumlab -text [msgcat::mc {Axis Numbers}]
+ FontMenuButton $f.numlab pap axis,font,family axis,font,size axis,font,weight axis,font,slant {}
+
+ grid $f.xtitle $f.x $f.xlinear $f.xlog -padx 2 -pady 2 -sticky w
+ grid $f.ytitle $f.y $f.ylinear $f.ylog -padx 2 -pady 2 -sticky w
+ grid $f.ttextlab $f.textlab -padx 2 -pady 2 -sticky w
+ grid $f.tnumlab $f.numlab -padx 2 -pady 2 -sticky w
+
+ # Dataset
+ set f [ttk::labelframe $w.plot.dataset -text [msgcat::mc {Dataset}]]
+
+ # Show
+ ttk::checkbutton $f.show -text [msgcat::mc {Show}] -variable pap(show)
+ grid $f.show -padx 2 -pady 2 -sticky w
+
+ # Shape
+ ttk::label $f.shapetitle -text [msgcat::mc {Shape}]
+ ttk::menubutton $f.shape -textvariable pap(shape,symbol) \
+ -menu $f.shape.menu
+ PlotLineShapeMenu $f.shape.menu pap(shape,symbol)
+ ttk::checkbutton $f.shapefill -text [msgcat::mc {Fill}] \
+ -variable pap(shape,fill)
+ ColorMenuButton $f.shapecolor pap shape,color {}
+ grid $f.shapetitle $f.shape $f.shapefill $f.shapecolor \
+ -padx 2 -pady 2 -sticky w
+
+ # Smooth
+ ttk::label $f.smoothtitle -text [msgcat::mc {Smooth}]
+ ttk::menubutton $f.smooth -textvariable pap(smooth) \
+ -menu $f.smooth.menu
+ PlotLineSmoothMenu $f.smooth.menu pap(smooth)
+ grid $f.smoothtitle $f.smooth -padx 2 -pady 2 -sticky w
+
+ # Color
+ ttk::label $f.colortitle -text [msgcat::mc {Color}]
+ ColorMenuButton $f.color pap color {}
+ grid $f.colortitle $f.color -padx 2 -pady 2 -sticky w
+
+ # Width
+ ttk::label $f.widthtitle -text [msgcat::mc {Width}]
+ ttk::menubutton $f.width -textvariable pap(width) -menu $f.width.menu
+ WidthDashMenu $f.width.menu pap width dash {} {}
+ grid $f.widthtitle $f.width -padx 2 -pady 2 -sticky w
+
+ # Error
+ ttk::label $f.errortitle -text [msgcat::mc {Error}]
+ ttk::checkbutton $f.error -text [msgcat::mc {Show}] \
+ -variable pap(error)
+ ttk::checkbutton $f.errorcap -text [msgcat::mc {Cap}] \
+ -variable pap(error,cap)
+ ColorMenuButton $f.errorcolor pap error,color {}
+ ttk::menubutton $f.errorwidth -textvariable pap(error,width) \
+ -menu $f.errorwidth.menu
+ WidthDashMenu $f.errorwidth.menu pap width dash {} {}
+ grid $f.errortitle $f.error $f.errorcap $f.errorcolor $f.errorwidth \
+ -padx 2 -pady 2 -sticky w
+
+ pack $w.plot.grid $w.plot.axis $w.plot.dataset \
+ -side top -fill both -expand true
+}
+
+proc ProcessPlotCmd {xarname iname buf fn} {
+ upvar $xarname xar
+ upvar $iname i
+
+ global iap
+ set varname $iap(tt)
+ set id 0
+
+ # check for next command line option
+ if {[string range [lindex $xar $i] 0 0] != {-}} {
+
+ # determine which plot
+ switch -- [string tolower [lindex $xar $i]] {
+ {} -
+ bar -
+ scatter -
+ new {}
+
+ data -
+ load -
+ save -
+ clear -
+ dup -
+ duplicate -
+ stats -
+ statistics -
+ list -
+ loadconfig -
+ saveconfig -
+ page -
+ pagesetup -
+ print -
+ close -
+
+ mode -
+ axis -
+ legend -
+ font -
+ title -
+ show -
+ color -
+ fill -
+ fillcolor -
+ error -
+ errorbar -
+ barmode -
+ name -
+ shape -
+ relief -
+ smooth -
+ width -
+ dash -
+ dataset -
+ select -
+
+ graph -
+ line -
+ view {
+ set varname [lindex $iap(windows) end]
+ set id [lsearch $iap(windows) $varname]
+ }
+
+ default {
+ set varname [lindex $xar $i]
+ set id [lsearch $iap(windows) $varname]
+ incr i
+ }
+ }
+ }
+
+ # we better have a tt by now
+ if {$id == -1} {
+ Error "[msgcat::mc {Unable to find plot window}] $varname"
+ return
+ }
+
+ upvar #0 $varname var
+ global $varname
+
+ # check for next command line option
+ if {[string range [lindex $xar $i] 0 0] != {-}} {
+
+ # now, process plot command
+ switch -- [string tolower [lindex $xar $i]] {
+ {} -
+ bar -
+ scatter {
+ if {$buf != {}} {
+ ProcessPlotNew $varname $xarname $iname $buf
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set txt [read $ch]
+ close $ch
+ ProcessPlotNew $varname $xarname $iname $txt
+ }
+ } else {
+ ProcessPlotNew $varname $xarname $iname {}
+ }
+ }
+ new {
+ incr i
+ switch -- [lindex $xar $i] {
+ name {
+ set varname [lindex $xar [expr $i+1]]
+ incr i 2
+ }
+ }
+ if {$buf != {}} {
+ ProcessPlotNew $varname $xarname $iname $buf
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set txt [read $ch]
+ close $ch
+ ProcessPlotNew $varname $xarname $iname $txt
+ }
+ } else {
+ ProcessPlotNew $varname $xarname $iname {}
+ }
+ }
+ data {
+ incr i
+ if {$buf != {}} {
+ ProcessPlotData $varname $xarname $iname $buf
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set txt [read $ch]
+ close $ch
+ ProcessPlotData $varname $xarname $iname $txt
+ }
+ }
+ }
+
+ load {
+ # File Menu
+ set ff [lindex $xar [expr $i+1]]
+ set dim [lindex $xar [expr $i+2]]
+ incr i 2
+ PlotLoadDataFile $varname $ff $dim
+ FileLast apdatafbox $ff
+ }
+ save {
+ # File Menu
+ incr i
+ set ff [lindex $xar $i]
+ PlotSaveDataFile $varname $ff
+ FileLast apdatafbox $ff
+ }
+ clear {
+ # File Menu
+ PlotClearData $varname
+ }
+ dup -
+ duplicate {
+ # File Menu
+ incr i
+ set mm [lindex $xar $i]
+ if {$mm == {}} {
+ set mm 1
+ } elseif {![string is integer $mm]} {
+ set mm 1
+ incr i -1
+ }
+ PlotDupData $varname $mm
+ }
+ stats -
+ statistics {
+ # File Menu
+ set var(stats) 1
+ PlotStats $varname
+ }
+ list {
+ # File Menu
+ set var(list) 1
+ PlotList $varname
+ }
+ loadconfig {
+ # File Menu
+ incr i
+ set ff [lindex $xar $i]
+ PlotLoadConfigFile $varname $ff
+ FileLast apconfigfbox $ff
+ }
+ saveconfig {
+ # File Menu
+ incr i
+ set ff [lindex $xar $i]
+ PlotSaveConfigFile $varname $ff
+ FileLast apconfigfbox $ff
+ }
+ page -
+ pagesetup {
+ # File Menu
+ incr i
+ ProcessPlotPageSetup $varname $xarname $iname
+ }
+ print {
+ # File Menu
+ incr i
+ ProcessPlotPrint $varname $xarname $iname
+ }
+ close {
+ # File Menu
+ PlotDestroy $varname
+ }
+
+ mode {
+ # Edit Menu
+ incr i
+ set var(mode) [lindex $xar $i]
+ PlotChangeMode $varname
+ }
+
+ axis {
+ # Graph Menu
+ incr i
+ ProcessPlotAxis $varname $xarname $iname
+ }
+ legend {
+ # Graph Menu
+ incr i
+ ProcessPlotLegend $varname $xarname $iname
+ }
+ font {
+ # Graph Menu
+ incr i
+ ProcessPlotFont $varname $xarname $iname
+ }
+ title {
+ # Graph Menu
+ incr i
+ ProcessPlotTitle $varname $xarname $iname
+ }
+ barmode {
+ incr i
+ set var(bar,mode) [lindex $xar $i]
+ $var(proc,updategraph) $varname
+ }
+
+ show {
+ # Dataset Menu
+ incr i
+ set var(show) [FromYesNo [lindex $xar $i]]
+ $var(proc,updateelement) $varname
+ }
+ color {
+ incr i
+ ProcessPlotColor $varname $xarname $iname
+ }
+ fill {
+ incr i
+ set var(fill) [FromYesNo [lindex $xar $i]]
+ $var(proc,updateelement) $varname
+ }
+ fillcolor {
+ incr i
+ set var(fill,color) [lindex $xar $i]
+ $var(proc,updateelement) $varname
+ }
+ error -
+ errorbar {
+ # Dataset Menu
+ incr i
+ ProcessPlotErrorBar $varname $xarname $iname
+ }
+ name {
+ # Dataset Menu
+ incr i
+ set var(name) [lindex $xar $i]
+ $var(proc,updateelement) $varname
+ }
+ shape {
+ # Dataset Line Menu
+ incr i
+ ProcessPlotShape $varname $xarname $iname
+ }
+ relief {
+ # Dataset Bar Menu
+ incr i
+ set var(bar,relief) [lindex $xar $i]
+ $var(proc,updateelement) $varname
+ }
+ smooth {
+ # Dataset Line Menu
+ incr i
+ set var(smooth) [lindex $xar $i]
+ $var(proc,updateelement) $varname
+ }
+ width {
+ # Dataset Line Menu
+ incr i
+ set var(width) [lindex $xar $i]
+ $var(proc,updateelement) $varname
+ }
+ dash {
+ # Dataset Line Menu
+ incr i
+ set var(dash) [FromYesNo [lindex $xar $i]]
+ $var(proc,updateelement) $varname
+ }
+
+ dataset -
+ select {
+ # Select Menu
+ incr i
+ set var(data,current) [lindex $xar $i]
+ PlotCurrentData $varname
+ }
+
+ graph {
+ # backward compatibility
+ incr i
+ ProcessPlotGraph $varname $xarname $iname
+ }
+ line {
+ # backward compatibility
+ incr i
+ ProcessPlotLine $varname $xarname $iname
+ }
+ view {
+ # backward compatibility
+ incr i
+ ProcessPlotView $varname $xarname $iname
+ }
+ }
+ } else {
+ ProcessPlotNew $varname $xarname $iname {}
+ }
+
+ # force update
+ update idletasks
+}
+
+proc ProcessPlotNew {varname xarname iname buf} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ # check for next command line option
+ if {[string range [lindex $xar $i] 0 0] != {-}} {
+ switch -- [string tolower [lindex $xar $i]] {
+ line {incr i; ProcessPlotNewOne line $varname $xarname $iname $buf}
+ bar {incr i;ProcessPlotNewOne bar $varname $xarname $iname $buf}
+ scatter {
+ incr i
+ ProcessPlotNewOne scatter $varname $xarname $iname $buf
+ }
+ default {ProcessPlotNewOne line $varname $xarname $iname $buf}
+ }
+ } else {
+ PlotLine $varname {} {} {} {} xy $buf
+ incr i -1
+ }
+}
+
+proc ProcessPlotNewOne {which varname xarname iname buf} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 3 $xarname xar
+ upvar 3 $iname i
+
+ if {[string range [lindex $xar $i] 0 0] != {-}} {
+ switch -- [string tolower [lindex $xar $i]] {
+ stdin {incr i; AnalysisPlotStdin $which $varname {} $buf}
+ {} {
+ switch $which {
+ line {PlotLine $varname {} {} {} {} xy $buf}
+ bar {PlotBar $varname {} {} {} {} xy $buf}
+ scatter {PlotScatter $varname {} {} {} {} xy $buf}
+ }
+ }
+ default {
+ switch $which {
+ line {
+ PlotLine $varname {} \
+ [lindex $xar $i] \
+ [lindex $xar [expr $i+1]] \
+ [lindex $xar [expr $i+2]] \
+ [lindex $xar [expr $i+3]] \
+ $buf
+ }
+ bar {
+ PlotBar $varname {} \
+ [lindex $xar $i] \
+ [lindex $xar [expr $i+1]] \
+ [lindex $xar [expr $i+2]] \
+ [lindex $xar [expr $i+3]] \
+ $buf
+ }
+ scatter {
+ PlotScatter $varname {} \
+ [lindex $xar $i] \
+ [lindex $xar [expr $i+1]] \
+ [lindex $xar [expr $i+2]] \
+ [lindex $xar [expr $i+3]] \
+ $buf
+ }
+ }
+ incr i 3
+ }
+ }
+ } else {
+ switch $which {
+ line {PlotLine $varname {} {} {} {} xy $buf}
+ bar {PlotBar $varname {} {} {} {} xy $buf}
+ scatter {PlotScatter $varname {} {} {} {} xy $buf}
+ }
+ incr i -1
+ }
+}
+
+proc ProcessPlotData {varname xarname iname buf} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ PlotRaise $varname
+ PlotDataSet $varname [lindex $xar $i] $buf
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+# File Menu
+proc ProcessPlotPrint {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ global ps
+ global current
+
+ switch -- [string tolower [lindex $xar $i]] {
+ destination {incr i; set ps(dest) [lindex $xar $i]}
+ command {incr i; set ps(cmd) [lindex $xar $i]}
+ filename {incr i; set ps(filename) [lindex $xar $i] }
+ palette -
+ color {incr i; set ps(color) [lindex $xar $i] }
+
+ {} {PlotPostScript $varname}
+ default {incr i -1; PlotPostScript $varname}
+ }
+}
+
+proc ProcessPlotPageSetup {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ global ps
+
+ switch -- [string tolower [lindex $xar $i]] {
+ orientation -
+ orient {incr i; set ps(orient) [lindex $xar $i]}
+ pagesize -
+ size {incr i; set ps(size) [lindex $xar $i] }
+ }
+}
+
+# Graph Menu
+proc ProcessPlotAxis {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ x {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ grid {incr i; set var(axis,x,grid) [FromYesNo [lindex $xar $i]]}
+ log {incr i; set var(axis,x,log) [FromYesNo [lindex $xar $i]]}
+ flip {incr i; set var(axis,x,flip) [FromYesNo [lindex $xar $i]]}
+ auto {incr i; set var(axis,x,auto) [FromYesNo [lindex $xar $i]]}
+ min {incr i; set var(axis,x,min) [lindex $xar $i]}
+ max {incr i; set var(axis,x,max) [lindex $xar $i]}
+ format {incr i; set var(axis,x,format) [lindex $xar $i]}
+ }
+ }
+ y {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ grid {incr i; set var(axis,y,grid) [FromYesNo [lindex $xar $i]]}
+ log {incr i; set var(axis,y,log) [FromYesNo [lindex $xar $i]]}
+ flip {incr i; set var(axis,y,flip) [FromYesNo [lindex $xar $i]]}
+ auto {incr i; set var(axis,y,auto) [FromYesNo [lindex $xar $i]]}
+ min {incr i; set var(axis,y,min) [lindex $xar $i]}
+ max {incr i; set var(axis,y,max) [lindex $xar $i]}
+ format {incr i; set var(axis,y,format) [lindex $xar $i]}
+ }
+ }
+ }
+
+ $var(proc,updategraph) $varname
+}
+
+proc ProcessPlotLegend {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ position {incr i; set var(legend,position) [lindex $xar $i]}
+ default {set var(legend) [FromYesNo [lindex $xar $i]]}
+ }
+
+ $var(proc,updategraph) $varname
+}
+
+proc ProcessPlotFont {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ title {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ family -
+ font {incr i; set var(graph,title,family) [lindex $xar $i]}
+ size {incr i; set var(graph,title,size) [lindex $xar $i]}
+ weight {incr i; set var(graph,title,weight) [lindex $xar $i]}
+ slant {incr i; set var(graph,title,slant) [lindex $xar $i]}
+ style {
+ incr i
+ switch [string tolower [lindex $xar $i]] {
+ normal {
+ set var(graph,title,weight) normal
+ set var(graph,title,slant) roman
+ }
+ bold {
+ set var(graph,title,weight) bold
+ set var(graph,title,slant) roman
+ }
+ italic {
+ set var(graph,title,weight) normal
+ set var(graph,title,slant) italic
+ }
+ }
+ }
+ }
+ }
+ axestitle -
+ labels {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ family -
+ font {incr i; set var(axis,title,family) [lindex $xar $i]}
+ size {incr i; set var(axis,title,size) [lindex $xar $i]}
+ weight {incr i; set var(axis,title,weight) [lindex $xar $i]}
+ slant {incr i; set var(axis,title,slant) [lindex $xar $i]}
+ style {
+ incr i
+ switch [string tolower [lindex $xar $i]] {
+ normal {
+ set var(axis,title,weight) normal
+ set var(axis,title,slant) roman
+ }
+ bold {
+ set var(axis,title,weight) bold
+ set var(axis,title,slant) roman
+ }
+ italic {
+ set var(axis,title,weight) normal
+ set var(axis,title,slant) italic
+ }
+ }
+ }
+ }
+ }
+ axesnumbers -
+ numbers {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ family -
+ font {incr i; set var(axis,font,family) [lindex $xar $i]}
+ size {incr i; set var(axis,font,size) [lindex $xar $i]}
+ weight {incr i; set var(axis,font,weight) [lindex $xar $i]}
+ slant {incr i; set var(axis,font,slant) [lindex $xar $i]}
+ style {
+ incr i
+ switch [string tolower [lindex $xar $i]] {
+ normal {
+ set var(axis,font,weight) normal
+ set var(axis,font,slant) roman
+ }
+ bold {
+ set var(axis,font,weight) bold
+ set var(axis,font,slant) roman
+ }
+ italic {
+ set var(axis,font,weight) normal
+ set var(axis,font,slant) italic
+ }
+ }
+ }
+ }
+ }
+ legendtitle {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ family -
+ font {incr i; set var(legend,title,family) [lindex $xar $i]}
+ size {incr i; set var(legend,title,size) [lindex $xar $i]}
+ weight {incr i; set var(legend,title,weight) [lindex $xar $i]}
+ slant {incr i; set var(legend,title,slant) [lindex $xar $i]}
+ }
+ }
+ legend {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ family -
+ font {incr i; set var(legend,font,family) [lindex $xar $i]}
+ size {incr i; set var(legend,font,size) [lindex $xar $i]}
+ weight {incr i; set var(legend,font,weight) [lindex $xar $i]}
+ slant {incr i; set var(legend,font,slant) [lindex $xar $i]}
+ }
+ }
+ }
+
+ $var(proc,updategraph) $varname
+}
+
+proc ProcessPlotTitle {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ x -
+ xaxis {incr i; set var(axis,x,title) [lindex $xar $i]}
+ y -
+ yaxis {incr i; set var(axis,y,title) [lindex $xar $i]}
+ legend {incr i; set var(legend,title) [lindex $xar $i]}
+ default {set var(graph,title) [lindex $xar $i]}
+ }
+
+ $var(proc,updategraph) $varname
+}
+
+proc ProcessPlotErrorBar {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ cap {incr i; set var(error,cap) [FromYesNo [lindex $xar $i]]}
+ color {incr i; set var(error,color) [lindex $xar $i]}
+ width {incr i; set var(error,width) [lindex $xar $i]}
+ default {set var(error) [FromYesNo [lindex $xar $i]]}
+ }
+
+ $var(proc,updateelement) $varname
+}
+
+# Dataset Menu
+proc ProcessPlotShape {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ fill {incr i; set var(shape,fill) [FromYesNo [lindex $xar $i]]}
+ color {incr i; set var(shape,color) [lindex $xar $i]}
+ default {set var(shape,symbol) [lindex $xar $i]}
+ }
+
+ $var(proc,updateelement) $varname
+}
+
+proc ProcessPlotColor {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ discrete -
+ line -
+ linear -
+ step -
+ quadratic -
+ bar {
+ # backward compatibility
+ incr i
+ set var(color) [lindex $xar $i]
+ }
+ error -
+ errorbar {
+ # backward compatibility
+ incr i
+ set var(error,color) [lindex $xar $i]
+ }
+ default {
+ # Dataset Menu
+ set var(color) [lindex $xar $i]
+ }
+ }
+
+ $var(proc,updateelement) $varname
+}
+
+# backward compatibility
+proc ProcessPlotGraph {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ grid {
+ incr i;
+ switch -- [string tolower [lindex $xar $i]] {
+ x {incr i; set var(axis,x,grid) [FromYesNo [lindex $xar $i]]}
+ y {incr i; set var(axis,y,grid) [FromYesNo [lindex $xar $i]]}
+ default {
+ # backward compatibility
+ set var(axis,y,grid) [FromYesNo [lindex $xar $i]]
+ set var(axis,x,grid) [FromYesNo [lindex $xar $i]]
+ }
+ }
+ }
+ log {
+ incr i;
+ switch -- [string tolower [lindex $xar $i]] {
+ x {incr i; set var(axis,x,log) [FromYesNo [lindex $xar $i]]}
+ y {incr i; set var(axis,y,log) [FromYesNo [lindex $xar $i]]}
+ }
+ }
+ flip {
+ incr i;
+ switch -- [string tolower [lindex $xar $i]] {
+ x {incr i; set var(axis,x,flip) [FromYesNo [lindex $xar $i]]}
+ y {incr i; set var(axis,y,flip) [FromYesNo [lindex $xar $i]]}
+ }
+ }
+ format {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ x {incr i; set var(axis,x,format) [lindex $xar $i]}
+ y {incr i; set var(axis,y,format) [lindex $xar $i]}
+ }
+ }
+ range {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ x {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ auto {
+ incr i
+ set var(axis,x,auto) [FromYesNo [lindex $xar $i]]
+ }
+ min {incr i; set var(axis,x,min) [lindex $xar $i]}
+ max {incr i; set var(axis,x,max) [lindex $xar $i]}
+ }
+ }
+ y {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ auto {
+ incr i
+ set var(axis,y,auto) [FromYesNo [lindex $xar $i]]
+ }
+ min {incr i; set var(axis,y,min) [lindex $xar $i]}
+ max {incr i; set var(axis,y,max) [lindex $xar $i]}
+ }
+ }
+ }
+ }
+ labels {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ title {incr i; set var(graph,title) [lindex $xar $i]}
+ xaxis {incr i; set var(axis,x,title) [lindex $xar $i]}
+ yaxis {incr i; set var(axis,y,title) [lindex $xar $i]}
+ legend {incr i; set var(legend,title) [lindex $xar $i]}
+ }
+ }
+ type {
+ # backward compatibility
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ line -
+ bar {}
+ }
+ }
+ scale {
+ # backward compatibility
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ linearlinear {
+ set var(axis,x,log) 0
+ set var(axis,y,log) 0
+ }
+ linearlog {
+ set var(axis,x,log) 0
+ set var(axis,y,log) 1
+ }
+ loglinear {
+ set var(axis,x,log) 1
+ set var(axis,y,log) 0
+ }
+ loglog {
+ set var(axis,x,log) 1
+ set var(axis,y,log) 1
+ }
+ }
+ }
+ }
+
+ $var(proc,updategraph) $varname
+}
+
+# backward compatibility
+proc ProcessPlotView {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ discrete {
+ incr i
+ set var(show) [FromYesNo [lindex $xar $i]]
+ }
+ line -
+ linear {
+ incr i
+ if {[FromYesNo [lindex $xar $i]]} {
+ set var(show) 1
+ set var(smooth) linear
+ }
+ }
+ step {
+ incr i
+ if {[FromYesNo [lindex $xar $i]]} {
+ set var(show) 1
+ set var(smooth) step
+ }
+ }
+ quadratic {
+ incr i
+ if {[FromYesNo [lindex $xar $i]]} {
+ set var(show) 1
+ set var(smooth) quadratic
+ }
+ }
+ error -
+ errorbar {
+ incr i
+ set var(error) [FromYesNo [lindex $xar $i]]
+ }
+ }
+
+ $var(proc,updateelement) $varname
+}
+
+# backward compatibility
+proc ProcessPlotLine {varname xarname iname} {
+ upvar #0 $varname var
+ global $varname
+
+ upvar 2 $xarname xar
+ upvar 2 $iname i
+
+ switch -- [string tolower [lindex $xar $i]] {
+ discrete {
+ incr i
+ set var(shape,symbol) [lindex $xar $i]
+ }
+ line -
+ linear -
+ step -
+ quadratic -
+ error -
+ errorbar {
+ incr i
+ switch -- [string tolower [lindex $xar $i]] {
+ width {
+ incr i
+ set var(width) [lindex $xar $i]
+ }
+ dash {
+ incr i
+ set var(dash) [FromYesNo [lindex $xar $i]]
+ }
+ style {
+ incr i
+ set var(error) 1
+ }
+ }
+ }
+ }
+
+ $var(proc,updateelement) $varname
+}
+
+proc ProcessSendPlotCmd {proc id param} {
+ global iap
+
+ set i 0
+
+ # determine which plot
+ switch -- [string tolower [lindex $param $i]] {
+ {} -
+ stats -
+ statistics -
+ list -
+ mode -
+ axis -
+ legend -
+ font -
+ title -
+ barmode -
+ show -
+ color -
+ error -
+ errorbar -
+ name -
+ shape -
+ relief -
+ smooth -
+ width -
+ dash -
+ dataset -
+ select {
+ set varname [lindex $iap(windows) end]
+ set idd [lsearch $iap(windows) $varname]
+ }
+
+ default {
+ set varname [lindex $param $i]
+ set idd [lsearch $iap(windows) $varname]
+ incr i
+ }
+ }
+
+ # we better have a tt by now
+ if {$idd == -1} {
+ Error "[msgcat::mc {Unable to find plot window}] $varname"
+ return
+ }
+
+ upvar #0 $varname var
+ global $varname
+
+ # now, process plot command
+ switch -- [string tolower [lindex $param $i]] {
+ {} {$proc $id "$iap(windows)\n"}
+ stats -
+ statistics {$proc $id "[PlotStatsGenerate $varname]"}
+ list {$proc $id "[PlotListGenerate $varname]"}
+ mode {$proc $id "$var(mode)\n"}
+ axis {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ x {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ grid {$proc $id [ToYesNo $var(axis,x,grid)]}
+ log {$proc $id [ToYesNo $var(axis,x,log)]}
+ flip {$proc $id [ToYesNo $var(axis,x,flip)]}
+ auto {$proc $id [ToYesNo $var(axis,x,auto)]}
+ min {$proc $id "$var(axis,x,min)\n"}
+ max {$proc $id "$var(axis,x,max)\n"}
+ format {$proc $id "$var(axis,x,format)\n"}
+ }
+ }
+ y {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ grid {$proc $id [ToYesNo $var(axis,y,grid)]}
+ log {$proc $id [ToYesNo $var(axis,y,log)]}
+ flip {$proc $id [ToYesNo $var(axis,y,flip)]}
+ auto {$proc $id [ToYesNo $var(axis,y,auto)]}
+ min {$proc $id "$var(axis,y,min)\n"}
+ max {$proc $id "$var(axis,y,max)\n"}
+ format {$proc $id "$var(axis,y,format)\n"}
+ }
+ }
+ }
+ }
+ legend {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ position {$proc $id "$var(legend,position)\n"}
+ default {$proc $id [ToYesNo $var(legend)]}
+ }
+ }
+ font {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ title {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ family -
+ font {$proc $id "$var(graph,title,family)\n"}
+ size {$proc $id "$var(graph,title,size)\n"}
+ weight {$proc $id "$var(graph,title,weight)\n"}
+ slant {$proc $id "$var(graph,title,slant)\n"}
+ }
+ }
+ axestitle -
+ labels {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ family -
+ font {$proc $id "$var(axis,title,family)\n"}
+ size {$proc $id "$var(axis,title,size)\n"}
+ weight {$proc $id "$var(axis,title,weight)\n"}
+ slant {$proc $id "$var(axis,title,slant)\n"}
+ }
+ }
+ axesnumbers -
+ numbers {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ family -
+ font {$proc $id "$var(axis,font,family)\n"}
+ size {$proc $id "$var(axis,font,size)\n"}
+ weight {$proc $id "$var(axis,font,weight)\n"}
+ slant {$proc $id "$var(axis,font,slant)\n"}
+ }
+ }
+ legendtitle {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ family -
+ font {$proc $id "$var(legend,title,family)\n"}
+ size {$proc $id "$var(legend,title,size)\n"}
+ weight {$proc $id "$var(legend,title,weight)\n"}
+ slant {$proc $id "$var(legend,title,slant)\n"}
+ }
+ }
+ legend {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ family -
+ font {$proc $id "$var(legend,font,family)\n"}
+ size {$proc $id "$var(legend,font,size)\n"}
+ weight {$proc $id "$var(legend,font,weight)\n"}
+ slant {$proc $id "$var(legend,font,slant)\n"}
+ }
+ }
+ }
+ }
+ title {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ x -
+ xaxis {$proc $id "$var(axis,x,title)\n"}
+ y -
+ yaxis {$proc $id "$var(axis,y,title)\n"}
+ legend {$proc $id "$var(legend,title)\n"}
+ default {$proc $id "$var(graph,title)\n"}
+ }
+ }
+ barmode {$proc $id "$var(bar,mode)\n"}
+
+ show {$proc $id [ToYesNo $var(show)]}
+ color {$proc $id "$var(color)\n"}
+ fill {$proc $id [ToYesNo $var(fill)]}
+ fillcolor {$proc $id "$var(fill,color)\n"}
+ error -
+ errorbar {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ cap {$proc $id [ToYesNo $var(error,cap)]}
+ color {$proc $id "$var(error,color)\n"}
+ width {$proc $id "$var(error,width)\n"}
+ default {$proc $id [ToYesNo $var(error)]}
+ }
+ }
+ name {$proc $id "$var(name)\n"}
+ shape {
+ incr i
+ switch -- [string tolower [lindex $param $i]] {
+ fill {$proc $id [ToYesNo $var(shape,fill)]}
+ color {$proc $id "$var(shape,color)\n"}
+ default {$proc $id "$var(shape,symbol)\n"}
+ }
+ }
+ relief {$proc $id "$var(bar,relief)\n"}
+ smooth {$proc $id "$var(smooth)\n"}
+ width {$proc $id "$var(width)\n"}
+ dash {$proc $id [ToYesNo $var(dash)]}
+ dataset -
+ select {$proc $id "$var(data,current)\n"}
+ }
+}
diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl
new file mode 100644
index 0000000..335b527
--- /dev/null
+++ b/ds9/library/plotscatter.tcl
@@ -0,0 +1,256 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used by backup
+proc PlotScatterTool {} {
+ global iap
+ PlotScatter $iap(tt) [msgcat::mc {Scatter Plot Tool}] {} {} {} 2 {}
+}
+
+proc PlotScatter {tt wtt title xaxis yaxis dim data} {
+ global iap
+
+ # make the window name unique
+ set ii [lsearch $iap(windows) $tt]
+ if {$ii>=0} {
+ incr iap(unique)
+ append tt $iap(unique)
+ }
+
+ # set the window title if none
+ if {$wtt == {}} {
+ set wtt $tt
+ }
+
+ set varname $tt
+ upvar #0 $varname var
+ global $varname
+
+ PlotScatterProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogScatter $varname
+
+ PlotDataSet $varname $dim $data
+ $var(proc,updategraph) $varname
+ PlotStats $varname
+ PlotList $varname
+}
+
+proc PlotScatterDialog {varname wtt title xaxis yaxis} {
+ upvar #0 $varname var
+ global $varname
+
+ PlotScatterProc $varname
+ PlotDialog $varname $wtt $title $xaxis $yaxis
+ PlotDialogScatter $varname
+}
+
+proc PlotScatterProc {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(proc,updategraph) PlotUpdateGraph
+ set var(proc,updateelement) PlotScatterUpdateElement
+ set var(proc,highlite) PlotScatterHighliteElement
+ set var(proc,button) PlotScatterButton
+}
+
+proc PlotDialogScatter {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ set var(seq) 0
+
+ # Dataset
+ $var(mb).dataset add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(show) \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset add separator
+ $var(mb).dataset add cascade -label [msgcat::mc {Shape}] \
+ -menu $var(mb).dataset.shape
+ $var(mb).dataset add cascade -label [msgcat::mc {Error}] \
+ -menu $var(mb).dataset.error
+ $var(mb).dataset add separator
+ $var(mb).dataset add command -label "[msgcat::mc {Name}]..." \
+ -command [list DatasetNameDialog $varname]
+
+ # Shape
+ menu $var(mb).dataset.shape
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Circle}] \
+ -variable ${varname}(shape,symbol) -value circle \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Square}] \
+ -variable ${varname}(shape,symbol) -value square \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Diamond}] \
+ -variable ${varname}(shape,symbol) -value diamond \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Plus}] \
+ -variable ${varname}(shape,symbol) -value plus \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Cross}] \
+ -variable ${varname}(shape,symbol) -value cross \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Simple Plus}] \
+ -variable ${varname}(shape,symbol) -value splus \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Simple Cross}] \
+ -variable ${varname}(shape,symbol) -value scross \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Triangle}] \
+ -variable ${varname}(shape,symbol) -value triangle \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add radiobutton \
+ -label [msgcat::mc {Arrow}] \
+ -variable ${varname}(shape,symbol) -value arrow \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add separator
+ $var(mb).dataset.shape add checkbutton \
+ -label [msgcat::mc {Fill}] \
+ -variable ${varname}(shape,fill) \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.shape add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.shape.color
+
+ # Color
+ PlotColorMenu $var(mb).dataset.shape.color $varname shape,color \
+ [list PlotScatterUpdateElement $varname]
+
+ # Error
+ menu $var(mb).dataset.error
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Show}] \
+ -variable ${varname}(error) \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.error add checkbutton -label [msgcat::mc {Cap}] \
+ -variable ${varname}(error,cap) \
+ -command [list PlotScatterUpdateElement $varname]
+ $var(mb).dataset.error add separator
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Color}] \
+ -menu $var(mb).dataset.error.color
+ $var(mb).dataset.error add cascade -label [msgcat::mc {Width}] \
+ -menu $var(mb).dataset.error.width
+
+ PlotColorMenu $var(mb).dataset.error.color $varname error,color \
+ [list PlotScatterUpdateElement $varname]
+ WidthDashMenu $var(mb).dataset.error.width $varname error,width {} \
+ [list PlotScatterUpdateElement $varname] {}
+
+ # graph
+ set var(type) scatter
+ set var(graph) [blt::graph $var(top).scatter \
+ -width 600 \
+ -height 500 \
+ -highlightthickness 0 \
+ ]
+
+ pack $var(graph) -expand yes -fill both
+ PlotChangeMode $varname
+}
+
+proc PlotScatterUpdateElement {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # warning: uses current vars
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ set nn $var(data,current)
+ PlotGetVar $varname $nn
+
+ if {$var(shape,symbol) == "none"} {
+ set var(shape,symbol) circle
+ }
+
+ if {$var(shape,fill)} {
+ set clr $var(shape,color)
+ } else {
+ set clr {}
+ }
+
+ if {$var(error)} {
+ set show both
+ } else {
+ set show none
+ }
+
+ if {$var(error,cap)} {
+ set cap [expr $var(error,width)+3]
+ } else {
+ set cap 0
+ }
+
+ $var(graph) element configure "d-${nn}" \
+ -label "$var(name)" -hide [expr !$var(show)] \
+ -symbol $var(shape,symbol) \
+ -fill $clr -outline $var(shape,color) \
+ -linewidth 0 -pixels 5 -scalesymbols no \
+ -showerrorbars $show -errorbarcolor $var(error,color) \
+ -errorbarwidth $var(error,width) -errorbarcap $cap
+
+ $var(graph) pen configure active -color blue \
+ -symbol $var(shape,symbol) \
+ -linewidth 0 -pixels 5 \
+ -showerrorbars $show -errorbarcolor $var(error,color) \
+ -errorbarwidth $var(error,width) -errorbarcap $cap
+}
+
+proc PlotScatterButton {varname x y} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ if {$var(callback) == {}} {
+ return
+ }
+
+ set rr [$var(graph) element closest $x $y]
+ set elem [lindex $rr 1]
+ set row [lindex $rr 3]
+
+ if {$elem != {}} {
+ if {$row != {}} {
+ $var(graph) element deactivate $elem
+ $var(graph) element activate $elem $row
+ # rows start at 1
+ eval "$var(callback) [expr $row+1]"
+ } else {
+ $var(graph) element deactivate $elem
+ eval "$var(callback) {}"
+ }
+ }
+}
+
+proc PlotScatterHighliteElement {varname rowlist} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(data,total) == 0} {
+ return
+ }
+
+ if {$var(show)} {
+ $var(graph) element deactivate d-1
+ if {$rowlist != {}} {
+ # can have multiple rows
+ eval "$var(graph) element activate d-1 $rowlist"
+ }
+ }
+}
diff --git a/ds9/library/point.tcl b/ds9/library/point.tcl
new file mode 100644
index 0000000..fd9adde
--- /dev/null
+++ b/ds9/library/point.tcl
@@ -0,0 +1,111 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PointDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(proc,apply) PointApply
+ set var(proc,close) PointClose
+ set var(proc,coordCB) PointCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # menus
+ $var(mb) add cascade -label [msgcat::mc {Shape}] -menu $var(mb).shape
+ menu $var(mb).shape
+ $var(mb).shape add radiobutton -label [msgcat::mc {Circle}] \
+ -variable ${varname}(shape) -value circle \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {Box}] \
+ -variable ${varname}(shape) -value box \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {Diamond}] \
+ -variable ${varname}(shape) -value diamond \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {Cross}] \
+ -variable ${varname}(shape) -value cross \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {X}] \
+ -variable ${varname}(shape) -value x \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {Arrow}] \
+ -variable ${varname}(shape) -value arrow \
+ -command "PointShape $varname"
+ $var(mb).shape add radiobutton -label [msgcat::mc {BoxCircle}] \
+ -variable ${varname}(shape) -value boxcircle \
+ -command "PointShape $varname"
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ # plot3d
+ MarkerAnalysisPlot3dDialog $varname
+
+ # init
+ set var(shape) [$var(frame) get marker $var(id) point shape]
+ set var(size) [$var(frame) get marker $var(id) point size]
+
+ set f $var(top).param
+
+ # size
+ ttk::label $f.tsize -text [msgcat::mc {Size}]
+ ttk::entry $f.size -textvariable ${varname}(size) -width 13
+ ttk::label $f.usize -text [msgcat::mc {Pixels}]
+
+ grid $f.tsize $f.size $f.usize -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc PointClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseCenterClose $varname
+}
+
+proc PointApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) point size $var(size)
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc PointCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "PointCoordCB"
+ }
+
+ MarkerAnalysisPlot3dSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+}
+
+# support
+
+proc PointShape {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) point shape $var(shape)
+}
diff --git a/ds9/library/polygon.tcl b/ds9/library/polygon.tcl
new file mode 100644
index 0000000..82ab00a
--- /dev/null
+++ b/ds9/library/polygon.tcl
@@ -0,0 +1,84 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PolygonDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(proc,apply) PolygonApply
+ set var(proc,close) PolygonClose
+ set var(proc,coordCB) PolygonCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ MarkerAnalysisStatsDialog $varname
+ MarkerAnalysisHistogramDialog $varname
+ MarkerAnalysisPlot3dDialog $varname
+
+ # init
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback rotate MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc PolygonClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc PolygonApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc PolygonCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "PolygonCoordCB"
+ }
+
+ MarkerAnalysisStatsSystem $varname
+ MarkerAnalysisPlot3dSystem $varname
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
diff --git a/ds9/library/prefs.tcl b/ds9/library/prefs.tcl
new file mode 100644
index 0000000..d894965
--- /dev/null
+++ b/ds9/library/prefs.tcl
@@ -0,0 +1,1004 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PrefsDef {} {
+ global prefs
+ global iprefs
+ global ds9
+
+ set iprefs(top) .pf
+ set iprefs(mb) .pfmb
+ set iprefs(tabs) {}
+
+ set prefs(ext) {.prf}
+ set prefs(version) [lindex $ds9(version) 0]
+ set prefs(dir) [file join [GetEnvHome] ".$ds9(app)"]
+ set prefs(fn) [file join $prefs(dir) "$ds9(app).$prefs(version)$prefs(ext)"]
+}
+
+proc LoadPrefs {} {
+ global ds9
+ global prefs
+
+ if {[file exist $prefs(dir)] && [file isdirectory $prefs(dir)]} {
+ # new style
+ # look for current version
+ switch -- [SourceInitFile $prefs(fn)] {
+ 1 {
+ # success
+ FixPrefs $prefs(version)
+ }
+ 0 {
+ # found and failed to execute
+ }
+ -1 {
+ # look for prev version
+ set major [lindex [split $prefs(version) {.}] 0]
+ set minor [lindex [split $prefs(version) {.}] 1]
+ if {$minor>0} {
+ set minor [expr $minor-1]
+ } else {
+ set major [expr $minor-1]
+ set minor 9
+ }
+ set fn [file join $prefs(dir) "$ds9(app).${major}.${minor}$prefs(ext)"]
+ if {[SourceInitFile $fn] == 1} {
+ FixPrefs $prefs(version)
+ }
+ }
+ }
+ } else {
+ # ok, try old style
+ if {[SourceInitFileDir $prefs(ext)]} {
+ # ok, this is a major kludge to fix a major booboo.
+ # Beta versions generated prefs with version set to
+ # something like '7.4b7'. We need to remove the 'b7' part.
+ set ll [string first {b} $prefs(version)]
+ if {$ll != -1} {
+ set ll [expr $ll -1]
+ set prefs(version) [string range $prefs(version) 0 $ll]
+ }
+ FixPrefs $prefs(version)
+ }
+ }
+}
+
+proc CheckPrefs {} {
+ global ds9
+ global prefs
+
+ set rr [string compare $prefs(version) [lindex $ds9(version) 0]]
+ switch $rr {
+ -1 {
+ if {[tk_messageBox -type yesno -icon question -message [msgcat::mc {DS9 has detected an older preferences file, do you wish to update?}]] == {yes}} {
+ SavePrefs
+ }
+ }
+ 0 {}
+ 1 {
+ tk_messageBox -type ok -icon warning -message [msgcat::mc {DS9 has detected a newer version of a preferences file.}]
+ }
+ }
+}
+
+proc ClearPrefs {} {
+ global ds9
+ global prefs
+
+ if {[file exist $prefs(dir)] && [file isdirectory $prefs(dir)]} {
+ # clear new style
+ if {[file exist $prefs(fn)]} {
+ catch {file delete -force $prefs(fn)}
+ }
+ } else {
+ # make sure old prefs files are removed
+ foreach pp {{.} {}} {
+ set fn $pp$ds9(app)$prefs(ext)
+ foreach dir [list {.} [GetEnvHome]] {
+ set ff [file join $dir $fn]
+ if {[file exist $ff]} {
+ catch {file delete -force $ff}
+ return
+ }
+ }
+ }
+ }
+}
+
+proc SavePrefs {} {
+ global tcl_platform
+ global ds9
+ global prefs
+
+ ClearPrefs
+
+ # new style prefs file
+ # mkdir if needed
+ catch {file mkdir $prefs(dir)}
+ if {![file exist $prefs(dir)] || ![file isdirectory $prefs(dir)]} {
+ # something is wrong, just bail
+ Error [msgcat::mc {An error has occurred while saving}]
+ return
+ }
+
+ # open prefs file
+ if {[catch {set ch [open $prefs(fn) w]}]} {
+ Error [msgcat::mc {An error has occurred while saving}]
+ return
+ }
+
+ switch $tcl_platform(platform) {
+ unix {file attributes $prefs(fn) -permissions "rw-r--r--"}
+ windows {}
+ }
+
+ puts $ch "global ds9"
+ puts $ch "global prefs"
+ puts $ch "set prefs(version) [lindex $ds9(version) 0]"
+
+ # check for wrong prefs
+ puts $ch "\# this is a check for to ensure a match between the"
+ puts $ch "\# current ds9 version matches the prefs version"
+ puts $ch "if {\[string compare \$prefs(version) \[lindex \$ds9(version)\ 0\]] == 1} {"
+ puts $ch " return"
+ puts $ch "}"
+
+ # Basic
+
+ global pds9
+ puts $ch "global pds9"
+ puts $ch "array set pds9 \{ [array get pds9] \}"
+
+ global current
+ global pcurrent
+ puts $ch "global current"
+ puts $ch "global pcurrent"
+ puts $ch "array set pcurrent \{ [array get pcurrent] \}"
+ puts $ch {array set current [array get pcurrent]}
+
+ global view
+ global pview
+ puts $ch "global view"
+ puts $ch "global pview"
+ puts $ch "array set pview \{ [array get pview] \}"
+ puts $ch {array set view [array get pview]}
+
+ global phttp
+ puts $ch "global phttp"
+ puts $ch "array set phttp \{ [array get phttp] \}"
+
+ global pbuttons
+ puts $ch "global pbuttons"
+ puts $ch "array set pbuttons \{ [array get pbuttons] \}"
+
+ global ppanner
+ puts $ch "global ppanner"
+ puts $ch "array set ppanner \{ [array get ppanner] \}"
+
+ global pmagnifier
+ puts $ch "global pmagnifier"
+ puts $ch "array set pmagnifier \{ [array get pmagnifier] \}"
+
+ # File
+
+ global ps
+ global pps
+ puts $ch "global ps"
+ puts $ch "global pps"
+ puts $ch "array set pps \{ [array get pps] \}"
+ puts $ch {array set ps [array get pps]}
+
+ global pr
+ global ppr
+ puts $ch "global pr"
+ puts $ch "global ppr"
+ puts $ch "array set ppr \{ [array get ppr] \}"
+ puts $ch {array set pr [array get ppr]}
+
+ # Frame
+
+ global blink
+ global pblink
+ puts $ch "global blink"
+ puts $ch "global pblink"
+ puts $ch "array set pblink \{ [array get pblink] \}"
+ puts $ch {array set blink [array get pblink]}
+
+ global tile
+ global ptile
+ puts $ch "global tile"
+ puts $ch "global ptile"
+ puts $ch "array set ptile \{ [array get ptile] \}"
+ puts $ch {array set tile [array get ptile]}
+
+ global threed
+ global pthreed
+ puts $ch "global threed"
+ puts $ch "global pthreed"
+ puts $ch "array set pthreed \{ [array get pthreed] \}"
+ puts $ch {array set threed [array get pthreed]}
+
+ # Bin
+
+ global bin
+ global pbin
+ puts $ch "global bin"
+ puts $ch "global pbin"
+ puts $ch "array set pbin \{ [array get pbin] \}"
+ puts $ch {array set bin [array get pbin]}
+
+ # Zoom
+
+ global panzoom
+ global ppanzoom
+ puts $ch "global panzoom"
+ puts $ch "global ppanzoom"
+ puts $ch "array set ppanzoom \{ [array get ppanzoom] \}"
+ puts $ch {array set panzoom [array get ppanzoom]}
+
+ # Scale
+
+ global scale
+ global pscale
+ puts $ch "global scale"
+ puts $ch "global pscale"
+ puts $ch "array set pscale \{ [array get pscale] \}"
+ puts $ch {array set scale [array get pscale]}
+
+ global minmax
+ global pminmax
+ puts $ch "global minmax"
+ puts $ch "global pminmax"
+ puts $ch "array set pminmax \{ [array get pminmax] \}"
+ puts $ch {array set minmax [array get pminmax]}
+
+ global zscale
+ global pzscale
+ puts $ch "global zscale"
+ puts $ch "global pzscale"
+ puts $ch "array set pzscale \{ [array get pzscale] \}"
+ puts $ch {array set zscale [array get pzscale]}
+
+ # Region
+
+ global marker
+ global pmarker
+ puts $ch "global marker"
+ puts $ch "global pmarker"
+ puts $ch "array set pmarker \{ [array get pmarker] \}"
+ puts $ch {array set marker [array get pmarker]}
+
+ # WCS
+
+ global wcs
+ global pwcs
+ puts $ch "global wcs"
+ puts $ch "global pwcs"
+ puts $ch "array set pwcs \{ [array get pwcs] \}"
+ puts $ch {array set wcs [array get pwcs]}
+
+ # Analysis
+
+ global ime
+ global pime
+ puts $ch "global pime"
+ puts $ch "array set pime \{ [array get pime] \}"
+ puts $ch {array set ime [array get pime]}
+
+ global pgraph
+ puts $ch "global pgraph"
+ puts $ch "array set pgraph \{ [array get pgraph] \}"
+
+ global pcoord
+ puts $ch "global pcoord"
+ puts $ch "array set pcoord \{ [array get pcoord] \}"
+
+ global pexamine
+ puts $ch "global pexamine"
+ puts $ch "array set pexamine \{ [array get pexamine] \}"
+
+ global pixel
+ global ppixel
+ puts $ch "global pixel"
+ puts $ch "global ppixel"
+ puts $ch "array set ppixel \{ [array get ppixel] \}"
+ puts $ch {array set pixel [array get ppixel]}
+
+ global mask
+ global pmask
+ puts $ch "global mask"
+ puts $ch "global pmask"
+ puts $ch "array set pmask \{ [array get pmask] \}"
+ puts $ch {array set mask [array get pmask]}
+
+ global contour
+ global pcontour
+ puts $ch "global contour"
+ puts $ch "global pcontour"
+ puts $ch "array set pcontour \{ [array get pcontour] \}"
+ puts $ch {array set contour [array get pcontour]}
+
+ global grid
+ global pgrid
+ puts $ch "global grid"
+ puts $ch "global pgrid"
+ puts $ch "array set pgrid \{ [array get pgrid] \}"
+ puts $ch {array set grid [array get pgrid]}
+
+ global block
+ global pblock
+ puts $ch "global block"
+ puts $ch "global pblock"
+ puts $ch "array set pblock \{ [array get pblock] \}"
+ puts $ch {array set block [array get pblock]}
+
+ global smooth
+ global psmooth
+ puts $ch "global smooth"
+ puts $ch "global psmooth"
+ puts $ch "array set psmooth \{ [array get psmooth] \}"
+ puts $ch {array set smooth [array get psmooth]}
+
+ global pnres
+ puts $ch "global pnres"
+ puts $ch "array set pnres \{ [array get pnres] \}"
+
+ global pcat
+ puts $ch "global pcat"
+ puts $ch "array set pcat \{ [array get pcat] \}"
+
+ global pvo
+ puts $ch "global pvo"
+ puts $ch "array set pvo \{ [array get pvo] \}"
+
+ global pap
+ puts $ch "global pap"
+ puts $ch "array set pap \{ [array get pap] \}"
+
+ global panalysis
+ puts $ch "global panalysis"
+ puts $ch "array set panalysis \{ [array get panalysis] \}"
+
+ # Other
+
+ puts $ch ""
+ puts $ch "\# Colorbar prefs"
+ global colorbar
+ global pcolorbar
+ puts $ch "global colorbar"
+ puts $ch "global pcolorbar"
+ puts $ch "array set pcolorbar \{ [array get pcolorbar] \}"
+ puts $ch {array set colorbar [array get pcolorbar]}
+
+ # and close
+ close $ch
+}
+
+# Backward Compatibility
+proc FixVar {varname ovarname} {
+ global aa bb
+ set aa $varname
+ set bb $ovarname
+
+ uplevel #0 {
+ if {[info exists $bb]} {
+ set $aa [expr $$bb]
+ unset $bb
+ }
+ }
+}
+
+proc FixVarRm {ovarname} {
+ global aa
+ set aa $ovarname
+
+ uplevel #0 {
+ if {[info exists $aa]} {
+ unset $aa
+ }
+ }
+}
+
+proc FixFontVar {weightname slantname stylename} {
+ global aa bb cc
+ set aa $weightname
+ set bb $slantname
+ set cc $stylename
+
+ uplevel #0 {
+ if {[info exists $cc]} {
+ switch [expr $$cc] {
+ normal {
+ set $aa normal
+ set $bb roman
+ }
+ bold {
+ set $aa bold
+ set $bb roman
+ }
+ italic {
+ set $aa normal
+ set $bb italic
+ }
+ }
+ unset $cc
+ }
+ }
+}
+
+# we only support 6.x and higher
+proc FixPrefs {version} {
+ set major [lindex [split $version {.}] 0]
+ if {$major == {5}} {
+ set version 5.x
+ }
+
+ switch $version {
+ 5.x {
+ FixPrefs5.xto6.0
+ FixPrefs6.0to6.1
+ FixPrefs6.1to6.2
+ FixPrefs6.2to7.0
+ FixPrefs7.0to7.1
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 6.0 {
+ FixPrefs6.0to6.1
+ FixPrefs6.1to6.2
+ FixPrefs6.2to7.0
+ FixPrefs7.0to7.1
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 6.1 -
+ 6.1.1 -
+ 6.1.2 {
+ FixPrefs6.1to6.2
+ FixPrefs6.2to7.0
+ FixPrefs7.0to7.1
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 6.2 {
+ FixPrefs6.2to7.0
+ FixPrefs7.0to7.1
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 7.0 {
+ FixPrefs7.0to7.1
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 7.1 {
+ FixPrefs7.1to7.2
+ FixPrefs7.2to7.3
+ }
+ 7.2 {
+ FixPrefs7.2to7.3
+ }
+ 7.3 -
+ 7.3.1 -
+ 7.3.2 {
+ }
+ 7.4 {
+ }
+ 7.5 {
+ FixPrefs7.4to7.5
+ }
+ }
+}
+
+proc FixPrefs7.4to7.5 {} {
+ FixVarRm pds9(threads)
+}
+
+proc FixPrefs7.2to7.3 {} {
+ global current
+ if {$current(mode) == {pointer}} {
+ set current(mode) region
+ }
+
+ FixVar pbuttons(edit,region) pbuttons(edit,pointer)
+ FixVar pbuttons(frame,match,cube,image) pbuttons(frame,match,cube)
+ FixVar pbuttons(frame,lock,cube,image) pbuttons(frame,lock,cube)
+
+ FixVar pap(axis,x,grid) pap(graph,x,grid)
+ FixVar pap(axis,x,log) pap(graph,x,log)
+ FixVar pap(axis,x,flip) pap(graph,x,flip)
+ FixVar pap(axis,y,grid) pap(graph,y,grid)
+ FixVar pap(axis,y,log) pap(graph,y,log)
+ FixVar pap(axis,y,flip) pap(graph,y,flip)
+
+ FixVar pap(graph,title,family) pap(titleFont)
+ FixVar pap(graph,title,size) pap(titleSize)
+ FixVar pap(graph,title,weight) pap(titleWeight)
+ FixVar pap(graph,title,slant) pap(titleSlant)
+
+ FixVar pap(axis,title,family) pap(textlabFont)
+ FixVar pap(axis,title,size) pap(textlabSize)
+ FixVar pap(axis,title,weight) pap(textlabWeight)
+ FixVar pap(axis,title,slant) pap(textlabSlant)
+
+ FixVar pap(axis,font,family) pap(numlabFont)
+ FixVar pap(axis,font,size) pap(numlabSize)
+ FixVar pap(axis,font,weight) pap(numlabWeight)
+ FixVar pap(axis,font,slant) pap(numlabSlant)
+
+ FixVar pap(show) pap(linear)
+ FixVar pap(shape,color) pap(discrete,color)
+ FixVar pap(shape,fill) pap(discrete,fill)
+ FixVar pap(width) pap(linear,width)
+ FixVar pap(color) pap(linear,color)
+
+ if {[info exists pap(linear,dash)]} {
+ set pap(linear,dash) [FromYesNo $pap(linear,dash)]
+ }
+ FixVar pap(dash) pap(linear,dash)
+
+ if {[info exists pap(discrete)]} {
+ if {$pap(discrete)} {
+ FixVar pap(shape,symbol) pap(discrete,symbol)
+ } else {
+ FixVarRm pap(discrete,symbol)
+ }
+ }
+
+ FixVarRm pap(bar)
+ FixVarRm pap(bar,color)
+
+ FixVarRm pap(discrete)
+ FixVarRm pap(linear,dash)
+
+ FixVarRm pap(quadratic)
+ FixVarRm pap(quadratic,width)
+ FixVarRm pap(quadratic,color)
+ FixVarRm pap(quadratic,dash)
+
+ FixVarRm pap(step)
+ FixVarRm pap(step,color)
+ FixVarRm pap(step,dash)
+ FixVarRm pap(step,width)
+}
+
+proc FixPrefs7.1to7.2 {} {
+ FixVar pbuttons(file,xpa,info) pbuttons(file,xpa)
+ FixVar pcurrent(align) pwcs(align)
+}
+
+proc FixPrefs7.0to7.1 {} {
+ global pap
+ if {[info exists pap(grid)]} {
+ set pap(grid,x) $pap(grid)
+ set pap(grid,y) $pap(grid)
+ switch $pap(grid,log) {
+ linearlinear {
+ set pap(grid,xlog) 0
+ set pap(grid,ylog) 0
+ }
+ linearlog {
+ set pap(grid,xlog) 0
+ set pap(grid,ylog) 1
+ }
+ loglinear {
+ set pap(grid,xlog) 1
+ set pap(grid,ylog) 0
+ }
+ loglog {
+ set pap(grid,xlog) 1
+ set pap(grid,ylog) 1
+ }
+ }
+ unset pap(grid)
+ unset pap(grid,log)
+ }
+}
+
+proc FixPrefs6.2to7.0 {} {
+ global ps
+ global pps
+ switch $pps(scale) {
+ scaled -
+ fixed {
+ set ps(scale) 100
+ set pps(scale) 100
+ }
+ }
+
+ global colorbar
+ global pcolorbar
+ set colorbar(map) [string tolower $colorbar(map)]
+ set pcolorbar(map) [string tolower $pcolorbar(map)]
+
+ FixVar pbuttons(frame,match,frame,wcs) pbuttons(frame,matchframe,wcs)
+ FixVar pbuttons(frame,match,frame,image) pbuttons(frame,matchframe,image)
+ FixVar pbuttons(frame,match,frame,physical) pbuttons(frame,matchframe,physical)
+ FixVar pbuttons(frame,match,frame,amplifier) pbuttons(frame,matchframe,amplifier)
+ FixVar pbuttons(frame,match,frame,detector) pbuttons(frame,matchframe,detector)
+
+ FixVar pbuttons(bin,match) pbuttons(frame,matchbin)
+ FixVar pbuttons(scale,match) pbuttons(frame,matchscale)
+ FixVar pbuttons(color,match) pbuttons(frame,matchcolor)
+
+ FixVar ppanner(compass) ppanner(compass,image)
+ FixVarRm ppanner(compass,wcs,system)
+ FixVarRm ppanner(compass,wcs,sky)
+
+ global pmarker
+ FixVarRm pmarker(dialog,system)
+ FixVarRm pmarker(dialog,sky)
+ FixVarRm pmarker(dialog,skyformat)
+ FixVarRm pmarker(dialog,dist,system)
+ FixVarRm pmarker(dialog,dist,format)
+
+ # mousewheel MacOSX Lion
+ global tcl_platform
+ global ppanzoom
+ global pbin
+ switch -- $tcl_platform(os) {
+ Darwin {
+ switch [lindex [split $tcl_platform(osVersion) {.}] 0] {
+ 11 {
+ set ppanzoom(wheel,factor) 1.01
+ set pbin(wheel,factor) 1.01
+ }
+ }
+ }
+ }
+
+ global pcoord
+ FixVarRm pcoord(sky)
+ FixVarRm pcoord(skyformat)
+}
+
+proc FixPrefs6.1to6.2 {} {
+ FixVar pbuttons(frame,matchframe,wcs) pbuttons(frame,matchframe)
+
+ global pds9
+ switch -- $pds9(font) {
+ helvetica -
+ courier -
+ times {}
+ default {set pds9(font) helvetica}
+ }
+ switch -- $pds9(font,size) {
+ 10 {set pds9(font,size) 9}
+ }
+ FixVar pmarker(centroid,auto) pmarker(autocentroid)
+ FixVarRm marker(autocentroid)
+
+ FixFontVar pds9(font,weight) pds9(font,slant) pds9(font,style)
+ FixFontVar pmarker(font,weight) pmarker(font,slant) pmarker(font,style)
+ FixFontVar pcolorbar(font,weight) pcolorbar(font,slant) \
+ pcolorbar(font,style)
+}
+
+proc FixPrefs6.0to6.1 {} {
+ # ds9
+ FixVar pds9(automarker) ds9(automarker)
+ FixVar pds9(xpa) ds9(xpa)
+ FixVar pds9(samp) ds9(samp,auto)
+ FixVar pds9(confirm) ds9(confirm)
+ FixVar pds9(bg) ds9(bg,color)
+ FixVar pds9(nan) ds9(nan,color)
+ FixVar pds9(dialog) ds9(dialog)
+ FixVar pds9(language) ds9(language)
+ FixVar pds9(language,name) ds9(language,name)
+ FixVar pds9(language,dir) ds9(language,dir)
+ FixVar pds9(font) ds9(font)
+ FixVar pds9(font,size) ds9(font,size)
+ FixVar pds9(font,style) ds9(font,style)
+ FixVar pcurrent(display) ds9(display,user)
+ FixVar pcurrent(mode) pds9(mode)
+
+ # note: versions 5.3 to 6.0 have array set ds9 [array get pds9]
+ # which will set following ds9(var), so delete
+ FixVarRm ds9(samp)
+ FixVarRm ds9(backup)
+ FixVarRm ds9(nan)
+ # which will overwrite the following ds9(var), so reset
+ global ds9
+ set ds9(bg) white
+
+ # analysis
+ FixVar panalysis(user) ds9(analysis,user)
+ FixVar panalysis(user2) ds9(analysis,user2)
+ FixVar panalysis(user3) ds9(analysis,user3)
+ FixVar panalysis(user4) ds9(analysis,user4)
+ global analysis
+ catch {unset analysis}
+
+ # magnifier
+ FixVar pmagnifier(region) magnifier(region)
+ FixVar pmagnifier(zoom) magnifier(zoom)
+ FixVar pmagnifier(cursor) magnifier(cursor)
+ global magnifier
+ catch {unset magnifier}
+
+ # panner
+ FixVar ppanner(compass,image) panner(compass,image)
+ FixVar ppanner(compass,wcs) panner(compass,wcs)
+ FixVar ppanner(compass,wcs,system) panner(compass,wcs,system)
+ FixVar ppanner(compass,wcs,sky) panner(compass,wcs,sky)
+ global panner
+ catch {unset panner}
+
+ # examine
+ FixVar pexamine(mode) examine(mode)
+ FixVar pexamine(zoom) examine(zoom)
+ global examine
+ catch {unset examine}
+
+ # vo
+ FixVar pvo(server) vo(server)
+ FixVar pvo(hv) vo(hv)
+ FixVar pvo(method) vo(method)
+ FixVar pvo(delay) vo(delay)
+ global vo
+ catch {unset vo}
+
+ # http
+ FixVar phttp(proxy) http(proxy)
+ FixVar phttp(proxy,host) http(proxy,host)
+ FixVar phttp(proxy,port) http(proxy,port)
+ FixVar phttp(auth) http(auth)
+ FixVar phttp(auth,user) http(auth,user)
+ FixVar phttp(auth,passwd) http(auth,passwd)
+ global http
+ catch {unset http}
+
+ # nres
+ FixVar pnres(server) nres(server)
+
+ # graph
+ FixVar pgraph(horz,grid) graph(horz,grid)
+ FixVar pgraph(horz,log) graph(horz,log)
+ FixVar pgraph(vert,grid) graph(vert,grid)
+ FixVar pgraph(vert,log) graph(vert,log)
+ global graph
+ catch {unset graph}
+
+ # cat
+ FixVar pcat(server) cat(server)
+ FixVar pcat(sym,shape) cat(sym,shape)
+ FixVar pcat(sym,color) cat(sym,color)
+ FixVar pcat(vot) cat(vot)
+
+ # contour
+ FixVarRm pcontour(color,msg)
+
+ # coords
+ global coord
+ catch {unset coord}
+
+ # scale
+ FixVarRm pscale(min)
+ FixVarRm pscale(max)
+ FixVarRm pscale(xaxis)
+ FixVarRm pscale(yaxis)
+
+ # marker
+ FixVarRm pmarker(maxdialog)
+ FixVarRm pmarker(load)
+ FixVarRm pmarker(paste,system)
+ FixVarRm pmarker(paste,sky)
+ FixVarRm pmarker(system)
+ FixVarRm pmarker(sky)
+ FixVarRm pmarker(skyformat)
+ FixVarRm pmarker(strip)
+
+ FixVarRm marker(dialog,system)
+ FixVarRm marker(dialog,sky)
+ FixVarRm marker(dialog,skyformat)
+ FixVarRm marker(dialog,dist,system)
+ FixVarRm marker(dialog,dist,format)
+
+ FixVarRm marker(circle,radius)
+ FixVarRm marker(annulus,inner)
+ FixVarRm marker(annulus,outer)
+ FixVarRm marker(annulus,annuli)
+ FixVarRm marker(panda,inner)
+ FixVarRm marker(panda,outer)
+ FixVarRm marker(panda,annuli)
+ FixVarRm marker(panda,ang1)
+ FixVarRm marker(panda,ang2)
+ FixVarRm marker(panda,angnum)
+ FixVarRm marker(ellipse,radius1)
+ FixVarRm marker(ellipse,radius2)
+ FixVarRm marker(ellipseannulus,radius1)
+ FixVarRm marker(ellipseannulus,radius2)
+ FixVarRm marker(ellipseannulus,radius3)
+ FixVarRm marker(ellipseannulus,annuli)
+ FixVarRm marker(epanda,radius1)
+ FixVarRm marker(epanda,radius2)
+ FixVarRm marker(epanda,radius3)
+ FixVarRm marker(epanda,annuli)
+ FixVarRm marker(epanda,ang1)
+ FixVarRm marker(epanda,ang2)
+ FixVarRm marker(epanda,angnum)
+ FixVarRm marker(box,radius1)
+ FixVarRm marker(box,radius2)
+ FixVarRm marker(boxannulus,radius1)
+ FixVarRm marker(boxannulus,radius2)
+ FixVarRm marker(boxannulus,radius3)
+ FixVarRm marker(boxannulus,annuli)
+ FixVarRm marker(bpanda,radius1)
+ FixVarRm marker(bpanda,radius2)
+ FixVarRm marker(bpanda,radius3)
+ FixVarRm marker(bpanda,annuli)
+ FixVarRm marker(bpanda,ang1)
+ FixVarRm marker(bpanda,ang2)
+ FixVarRm marker(bpanda,angnum)
+ FixVarRm marker(polygon,width)
+ FixVarRm marker(polygon,height)
+ FixVarRm marker(projection,thick)
+ FixVarRm marker(compass,radius)
+ FixVarRm marker(point,size)
+}
+
+proc FixPrefs5.xto6.0 {} {
+ FixVar pap(grid) prefs(ap,grid)
+ FixVar pap(grid,log) prefs(ap,grid,log)
+
+ FixVar pap(discrete) prefs(ap,discrete)
+ FixVar pap(discrete,symbol) prefs(ap,discrete,symbol)
+ FixVar pap(discrete,color) prefs(ap,discrete,color)
+
+ FixVar pap(linear) prefs(ap,linear)
+ FixVar pap(linear,width) prefs(ap,linear,width)
+ FixVar pap(linear,color) prefs(ap,linear,color)
+ FixVar pap(linear,dash) prefs(ap,linear,dash)
+
+ FixVar pap(step) prefs(ap,step)
+ FixVar pap(step,width) prefs(ap,step,width)
+ FixVar pap(step,color) prefs(ap,step,color)
+ FixVar pap(step,dash) prefs(ap,step,dash)
+
+ FixVar pap(quadratic) prefs(ap,quadratic)
+ FixVar pap(quadratic,width) prefs(ap,quadratic,width)
+ FixVar pap(quadratic,color) prefs(ap,quadratic,color)
+ FixVar pap(quadratic,dash) prefs(ap,quadratic,dash)
+
+ FixVar pap(error,color) prefs(ap,error,color)
+ FixVar pap(error,width) prefs(ap,error,width)
+ FixVar pap(error,style) prefs(ap,error,style)
+
+ FixVar pap(titleFont) prefs(ap,titleFont)
+ FixVar pap(titleSize) prefs(ap,titleSize)
+ FixVar pap(titleStyle) prefs(ap,titleStyle)
+
+ FixVar pap(textlabFont) prefs(ap,textlabFont)
+ FixVar pap(textlabSize) prefs(ap,textlabSize)
+ FixVar pap(textlabStyle) prefs(ap,textlabStyle)
+
+ FixVar pap(numlabFont) prefs(ap,numlabFont)
+ FixVar pap(numlabSize) prefs(ap,numlabSize)
+ FixVar pap(numlabStyle) prefs(ap,numlabStyle)
+
+ FixVar pcurrent(zoom) prefs(zoom)
+ FixVar pcurrent(orient) prefs(orient)
+ FixVar pcurrent(rotate) prefs(rotate)
+
+ FixVar panalysis(log) prefs(analysis,log)
+ FixVar pds9(mode) prefs(ds9,mode)
+ FixVar pblink(interval) prefs(blink,interval)
+ FixVar ptile(mode) prefs(tile,mode)
+
+ FixVar pcolorbar(map) prefs(colorbar,map)
+ FixVar pcolorbar(invert) prefs(colorbar,invert)
+
+ FixVar pmarker(shape) prefs(marker,shape)
+ FixVar pmarker(color) prefs(marker,color)
+ FixVar pmarker(width) prefs(marker,width)
+ FixVar pmarker(fixed) prefs(marker,fixed)
+ FixVar pmarker(edit) prefs(marker,edit)
+ FixVar pmarker(move) prefs(marker,move)
+ FixVar pmarker(rotate) prefs(marker,rotate)
+ FixVar pmarker(delete) prefs(marker,delete)
+ FixVar pmarker(include) prefs(marker,include)
+ FixVar pmarker(source) prefs(marker,source)
+ FixVar pmarker(font) prefs(marker,font)
+ FixVar pmarker(font,size) prefs(marker,font,size)
+ FixVar pmarker(font,style) prefs(marker,font,style)
+ FixVar pmarker(format) prefs(marker,format)
+ FixVar pmarker(strip) prefs(marker,strip)
+ FixVar pmarker(system) prefs(marker,system)
+ FixVar pmarker(sky) prefs(marker,sky)
+ FixVar pmarker(skyformat) prefs(marker,skyformat)
+ FixVarRm prefs(marker,wcs)
+ FixVarRm marker(wcs)
+ FixVarRm marker(polygon,width)
+ FixVarRm marker(polygon,height)
+
+ FixVar pmarker(dialog,system) marker(dialog,system)
+ FixVar pmarker(dialog,sky) marker(dialog,sky)
+ FixVar pmarker(dialog,skyformat) marker(dialog,skyformat)
+ FixVar pmarker(dialog,dist,system) marker(dialog,dist,system)
+ FixVar pmarker(dialog,dist,format) marker(dialog,dist,format)
+
+ FixVar pmarker(circle,radius) marker(circle,radius)
+ FixVar pmarker(annulus,inner) marker(annulus,inner)
+ FixVar pmarker(annulus,outer) marker(annulus,outer)
+ FixVar pmarker(annulus,annuli) marker(annulus,annuli)
+ FixVar pmarker(panda,inner) marker(panda,inner)
+ FixVar pmarker(panda,outer) marker(panda,outer)
+ FixVar pmarker(panda,annuli) marker(panda,annuli)
+ FixVar pmarker(panda,ang1) marker(panda,ang1)
+ FixVar pmarker(panda,ang2) marker(panda,ang2)
+ FixVar pmarker(panda,angnum) marker(panda,angnum)
+ FixVar pmarker(ellipse,radius1) marker(ellipse,radius1)
+ FixVar pmarker(ellipse,radius2) marker(ellipse,radius2)
+ FixVar pmarker(ellipseannulus,radius1) marker(ellipseannulus,radius1)
+ FixVar pmarker(ellipseannulus,radius2) marker(ellipseannulus,radius2)
+ FixVar pmarker(ellipseannulus,radius3) marker(ellipseannulus,radius3)
+ FixVar pmarker(ellipseannulus,annuli) marker(ellipseannulus,annuli)
+ FixVar pmarker(epanda,radius1) marker(epanda,radius1)
+ FixVar pmarker(epanda,radius2) marker(epanda,radius2)
+ FixVar pmarker(epanda,radius3) marker(epanda,radius3)
+ FixVar pmarker(epanda,annuli) marker(epanda,annuli)
+ FixVar pmarker(epanda,ang1) marker(epanda,ang1)
+ FixVar pmarker(epanda,ang2) marker(epanda,ang2)
+ FixVar pmarker(epanda,angnum) marker(epanda,angnum)
+ FixVar pmarker(box,radius1) marker(box,radius1)
+ FixVar pmarker(box,radius2) marker(box,radius2)
+ FixVar pmarker(boxannulus,radius1) marker(boxannulus,radius1)
+ FixVar pmarker(boxannulus,radius2) marker(boxannulus,radius2)
+ FixVar pmarker(boxannulus,radius3) marker(boxannulus,radius3)
+ FixVar pmarker(boxannulus,annuli) marker(boxannulus,annuli)
+ FixVar pmarker(bpanda,radius1) marker(bpanda,radius1)
+ FixVar pmarker(bpanda,radius2) marker(bpanda,radius2)
+ FixVar pmarker(bpanda,radius3) marker(bpanda,radius3)
+ FixVar pmarker(bpanda,annuli) marker(bpanda,annuli)
+ FixVar pmarker(bpanda,ang1) marker(bpanda,ang1)
+ FixVar pmarker(bpanda,ang2) marker(bpanda,ang2)
+ FixVar pmarker(bpanda,angnum) marker(bpanda,angnum)
+ FixVar pmarker(projection,thick) marker(projection,thick)
+ FixVar pmarker(point,size) marker(point,size)
+
+ # buttons
+ global buttons
+ global pbuttons
+ if {[info exists buttons(file,about)]} {
+ foreach nn [array names buttons] {
+ set aa [split $nn ,]
+ if {[lindex $aa 1] != {}} {
+ switch [lindex $aa 0] {
+ file -
+ edit -
+ view -
+ frame -
+ bin -
+ zoom -
+ scale -
+ color -
+ region -
+ wcs -
+ help {
+ set pbuttons($nn) $buttons($nn)
+ unset buttons($nn)
+ }
+ }
+ }
+ }
+
+ FixVar pbuttons(scale,995) buttons(scale,99.5)
+ FixVar pbuttons(scale,925) buttons(scale,92.5)
+ FixVar pbuttons(zoom,i32) buttons(zoom,1/32)
+ FixVar pbuttons(zoom,i16) buttons(zoom,1/16)
+ FixVar pbuttons(zoom,i8) buttons(zoom,1/8)
+ FixVar pbuttons(zoom,i4) buttons(zoom,1/4)
+ FixVar pbuttons(zoom,i2) buttons(zoom,1/2)
+
+ FixVarRm pbuttons(scale,92.5)
+ FixVarRm pbuttons(scale,99.5)
+ FixVarRm pbuttons(zoom,1/32)
+ FixVarRm pbuttons(zoom,1/16)
+ FixVarRm pbuttons(zoom,1/8)
+ FixVarRm pbuttons(zoom,1/4)
+ FixVarRm pbuttons(zoom,1/2)
+ }
+}
diff --git a/ds9/library/prefsdialog.tcl b/ds9/library/prefsdialog.tcl
new file mode 100644
index 0000000..be90b92
--- /dev/null
+++ b/ds9/library/prefsdialog.tcl
@@ -0,0 +1,317 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PrefsDialog {{which {}}} {
+ global ds9
+ global iprefs
+ global dprefs
+
+ # see if we already have a window visible
+ if {[winfo exists $iprefs(top)]} {
+ raise $iprefs(top)
+ return
+ }
+
+ # create the window
+ set w $iprefs(top)
+ set mb $iprefs(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Preferences}] PrefsDialogSave
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Clear Preferences}] \
+ -command PrefsDialogClear
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Save}] -command PrefsDialogSave
+ $mb.file add command -label [msgcat::mc {Close}] -command PrefsDialogClose
+
+ EditMenu $mb iprefs
+
+ # List
+ set f [ttk::frame $w.param]
+
+ ttk::scrollbar $f.scroll -command [list $f.box yview]
+ set dprefs(list) [listbox $f.box \
+ -yscroll [list $f.scroll set] \
+ -selectmode browse \
+ -setgrid true \
+ -width 18 -height 28 \
+ ]
+ grid $f.box $f.scroll -sticky news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 2 -weight 1
+
+ bind $dprefs(list) <<ListboxSelect>> [list PrefsDialogListUpdate]
+
+ set dprefs(tab) $f
+ set dprefs(tabs) {}
+
+ PrefsDialogGeneral
+ PrefsDialogStartup
+ PrefsDialogMenu
+ PrefsDialogPanner
+ PrefsDialogMagnifier
+ PrefsDialog3d
+ PrefsDialogGraph
+ PrefsDialogScale
+ PrefsDialogColor
+ PrefsDialogBin
+ PrefsDialogZoom
+ PrefsDialogRegion
+ PrefsDialogAnnulus
+ PrefsDialogPanda
+ PrefsDialogAnalysis
+ PrefsDialogPixelTable
+ PrefsDialogContour
+ PrefsDialogSmooth
+ PrefsDialogCatalog
+ PrefsDialogNRES
+ PrefsDialogPlot
+ PrefsDialogVO
+ PrefsDialogPrint
+ PrefsDialogPageSetup
+ PrefsDialogCoord
+ PrefsDialogExamine
+ PrefsDialogHTTP
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.save -text [msgcat::mc {Save}] \
+ -command PrefsDialogSave
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command PrefsDialogClose
+ ttk::button $f.clear -text [msgcat::mc {Clear Preferences}] \
+ -command PrefsDialogClear
+ pack $f.clear $f.save $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -fill both -expand true
+
+ # http is hard coded to be last
+ switch $which {
+ http {$dprefs(list) selection set end}
+ default {$dprefs(list) selection set 0}
+ }
+
+ PrefsDialogListUpdate
+}
+
+proc PrefsDialogListUpdate {} {
+ global dprefs
+
+ set which [$dprefs(list) curselection]
+ if {$which == {}} {
+ set which 0
+ }
+ foreach tab $dprefs(tabs) {
+ grid forget $tab
+ }
+
+ grid [lindex $dprefs(tabs) $which] -row 0 -column 2 -sticky new
+}
+
+proc PrefsDialogSave {} {
+ global iprefs
+
+ if {[winfo exists $iprefs(top)]} {
+ destroy $iprefs(top)
+ destroy $iprefs(mb)
+ }
+
+ SavePrefs
+}
+
+proc PrefsDialogClose {} {
+ global iprefs
+ global dprefs
+
+ if {[winfo exists $iprefs(top)]} {
+ destroy $iprefs(top)
+ destroy $iprefs(mb)
+ }
+
+ unset dprefs
+}
+
+proc PrefsDialogClear {} {
+ global iprefs
+ global dprefs
+ global pds9
+
+ if {$pds9(confirm)} {
+ if {[tk_messageBox -type okcancel -icon question -message [msgcat::mc {Clear Preferences?}]] != {ok}} {
+ return
+ }
+ }
+
+ ClearPrefs
+ PrefsDialogClose
+}
+
+# Pref Frames
+
+proc PrefsDialogGeneral {} {
+ global dprefs
+ global ds9
+ global pds9
+ global pmagnifier
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {General}]
+ lappend dprefs(tabs) [ttk::frame $w.general]
+
+ # General
+ set f [ttk::labelframe $w.general.misc -text [msgcat::mc {General}]]
+
+ ttk::checkbutton $f.backup \
+ -text [msgcat::mc {Always save files during Backup}] \
+ -variable pds9(backup)
+ ttk::checkbutton $f.auto -text [msgcat::mc {Autoload FITS Regions}] \
+ -variable pds9(automarker)
+ ttk::checkbutton $f.confirm \
+ -text [msgcat::mc {Enable Confirmation Dialogs}] \
+ -variable pds9(confirm)
+ ttk::label $f.tthreads -text [msgcat::mc {Number of Threads}]
+ ttk::entry $f.threads -textvariable ds9(threads) \
+ -validate focusout -validatecommand ChangeThreads -width 8
+
+ grid $f.backup -padx 2 -pady 2 -sticky w
+ grid $f.auto -padx 2 -pady 2 -sticky w
+ grid $f.confirm -padx 2 -pady 2 -sticky w
+ grid $f.tthreads $f.threads -padx 2 -pady 2 -sticky w
+
+ # Language
+ set f [ttk::labelframe $w.general.lang -text [msgcat::mc {Language}]]
+
+ ttk::menubutton $f.lang -textvariable pds9(language,name) -menu $f.lang.menu
+
+ set m $f.lang.menu
+ menu $m
+ $m add radiobutton -label [LanguageToName locale] \
+ -variable pds9(language,name) -command "set pds9(language) locale"
+ $m add separator
+ $m add radiobutton -label [LanguageToName cs] \
+ -variable pds9(language,name) -command "set pds9(language) cs"
+ $m add radiobutton -label [LanguageToName da] \
+ -variable pds9(language,name) -command "set pds9(language) da"
+ $m add radiobutton -label [LanguageToName de] \
+ -variable pds9(language,name) -command "set pds9(language) de"
+ $m add radiobutton -label [LanguageToName en] \
+ -variable pds9(language,name) -command "set pds9(language) en"
+ $m add radiobutton -label [LanguageToName es] \
+ -variable pds9(language,name) -command "set pds9(language) es"
+ $m add radiobutton -label [LanguageToName fr] \
+ -variable pds9(language,name) -command "set pds9(language) fr"
+ $m add radiobutton -label [LanguageToName ja] \
+ -variable pds9(language,name) -command "set pds9(language) ja"
+ $m add radiobutton -label [LanguageToName pt] \
+ -variable pds9(language,name) -command "set pds9(language) pt"
+ $m add radiobutton -label [LanguageToName zh] \
+ -variable pds9(language,name) -command "set pds9(language) zh"
+
+ grid $f.lang -padx 2 -pady 2 -sticky w
+
+ # GUI Font
+ set f [ttk::labelframe $w.general.font -text [msgcat::mc {GUI Font}]]
+
+ FontMenuButton $f.font pds9 font \
+ font,size font,weight font,slant \
+ [list SetDefaultFont true]
+ ttk::button $f.reset -text [msgcat::mc {Reset}] \
+ -command ResetDefaultFont
+
+ grid $f.font $f.reset -padx 2 -pady 2 -sticky w
+
+ # Text Font
+ set f [ttk::labelframe $w.general.textfont -text [msgcat::mc {Text Font}]]
+
+ FontMenuButton $f.textfont pds9 text,font \
+ text,font,size text,font,weight text,font,slant \
+ [list SetDefaultTextFont true]
+ ttk::button $f.textreset -text [msgcat::mc {Reset}] \
+ -command ResetDefaultTextFont
+
+ grid $f.textfont $f.textreset -padx 2 -pady 2 -sticky w
+
+ # Color
+ set f [ttk::labelframe $w.general.color -text [msgcat::mc {Color}]]
+
+ ttk::label $f.tbg -text [msgcat::mc {Background Color}]
+ ColorMenuButton $f.bg pds9 bg PrefsBgColor
+
+ ttk::label $f.tnan -text [msgcat::mc {Blank/Inf/NaN Color}]
+ ColorMenuButton $f.nan pds9 nan PrefsNanColor
+
+ grid $f.tbg $f.bg -padx 2 -pady 2 -sticky w
+ grid $f.tnan $f.nan -padx 2 -pady 2 -sticky w
+
+ # Mosaic
+ set f [ttk::labelframe $w.general.mosaic -text [msgcat::mc {Mosaic}]]
+ ttk::checkbutton $f.align -text {IRAF DETSEC Align} -variable pds9(iraf) \
+ -command PrefsIRAFAlign
+
+ grid $f.align -padx 2 -pady 2 -sticky w
+
+ # Dialog Box
+ set f [ttk::labelframe $w.general.box -text [msgcat::mc {Dialog Box}]]
+
+ ttk::radiobutton $f.motif -text {Motif} -variable pds9(dialog) \
+ -value motif
+ ttk::radiobutton $f.windows -text {Windows} -variable pds9(dialog) \
+ -value windows
+ grid $f.motif $f.windows -padx 2 -pady 2 -sticky w
+
+ switch $ds9(wm) {
+ x11 {}
+ aqua -
+ win32 {
+ ttk::radiobutton $f.native -text [msgcat::mc {Native Dialog}] \
+ -variable pds9(dialog) -value native
+ grid $f.native -row 0 -column 2 -padx 2 -pady 2 -sticky w
+ }
+ }
+
+ ttk::checkbutton $f.center -text [msgcat::mc {Center Non-modal Dialogs}] \
+ -variable pds9(dialog,center)
+ ttk::checkbutton $f.all -text [msgcat::mc {Default All Files}] \
+ -variable pds9(dialog,all)
+
+ grid $f.center - -padx 2 -pady 2 -sticky w
+ grid $f.all - -padx 2 -pady 2 -sticky w
+
+ pack $w.general.misc $w.general.lang $w.general.font \
+ $w.general.textfont $w.general.color $w.general.mosaic \
+ $w.general.box \
+ -side top -fill both -expand true
+}
+
+proc PrefsDialogStartup {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Startup}]
+ lappend dprefs(tabs) [ttk::frame $w.startup]
+
+ set f [ttk::labelframe $w.startup.params -text [msgcat::mc {At Startup}]]
+
+ ttk::checkbutton $f.xpa -text [msgcat::mc {Initialize XPA}] \
+ -variable pds9(xpa)
+ ttk::checkbutton $f.samp -text [msgcat::mc {Connect SAMP}] \
+ -variable pds9(samp)
+
+ grid $f.xpa -padx 2 -pady 2 -sticky w
+ grid $f.samp -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true -anchor nw
+}
diff --git a/ds9/library/print.tcl b/ds9/library/print.tcl
new file mode 100644
index 0000000..6b92061
--- /dev/null
+++ b/ds9/library/print.tcl
@@ -0,0 +1,612 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc PSDef {} {
+ global ds9
+ global ps
+ global pps
+
+ set ps(dest) printer
+ set ps(cmd) {lp}
+ set ps(filename) {ds9.ps}
+ set ps(filename,txt) {ds9.txt}
+ set ps(color) rgb
+ set ps(level) 2
+ set ps(resolution) 150
+
+ set ps(orient) portrait
+ set ps(scale) 100
+ set ps(size) letter
+ set ps(width) 8.5
+ set ps(height) 11
+
+ array set pps [array get ps]
+}
+
+# Print procs
+
+proc PSPrint {} {
+ if {[PSPrintDialog ps]} {
+ if {[catch {PostScript} printError]} {
+ Error "[msgcat::mc {An error has occurred while printing}] $printError"
+ }
+ }
+}
+
+proc PostScript {} {
+ global ds9
+ global ps
+ global view
+ global canvas
+ global colorbar
+ global current
+
+ # we need to be realized
+ RealizeDS9
+ # need the colorbar levels updated
+ UpdateColormapLevel
+
+ set options {}
+
+ # Orientation
+ switch -- $ps(orient) {
+ portrait {append options " -rotate false"}
+ landscape {append options " -rotate true"}
+ }
+
+ # Page size
+ # reduce size to .95 for backward compatibility
+ set width [winfo width $ds9(canvas)]
+ set height [winfo height $ds9(canvas)]
+ set xx [expr $width*(1- (100./$ps(scale)/.95))/2.]
+ set yy [expr $height*(1- (100./$ps(scale)/.95))/2.]
+ set ww [expr $width*100./$ps(scale)/.95]
+ set hh [expr $height*100./$ps(scale)/.95]
+
+ append options " -x $xx -y $yy -width $ww -height $hh"
+
+ switch -- $ps(size) {
+ letter {PostScriptPageSize 4.25 5.5 7.5 10. i options}
+ legal {PostScriptPageSize 4.25 7. 7.5 13. i options}
+ tabloid {PostScriptPageSize 5.5 8.5 10. 16. i options}
+ poster {PostScriptPageSize 18. 24. 35. 47. i options}
+ a4 {PostScriptPageSize 105 148.5 185 272 m options}
+ other {
+ if {$ps(width) != {} && $ps(height) != {}} {
+ set pxx [expr double($ps(width))/2.]
+ set pyy [expr double($ps(height))/2.]
+ set pww [expr $ps(width)-1.]
+ set phh [expr $ps(height)-1.]
+ PostScriptPageSize $pxx $pyy $pww $phh i options
+ }
+ }
+ othermm {
+ if {$ps(width) != {} && $ps(height) != {}} {
+ set pxx [expr double($ps(width))/2.]
+ set pyy [expr double($ps(height))/2.]
+ set pww [expr $ps(width)-1.]
+ set phh [expr $ps(height)-1.]
+ PostScriptPageSize $pxx $pyy $pww $phh m options
+ }
+ }
+ }
+
+ # Printer vs File
+ set channel {}
+ switch -- $ps(dest) {
+ "file" {
+ append options " -file \{$ps(filename)\}"
+ }
+ "printer" {
+ set channel [open "| $ps(cmd)" w]
+ append options " -channel $channel"
+ }
+ }
+
+ # resolution
+ switch $ps(resolution) {
+ screen -
+ Screen -
+ SCREEN {set res 96}
+ default {set res $ps(resolution)}
+ }
+
+ # set color specific postscript options
+ colorbar postscript level $ps(level)
+ colorbar postscript colorspace $ps(color)
+ colorbar postscript resolution $res
+
+ colorbarrgb postscript level $ps(level)
+ colorbarrgb postscript colorspace $ps(color)
+ colorbarrgb postscript resolution $res
+
+ # set frame specific postscript options
+ foreach ff $ds9(frames) {
+ $ff postscript level $ps(level)
+ $ff postscript colorspace $ps(color)
+ $ff postscript resolution $res
+ }
+
+ # graphs
+ if {$view(graph,vert)} {
+ $ds9(graph,vert) configure -plotbackground white -bg white
+ }
+ if {$view(graph,horz)} {
+ $ds9(graph,horz) configure -plotbackground white -bg white
+ }
+
+ # now invoke canvas postscript command
+ if {[catch {eval $ds9(canvas) postscript $options} rr]} {
+ Error "[msgcat::mc {A postscript generation error has occurred}] $rr"
+ }
+
+ switch -- $ps(dest) {
+ "file" {}
+ "printer" {
+ if {$channel != {}} {
+ close $channel
+ }
+ }
+ }
+
+ # reset graphs
+ if {$view(graph,vert)} {
+ $ds9(graph,vert) configure -plotbackground $ds9(bg) -bg $ds9(bg)
+ }
+ if {$view(graph,horz)} {
+ $ds9(graph,horz) configure -plotbackground $ds9(bg) -bg $ds9(bg)
+ }
+}
+
+proc EPS {fn} {
+ global ds9
+ global ps
+ global view
+ global canvas
+ global colorbar
+ global current
+
+ # we need to be realized
+ RealizeDS9
+ # need the colorbar levels updated
+ UpdateColormapLevel
+
+ set color rgb
+ set level 2
+ set resolution 72
+
+ set options {}
+
+ # Page size
+ set width [winfo width $ds9(canvas)]
+ set height [winfo height $ds9(canvas)]
+ append options " -pagex 0 -pagey 0 -pageanchor sw"
+ if ($width>$height) {
+ append options " -pagewidth $width"
+ } else {
+ append options " -pageheight $height"
+ }
+
+ # File
+ append options " -file \{$fn\}"
+
+ # set color specific postscript options
+ colorbar postscript level $level
+ colorbar postscript colorspace $color
+ colorbar postscript resolution $resolution
+
+ colorbarrgb postscript level $level
+ colorbarrgb postscript colorspace $color
+ colorbarrgb postscript resolution $resolution
+
+ # set frame specific postscript options
+ foreach ff $ds9(frames) {
+ $ff postscript level $level
+ $ff postscript colorspace $color
+ $ff postscript resolution $resolution
+ }
+
+ # graphs
+ if {$view(graph,vert)} {
+ $ds9(graph,vert) configure -plotbackground white -bg white
+ }
+ if {$view(graph,horz)} {
+ $ds9(graph,horz) configure -plotbackground white -bg white
+ }
+
+ # now invoke canvas postscript command
+ if {[catch {eval $ds9(canvas) postscript $options} rr]} {
+ Error "[msgcat::mc {A postscript generation error has occurred}] $rr"
+ }
+
+ # reset graphs
+ if {$view(graph,vert)} {
+ $ds9(graph,vert) configure -plotbackground $ds9(bg) -bg $ds9(bg)
+ }
+ if {$view(graph,horz)} {
+ $ds9(graph,horz) configure -plotbackground $ds9(bg) -bg $ds9(bg)
+ }
+}
+
+proc PostScriptPageSize {xx yy ww hh unit optname} {
+ upvar $optname options
+
+ global ds9
+ global ps
+
+ append options " -pagex $xx$unit -pagey $yy$unit"
+
+ set width [winfo width $ds9(canvas)]
+ set height [winfo height $ds9(canvas)]
+
+ switch -- $ps(orient) {
+ portrait {
+ if {[expr double($ww)/$width] < [expr double($hh)/$height]} {
+ append options " -pagewidth $ww$unit"
+ } else {
+ append options " -pageheight $hh$unit"
+ }
+ }
+ landscape {
+ if {[expr double($ww)/$width] > [expr double($hh)/$height]} {
+ append options " -pageheight $ww$unit"
+ } else {
+ append options " -pagewidth $hh$unit"
+ }
+ }
+ }
+}
+
+# Print Dialog procs
+proc PSPrintDialog {which} {
+ global ps
+ global ed
+
+ set ed(ok) 0
+ array set ed [array get ps]
+
+ set w {.print}
+
+ DialogCreate $w [msgcat::mc {Print}] ed(ok)
+
+ # PrintTo
+ set f [ttk::labelframe $w.pt -text [msgcat::mc {Print To}]]
+
+ ttk::radiobutton $f.printer -text [msgcat::mc {Printer}] \
+ -variable ed(dest) -value printer
+ ttk::label $f.tcmd -text [msgcat::mc {Command}]
+ ttk::entry $f.cmd -textvariable ed(cmd) -width 20
+
+ ttk::radiobutton $f.file -text [msgcat::mc {File}] \
+ -variable ed(dest) -value file
+ ttk::label $f.tname -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable ed(filename) -width 20
+ ttk::button $f.browse -text [msgcat::mc {Browse}] \
+ -command "PSPrintBrowse ed(filename)"
+
+ grid $f.printer $f.tcmd $f.cmd -padx 2 -pady 2 -sticky ew
+ grid $f.file $f.tname $f.name $f.browse -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 2 -weight 1
+
+ # Options
+ set f [ttk::labelframe $w.ps -text [msgcat::mc {Postscript}]]
+
+ ttk::label $f.color -text [msgcat::mc {Color}]
+ ttk::radiobutton $f.rgb -text [msgcat::mc {RGB}] \
+ -variable ed(color) -value rgb
+ ttk::radiobutton $f.cmyk -text [msgcat::mc {CMYK}] \
+ -variable ed(color) -value cmyk
+ ttk::radiobutton $f.gray -text [msgcat::mc {Grayscale}] \
+ -variable ed(color) -value gray
+ ttk::label $f.level -text [msgcat::mc {Level}]
+ ttk::radiobutton $f.level1 -text "[msgcat::mc {Level}] 1" \
+ -variable ed(level) -value 1
+ ttk::radiobutton $f.level2 -text "[msgcat::mc {Level}] 2" \
+ -variable ed(level) -value 2
+ ttk::radiobutton $f.level3 -text "[msgcat::mc {Level}] 3" \
+ -variable ed(level) -value 3
+ ttk::label $f.dpi -text [msgcat::mc {DPI}]
+ tk_optionMenu $f.resolution ed(resolution) 72 Screen 96 144 150 225 300 600 1200
+
+ grid $f.color $f.rgb $f.cmyk $f.gray -padx 2 -pady 2 -sticky w
+ grid $f.level $f.level3 $f.level2 $f.level1 -padx 2 -pady 2 -sticky w
+ grid $f.dpi $f.resolution -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ grid $w.pt -sticky news
+ grid $w.ps -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ array set ps [array get ed]
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PSPrintBrowse {varname} {
+ upvar $varname var
+
+ FileLast pssavfbox $var
+ set var [SaveFileDialog pssavfbox]
+}
+
+# Used for plots
+proc PlotPrintDialog {} {
+ global ps
+ global ed
+
+ set ed(ok) 0
+ array set ed [array get ps]
+
+ set w {.print}
+
+ DialogCreate $w [msgcat::mc {Print}] ed(ok)
+
+ # PrintTo
+ set f [ttk::labelframe $w.pt -text [msgcat::mc {Print To}]]
+
+ ttk::radiobutton $f.printer -text [msgcat::mc {Printer}] \
+ -variable ed(dest) -value printer
+ ttk::label $f.tcmd -text [msgcat::mc {Command}]
+ ttk::entry $f.cmd -textvariable ed(cmd) -width 20
+
+ ttk::radiobutton $f.file -text [msgcat::mc {File}] \
+ -variable ed(dest) -value file
+ ttk::label $f.tname -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable ed(filename) -width 20
+ ttk::button $f.browse -text [msgcat::mc {Browse}] \
+ -command "PlotPrintBrowse ed(filename)"
+
+ grid $f.printer $f.tcmd $f.cmd -padx 2 -pady 2 -sticky ew
+ grid $f.file $f.tname $f.name $f.browse -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 2 -weight 1
+
+ # Options
+ set f [ttk::labelframe $w.ps -text [msgcat::mc {Postscript}]]
+
+ ttk::label $f.color -text [msgcat::mc {Color}]
+ ttk::radiobutton $f.rgb -text [msgcat::mc {RGB}] \
+ -variable ed(color) -value rgb
+ ttk::radiobutton $f.gray -text [msgcat::mc {Grayscale}] \
+ -variable ed(color) -value gray
+
+ grid $f.color $f.rgb $f.gray -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ grid $w.pt -sticky news
+ grid $w.ps -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ array set ps [array get ed]
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PlotPrintBrowse {varname} {
+ upvar $varname var
+
+ FileLast apsavfbox $var
+ set var [SaveFileDialog apsavfbox]
+}
+
+# Used for SimpleText and Catalog
+proc PRPrintDialog {} {
+ global ps
+ global ed
+
+ set ed(ok) 0
+ array set ed [array get ps]
+
+ set w {.print}
+
+ DialogCreate $w [msgcat::mc {Print}] ed(ok)
+
+ # PrintTo
+ set f [ttk::labelframe $w.pt -text [msgcat::mc {Print To}]]
+
+ ttk::radiobutton $f.printer -text [msgcat::mc {Printer}] \
+ -variable ed(dest) -value printer
+ ttk::label $f.tcmd -text [msgcat::mc {Command}]
+ ttk::entry $f.cmd -textvariable ed(cmd) -width 20
+
+ ttk::radiobutton $f.file -text [msgcat::mc {File}] \
+ -variable ed(dest) -value file
+ ttk::label $f.tname -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable ed(filename,txt) -width 20
+ ttk::button $f.browse -text [msgcat::mc {Browse}] \
+ -command "PRPrintBrowse ed(filename,txt)"
+
+ grid $f.printer $f.tcmd $f.cmd -padx 2 -pady 2 -sticky ew
+ grid $f.file $f.tname $f.name $f.browse -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 2 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ grid $w.pt -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ DialogCenter $w
+ DialogWait $w ed(ok) $w.buttons.ok
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ array set ps [array get ed]
+ }
+
+ set rr $ed(ok)
+ unset ed
+ return $rr
+}
+
+proc PRPrintBrowse {varname} {
+ upvar $varname var
+
+ FileLast prsavfbox $var
+ set var [SaveFileDialog prsavfbox]
+}
+
+proc PrefsDialogPrint {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Postscript}]
+ lappend dprefs(tabs) [ttk::frame $w.print]
+
+ # PrintTo
+ set f [ttk::labelframe $w.print.printto -text [msgcat::mc {Print To}]]
+
+ ttk::radiobutton $f.printer -text [msgcat::mc {Printer}] \
+ -variable pps(dest) -value printer
+ ttk::label $f.tcmd -text [msgcat::mc {Command}]
+ ttk::entry $f.cmd -textvariable pps(cmd) -width 20
+
+ ttk::radiobutton $f.file -text [msgcat::mc {File}] \
+ -variable pps(dest) -value file
+ ttk::label $f.tname -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable pps(filename) -width 20
+ ttk::button $f.browse -text [msgcat::mc {Browse}] \
+ -command "PSPrintBrowse pps(filename)"
+
+ grid $f.printer $f.tcmd $f.cmd -padx 2 -pady 2 -sticky w
+ grid $f.file $f.tname $f.name $f.browse -padx 2 -pady 2 -sticky w
+
+ # Options
+ set f [ttk::labelframe $w.print.ps -text [msgcat::mc {Postscript}]]
+
+ ttk::label $f.color -text [msgcat::mc {Color}]
+ ttk::radiobutton $f.rgb -text [msgcat::mc {RGB}] \
+ -variable pps(color) -value rgb
+ ttk::radiobutton $f.cmyk -text [msgcat::mc {CMYK}] \
+ -variable pps(color) -value cmyk
+ ttk::radiobutton $f.gray -text [msgcat::mc {Grayscale}] \
+ -variable pps(color) -value gray
+ ttk::label $f.level -text [msgcat::mc {Level}]
+ ttk::radiobutton $f.level1 -text "[msgcat::mc {Level}] 1" \
+ -variable pps(level) -value 1
+ ttk::radiobutton $f.level2 -text "[msgcat::mc {Level}] 2" \
+ -variable pps(level) -value 2
+ ttk::radiobutton $f.level3 -text "[msgcat::mc {Level}] 3" \
+ -variable pps(level) -value 3
+ ttk::label $f.dpi -text [msgcat::mc {DPI}]
+ tk_optionMenu $f.resolution pps(resolution) 72 Screen 96 144 150 225 300 600 1200
+
+ grid $f.color $f.rgb $f.cmyk $f.gray -padx 2 -pady 2 -sticky w
+ grid $f.level $f.level3 $f.level2 $f.level1 -padx 2 -pady 2 -sticky w
+ grid $f.dpi $f.resolution -padx 2 -pady 2 -sticky w
+
+ pack $w.print.printto $w.print.ps \
+ -side top -fill both -expand true
+}
+
+# Process Cmds
+
+proc ProcessPrintCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {ProcessPSPrintCmd var i}
+ }
+}
+
+proc ProcessSendPrintCmd {proc id param} {
+ global ds9
+
+ switch $ds9(wm) {
+ x11 -
+ aqua -
+ win32 {ProcessSendPSPrintCmd $proc $id $param}
+ }
+}
+
+proc ProcessPSPrintCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ps
+
+ switch -- [string tolower [lindex $var $i]] {
+ destination {incr i; set ps(dest) [lindex $var $i]}
+ command {incr i; set ps(cmd) [lindex $var $i]}
+ filename {incr i; set ps(filename) [lindex $var $i]}
+ palette -
+ color {incr i; set ps(color) [lindex $var $i]}
+ level {incr i; set ps(level) [lindex $var $i]}
+ interpolate {incr i}
+ resolution {incr i; set ps(resolution) [lindex $var $i]}
+
+ {} {PostScript}
+ default {incr i -1; PostScript}
+ }
+}
+
+proc ProcessSendPSPrintCmd {proc id param} {
+ global ps
+
+ switch -- [string tolower $param] {
+ destination {$proc $id "$ps(dest)\n"}
+ command {$proc $id "$ps(cmd)\n"}
+ filename {$proc $id "$ps(filename)\n"}
+ palette -
+ color {$proc $id "$ps(color)\n"}
+ level {$proc $id "$ps(level)\n"}
+ interpolate {$proc $id "0\n"}
+ resolution {$proc $id "$ps(resolution)\n"}
+ }
+}
diff --git a/ds9/library/projection.tcl b/ds9/library/projection.tcl
new file mode 100644
index 0000000..9dc331e
--- /dev/null
+++ b/ds9/library/projection.tcl
@@ -0,0 +1,128 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ProjectionDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(tcoord) [lindex $rr 0]
+ set var(tformat) degrees
+ AdjustCoordSystem $varname tcoord
+
+ # procs
+ set var(which) projection
+ set var(proc,apply) ProjectionApply
+ set var(proc,coordCB) ProjectionCoordCB
+ set var(proc,editCB) ProjectionEditCB
+ set var(proc,distCB) ProjectionDistCB
+
+ # base
+ MarkerBaseLineDialog $varname 500 200
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ # plot2d
+ MarkerAnalysisPlot2dDialog $varname
+
+ # init
+ ProjectionThickCB $varname
+
+ set f $var(top).param
+
+ # Thick
+ ttk::label $f.tthick -text [msgcat::mc {Thickness}]
+ ttk::entry $f.thick -textvariable ${varname}(thick) -width 13
+ DistMenuButton $f.uthick $varname tcoord 1 tformat \
+ [list ProjectionThickCB $varname]
+ DistMenuEnable $f.uthick.menu $varname tcoord 1 tformat
+
+ grid $f.tthick $f.thick $f.uthick -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc ProjectionApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) projection $var(system) $var(sky) \
+ $var(x) $var(y) $var(x2) $var(y2) \
+ $var(thick) $var(tcoord) $var(tformat)
+
+ MarkerBaseLineApply $varname
+}
+
+# callbacks
+
+proc ProjectionCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "ProjectionCoordCB"
+ }
+
+ MarkerAnalysisPlot2dSystem $varname
+ MarkerBaseCoordCB $varname
+ ProjectionEditCB $varname
+}
+
+proc ProjectionEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "ProjectionEditCB"
+ }
+
+ MarkerBaseLineEditCB $varname
+
+ set var(dist) [$var(frame) get marker $var(id) projection length \
+ $var(dcoord) $var(dformat)]
+ set var(thick) [$var(frame) get marker $var(id) projection thick \
+ $var(tcoord) $var(tformat)]
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+}
+
+proc ProjectionDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "ProjectionDistCB"
+ }
+
+ set var(dist) [$var(frame) get marker $var(id) projection length \
+ $var(dcoord) $var(dformat)]
+}
+
+proc ProjectionThickCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "ProjectionThickCB"
+ }
+
+ set var(thick) [$var(frame) get marker $var(id) projection thick \
+ $var(tcoord) $var(tformat)]
+}
+
diff --git a/ds9/library/rgb.tcl b/ds9/library/rgb.tcl
new file mode 100644
index 0000000..292a9d2
--- /dev/null
+++ b/ds9/library/rgb.tcl
@@ -0,0 +1,365 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc RGBDef {} {
+ global rgb
+ global irgb
+
+ set irgb(top) .rgb
+ set irgb(mb) .rgbmb
+
+ set rgb(red) 1
+ set rgb(green) 1
+ set rgb(blue) 1
+ set rgb(system) wcs
+ set rgb(lock,wcs) 0
+ set rgb(lock,crop) 0
+ set rgb(lock,slice) 0
+ set rgb(lock,bin) 0
+ set rgb(lock,axes) 0
+ set rgb(lock,scale) 0
+ set rgb(lock,scalelimits) 0
+ set rgb(lock,colorbar) 0
+ set rgb(lock,block) 0
+ set rgb(lock,smooth) 0
+}
+
+proc RGBEvalLockCurrent {varname cmd} {
+ global current
+
+ global rgb
+ global crop
+ global cube
+ global bin
+ global scale
+ global colorbar
+ global block
+ global smooth
+
+ RGBEvalLock $varname $current(frame) $cmd
+}
+
+proc RGBEvalLock {varname which cmd} {
+ upvar $varname var
+
+ global rgb
+ global crop
+ global cube
+ global bin
+ global scale
+ global colorbar
+ global block
+ global smooth
+
+ if {$var && [$which get type] == {rgb}} {
+ set ch [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ eval $cmd
+ }
+ $which rgb channel $ch
+ } else {
+ eval $cmd
+ }
+}
+
+proc RGBEvalLockColorbar {cmd} {
+ global current
+ global scale
+ global rgb
+
+ if {$rgb(lock,colorbar) && [$current(frame) get type] == {rgb}} {
+ set ch $current(rgb)
+ foreach c {red green blue} {
+ colorbarrgb rgb channel $c
+ eval $cmd
+ }
+ set current(rgb) $ch
+ colorbarrgb rgb channel $current(rgb)
+ } else {
+ eval $cmd
+ }
+}
+
+proc RGBChannel {} {
+ global current
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) get type] == {rgb}} {
+ colorbarrgb rgb channel $current(rgb)
+ }
+ $current(frame) rgb channel $current(rgb)
+ UpdateDS9
+ }
+}
+
+proc RGBView {} {
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ $current(frame) rgb view $rgb(red) $rgb(green) $rgb(blue)
+ }
+}
+
+proc RGBSystem {} {
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ $current(frame) rgb system $rgb(system)
+ }
+}
+
+# used by backup
+proc RGBDialog {} {
+ global rgb
+ global irgb
+
+ global current
+ global ds9
+
+ # see if we already have a window visible
+ if {[winfo exists $irgb(top)]} {
+ raise $irgb(top)
+ return
+ }
+
+ # create the rgb window
+ set w $irgb(top)
+ set mb $irgb(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {RGB}] RGBDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Align}] -menu $mb.align
+ $mb add cascade -label [msgcat::mc {Lock}] -menu $mb.lock
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Close}] -command RGBDestroyDialog
+
+ CoordMenu $mb.align rgb system 1 {} {} RGBSystem
+
+ menu $mb.lock
+ $mb.lock add checkbutton -label [msgcat::mc {WCS}] \
+ -variable rgb(lock,wcs)
+ $mb.lock add checkbutton -label [msgcat::mc {Crop}] \
+ -variable rgb(lock,crop)
+ $mb.lock add checkbutton -label [msgcat::mc {Slice}] \
+ -variable rgb(lock,slice)
+ $mb.lock add checkbutton -label [msgcat::mc {Bin}] \
+ -variable rgb(lock,bin)
+ $mb.lock add checkbutton -label [msgcat::mc {Axes Order}] \
+ -variable rgb(lock,axes)
+ $mb.lock add checkbutton -label [msgcat::mc {Scale}] \
+ -variable rgb(lock,scale)
+ $mb.lock add checkbutton -label [msgcat::mc {Scale and Limits}] \
+ -variable rgb(lock,scalelimits)
+ $mb.lock add checkbutton -label [msgcat::mc {Colorbar}] \
+ -variable rgb(lock,colorbar)
+ $mb.lock add checkbutton -label [msgcat::mc {Block}] \
+ -variable rgb(lock,block)
+ $mb.lock add checkbutton -label [msgcat::mc {Smooth}] \
+ -variable rgb(lock,smooth)
+
+ # Param
+ set f [ttk::frame $w.param]
+ ttk::label $f.currenttitle -text [msgcat::mc {Current}]
+ ttk::label $f.viewtitle -text [msgcat::mc {View}]
+ ttk::label $f.redtitle -text [msgcat::mc {Red}]
+ ttk::label $f.bluetitle -text [msgcat::mc {Blue}]
+ ttk::label $f.greentitle -text [msgcat::mc {Green}]
+
+ ttk::radiobutton $f.redcurrent -variable current(rgb) \
+ -value red -command RGBChannel
+ ttk::radiobutton $f.greencurrent -variable current(rgb) \
+ -value green -command RGBChannel
+ ttk::radiobutton $f.bluecurrent -variable current(rgb) \
+ -value blue -command RGBChannel
+
+ ttk::checkbutton $f.redview -variable rgb(red) -command RGBView
+ ttk::checkbutton $f.greenview -variable rgb(green) -command RGBView
+ ttk::checkbutton $f.blueview -variable rgb(blue) -command RGBView
+
+ grid x $f.currenttitle $f.viewtitle -padx 2 -pady 2 -sticky w
+ grid $f.redtitle $f.redcurrent $f.redview -padx 2 -pady 2 -sticky w
+ grid $f.greentitle $f.greencurrent $f.greenview -padx 2 -pady 2 -sticky w
+ grid $f.bluetitle $f.bluecurrent $f.blueview -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command RGBDestroyDialog
+ pack $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+}
+
+proc RGBDestroyDialog {} {
+ global irgb
+
+ if {[winfo exists $irgb(top)]} {
+ destroy $irgb(top)
+ destroy $irgb(mb)
+ }
+}
+
+proc UpdateRGBMenu {} {
+ # can be changed by wcs
+ SetCoordSystem rgb system {} {}
+}
+
+proc UpdateRGBDialog {} {
+ global rgb
+ global irgb
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateRGBDialog"
+ }
+
+ if {![winfo exists $irgb(top)]} {
+ return
+ }
+
+ if {$current(frame) != {}} {
+ set rgb(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ # now make sure we have the coord systems
+ AdjustCoordSystem rgb system
+ CoordMenuEnable $irgb(mb).align rgb system 1 {} {}
+ } else {
+ CoordMenuReset $irgb(mb).align rgb system 1 {} {}
+ }
+ }
+
+ if {$current(frame) != {}} {
+ set current(rgb) [$current(frame) get rgb channel]
+ set r [$current(frame) get rgb view]
+ set rgb(red) [lindex $r 0]
+ set rgb(green) [lindex $r 1]
+ set rgb(blue) [lindex $r 2]
+ set rgb(system) [$current(frame) get rgb system]
+ }
+}
+
+proc RGBBackup {ch which} {
+ puts $ch "$which rgb channel [$which get rgb channel]"
+ puts $ch "$which rgb view [$which get rgb view]"
+ puts $ch "$which rgb system [$which get rgb system]"
+}
+
+# Process Cmds
+
+proc ProcessRGBCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ global rgb
+
+ RGBDialog
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {}
+ close {RGBDestroyDialog}
+ red -
+ green -
+ blue {
+ set current(rgb) [string tolower [lindex $var $i]]
+ RGBChannel
+ }
+ channel {
+ incr i
+ set current(rgb) [string tolower [lindex $var $i]]
+ RGBChannel
+ }
+ lock {
+ incr i
+ set item [string tolower [lindex $var $i]]
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set rr [FromYesNo [lindex $var $i]]
+ } else {
+ set rr 1
+ incr i -1
+ }
+ switch -- $item {
+ wcs {set rgb(lock,wcs) $rr}
+ crop {set rgb(lock,crop) $rr}
+ slice {set rgb(lock,slice) $rr}
+ bin {set rgb(lock,bin) $rr}
+ axes -
+ order {set rgb(lock,axes) $rr}
+ scale {set rgb(lock,scale) $rr}
+ limits -
+ scalelimits {set rgb(lock,scalelimits) $rr}
+ color -
+ colormap -
+ colorbar {set rgb(lock,colorbar) $rr}
+ block {set rgb(lock,block) $rr}
+ smooth {set rgb(lock,smooth) $rr}
+ }
+ }
+ system {
+ incr i
+ set rgb(system) [string tolower [lindex $var $i]]
+ RGBSystem
+ }
+ view {
+ set w [lindex $var [expr $i+1]]
+ set yesno [lindex $var [expr $i+2]]
+ switch -- [string tolower $w] {
+ red {set rgb(red) [FromYesNo $yesno]; RGBView}
+ green {set rgb(green) [FromYesNo $yesno]; RGBView}
+ blue {set rgb(blue) [FromYesNo $yesno]; RGBView}
+ }
+ incr i 2
+ }
+ default {
+ CreateRGBFrame
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendRGBCmd {proc id param} {
+ global current
+ global rgb
+
+ switch -- [lindex $param 0] {
+ channel {$proc $id "$current(rgb)\n"}
+ lock {
+ switch -- [string tolower [lindex $param 1]] {
+ wcs {$proc $id [ToYesNo $rgb(lock,wcs)]}
+ crop {$proc $id [ToYesNo $rgb(lock,crop)]}
+ slice {$proc $id [ToYesNo $rgb(lock,slice)]}
+ bin {$proc $id [ToYesNo $rgb(lock,bin)]}
+ axes -
+ order {$proc $id [ToYesNo $rgb(lock,axes)]}
+ scale {$proc $id [ToYesNo $rgb(lock,scale)]}
+ limits -
+ scalelimits {$proc $id [ToYesNo $rgb(lock,scalelimits)]}
+ colorbar {$proc $id [ToYesNo $rgb(lock,colorbar)]}
+ block {$proc $id [ToYesNo $rgb(lock,block)]}
+ smooth {$proc $id [ToYesNo $rgb(lock,smooth)]}
+ }
+ }
+ system {$proc $id "$rgb(system)\n"}
+ view {
+ switch -- [lindex $param 1] {
+ red {$proc $id [ToYesNo $rgb(red)]}
+ green {$proc $id [ToYesNo $rgb(green)]}
+ blue {$proc $id [ToYesNo $rgb(blue)]}
+ }
+ }
+ }
+}
+
diff --git a/ds9/library/rgbarray.tcl b/ds9/library/rgbarray.tcl
new file mode 100644
index 0000000..2dc38d0
--- /dev/null
+++ b/ds9/library/rgbarray.tcl
@@ -0,0 +1,185 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ImportRGBArrayFile {fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {return}
+ rgb {}
+ }
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) mmapincr
+
+ # if no zdim is present, insert one
+ set exp {.*\[.*zdim[ ]*=[ ]*[0-9]+}
+ if {![regexp $exp $fn]} {
+ set i [string last "\]" $fn]
+ set fn "[string range $fn 0 [expr $i-1]],zdim=3\]"
+ }
+ set loadParam(file,name) $fn
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ # check for stdin/gz
+ ConvertArrayFile
+ ProcessLoad
+}
+
+proc ImportRGBArrayAlloc {path fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {return}
+ rgb {}
+ }
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) allocgz
+
+ # if no zdim is present, insert one
+ set exp {.*\[.*zdim[ ]*=[ ]*[0-9]+}
+ if {![regexp $exp $fn]} {
+ set i [string last "\]" $fn]
+ set fn "[string range $fn 0 [expr $i-1]],zdim=3\]"
+ }
+ if {![regexp $exp $path]} {
+ set i [string last "\]" $path]
+ set path "[string range $path 0 [expr $i-1]],zdim=3\]"
+ }
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc ImportRGBArraySocket {sock fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {return}
+ rgb {}
+ }
+
+ set loadParam(file,type) array
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) socketgz
+ # if no zdim is present, insert one
+ set exp {.*\[.*zdim[ ]*=[ ]*[0-9]+}
+ if {![regexp $exp $fn]} {
+ set i [string last "\]" $fn]
+ set fn "[string range $fn 0 [expr $i-1]],zdim=3\]"
+ }
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ return [ProcessLoad 0]
+}
+
+proc ExportRGBArrayFile {fn opt} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save array rgb cube file "\{$fn\}" $opt
+}
+
+proc ExportRGBArraySocket {sock opt} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save array rgb cube socket $sock $opt
+}
+
+proc ProcessRGBArrayCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateRGBFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![ImportRGBArraySocket $sock $param]} {
+ InitError xpa
+ ImportRGBArrayFile $param
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ ImportRGBArrayAlloc $fn $param
+ } else {
+ ImportRGBArrayFile $param
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendRGBArrayCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ set opt [string tolower [lindex $param 0]]
+ if {$sock != {}} {
+ # xpa
+ ExportRGBArraySocket $sock $opt
+ } elseif {$fn != {}} {
+ # comm
+ ExportRGBArrayFile $fn $opt
+ $proc $id {} $fn
+ }
+}
+
+
diff --git a/ds9/library/rgbcube.tcl b/ds9/library/rgbcube.tcl
new file mode 100644
index 0000000..612cd89
--- /dev/null
+++ b/ds9/library/rgbcube.tcl
@@ -0,0 +1,163 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadRGBCubeFile {fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadRGBCubeAlloc {path fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc LoadRGBCubeSocket {sock fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ return [ProcessLoad 0]
+}
+
+proc SaveRGBCubeFile {fn} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits rgb cube file "\{$fn\}"
+}
+
+proc SaveRGBCubeSocket {sock} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits rgb cube socket $sock
+}
+
+proc ProcessRGBCubeCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateRGBFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadRGBCubeSocket $sock $param]} {
+ InitError xpa
+ LoadRGBCubeFile $param
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadRGBCubeAlloc $fn $param
+ } else {
+ LoadRGBCubeFile $param
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendRGBCubeCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {$sock != {}} {
+ # xpa
+ SaveRGBCubeSocket $sock
+ } elseif {$fn != {}} {
+ # comm
+ SaveRGBCubeFile $fn
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/rgbimage.tcl b/ds9/library/rgbimage.tcl
new file mode 100644
index 0000000..6ed2b3b
--- /dev/null
+++ b/ds9/library/rgbimage.tcl
@@ -0,0 +1,181 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadRGBImageFile {fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb image}
+ set loadParam(load,type) mmapincr
+ set loadParam(file,name) $fn
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ConvertFitsFile
+ ProcessLoad
+}
+
+proc LoadRGBImageAlloc {path fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb image}
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $path
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc LoadRGBImageSocket {sock fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb image}
+ set loadParam(load,type) socketgz
+ set loadParam(file,name) $fn
+ set loadParam(socket,id) $sock
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ return [ProcessLoad 0]
+}
+
+proc SaveRGBImageFile {fn} {
+ global current
+
+ if {$fn == {} || $current(frame) == {}} {
+ return
+ }
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to save RGB image from a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits rgb image file "\{$fn\}"
+}
+
+proc SaveRGBImageSocket {sock} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to save RGB image from a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ $current(frame) save fits rgb image socket $sock
+}
+
+proc ProcessRGBImageCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateRGBFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+ set param [lindex $var $i]
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {![LoadRGBImageSocket $sock $param]} {
+ InitError xpa
+ LoadRGBImageFile $param
+ }
+ } else {
+ # comm
+ if {$fn != {}} {
+ LoadRGBImageAlloc $fn $param
+ } else {
+ LoadRGBImageFile $param
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendRGBImageCmd {proc id param sock fn} {
+ global current
+
+ if {$current(frame) == {}} {
+ return
+ }
+
+ if {$sock != {}} {
+ # xpa
+ SaveRGBImageSocket $sock
+ } elseif {$fn != {}} {
+ # comm
+ SaveRGBImageFile $fn
+ $proc $id {} $fn
+ }
+}
diff --git a/ds9/library/ruler.tcl b/ds9/library/ruler.tcl
new file mode 100644
index 0000000..2aa9779
--- /dev/null
+++ b/ds9/library/ruler.tcl
@@ -0,0 +1,117 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc RulerDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set s [$var(frame) get marker $var(id) ruler system]
+ set var(system) [lindex $s 0]
+ set var(sky) [lindex $s 1]
+ set var(skyformat) degrees
+ set var(dcoord) [lindex $s 2]
+ set var(dformat) [lindex $s 3]
+
+ # procs
+ set var(which) ruler
+ set var(proc,apply) RulerApply
+ set var(proc,coordCB) RulerCoordCB
+ set var(proc,editCB) RulerEditCB
+ set var(proc,distCB) RulerDistCB
+
+ # base
+ MarkerBaseLineDialog $varname 375 200
+
+ set f $var(top).param
+
+ # Axis Length
+ ttk::label $f.tlen -text [msgcat::mc {Axis Length}]
+ ttk::label $f.rx -textvariable ${varname}(distx) -relief groove -width 12
+ ttk::label $f.ry -textvariable ${varname}(disty) -relief groove -width 12
+ ttk::label $f.ulen -textvariable ${varname}(dcoord,msg)
+
+ grid $f.tlen $f.rx $f.ry $f.ulen -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc RulerApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) ruler point $var(system) $var(sky) \
+ $var(x) $var(y) $var(x2) $var(y2)
+
+ MarkerBaseLineApply $varname
+}
+
+# callbacks
+
+proc RulerCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "RulerCoordCB"
+ }
+
+ MarkerBaseCoordCB $varname
+
+ $var(frame) marker $var(id) ruler system $var(system) $var(sky) \
+ $var(dcoord) $var(dformat)
+
+ RulerEditCB $varname
+}
+
+proc RulerEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "RulerEditCB"
+ }
+
+ MarkerBaseLineEditCB $varname
+
+ set d [$var(frame) get marker $var(id) ruler length \
+ $var(dcoord) $var(dformat)]
+ set var(dist) [lindex $d 0]
+ set var(distx) [lindex $d 1]
+ set var(disty) [lindex $d 2]
+
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+}
+
+proc RulerDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "RulerDistCB"
+ }
+
+ $var(frame) marker $var(id) ruler system $var(system) $var(sky) \
+ $var(dcoord) $var(dformat)
+
+ set d [$var(frame) get marker $var(id) ruler length \
+ $var(dcoord) $var(dformat)]
+ set var(dist) [lindex $d 0]
+ set var(distx) [lindex $d 1]
+ set var(disty) [lindex $d 2]
+}
+
+
diff --git a/ds9/library/samp.tcl b/ds9/library/samp.tcl
new file mode 100644
index 0000000..6971008
--- /dev/null
+++ b/ds9/library/samp.tcl
@@ -0,0 +1,1730 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SAMPDef {} {
+ global isamp
+
+ set isamp(timeout) 1000
+}
+
+proc InitSAMP {} {
+ global pds9
+
+ if {$pds9(samp)} {
+ catch {SAMPConnect 0}
+ }
+}
+
+# Cmds
+
+proc SAMPConnect {{verbose 1}} {
+ global ds9
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ # connected?
+ if {[info exists samp]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: already connected}]
+ }
+ return
+ }
+
+ # reset samp array
+ catch {unset samp}
+ set samp(apps,image) {}
+ set samp(apps,table) {}
+ set samp(apps,votable) {}
+
+ # these are to try to prevent feedback problems with
+ # other probgrams
+ set samp(rcvd,lock) 0
+ set samp(send,lock) 0
+
+ # delete any old tmp files
+ SAMPDelTmpFiles
+
+ # can we find a hub?
+ if {![SAMPParseHub]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: unable to locate HUB}]
+ }
+ catch {unset samp}
+ return
+ }
+
+ # register
+ set params [list "string $samp(secret)"]
+ if {![SAMPSend {samp.hub.register} $params rr]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: internal error}]
+ }
+ catch {unset samp}
+ return
+ }
+ set rr [lindex $rr 1]
+ foreach ff $rr {
+ foreach {key val} $ff {
+ switch -- $key {
+ samp.hub-id {set samp(hub) $val}
+ samp.self-id {set samp(self) $val}
+ samp.private-key {set samp(private) $val}
+ }
+ }
+ }
+
+ # declare metadata
+ catch {unset sampmap}
+ set sampmap(samp.name) {string "SAOImage DS9"}
+ set sampmap(samp.description.text) {string "SAOImage DS9 is an astronomical visualization application"}
+ set sampmap(samp.icon.url) {string "http://ds9.si.edu/doc/sun.gif"}
+ set sampmap(samp.documentation.url) {string "http://ds9.si.edu/doc/ref/index.html"}
+
+ set sampmap(home.page) {string "http://ds9.si.edu/"}
+ set sampmap(author.name) {string "William Joye"}
+ set sampmap(author.email) {string "saord@cfa.harvard.edu"}
+ set sampmap(author.affiliation) {string "Smithsonian Astrophysical Observatory"}
+ set sampmap(ds9.version) "string [lindex $ds9(version) 0]"
+
+ set param1 [list "string $samp(private)"]
+ set param2 [list "struct sampmap"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.declareMetadata} $params rr]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: internal error}]
+ }
+ catch {unset samp}
+ return
+ }
+
+ # who are we
+ set samp(port) [lindex [fconfigure [xmlrpc::serve 0] -sockname] 2]
+ set samp(home) "[info hostname]:$samp(port)"
+
+ # callback
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string http://$samp(home)"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.setXmlrpcCallback} $params rr]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: internal error}]
+ }
+ catch {unset samp}
+ return
+ }
+
+ # declare subscriptions
+ catch {unset sampmap}
+ catch {unset sampmap2}
+ set sampmap(samp.app.ping) {struct mapPing}
+
+ set sampmap(samp.hub.event.shutdown) {struct mapShutdown}
+ set sampmap(samp.hub.event.register) {struct mapRegister}
+ set sampmap(samp.hub.event.unregister) {struct mapUnregister}
+ set sampmap(samp.hub.disconnect) {struct mapDisconnect}
+
+ set sampmap(image.load.fits) {struct mapImageLoadFits}
+ set sampmap(table.load.fits) {struct mapTableLoadFits}
+ set sampmap(table.load.votable) {struct mapTableLoadVotable}
+ set sampmap(table.highlight.row) {struct mapTableHighlightRow}
+ set sampmap(table.select.rowList) {struct mapTableSelectRowList}
+ set sampmap(coord.pointAt.sky) {struct mapCoordPointAtSky}
+ set sampmap(client.env.get) {struct mapClientEnvGet}
+
+ set sampmap(x-samp.affiliation.name) {struct mapAffiliationName}
+ set sampmap(x-samp.affiliation.url) {struct mapAffiliationURL}
+ set sampmap(x-samp.homepage.url) {struct mapHomepageURL}
+ set sampmap(x-samp.releasenotes.url) {struct mapReleasenotesURL}
+ set sampmap(x-samp.faq.url) {struct mapFAQURL}
+ set sampmap(x-samp.authors) {struct mapAuthors}
+ set sampmap(x-samp.release.version) {struct mapReleaseVersion}
+
+ set sampmap(ds9.get) {struct mapDS9Get}
+ set sampmap(ds9.set) {struct mapDS9Set}
+ set sampmap(ds9.restricted-get) {struct sampmap2}
+ set sampmap(ds9.restricted-set) {struct sampmap2}
+
+ set sampmap2(x-samp.mostly-harmless) {string "1"}
+
+ set param1 [list "string $samp(private)"]
+ set param2 [list "struct sampmap"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.declareSubscriptions} $params rr]} {
+ if {$verbose} {
+ Error [msgcat::mc {SAMP: internal error}]
+ }
+ catch {unset samp}
+ return
+ }
+
+ after $isamp(timeout) SAMPUpdate
+}
+
+proc SAMPDisconnect {} {
+ global ds9
+ global samp
+
+ # connected?
+ if {![info exists samp]} {
+ Error [msgcat::mc {SAMP: not connected}]
+ return
+ }
+
+ # disconnect
+ if {[info exists samp(private)]} {
+ set params [list "string $samp(private)"]
+ set rr {}
+ SAMPSend {samp.hub.unregister} $params rr
+ SAMPShutdown
+ }
+
+ UpdateFileMenu
+ UpdateCATDialog
+}
+
+proc SAMPSendImageLoadFits {id} {
+ global ds9
+ global current
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendImageLoadFits"
+ }
+
+ # connected?
+ if {![info exists samp]} {
+ Error [msgcat::mc {SAMP: not connected}]
+ return
+ }
+
+ # are we locked?
+ if {$samp(rcvd,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Rcvd locked"
+ }
+ return
+ }
+
+ # got something to send?
+ if {![$current(frame) has fits]} {
+ return
+ }
+
+ # save current frame
+ set fn [tmpnam {.samp}]
+ catch {$current(frame) save fits image file "\{$fn\}"}
+
+ # name to use
+ set fnb [$current(frame) get fits file name root base]
+ if {[regexp {(.*)\[.*\]} $fnb aa bb]} {
+ set fnb $bb
+ }
+
+ # cmd
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "image.load.fits"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(url) "string \"[XMLQuote file://localhost/$fn]\""
+ set sampmap2(name) "string \"[XMLQuote $fnb]\""
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendTableLoadFits {id} {
+ global ds9
+ global current
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendTableLoadFits"
+ }
+
+ # connected?
+ if {![info exists samp]} {
+ Error [msgcat::mc {SAMP: not connected}]
+ return
+ }
+
+ # are we locked?
+ if {$samp(rcvd,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Rcvd locked"
+ }
+ return
+ }
+
+ # got something to send?
+ if {![$current(frame) has fits] && [$current(frame) has fits bin]} {
+ return
+ }
+
+ # save current frame
+ set fn [tmpnam {.samp}]
+ catch {$current(frame) save fits table file "\{$fn\}"}
+
+ # name to use
+ set fnb [$current(frame) get fits file name root base]
+ if {[regexp {(.*)\[.*\]} $fnb aa bb]} {
+ set fnb $bb
+ }
+
+ # cmd
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "table.load.fits"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(url) "string \"[XMLQuote file://localhost/$fn]\""
+ set sampmap2(name) "string \"[XMLQuote $fnb]\""
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendTableLoadVotable {id varname} {
+ global ds9
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendTableLoadVotable $id $varname"
+ }
+
+ # connected?
+ if {![info exists samp]} {
+ Error [msgcat::mc {SAMP: not connected}]
+ return
+ }
+
+ # are we locked?
+ if {$samp(rcvd,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Rcvd locked"
+ }
+ return
+ }
+
+ # remember
+ set samp(icat,$varname$samp(port)) $varname
+ set samp(ocat,$varname) $varname$samp(port)
+
+ # save votable
+ set fn [tmpnam {.samp}]
+ CATSaveFn $varname $fn VOTWrite
+
+ # cmd
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "table.load.votable"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(url) "string \"[XMLQuote file://localhost/$fn]\""
+ set sampmap2(table-id) "string [XMLQuote $varname$samp(port)]"
+ set sampmap2(name) "string \"[XMLQuote $var(title)]\""
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendTableHighlightRow {id varname row} {
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ # row starts at 1
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendTableHighlightRow $samp(ocat,$varname) $row"
+ }
+
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "table.highlight.row"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(table-id) "string [XMLQuote $samp(ocat,$varname)]"
+ set sampmap2(row) "string [XMLQuote [expr $row-1]]"
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendTableSelectRowList {id varname rows} {
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ # rows start at 1
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendTableSelectRowList $samp(ocat,$varname) $rows"
+ }
+
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "table.select.rowList"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(table-id) "string [XMLQuote $samp(ocat,$varname)]"
+ set ss {}
+ foreach rr $rows {
+ lappend ss "string [expr $rr-1]"
+ }
+ set sampmap2(row-list) [list array $ss]
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendTableRowListCmd {varname rowlist} {
+ global ds9
+ global samp
+
+ # connected?
+ if {![info exists samp]} {
+ return
+ }
+
+ if {$samp(apps,votable) == {}} {
+ return
+ }
+
+ # are we good?
+ if {![info exists samp(ocat,$varname)]} {
+ return
+ }
+
+ # are we locked?
+ if {$samp(rcvd,lock)} {
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Rcvd locked"
+ }
+ return
+ }
+
+ switch -- [llength $rowlist] {
+ 0 {}
+ 1 {SAMPSendTableHighlightRow {} $varname $rowlist}
+ default {SAMPSendTableSelectRowList {} $varname $rowlist}
+ }
+}
+
+proc SAMPSendCoordPointAtSky {id coord} {
+ global isamp
+ global samp
+ global sampmap
+ global sampmap2
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSendCoordPointAtSky $id $coord"
+ }
+
+ catch {unset sampmap}
+ set sampmap(samp.mtype) {string "coord.pointAt.sky"}
+ set sampmap(samp.params) {struct sampmap2}
+
+ catch {unset sampmap2}
+ set sampmap2(ra) "string [XMLQuote [lindex $coord 0]]"
+ set sampmap2(dec) "string [XMLQuote [lindex $coord 1]]"
+
+ set param1 [list "string $samp(private)"]
+ if {$id != {}} {
+ set param2 [list "string $id"]
+ } else {
+ set param2 {}
+ }
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+
+ if {$id != {}} {
+ SAMPSend {samp.hub.notify} $params rr
+ } else {
+ SAMPSend {samp.hub.notifyAll} $params rr
+ }
+
+ # set lock
+ set samp(send,lock) 1
+ after $isamp(timeout) SAMPClearSendLock
+}
+
+proc SAMPSendCoordPointAtSkyCmd {which} {
+ global ds9
+ global samp
+
+ # connected?
+ if {![info exists samp]} {
+ return
+ }
+
+ # are we locked?
+ if {$samp(rcvd,lock)} {
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Rcvd locked"
+ }
+ return
+ }
+
+ if {$samp(apps,image) == {} || $samp(apps,table) == {}} {
+ return
+ }
+
+ if {[$which has wcs equatorial wcs]} {
+ set coord [$which get coordinates [$which get cursor canvas] wcs fk5 degrees]
+ if {$coord != {}} {
+ SAMPSendCoordPointAtSky {} "$coord"
+ }
+ }
+}
+
+# Support
+
+proc SAMPShutdown {} {
+ global ds9
+ global samp
+
+ # delete any files
+ SAMPDelTmpFiles
+
+ # close the server socket if still up
+ catch {close $xmlrpc::acceptfd}
+
+ # update the menus
+ set samp(apps,image) {}
+ set samp(apps,table) {}
+ set samp(apps,votable) {}
+ UpdateFileMenu
+ UpdateCATDialog
+
+ # unset samp array
+ catch {unset samp}
+}
+
+proc SAMPUpdate {} {
+ # this routine is run after a delay since it needs to
+ # call the hub for metadata
+
+ # connected? we might have already disconnected.
+ global samp
+ if {![info exists samp]} {
+ return
+ }
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPUpdate"
+ }
+
+ # image fits
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string image.load.fits"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.getSubscribedClients} $params rr]} {
+ return
+ }
+
+ set samp(apps,image) {}
+ foreach arg [lindex $rr 1] {
+ foreach {key val} $arg {
+ if {$key != {}} {
+ lappend samp(apps,image) [list $key [SAMPGetAppName $key]]
+ }
+ }
+ }
+
+ # table fits
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string table.load.fits"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.getSubscribedClients} $params rr]} {
+ return
+ }
+
+ set samp(apps,table) {}
+ foreach arg [lindex $rr 1] {
+ foreach {key val} $arg {
+ if {$key != {}} {
+ lappend samp(apps,table) [list $key [SAMPGetAppName $key]]
+ }
+ }
+ }
+
+ # votable
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string table.load.votable"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.getSubscribedClients} $params rr]} {
+ return
+ }
+
+ set samp(apps,votable) {}
+ foreach arg [lindex $rr 1] {
+ foreach {key val} $arg {
+ if {$key != {}} {
+ lappend samp(apps,votable) [list $key [SAMPGetAppName $key]]
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPUpdate: image apps: $samp(apps,image)"
+ puts stderr "SAMPUpdate: table apps: $samp(apps,table)"
+ puts stderr "SAMPUpdate: votable apps: $samp(apps,votable)"
+ }
+
+ UpdateFileMenu
+ UpdateCATDialog
+}
+
+proc SAMPSend {method params resultVar} {
+ upvar $resultVar result
+
+ global samp
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSend: $method $params"
+ }
+
+ if {[catch {set result [xmlrpc::call $samp(url) $samp(method) $method $params]}]} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSend Error: $result"
+ }
+ return 0
+ }
+
+ # reset error if needed
+ # xmlrpc leaves error msgs
+ InitError samp
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPSend Result: $result"
+ }
+ return 1
+}
+
+proc SAMPReply {msgid status {result {}} {url {}} {error {}}} {
+ global samp
+ global sampmap
+ global sampmap2
+ global sampmap3
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPReply:$msgid:$status:$result:$url:$error:"
+ }
+
+ catch {unset sampmap}
+ catch {unset sampmap2}
+ catch {unset sampmap3}
+ switch -- $status {
+ OK {
+ set sampmap(samp.status) {string "samp.ok"}
+ set sampmap(samp.result) {struct sampmap2}
+ if {$result != {}} {
+ set sampmap2(value) "string \"[XMLQuote $result]\""
+ }
+ if {$url != {}} {
+ set sampmap2(url) "string \"[XMLQuote $url]\""
+ }
+ }
+ WARNING {
+ set sampmap(samp.status) {string "samp.warning"}
+ set sampmap(samp.result) {struct sampmap2}
+ set sampmap(samp.error) {struct sampmap3}
+ if {$result != {}} {
+ set sampmap2(value) "string \"[XMLQuote $result]\""
+ }
+ if {$url != {}} {
+ set sampmap2(url) "string \"[XMLQuote $url]\""
+ }
+ set sampmap3(samp.errortxt) "string \"[XMLQuote $error]\""
+ }
+ ERROR {
+ set sampmap(samp.status) {string "samp.error"}
+ set sampmap(samp.error) {struct sampmap3}
+ set sampmap3(samp.errortxt) "string \"[XMLQuote $error]\""
+ }
+ }
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string $msgid"]
+ set param3 [list "struct sampmap"]
+ set params "$param1 $param2 $param3"
+ if {![SAMPSend {samp.hub.reply} $params rr]} {
+ return
+ }
+}
+
+proc SAMPReplySimple {msgid str} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPReplySimple: $str"
+ }
+
+ global samp
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ SAMPReply $msgid OK "$str"
+}
+
+proc SAMPClearSendLock {} {
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPClearSendLock"
+ }
+ set samp(send,lock) 0
+}
+
+# receiveNotification(string sender-id, map message)
+proc samp.client.receiveNotification {args} {
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPReceivedNotification: $args"
+ }
+ set secret [lindex $args 0]
+ set id [lindex $args 1]
+ set map [lindex $args 2]
+
+ set mtype {}
+ set params {}
+ foreach mm $map {
+ foreach {key val} $mm {
+ switch -- $key {
+ samp.mtype {set mtype $val}
+ samp.params {set params $val}
+ }
+ }
+ }
+
+ switch -- $mtype {
+ samp.hub.event.shutdown {
+ SAMPRcvdEventShutdown params
+ }
+ samp.hub.event.register {
+ SAMPRcvdEventRegister params
+ }
+ samp.hub.event.unregister {
+ SAMPRcvdEventUnregister params
+ }
+ samp.hub.disconnect {
+ SAMPRcvdDisconnect params
+ }
+ image.load.fits {
+ SAMPRcvdImageLoadFits params
+ }
+ table.load.fits {
+ SAMPRcvdTableLoadFits params
+ }
+ table.load.votable {
+ SAMPRcvdTableLoadVotable params
+ }
+ table.highlight.row {
+ SAMPRcvdTableHighlightRow params
+ }
+ table.select.rowList {
+ SAMPRcvdTableSelectRowList params
+ }
+ coord.pointAt.sky {
+ SAMPRcvdCoordPointAtSky params
+ }
+ ds9.set {
+ SAMPRcvdDS9Set {} params 0
+ }
+ ds9.restricted-set {
+ SAMPRcvdDS9Set {} params 1
+ }
+ default {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP samp.client.receiveNotification: bad mtype $mtype"
+ }
+ }
+ }
+ return {string OK}
+}
+
+# receiveCall(string sender-id, string msg-id, map message)
+proc samp.client.receiveCall {args} {
+ global ds9
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPReceivedCall: $args"
+ }
+
+ set secret [lindex $args 0]
+ set id [lindex $args 1]
+ set msgid [lindex $args 2]
+ set map [lindex $args 3]
+
+ set mtype {}
+ set params {}
+ foreach mm $map {
+ foreach {key val} $mm {
+ switch -- $key {
+ samp.mtype {set mtype $val}
+ samp.params {set params $val}
+ }
+ }
+ }
+
+ switch -- $mtype {
+ samp.app.ping {
+ SAMPReply $msgid OK
+ }
+ image.load.fits {
+ SAMPRcvdImageLoadFits params
+ SAMPReply $msgid OK
+ }
+ table.load.fits {
+ SAMPRcvdTableLoadFits params
+ SAMPReply $msgid OK
+ }
+ table.load.votable {
+ SAMPRcvdTableLoadVotable params
+ SAMPReply $msgid OK
+ }
+ table.highlight.row {
+ SAMPRcvdTableHighlightRow params
+ SAMPReply $msgid OK
+ }
+ table.select.rowList {
+ SAMPRcvdTableSelectRowList params
+ SAMPReply $msgid OK
+ }
+ coord.pointAt.sky {
+ SAMPRcvdCoordPointAtSky params
+ SAMPReply $msgid OK
+ }
+ client.env.get {
+ SAMPRcvdClientEnvGet $msgid params
+ }
+ x-samp.affiliation.name {
+ SAMPReplySimple $msgid "SMITHSONIAN ASTROPHYSICAL OBSERVATORY"
+ }
+ x-samp.affiliation.url {
+ SAMPReplySimple $msgid "https://www.cfa.harvard.edu/sao"
+ }
+ x-samp.homepage.url {
+ SAMPReplySimple $msgid "http://ds9.si.edu"
+ }
+ x-samp.releasenotes.url {
+ SAMPReplySimple $msgid OK "http://ds9.si.edu/doc/release/r7.0.html"
+ }
+ x-samp.faq.url {
+ SAMPReplySimple $msgid OK "http://ds9.si.edu/doc/faq.html"
+ }
+ x-samp.authors {
+ global help
+ SAMPReplySimple $msgid OK "$help(authors)"
+ }
+ x-samp.release.version {
+ SAMPReplySimple $msgid OK "$ds9(version)"
+ }
+ ds9.get {
+ SAMPRcvdDS9Get $msgid params
+ }
+ ds9.set {
+ SAMPRcvdDS9Set $msgid params 0
+ }
+ ds9.restricted-get {
+ SAMPRcvdDS9Get $msgid params
+ }
+ ds9.restricted-set {
+ SAMPRcvdDS9Set $msgid params 1
+ }
+ default {
+ SAMPReply $msgid ERROR {} {} "[msgcat::mc {Unknown command}]: $mtype"
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP samp.client.receiveCall: bad mtype $mtype"
+ }
+ }
+ }
+ return {string OK}
+}
+
+# receiveResponse(string responder-id, string msg-tag, map response)
+proc samp.client.receiveResponse {args} {
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPReceivedResponse: $args"
+ }
+
+ set msgtag [lindex $args 0]
+ set value [lindex $args 1]
+ set map [lindex $args 2]
+
+ return {string OK}
+}
+
+# Support
+
+proc SAMPParseHub {} {
+ global samp
+ global env
+
+ set fn {}
+
+ if {[info exists env(SAMP_HUB)]} {
+ if {$env(SAMP_HUB) != {}} {
+ set exp {std-lockurl:(.*)}
+ if {[regexp $exp $env(SAMP_HUB) dummy url]} {
+
+ ParseURL $url rr
+ switch -- $rr(scheme) {
+ ftp {
+ set fn [tmpnam {.samp}]
+ GetFileFTP $rr(authority) $rr(path) $fn
+ }
+ file {set fn $rr(path)}
+ http -
+ default {
+ set fn [tmpnam {.samp}]
+ GetFileHTTP $url $fn
+ }
+ }
+ }
+ }
+ }
+
+ if {$fn == {}} {
+ # look in home directory for .samp
+ global tcl_platform
+ switch $tcl_platform(platform) {
+ unix {
+ set fn [file join [GetEnvHome] {.samp}]
+ }
+ windows {
+ set fn [file join "$env(HOMEDRIVE)$env(HOMEPATH)" {.samp}]
+ }
+ }
+ }
+
+ # no hub to be found
+ if {![file exist $fn]} {
+ return 0
+ }
+
+ set samp(secret) {}
+ set samp(url) {}
+ set samp(metod) {}
+ set fp [open $fn r]
+ while {1} {
+ if {[gets $fp line] == -1} {
+ break
+ }
+
+ # skip any comments
+ if {[string range $line 0 0] == "#"} {
+ continue;
+ }
+
+ if {[regexp -nocase {samp.secret=(.*)} $line foo ss]} {
+ set samp(secret) $ss
+ }
+ if {[regexp -nocase {samp.hub.xmlrpc.url=(.*)} $line foo url]} {
+ if {[ParseURL $url r]} {
+ set samp(url) $r(scheme)://$r(authority)
+ set samp(method) [string range $r(path) 1 end]
+ }
+ }
+ }
+ catch {close $fp}
+
+ if {$samp(secret) == {} || $samp(url) == {}} {
+ SAMPDelTmpFiles
+ return 0
+ }
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPParseHub: $samp(secret) $samp(url) $samp(method)"
+ }
+ return 1
+}
+
+proc SAMPGetAppName {id} {
+ global samp
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPGetAppName: $id"
+ }
+
+ set param1 [list "string $samp(private)"]
+ set param2 [list "string $id"]
+ set params "$param1 $param2"
+ if {![SAMPSend {samp.hub.getMetadata} $params rr]} {
+ return
+ }
+
+ set name {}
+ foreach arg [lindex $rr 1] {
+ foreach {key val} $arg {
+ switch -- $key {
+ samp.name {set name [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ return $name
+}
+
+# CallBacks
+# Hub
+
+proc SAMPRcvdEventShutdown {varname} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdEventShutdown: $args"
+ }
+
+ SAMPShutdown
+}
+
+proc SAMPRcvdEventRegister {varname} {
+ upvar $varname args
+
+ global isamp
+ global samp
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdEventRegister: $args"
+ }
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ id {
+ # check to see if its just us
+ if {$samp(self) == $val} {
+ return
+ }
+ }
+ }
+ }
+ }
+
+ # wait
+ after $isamp(timeout) SAMPUpdate
+}
+
+proc SAMPRcvdEventUnregister {varname} {
+ upvar $varname args
+
+ global isamp
+ global samp
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdEventUnregister: $args"
+ }
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ id {
+ # check to see if its just us
+ if {$samp(self) == $val} {
+ return
+ }
+ }
+ }
+ }
+ }
+
+ # wait
+ after $isamp(timeout) SAMPUpdate
+}
+
+proc SAMPRcvdDisconnect {varname} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdDisconnect: $args"
+ }
+
+ set msg {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ reason {set msg [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ SAMPShutdown
+}
+
+# HTTPClient
+
+proc SAMPRcvdImageLoadFits {varname} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdImageLoadFits: $args"
+ }
+
+ global current
+ global samp
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set imageid {}
+ set name {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ image-id {set imageid [XMLUnQuote $val]}
+ name {set name [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdImageLoadFits: $url $imageid $name"
+ }
+
+ if {$url != {}} {
+ MultiLoad
+ LoadURLFits $url {} {}
+ }
+}
+
+proc SAMPRcvdTableLoadFits {varname} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableLoadFits: $args"
+ }
+
+ global current
+ global samp
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set imageid {}
+ set name {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ image-id {set imageid [XMLUnQuote $val]}
+ name {set name [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableLoadFits: $url $imageid $name"
+ }
+
+ if {$url != {}} {
+ MultiLoad
+ LoadURLFits $url {} {}
+ }
+}
+
+proc SAMPRcvdTableLoadVotable {varname} {
+ upvar $varname args
+
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableLoadVotable: $args"
+ }
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set tabid {}
+ set name {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ table-id {set tabid [XMLUnQuote $val]}
+ name {set name [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableLoadVotable: $url $tabid $name"
+ }
+
+ global icat
+ if {$url != {}} {
+ CATVOTURL $url $name $tabid
+ if {$tabid != {}} {
+ set catid [lindex $icat(cats) end]
+ set samp(icat,$tabid) $catid
+ set samp(ocat,$catid) $tabid
+ }
+ }
+}
+
+proc SAMPRcvdTableHighlightRow {varname} {
+ upvar $varname args
+
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableHighlightRow: $args"
+ }
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set tabid {}
+ set row {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ table-id {set tabid [XMLUnQuote $val]}
+ row {set row [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableHighlightRow: $url $tabid $row"
+ }
+
+ if {$tabid != {} && $row != {}} {
+ if {[info exists samp(icat,$tabid)]} {
+ CATSelectRows $samp(icat,$tabid) samp [expr $row+1]
+ }
+ }
+}
+
+proc SAMPRcvdTableSelectRowList {varname} {
+ upvar $varname args
+
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableSelectRowList: $args"
+ }
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set tabid {}
+ set rowlist {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ table-id {set tabid [XMLUnQuote $val]}
+ row-list {
+ foreach rr [XMLUnQuote $val] {
+ lappend rowlist [expr $rr+1]
+ }
+ }
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdTableSelectRowList: $url $tabid $rowlist"
+ }
+
+ if {$tabid != {} && [llength $rowlist] != 0} {
+ if {[info exists samp(icat,$tabid)]} {
+ CATSelectRows $samp(icat,$tabid) samp $rowlist
+ }
+ }
+}
+
+proc SAMPRcvdCoordPointAtSky {varname} {
+ upvar $varname args
+
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdCoordPointAtSky: $args"
+ }
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set ra {}
+ set dec {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ ra {set ra [XMLUnQuote $val]}
+ dec {set dec [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdCoordPointAtSky: $ra $dec"
+ }
+
+ global current
+ if {$ra != {} && $dec != {} && [$current(frame) has wcs equatorial wcs]} {
+ set samp(rcvd,lock) 1
+ PanTo $ra $dec wcs fk5
+ set samp(rcvd,lock) 0
+ }
+}
+
+proc SAMPRcvdClientEnvGet {msgid varname} {
+ upvar $varname args
+
+ global samp
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdClientEnvGet: $msgid $args"
+ }
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set name {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ name {set name [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdClientEnvGet: $name"
+ }
+
+ global env
+ if {[catch {set rr $env($name)}]} {
+ SAMPReply $msgid ERROR {} {} [lindex [split $errorInfo "\n"] 0]
+ global errorInfo
+ set errorInfo {}
+ } else {
+ SAMPReply $msgid OK $rr
+ }
+}
+
+proc SAMPRcvdDS9Set {msgid varname safemode} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdDS9Set: $msgid $args $safemode"
+ }
+
+ global current
+ global samp
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set cmd {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ cmd {set cmd [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ set fn {}
+
+ InitError samp
+ if {$url != {}} {
+ set fn [tmpnam {.samp}]
+ GetFileURL $url fn
+ }
+ CommSet $fn $cmd $safemode
+ if {$msgid != {}} {
+ SAMPRcvdDS9SetReply $msgid
+ }
+}
+
+proc SAMPRcvdDS9SetReply {msgid} {
+ global ds9
+ global icursor
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdDS9SetReply: $msgid"
+ }
+
+ global errorInfo
+ if {$errorInfo != {} || $ds9(msg) != {}} {
+ if {$ds9(msg) != {}} {
+ switch $ds9(msg,level) {
+ info -
+ warning {SAMPReply $msgid OK $ds9(msg)}
+ error -
+ fatal {SAMPReply $msgid ERROR {} {} $ds9(msg)}
+ }
+ } else {
+ SAMPReply $msgid ERROR {} {} [lindex [split $errorInfo "\n"] 0]
+ }
+ InitError samp
+ } else {
+ SAMPReply $msgid OK
+ }
+}
+
+proc SAMPRcvdDS9Get {msgid varname} {
+ upvar $varname args
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdDS9Get: $args"
+ }
+
+ global current
+ global samp
+
+ # are we locked?
+ if {$samp(send,lock)} {
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMP: ABORT Send locked"
+ }
+ return
+ }
+
+ set url {}
+ set cmd {}
+
+ foreach arg $args {
+ foreach {key val} $arg {
+ switch -- $key {
+ url {set url [XMLUnQuote $val]}
+ cmd {set cmd [XMLUnQuote $val]}
+ }
+ }
+ }
+
+ set fn [tmpnam {.samp}]
+ InitError samp
+ CommGet SAMPRcvdDS9GetReply $msgid $cmd $fn
+}
+
+proc SAMPRcvdDS9GetReply {msgid msg {fn {}}} {
+ global ds9
+ global icursor
+
+ global debug
+ if {$debug(tcl,samp)} {
+ puts stderr "SAMPRcvdDS9GetReply: $msgid $msg $fn"
+ }
+
+ global errorInfo
+ if {$errorInfo != {} || $ds9(msg) != {}} {
+ if {$ds9(msg) != {}} {
+ switch $ds9(msg,level) {
+ info -
+ warning {SAMPReply $msgid OK $ds9(msg)}
+ error -
+ fatal {SAMPReply $msgid ERROR {} {} $ds9(msg)}
+ }
+ } else {
+ SAMPReply $msgid ERROR {} {} [lindex [split $errorInfo "\n"] 0]
+ }
+ InitError samp
+ } else {
+ # be sure to white space any newlines, backslashes, and trim
+ set value [string trim [string map {\n { } \\ {}} $msg]]
+
+ # create url
+ set url {}
+ if {$fn != {}} {
+ set url "file://localhost/$fn"
+ }
+
+ SAMPReply $msgid OK $value $url
+ }
+}
+
+proc SAMPDelTmpFiles {} {
+ global ds9
+
+ # delete any previous files
+ foreach fn [glob -directory $ds9(tmpdir) -nocomplain {ds9*samp*}] {
+ catch {file delete -force "$fn"}
+ }
+}
+
+# Cmds
+
+proc ProcessSAMPCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global samp
+ global ds9
+ global env
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ SAMPUpdate
+
+ switch -- [string tolower [lindex $var $i]] {
+ send {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ image {
+ incr i
+ set name [string tolower [lindex $var $i]]
+ if {[info exists samp]} {
+ foreach arg $samp(apps,image) {
+ foreach {key val} $arg {
+ if {[string tolower $val] == $name} {
+ SAMPSendImageLoadFits $key
+ break
+ }
+ }
+ }
+ } else {
+ Error [msgcat::mc {SAMP: not connected}]
+ }
+ }
+ table {
+ incr i
+ set name [string tolower [lindex $var $i]]
+ if {[info exists samp]} {
+ foreach arg $samp(apps,table) {
+ foreach {key val} $arg {
+ if {[string tolower $val] == $name} {
+ SAMPSendTableLoadFits $key
+ break
+ }
+ }
+ }
+ } else {
+ Error [msgcat::mc {SAMP: not connected}]
+ }
+ }
+ default {
+ set name [string tolower [lindex $var $i]]
+ if {[info exists samp]} {
+ foreach arg $samp(apps,image) {
+ foreach {key val} $arg {
+ if {[string tolower $val] == $name} {
+ SAMPSendImageLoadFits $key
+ break
+ }
+ }
+ }
+ } else {
+ Error [msgcat::mc {SAMP: not connected}]
+ }
+ }
+ }
+ }
+ broadcast {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ image {SAMPSendImageLoadFits {}}
+ table {SAMPSendTableLoadFits {}}
+ default {
+ incr i -1
+ SAMPSendImageLoadFits {}
+ }
+ }
+ }
+ connect {SAMPConnect}
+ disconnect {SAMPDisconnect}
+ default {
+ if {[FromYesNo [lindex $var $i]]} {
+ SAMPConnect
+ } else {
+ SAMPDisconnect
+ }
+ }
+ }
+}
diff --git a/ds9/library/sao.tcl b/ds9/library/sao.tcl
new file mode 100644
index 0000000..9724992
--- /dev/null
+++ b/ds9/library/sao.tcl
@@ -0,0 +1,158 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SAODef {} {
+ global sao
+ global isao
+
+ set isao(top) .sao
+ set isao(mb) .saomb
+
+ set sao(sky) fk5
+ set sao(rformat) arcmin
+ set sao(width) 15
+ set sao(height) 15
+ set sao(mode) new
+ set sao(save) 0
+ set sao(survey) dss
+}
+
+proc SAODialog {} {
+ global sao
+ global isao
+ global wcs
+
+ if {[winfo exists $isao(top)]} {
+ raise $isao(top)
+ return
+ }
+
+ set varname dsao
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $isao(top)
+ set var(mb) $isao(mb)
+ set var(sky) $sao(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $sao(rformat)
+ set var(width) $sao(width)
+ set var(height) $sao(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $sao(mode)
+ set var(save) $sao(save)
+ set var(survey) $sao(survey)
+
+ set w $var(top)
+ IMGSVRInit $varname "SAO-DSS [msgcat::mc {Server}]" \
+ SAOExec SAOAck ARDone ARError
+
+ IMGSVRUpdate $varname
+}
+
+proc SAOExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set compress no
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set compress gzip
+ set var(fn) [tmpnam {.fits.gz}]
+ }
+
+ # skyformat
+ switch -- $var(skyformat) {
+ degrees {
+ set xx [uformat d h: $var(x)]
+ set yy [uformat d d: $var(y)]
+ }
+ sexagesimal {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ }
+
+ # size - convert to arcmin
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+ if {$ww>60} {
+ set ww 60
+ }
+ if {$hh>60} {
+ set hh 60
+ }
+
+ # query
+ set var(query) [http::formatQuery r $xx d $yy e J2000 w $ww h $ww c $compress]
+ set url "http://www.cfa.harvard.edu/archive/dss"
+ IMGSVRGetURL $varname $url
+}
+
+proc SAOAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the DSS-SAO
+
+The Digitized Sky Surveys were produced at the Space Telescope Science
+Institute under U.S. Government grant NAG W-2166. The images of these
+surveys are based on photographic data obtained using the Oschin
+Schmidt Telescope on Palomar Mountain and the UK Schmidt Telescope.
+The plates were processed into the present compressed digital form
+with the permission of these institutions.
+
+The Oschin Schmidt Telescope is operated by the California Institute
+of Technology and Palomar Observatory.
+
+The UK Schmidt Telescope was operated by the Royal Observatory
+Edinburgh, with funding from the UK Science and Engineering Research
+Council (later the UK Particle Physics and Astronomy Research Council),
+until 1988 June, and thereafter by the Anglo-Australian
+Observatory. The blue plates of the southern Sky Atlas and its
+Equatorial Extension (together known as the SERC-J), as well as the
+Equatorial Red (ER), and the Second Epoch [red] Survey (SES) were all
+taken with the UK Schmidt.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessSAOCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ SAODialog
+ IMGSVRProcessCmd $varname $iname dsao
+}
+
+proc ProcessSendSAOCmd {proc id param} {
+ SAODialog
+ IMGSVRProcessSendCmd $proc $id $param dsao
+}
+
diff --git a/ds9/library/save.tcl b/ds9/library/save.tcl
new file mode 100644
index 0000000..e4ec500
--- /dev/null
+++ b/ds9/library/save.tcl
@@ -0,0 +1,251 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SaveDef {} {
+ global savefits
+
+ set savefits(type) image
+ set savefits(mosaic) 1
+}
+
+proc Save {format fn} {
+ global savefits
+
+ switch -- $format {
+ fits {SaveFitsFile $savefits(type) $fn}
+ sfits {}
+ rgbimage {SaveRGBImageFile $fn}
+ rgbcube {SaveRGBCubeFile $fn}
+ srgbcube {}
+ mecube {SaveMECubeFile $fn}
+ multiframe {}
+ mosaicimage -
+ mosaicimagewcs {SaveMosaicImageWCSFile $fn}
+ mosaicimageiraf {}
+ mosaicimagewfpc {}
+ mosaic -
+ mosaicwcs {SaveMosaicWCSFile $fn $savefits(mosaic)}
+ mosaiciraf {}
+ smosaicwcs {}
+ smosaiciraf {}
+ }
+}
+
+# Process Cmds
+
+proc ProcessSaveCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ set format {}
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+
+ switch -- $fn {
+ fits -
+ sfits -
+ rgbimage -
+ rgbcube -
+ srgbcube -
+ mecube -
+ multiframe -
+ mosaicimagewcs -
+ mosaicimageiraf -
+ mosaicimagewfpc -
+ mosaicwcs -
+ mosaiciraf -
+ smosaicwcs -
+ smosaiciraf {
+ set format $fn
+ set fn {}
+ incr i
+ }
+ mosaicimage -
+ mosaic {
+ set format $fn
+ set fn {}
+ incr i
+
+ # eat any wcs
+ if {[string range [lindex $var $i] 0 2] == {wcs}} {
+ incr i
+ }
+ }
+ }
+
+ # one last time
+ if {$fn == {}} {
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+ }
+
+ if {$format == {}} {
+ set format [ExtToFormat $fn]
+ }
+
+ global savefits
+ set param [string tolower [lindex $var [expr $i+1]]]
+ switch $format {
+ fits {
+ switch $param {
+ slice -
+ image -
+ table {
+ set savefits(type) $param
+ incr i
+ }
+ default {set savefits(type) image}
+ }
+ }
+ mosaic -
+ mosaiciraf -
+ mosaicwcs {
+ if {[string is integer -strict $param]} {
+ set savefits(mosaic) $param
+ incr i
+ }
+ }
+ }
+
+ global savefitsfbox
+ FileLast savefitsfbox $fn
+ Save $format $fn
+}
+
+# Support
+
+proc SaveDialog {format} {
+ global savefits
+ global current
+
+ set fn [SaveFileDialog savefitsfbox]
+
+ set which image
+ if {$fn != {}} {
+ set ok 1
+ if {$current(frame) != {}} {
+ switch -- $format {
+ fits {
+ if {[$current(frame) has fits bin]} {
+ set ok [SaveParams savefits]
+ }
+ }
+ slice {
+ set format fits
+ set savefits(type) slice
+ }
+ mosaicwcs -
+ mosaiciraf {
+ if {[$current(frame) has fits mosaic]} {
+ set ok [SaveMosaicParams savefits]
+ }
+ }
+ }
+ }
+
+ if {$ok} {
+ Save $format $fn
+ }
+ }
+}
+
+proc SaveParams {varname} {
+ upvar $varname var
+ global ed2
+ set w {.savefits}
+
+ set ed2(ok) 0
+ set ed2(type) $var(type)
+
+ DialogCreate $w {Fits} ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.tfits -text [msgcat::mc {Fits}]
+ ttk::radiobutton $f.image -text [msgcat::mc {Image}] \
+ -variable ed2(type) -value image
+ ttk::radiobutton $f.table -text {Table} \
+ -variable ed2(type) -value table
+ grid $f.tfits $f.image $f.table -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set var(type) $ed2(type)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
+
+proc SaveMosaicParams {varname} {
+ upvar $varname var
+ global ed2
+ set w {.savefits}
+
+ set ed2(ok) 0
+ set ed2(mosaic) $var(mosaic)
+
+ DialogCreate $w {Mosaic} ed2(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ ttk::label $f.tmosaic -text [msgcat::mc {Mosaic}]
+ ttk::entry $f.mosaic -textvariable ed2(mosaic) -width 8
+ grid $f.tmosaic $f.mosaic -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed2(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed2(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed2(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed2(ok)
+ DialogDismiss $w
+
+ if {$ed2(ok)} {
+ set var(mosaic) $ed2(mosaic)
+ }
+
+ set rr $ed2(ok)
+ unset ed2
+ return $rr
+}
diff --git a/ds9/library/saveimage.tcl b/ds9/library/saveimage.tcl
new file mode 100644
index 0000000..4ddef37
--- /dev/null
+++ b/ds9/library/saveimage.tcl
@@ -0,0 +1,271 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SaveImageDef {} {
+ global saveimage
+
+ set saveimage(jpeg,quality) 75
+ set saveimage(tiff,compress) none
+
+ set aa [msgcat::mc {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}]
+ set bb [msgcat::mc {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}]
+ set cc [msgcat::mc {This function is not currently supported for this port.}]
+
+ global ds9
+ switch $ds9(wm) {
+ x11 {
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Darwin {
+ switch [lindex [split $tcl_platform(osVersion) {.}] 0] {
+ 10 -
+ 11 {set saveimage(error) $bb}
+ 8 -
+ 9 -
+ default {set saveimage(error) $aa}
+ }
+ }
+ default {set saveimage(error) $aa}
+ }
+ }
+ aqua -
+ win32 {set saveimage(error) $cc}
+ }
+}
+
+proc SaveImageDialog {format} {
+ global saveimage
+ global fitsfbox
+ global epsfbox
+ global giffbox
+ global jpegfbox
+ global tifffbox
+ global pngfbox
+
+ switch -- $format {
+ fits {set fn [SaveFileDialog fitsfbox]}
+ eps {set fn [SaveFileDialog epsfbox]}
+ gif {set fn [SaveFileDialog giffbox]}
+ jpeg {set fn [SaveFileDialog jpegfbox]}
+ tiff {set fn [SaveFileDialog tifffbox]}
+ png {set fn [SaveFileDialog pngfbox]}
+ }
+
+ if {$fn != {}} {
+ set ok 1
+ switch -- $format {
+ fits -
+ eps -
+ gif -
+ png {}
+ jpeg {set ok [JPEGExportDialog saveimage(jpeg,quality)]}
+ tiff {set ok [TIFFExportDialog saveimage(tiff,compress)]}
+ }
+
+ if {$ok} {
+ SaveImage $fn $format
+ }
+ }
+}
+
+proc SaveImage {fn format} {
+ global ds9
+ global current
+ global saveimage
+ global cube
+
+ if {$fn == {} || ![$current(frame) has fits]} {
+ return
+ }
+
+ # besure we are on top
+ raise $ds9(top)
+
+ # and no highlite
+ $current(frame) highlite off
+ # and refresh screen
+ RealizeDS9
+
+ switch -- $format {
+ fits {$current(frame) save fits resample file "\{$fn\}"}
+ eps {EPS $fn}
+ gif -
+ tiff -
+ jpeg -
+ png {SaveImagePhoto $fn $format}
+ }
+
+ # reset
+ switch -- $ds9(display) {
+ single -
+ blink {}
+ tile {$current(frame) highlite on}
+ }
+
+ # and refresh screen
+ RealizeDS9
+}
+
+# Support
+
+proc SaveImagePhoto {fn format} {
+ global ds9
+ global saveimage
+
+ switch $ds9(wm) {
+ x11 {}
+ aqua -
+ win32 {
+ Error $saveimage(error)
+ return
+ }
+ }
+
+ set rr [catch {image create photo -format window -data $ds9(canvas)} ph]
+ if {$rr != 0} {
+ Error $saveimage(error)
+ }
+
+ switch -- $format {
+ gif -
+ png {$ph write $fn -format $format}
+ jpeg {$ph write $fn \
+ -format [list $format -quality $saveimage(jpeg,quality)]}
+ tiff {$ph write $fn \
+ -format [list $format -compression $saveimage(tiff,compress)]}
+ }
+
+ image delete $ph
+}
+
+# Process Cmds
+
+proc ProcessSaveImageCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ # yes, really need this
+ # ProcessRealizeDS9
+ UpdateDS9
+ RealizeDS9
+
+ set format {}
+ set param {}
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+
+ # backward compatibility
+ switch $fn {
+ fits -
+ eps -
+ gif -
+ tiff -
+ jpeg -
+ png {
+ set format $fn
+ set fn {}
+ incr i
+ }
+ jpg {
+ set format jpeg
+ set fn {}
+ incr i
+ }
+ tif {
+ set format tiff
+ set fn {}
+ incr i
+ }
+ mpeg {
+ # backward compatibility
+ global movie
+ incr i
+ set fn [lindex $var $i]
+ if {[string is integer -strict $fn]} {
+ incr i
+ set fn [lindex $var $i]
+ }
+ set movie(action) slice
+ Movie $fn
+ }
+ }
+
+ # try again
+ if {$fn == {}} {
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+
+ if {[string is integer -strict $fn] ||
+ $fn == {none} || $fn == {jpeg} ||
+ $fn == {backbits} || $fn == {deflate}} {
+ set param $fn
+ set fn {}
+ incr i
+ }
+ }
+
+ # one last time
+ if {$fn == {}} {
+ set fn [lindex $var $i]
+ if {$fn == {}} {
+ return
+ }
+ }
+
+ global saveimage
+ if {$format == {}} {
+ set format [ExtToFormat $fn]
+ }
+
+ if {$param == {}} {
+ set param [string tolower [lindex $var [expr $i+1]]]
+ switch $format {
+ fits -
+ eps -
+ gif -
+ png {}
+ jpeg {
+ if {[string is integer -strict $param]} {
+ set saveimage(jpeg,quality) $param
+ incr i
+ }
+ }
+ tiff {
+ switch $param {
+ none -
+ jpeg -
+ packbits -
+ deflate {
+ set saveimage(tiff,compress) $param
+ incr i
+ }
+ }
+ }
+ }
+ }
+
+ global fitsfbox
+ global epsfbox
+ global giffbox
+ global jpegfbox
+ global tifffbox
+ global pngfbox
+ switch -- $format {
+ fits {FileLast fitsfbox $fn}
+ eps {FileLast epsfbox $fn}
+ gif {FileLast giffbox $fn}
+ jpeg {FileLast jpegfbox $fn}
+ tiff {FileLast tifffbox $fn}
+ png {FileLast pngfbox $fn}
+ }
+ SaveImage $fn $format
+}
+
diff --git a/ds9/library/scale.tcl b/ds9/library/scale.tcl
new file mode 100644
index 0000000..fa1c84e
--- /dev/null
+++ b/ds9/library/scale.tcl
@@ -0,0 +1,1053 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ScaleDef {} {
+ global scale
+ global iscale
+ global pscale
+
+ set iscale(top) .scale
+ set iscale(mb) .scalemb
+
+ set scale(min) 1
+ set scale(max) 100
+ set scale(xaxis) full
+ set scale(yaxis) log
+ set scale(bins) 512
+
+ set scale(lock) 0
+ set scale(lock,limits) 0
+
+ set scale(type) linear
+ set scale(log) 1000
+ set scale(mode) minmax
+ set scale(scope) local
+ set scale(datasec) 1
+
+ set pscale(type) $scale(type)
+ set pscale(log) $scale(log)
+ set pscale(mode) $scale(mode)
+ set pscale(scope) $scale(scope)
+ set pscale(datasec) $scale(datasec)
+}
+
+proc MinMaxDef {} {
+ global minmax
+ global pminmax
+
+ set minmax(mode) scan
+ set minmax(sample) 25
+
+ array set pminmax [array get minmax]
+}
+
+proc ZScaleDef {} {
+ global zscale
+ global pzscale
+
+ set zscale(contrast) .25
+ set zscale(sample) 600
+ set zscale(line) 120
+
+ array set pzscale [array get zscale]
+}
+
+proc ChangeDATASEC {} {
+ global current
+ global scale
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) datasec $scale(datasec)]
+ UpdateScale
+ }
+}
+
+proc ChangeScale {} {
+ global current
+ global scale
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has iis]} {
+ return {}
+ }
+
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) colorscale log $scale(log)]
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) colorscale $scale(type)]
+ ResetWatchCursor
+ UpdateScale
+ }
+}
+
+proc ChangeScaleMode {} {
+ global current
+ global scale
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has iis]} {
+ return {}
+ }
+
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip mode $scale(mode)]
+ ResetWatchCursor
+ UpdateScale
+ }
+}
+
+proc ChangeScaleLimit {} {
+ global current
+ global scale
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has iis]} {
+ return {}
+ }
+
+ set scale(mode) user
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip user $scale(min) $scale(max)]
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip mode $scale(mode)]
+ UpdateScale
+ }
+}
+
+proc ChangeScaleScope {} {
+ global current
+ global scale
+ global rgb
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has iis]} {
+ return {}
+ }
+
+ SetWatchCursor
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip scope $scale(scope)]
+ ResetWatchCursor
+ UpdateScale
+ }
+}
+
+proc ChangeMinMax {} {
+ global current
+ global minmax
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,scale) \
+ [list $current(frame) clip minmax $minmax(sample) $minmax(mode)]
+ UpdateScale
+ }
+}
+
+proc ChangeZScale {} {
+ global current
+ global zscale
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip zscale $zscale(contrast) $zscale(sample) $zscale(line)]
+ UpdateScale
+ }
+}
+
+proc UpdateScale {} {
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateScale"
+ }
+
+ LockScaleCurrent
+ LockScaleLimitsCurrent
+ UpdateScaleMenu
+ UpdateScaleDialog
+ UpdateContourScale
+ UpdateGraphYAxis $current(frame)
+ UpdateInfoBoxBase
+ UpdateMain
+}
+
+proc ScaleDialog {} {
+ global scale
+ global iscale
+ global dscale
+
+ global current
+ global ds9
+ global minmax
+ global canvas
+
+ # see if we already have a window visible
+
+ if {[winfo exists $iscale(top)]} {
+ raise $iscale(top)
+ return
+ }
+
+ # create the window
+ set w $iscale(top)
+ set mb $iscale(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Scale Parameters}] ScaleDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {Scale}] -menu $mb.scale
+ $mb add cascade -label [msgcat::mc {Limits}] -menu $mb.limit
+ $mb add cascade -label [msgcat::mc {Scope}] -menu $mb.scope
+ $mb add cascade -label [msgcat::mc {Min Max}] -menu $mb.minmax
+ $mb add cascade -label [msgcat::mc {Parameters}] -menu $mb.param
+ $mb add cascade -label [msgcat::mc {Graph}] -menu $mb.graph
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command ScaleApplyDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command ScaleDestroyDialog
+
+ EditMenu $mb iscale
+
+ menu $mb.scale
+ $mb.scale add radiobutton -label [msgcat::mc {Linear}] \
+ -variable scale(type) -command ChangeScale -value linear
+ $mb.scale add radiobutton -label [msgcat::mc {Log}] \
+ -variable scale(type) -command ChangeScale -value log
+ $mb.scale add radiobutton -label [msgcat::mc {Power}] \
+ -variable scale(type) -command ChangeScale -value pow
+ $mb.scale add radiobutton -label [msgcat::mc {Square Root}] \
+ -variable scale(type) -command ChangeScale -value sqrt
+ $mb.scale add radiobutton -label [msgcat::mc {Squared}] \
+ -variable scale(type) -command ChangeScale -value squared
+ $mb.scale add radiobutton -label {ASINH} \
+ -variable scale(type) -command ChangeScale -value asinh
+ $mb.scale add radiobutton -label {SINH} \
+ -variable scale(type) -command ChangeScale -value sinh
+ $mb.scale add radiobutton -label [msgcat::mc {Histogram Equalization}] \
+ -variable scale(type) -command ChangeScale -value histequ
+ $mb.scale add separator
+ $mb.scale add command -label "[msgcat::mc {Log Exponent}]..." \
+ -command ScaleLogDialog
+
+ menu $mb.limit
+ $mb.limit add radiobutton -label [msgcat::mc {Min Max}] \
+ -variable scale(mode) -command ChangeScaleMode -value minmax
+ $mb.limit add separator
+ $mb.limit add radiobutton -label {99.5%} \
+ -variable scale(mode) -command ChangeScaleMode -value 99.5
+ $mb.limit add radiobutton -label {99%} \
+ -variable scale(mode) -command ChangeScaleMode -value 99
+ $mb.limit add radiobutton -label {98%} \
+ -variable scale(mode) -command ChangeScaleMode -value 98
+ $mb.limit add radiobutton -label {97%} \
+ -variable scale(mode) -command ChangeScaleMode -value 97
+ $mb.limit add radiobutton -label {96%} \
+ -variable scale(mode) -command ChangeScaleMode -value 96
+ $mb.limit add radiobutton -label {95%} \
+ -variable scale(mode) -command ChangeScaleMode -value 95
+ $mb.limit add radiobutton -label {92.5%} \
+ -variable scale(mode) -command ChangeScaleMode -value 92.5
+ $mb.limit add radiobutton -label {90%} \
+ -variable scale(mode) -command ChangeScaleMode -value 90
+ $mb.limit add separator
+ $mb.limit add radiobutton -label {ZScale} \
+ -variable scale(mode) -command ChangeScaleMode -value zscale
+ $mb.limit add radiobutton -label {ZMax} \
+ -variable scale(mode) -command ChangeScaleMode -value zmax
+ $mb.limit add radiobutton -label [msgcat::mc {User}] \
+ -variable scale(mode) -command ChangeScaleMode -value user
+
+ menu $mb.scope
+ $mb.scope add radiobutton -label [msgcat::mc {Global}] \
+ -variable scale(scope) -command ChangeScaleScope -value global
+ $mb.scope add radiobutton -label [msgcat::mc {Local}] \
+ -variable scale(scope) -command ChangeScaleScope -value local
+
+ menu $mb.minmax
+ $mb.minmax add radiobutton -label [msgcat::mc {Scan}] \
+ -variable minmax(mode) -value scan -command ChangeMinMax
+ $mb.minmax add radiobutton -label [msgcat::mc {Sample}] \
+ -variable minmax(mode) -value sample -command ChangeMinMax
+ $mb.minmax add radiobutton -label {DATAMIN DATAMAX} \
+ -variable minmax(mode) -value datamin -command ChangeMinMax
+ $mb.minmax add radiobutton -label {IRAF-MIN IRAF-MAX} \
+ -variable minmax(mode) -value irafmin -command ChangeMinMax
+ $mb.minmax add separator
+ $mb.minmax add command -label "[msgcat::mc {Sample Parameters}]..." \
+ -command MinMaxDialog
+
+ menu $mb.param
+ $mb.param add checkbutton -label "[msgcat::mc {Use}] DATASEC" \
+ -variable scale(datasec) -command ChangeDATASEC
+ $mb.param add separator
+ $mb.param add command -label {ZScale...} -command ZScaleDialog
+
+ menu $mb.graph
+ $mb.graph add radiobutton -label [msgcat::mc {Linear}] \
+ -value linear -variable scale(yaxis) -command ScaleYAxisDialog
+ $mb.graph add radiobutton -label [msgcat::mc {Log}] \
+ -value log -variable scale(yaxis) -command ScaleYAxisDialog
+ $mb.graph add separator
+ $mb.graph add radiobutton -label [msgcat::mc {Full Range}] \
+ -value full -variable scale(xaxis) -command ScaleXAxisDialog
+ $mb.graph add radiobutton -label [msgcat::mc {Current Range}] \
+ -value current -variable scale(xaxis) -command ScaleXAxisDialog
+
+ # Param
+ set f [ttk::frame $w.param]
+
+ # Graph
+ set dscale(hist) [blt::graph $f.chart \
+ -width 500 \
+ -height 200 \
+ -title [msgcat::mc {Pixel Distribution}] \
+ -font [font actual TkDefaultFont] \
+ -plotrelief groove \
+ -plotborderwidth 2 \
+ ]
+
+ $dscale(hist) legend configure -hide yes
+ $dscale(hist) xaxis configure -hide yes -grid no -ticklength 3 \
+ -tickfont [font actual TkDefaultFont]
+ $dscale(hist) yaxis configure -hide yes -grid yes -ticklength 3 \
+ -tickfont [font actual TkDefaultFont]
+ set dscale(xdata) histX
+ set dscale(ydata) histY
+ blt::vector create $dscale(xdata) $dscale(ydata)
+ $dscale(hist) element create bar1 -smooth step -areabackground black \
+ -xdata $dscale(xdata) -ydata $dscale(ydata)
+
+ # Cut Lines
+ $dscale(hist) marker bind min <B1-Motion> \
+ [list ScaleMotionDialog %x %y dscale(min)]
+ $dscale(hist) marker bind max <B1-Motion> \
+ [list ScaleMotionDialog %x %y dscale(max)]
+ $dscale(hist) marker bind up <ButtonRelease-1> ScaleReleaseDialog
+
+ set dscale(histmin) [$dscale(hist) marker create line -element bar1 \
+ -outline red -bindtags [list min up]]
+ set dscale(histmax) [$dscale(hist) marker create line -element bar1 \
+ -outline green -bindtags [list max up]]
+
+ # Cut Levels
+ ttk::label $f.title -text [msgcat::mc {Limits}]
+ ttk::label $f.ltitle -text [msgcat::mc {Low}]
+ ttk::entry $f.lvalue -textvariable dscale(min) -width 13
+ ttk::label $f.htitle -text [msgcat::mc {High}]
+ ttk::entry $f.hvalue -textvariable dscale(max) -width 13
+
+ pack $dscale(hist) -fill both -expand true
+ pack $f.title $f.ltitle $f.lvalue $f.htitle $f.hvalue \
+ -side left -padx 2 -pady 2
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command ScaleApplyDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command ScaleDestroyDialog
+ pack $f.apply $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ UpdateScaleDialog
+}
+
+proc ScaleApplyDialog {} {
+ global scale
+ global dscale
+ global current
+ global rgb
+
+ if {$current(frame) != {} &&
+ $dscale(min) != {} &&
+ $dscale(max) != {}} {
+ $dscale(hist) marker configure $dscale(histmin) \
+ -coords "$dscale(min) -Inf $dscale(min) Inf"
+ $dscale(hist) marker configure $dscale(histmax) \
+ -coords "$dscale(max) -Inf $dscale(max) Inf"
+
+ set scale(min) $dscale(min)
+ set scale(max) $dscale(max)
+
+ set scale(mode) user
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip user $scale(min) $scale(max)]
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip mode $scale(mode)]
+ UpdateScale
+ }
+}
+
+proc ScaleDestroyDialog {} {
+ global scale
+ global iscale
+ global dscale
+
+ if {[winfo exists $iscale(top)]} {
+ destroy $iscale(top)
+ destroy $iscale(mb)
+ }
+
+ blt::vector destroy $dscale(xdata) $dscale(ydata)
+ unset dscale
+}
+
+proc ScaleMotionDialog {x y varname} {
+ upvar $varname var
+ global scale
+ global dscale
+
+ set var [lindex [$dscale(hist) invtransform $x $y] 0]
+ if {$dscale(min) > $dscale(max)} {
+ if {$varname == "dscale(min)"} {
+ set var $dscale(max)
+ } else {
+ set var $dscale(min)
+ }
+ }
+
+ $dscale(hist) marker configure $dscale(histmin) \
+ -coords "$dscale(min) -Inf $dscale(min) Inf"
+ $dscale(hist) marker configure $dscale(histmax) \
+ -coords "$dscale(max) -Inf $dscale(max) Inf"
+}
+
+proc ScaleReleaseDialog {} {
+ global scale
+ global dscale
+ global current
+ global rgb
+
+ if {$current(frame) != {} &&
+ $dscale(min) != {} &&
+ $dscale(max) != {}} {
+
+ set scale(min) $dscale(min)
+ set scale(max) $dscale(max)
+
+ set scale(mode) user
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip user $scale(min) $scale(max)]
+ RGBEvalLockCurrent rgb(lock,scale) [list $current(frame) clip mode $scale(mode)]
+
+ UpdateScale
+ ScaleXAxisDialog
+ }
+}
+
+proc UpdateScaleDialog {} {
+ global scale
+ global iscale
+ global dscale
+
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateScaleDialog"
+ }
+
+ if {![winfo exists $iscale(top)]} {
+ return
+ }
+
+ set dscale(min) {}
+ set dscale(max) {}
+
+ if {$current(frame) != {}} {
+ set limits [$current(frame) get clip]
+
+ set dscale(min) [lindex $limits 0]
+ set dscale(max) [lindex $limits 1]
+
+ # "nan" will not pass
+ if {[$current(frame) has fits] && ![$current(frame) has iis] &&
+ ($dscale(min)<$dscale(max))} {
+
+ set limits [$current(frame) get minmax]
+
+ set dscale(minmin) [lindex $limits 0]
+ set dscale(minmax) [lindex $limits 1]
+
+ SetWatchCursor
+ $current(frame) get histogram \
+ $dscale(xdata) $dscale(ydata) $scale(bins)
+ ResetWatchCursor
+
+ # we seem to need to do this so that the min/max values are known
+ blt::vector expr min($dscale(ydata))
+ blt::vector expr max($dscale(ydata))
+
+ $dscale(hist) element configure bar1 -hide no
+
+ $dscale(hist) xaxis configure -hide no
+ $dscale(hist) yaxis configure -hide no -min 1
+
+ $dscale(hist) marker configure $dscale(histmin) \
+ -coords "$dscale(min) -Inf $dscale(min) Inf"
+ $dscale(hist) marker configure $dscale(histmax) \
+ -coords "$dscale(max) -Inf $dscale(max) Inf"
+
+ if {[$current(frame) has datamin]} {
+ $iscale(mb).minmax \
+ entryconfig {DATAMIN DATAMAX} -state normal
+ } else {
+ $iscale(mb).minmax \
+ entryconfig {DATAMIN DATAMAX} -state disabled
+ }
+ if {[$current(frame) has irafmin]} {
+ $iscale(mb).minmax \
+ entryconfig {IRAF-MIN IRAF-MAX} -state normal
+ } else {
+ $iscale(mb).minmax \
+ entryconfig {IRAF-MIN IRAF-MAX} -state disabled
+ }
+
+ ScaleYAxisDialog
+ ScaleXAxisDialog
+
+ return
+ }
+ }
+
+ $dscale(hist) element configure bar1 -hide yes
+ $dscale(hist) xaxis configure -hide yes
+ $dscale(hist) yaxis configure -hide yes
+
+ $iscale(mb) entryconfig [msgcat::mc {Scope}] -state normal
+ $iscale(mb).minmax entryconfig {DATAMIN DATAMAX} -state normal
+ $iscale(mb).minmax entryconfig {IRAF-MIN IRAF-MAX} -state normal
+}
+
+proc UpdateScaleDialogFont {} {
+ global iscale
+ global dscale
+
+ if {![winfo exists $iscale(top)]} {
+ return
+ }
+
+ $dscale(hist) configure -font [font actual TkDefaultFont]
+ $dscale(hist) xaxis configure -tickfont [font actual TkDefaultFont]
+ $dscale(hist) yaxis configure -tickfont [font actual TkDefaultFont]
+}
+
+proc ScaleYAxisDialog {} {
+ global scale
+ global dscale
+
+ switch -- $scale(yaxis) {
+ linear {$dscale(hist) yaxis configure -logscale 0 -min 0}
+ log {$dscale(hist) yaxis configure -logscale 1 -min 1}
+ }
+}
+
+proc ScaleXAxisDialog {} {
+ global scale
+ global dscale
+
+ switch -- $scale(xaxis) {
+ full {
+ set width [expr abs(1.0*($dscale(minmax)-$dscale(minmin))/ \
+ [$dscale(xdata) length])]
+
+ $dscale(hist) xaxis configure \
+ -min [expr $dscale(minmin)-$width] \
+ -max [expr $dscale(minmax)+$width]
+ }
+ current {
+ set width [expr abs(1.0*($dscale(max)-$dscale(min))/ \
+ [$dscale(xdata) length])]
+
+ if {[expr abs($dscale(max)-$dscale(min)) > 0]} {
+ set diff [expr $dscale(max)-$dscale(min)]
+ set per .10
+ set a [expr $dscale(min)-($diff*$per)]
+ set b [expr $dscale(max)+($diff*$per)]
+ $dscale(hist) xaxis configure -min $a -max $b
+ }
+ }
+ }
+}
+
+proc ScaleLogDialog {} {
+ global scale
+
+ if {[EntryDialog [msgcat::mc {Scale}] [msgcat::mc {Log Exponent}] 10 scale(log)]} {
+ ChangeScale
+ }
+}
+
+proc MinMaxDialog {} {
+ global minmax
+ global ed
+
+ set w {.sample}
+
+ set ed(ok) 0
+ set ed(sample) $minmax(sample)
+
+ DialogCreate $w [msgcat::mc {Sample Parameters}] ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ slider $f.ssample 0 100 [msgcat::mc {Sample Increment}] ed(sample) {}
+ grid $f.ssample -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ if {$ed(sample) == 0} {
+ set ed(sample) 1
+ }
+ set minmax(sample) $ed(sample)
+ ChangeMinMax
+ }
+
+ unset ed
+}
+
+proc ZScaleDialog {} {
+ global zscale
+ global ed
+
+ set w {.zscale}
+
+ set ed(ok) 0
+ array set ed [array get zscale]
+
+ DialogCreate $w "ZScale [msgcat::mc {Parameters}]" ed(ok)
+
+ # Param
+ set f [ttk::frame $w.param]
+ slider $f.scontrast 0. 1. [msgcat::mc {Contrast}] ed(contrast) {}
+ slider $f.ssize 0 1000 [msgcat::mc {Number of Samples}] ed(sample) {}
+ slider $f.sline 0 500 [msgcat::mc {Samples per Line}] ed(line) {}
+
+ grid $f.scontrast -padx 2 -pady 2 -sticky ew
+ grid $f.ssize -padx 2 -pady 2 -sticky ew
+ grid $f.sline -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ ttk::button $f.cancel -text [msgcat::mc {Cancel}] -command {set ed(ok) 0}
+ pack $f.ok $f.cancel -side left -expand true -padx 2 -pady 4
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ if {$ed(ok)} {
+ if {$ed(line) == 0} {
+ set ed(line) 1
+ }
+ array set zscale [array get ed]
+ ChangeZScale
+ }
+
+ unset ed
+}
+
+proc MatchScaleCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchScale $current(frame)
+ }
+}
+
+proc MatchScaleLimitsCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchScaleLimits $current(frame)
+ }
+}
+
+proc MatchScale {which} {
+ global ds9
+ global rgb
+ global scale
+
+ set type [$which get colorscale]
+ set log [$which get colorscale log]
+ set limits [$which get clip]
+ set mode [$which get clip mode]
+ set scope [$which get clip scope]
+ set mmsample [$which get clip minmax sample]
+ set mmmode [$which get clip minmax mode]
+ set zscontrast [$which get clip zscale contrast]
+ set zssample [$which get clip zscale sample]
+ set zsline [$which get clip zscale line]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,scale) $ff [list $ff colorscale $type]
+ RGBEvalLock rgb(lock,scale) $ff [list $ff colorscale log $log]
+ RGBEvalLock rgb(lock,scale) $ff [list $ff clip user $limits]
+ RGBEvalLock rgb(lock,scale) $ff [list $ff clip mode $mode]
+ RGBEvalLock rgb(lock,scale) $ff [list $ff clip scope $scope]
+ RGBEvalLock rgb(lock,scale) $ff \
+ [list $ff clip minmax $mmsample $mmmode]
+ RGBEvalLock rgb(lock,scale) $ff \
+ [list $ff clip zscale $zscontrast $zssample $zsline]
+ }
+ }
+}
+
+proc MatchScaleLimits {which} {
+ global ds9
+ global rgb
+ global scale
+
+ set limits [$which get clip]
+ set mode user
+ set type [$which get colorscale]
+ set log [$which get colorscale log]
+ set scope [$which get clip scope]
+ set mmmode [$which get clip minmax mode]
+ set mmsample [$which get clip minmax sample]
+ set zscontrast [$which get clip zscale contrast]
+ set zssample [$which get clip zscale sample]
+ set zsline [$which get clip zscale line]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ RGBEvalLock rgb(lock,scalelimits) $ff [list $ff colorscale $type]
+ RGBEvalLock rgb(lock,scalelimits) $ff [list $ff colorscale log $log]
+ RGBEvalLock rgb(lock,scalelimits) $ff [list $ff clip user $limits]
+ RGBEvalLock rgb(lock,scalelimits) $ff [list $ff clip mode $mode]
+ RGBEvalLock rgb(lock,scalelimits) $ff [list $ff clip scope $scope]
+ RGBEvalLock rgb(lock,scalelimits) $ff \
+ [list $ff clip minmax $mmsample $mmmode]
+ RGBEvalLock rgb(lock,scalelimits) $ff \
+ [list $ff clip zscale $zscontrast $zssample $zsline]
+ }
+ }
+}
+
+proc LockScaleCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockScale $current(frame)
+ }
+}
+
+proc LockScaleLimitsCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockScaleLimits $current(frame)
+ }
+}
+
+proc LockScale {which} {
+ global scale
+
+ if {$scale(lock)} {
+ MatchScale $which
+ }
+}
+
+proc LockScaleLimits {which} {
+ global scale
+
+ if {$scale(lock,limits)} {
+ MatchScaleLimits $which
+ }
+}
+
+proc ScaleBackup {ch which} {
+ switch -- [$which get type] {
+ base -
+ 3d {ScaleBackupBase $ch $which}
+ rgb {ScaleBackupRGB $ch $which}
+ }
+}
+
+proc ScaleBackupBase {ch which} {
+ puts $ch "$which colorscale [$which get colorscale]"
+ puts $ch "$which colorscale log [$which get colorscale log]"
+ puts $ch "$which datasec [$which get datasec]"
+ puts $ch "$which clip user [$which get clip]"
+ puts $ch "$which clip mode [$which get clip mode]"
+ puts $ch "$which clip scope [$which get clip scope]"
+ puts $ch "$which clip minmax mode [$which get clip minmax mode]"
+ puts $ch "$which clip minmax sample [$which get clip minmax sample]"
+ puts $ch "$which clip zscale contrast [$which get clip zscale contrast]"
+ puts $ch "$which clip zscale sample [$which get clip zscale sample]"
+ puts $ch "$which clip zscale line [$which get clip zscale line]"
+}
+
+proc ScaleBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ ScaleBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+# Process Cmds
+
+proc ProcessScaleCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global scale
+
+ switch -- [string tolower [lindex $var $i]] {
+ match {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ limits -
+ scalelimits {
+ MatchScaleLimitsCurrent
+ }
+ default {
+ incr i -1
+ MatchScaleCurrent
+ }
+ }
+ }
+ lock {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ limits -
+ scalelimits {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set scale(lock,limits) [FromYesNo [lindex $var $i]]
+ } else {
+ set scale(lock,limits) 1
+ incr i -1
+ }
+ LockScaleLimitsCurrent
+ }
+ default {
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set scale(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set scale(lock) 1
+ incr i -1
+ }
+ LockScaleCurrent
+ }
+ }
+ }
+ open {ScaleDialog}
+ close {ScaleDestroyDialog}
+ linear -
+ pow -
+ sqrt -
+ squared -
+ asinh -
+ sinh -
+ histequ {
+ set scale(type) [string tolower [lindex $var $i]]
+ ChangeScale
+ }
+ log {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ exp {
+ incr i
+ set scale(log) [string tolower [lindex $var $i]]
+ ChangeScale
+ }
+ default {
+ incr i -1
+ set scale(type) [string tolower [lindex $var $i]]
+ ChangeScale
+ }
+ }
+ }
+ datasec {
+ incr i
+ set scale(datasec) [FromYesNo [lindex $var $i]]
+ ChangeDATASEC
+ }
+ limits -
+ scalelimits {
+ incr i
+ set scale(min) [lindex $var $i]
+ incr i
+ set scale(max) [lindex $var $i]
+ ChangeScaleLimit
+ }
+ minmax -
+ zscale -
+ zmax -
+ user {
+ set scale(mode) [string tolower [lindex $var $i]]
+ ChangeScaleMode
+ }
+ mode {
+ incr i
+ set scale(mode) [string tolower [lindex $var $i]]
+ ChangeScaleMode
+ }
+ local -
+ global {
+ set scale(scope) [string tolower [lindex $var $i]]
+ ChangeScaleScope
+ }
+ scope {
+ incr i
+ set scale(scope) [string tolower [lindex $var $i]]
+ ChangeScaleScope
+ }
+ }
+}
+
+proc ProcessSendScaleCmd {proc id param} {
+ global current
+ global scale
+
+ switch -- [string tolower $param] {
+ lock {$proc $id [ToYesNo $scale(lock)]}
+ {lock limits} {$proc $id [ToYesNo $scale(lock,limits)]}
+ datasec {$proc $id "$scale(datasec)\n"}
+ limits {
+ if {$current(frame) != {}} {
+ set lims [$current(frame) get clip]
+ $proc $id "[lindex $lims 0] [lindex $lims 1]\n"
+ }
+ }
+ mode {$proc $id "$scale(mode)\n"}
+ scope {$proc $id "$scale(scope)\n"}
+ log -
+ {log exp} {$proc $id "$scale(log)\n"}
+ default {$proc $id "$scale(type)\n"}
+ }
+}
+
+proc ProcessMinMaxCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global minmax
+ global scale
+
+ switch -- [string tolower [lindex $var $i]] {
+ auto {
+ # backward compatibility
+ set minmax(mode) scan
+ ChangeMinMax
+ }
+ scan -
+ sample -
+ datamin -
+ irafmin {
+ set minmax(mode) [string tolower [lindex $var $i]]
+ ChangeMinMax
+ }
+ mode {
+ incr i
+ set minmax(mode) [string tolower [lindex $var $i]]
+ ChangeMinMax
+ }
+ interval {
+ incr i
+ set minmax(sample) [lindex $var $i]
+ ChangeMinMax
+ }
+ default {
+ # for backward compatibility
+ set scale(mode) minmax
+ ChangeScaleMode
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendMinMaxCmd {proc id param} {
+ global minmax
+
+ switch -- [string tolower $param] {
+ mode {$proc $id "$minmax(mode)\n"}
+ interval {$proc $id "$minmax(sample)\n"}
+ default {
+ # for backward compatibility
+ $proc $id "$minmax(mode)\n"
+ }
+ }
+}
+
+proc ProcessZScaleCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global zscale
+ global scale
+
+ switch -- [string tolower [lindex $var $i]] {
+ contrast {
+ incr i
+ set zscale(contrast) [lindex $var $i]
+ ChangeZScale
+ }
+ sample {
+ incr i
+ set zscale(sample) [lindex $var $i]
+ ChangeZScale
+ }
+ line {
+ incr i
+ set zscale(line) [lindex $var $i]
+ ChangeZScale
+ }
+ default {
+ # for backward compatibility
+ set scale(mode) zscale
+ ChangeScaleMode
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendZScaleCmd {proc id param} {
+ global zscale
+
+ switch -- [string tolower $param] {
+ contrast {$proc $id "$zscale(contrast)\n"}
+ sample {$proc $id "$zscale(sample)\n"}
+ line {$proc $id "$zscale(line)\n"}
+ }
+}
diff --git a/ds9/library/segment.tcl b/ds9/library/segment.tcl
new file mode 100644
index 0000000..eb1ba95
--- /dev/null
+++ b/ds9/library/segment.tcl
@@ -0,0 +1,74 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SegmentDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # procs
+ set var(proc,apply) SegmentApply
+ set var(proc,close) SegmentClose
+ set var(proc,coordCB) SegmentCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # init
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback rotate MarkerBaseCenterRotateCB $varname
+
+ set f $var(top).param
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc SegmentClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc SegmentApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+# callbacks
+
+proc SegmentCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "SegmentCoordCB"
+ }
+
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
diff --git a/ds9/library/sfits.tcl b/ds9/library/sfits.tcl
new file mode 100644
index 0000000..9339ca9
--- /dev/null
+++ b/ds9/library/sfits.tcl
@@ -0,0 +1,64 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadSFitsFile {hdr fn layer mode} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) smmap
+ set loadParam(file,name) $fn
+ set loadParam(file,header) $hdr
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc ProcessSFitsCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+ set mode {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ set mode slice
+ }
+ }
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {0} {
+ # not supported
+ } else {
+ LoadSFitsFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $mode
+ }
+ } else {
+ # comm
+ if {0} {
+ # not supported
+ } else {
+ LoadSFitsFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $mode
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/shm.tcl b/ds9/library/shm.tcl
new file mode 100644
index 0000000..c75c0de
--- /dev/null
+++ b/ds9/library/shm.tcl
@@ -0,0 +1,251 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ProcessShmCmd {varname iname ml} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+ global ds9
+
+ StartLoad
+ set done 0
+ while {!$done} {
+
+ # defaults
+ set loadParam(load,type) shared
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {}
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ set nn [lindex $var [expr $i+4]]
+ if {$nn == {} || [string range $nn 0 0] == "-"} {
+ set def 1
+ } else {
+ set def 0
+ }
+
+ switch -- [lindex $var $i] {
+ key -
+ shmid {
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(shared,idtype) [lindex $var $i]
+ set loadParam(shared,id) [lindex $var [expr $i+1]]
+ set loadParam(file,name) [lindex $var [expr $i+2]]
+ incr i 2
+ }
+
+ fits {
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ sfits {
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(load,type) sshared
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,hdr) [lindex $var [expr $i+2]]
+ set loadParam(shared,id) [lindex $var [expr $i+3]]
+ set loadParam(file,name) [lindex $var [expr $i+4]]
+ incr i 4
+ }
+
+ mosaicimage {
+ if {$ml} {
+ MultiLoad
+ }
+ if {$def} {
+ set loadParam(file,mode) {mosaic image iraf}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ } else {
+ set loadParam(file,mode) \
+ [list mosaic image [lindex $var [expr $i+1]]]
+ set loadParam(shared,idtype) [lindex $var [expr $i+2]]
+ set loadParam(shared,id) [lindex $var [expr $i+3]]
+ set loadParam(file,name) [lindex $var [expr $i+4]]
+ incr i 4
+ }
+ }
+ mosaic {
+ if {$def} {
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ } else {
+ set loadParam(file,mode) \
+ [list mosaic [lindex $var [expr $i+1]]]
+ set loadParam(shared,idtype) [lindex $var [expr $i+2]]
+ set loadParam(shared,id) [lindex $var [expr $i+3]]
+ set loadParam(file,name) [lindex $var [expr $i+4]]
+ incr i 4
+ }
+ }
+ smosaic {
+ set loadParam(load,type) sshared
+ set loadParam(file,mode) \
+ [list mosaic [lindex $var [expr $i+1]]]
+ set loadParam(shared,idtype) [lindex $var [expr $i+2]]
+ set loadParam(shared,hdr) [lindex $var [expr $i+3]]
+ set loadParam(shared,id) [lindex $var [expr $i+4]]
+ set loadParam(file,name) [lindex $var [expr $i+5]]
+ incr i 5
+ }
+
+ mosaicimageiraf {
+ # backward compatibility
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(file,mode) {mosaic image iraf}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ mosaiciraf {
+ # backward compatibility
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ mosaicimagewcs {
+ # backward compatibility
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(file,mode) {mosaic image wcs}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ mosaicwcs {
+ # backward compatibility
+ set loadParam(file,mode) {mosaic wcs}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ mosaicimagewfpc2 {
+ # backward compatibility
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(file,mode) {mosaic image wfpc2}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+
+ rgbcube {
+ if {$ml} {
+ CreateRGBFrame
+ }
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ srgbcube {
+ if {$ml} {
+ CreateRGBFrame
+ }
+ set loadParam(load,type) sshared
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,hdr) [lindex $var [expr $i+2]]
+ set loadParam(shared,id) [lindex $var [expr $i+3]]
+ set loadParam(file,name) [lindex $var [expr $i+4]]
+ incr i 4
+ }
+ rgbimage {
+ if {$ml} {
+ CreateRGBFrame
+ }
+ set loadParam(file,mode) {rgb image}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ rgbarray {
+ if {$ml} {
+ CreateRGBFrame
+ }
+ set loadParam(file,type) array
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+ array {
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(file,type) array
+ set loadParam(shared,idtype) [lindex $var [expr $i+1]]
+ set loadParam(shared,id) [lindex $var [expr $i+2]]
+ set loadParam(file,name) [lindex $var [expr $i+3]]
+ incr i 3
+ }
+
+ default {
+ if {$ml} {
+ MultiLoad
+ }
+ set loadParam(shared,idtype) key
+ set loadParam(shared,id) [lindex $var $i]
+ set loadParam(file,name) [lindex $var [expr $i+1]]
+ incr i 1
+ }
+ }
+
+ ProcessLoad
+
+ # more to come?
+ incr i
+ if {([lindex $var $i] == "-shm") ||
+ ([lindex $var $i] == "shm")} {
+ set done 0
+ incr i
+ } else {
+ set done 1
+ incr i -1
+ }
+ }
+ FinishLoad
+}
+
+proc ProcessSendShmCmd {proc id param} {
+ global current
+
+ if {$current(frame) != {}} {
+ $proc $id "[$current(frame) get fits file name full]\n"
+ }
+}
+
diff --git a/ds9/library/sia.tcl b/ds9/library/sia.tcl
new file mode 100644
index 0000000..d992ccb
--- /dev/null
+++ b/ds9/library/sia.tcl
@@ -0,0 +1,499 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SIADef {} {
+ global sia
+ global isia
+ global psia
+ global wcs
+
+ set isia(sias) {}
+
+ set isia(rformat) arcmin
+ set isia(width) 15
+ set isia(height) 15
+
+ set isia(minrows) 20
+ set isia(mincols) 10
+
+ set isia(mode) new
+ set isia(save) 0
+
+ set isia(def) { \
+ {{2MASS (NASA/IPAC)} \
+ sia2mass \
+ {http://irsa.ipac.caltech.edu/cgi-bin/2MASS/IM/nph-im_sia}\
+ {} \
+ post \
+ } \
+ {{AKARI (ISAS/JAXA)} \
+ siaakari \
+ {http://jvo.nao.ac.jp/skynode/do/siap/akari/fis_image_v1/1.0}\
+ {} \
+ post \
+ } \
+ {{Astro-Wise} \
+ siaastrowise \
+ {http://vo.astro-wise.org/SIAP}\
+ {VERB=2&FORM=VOTable&PROJECT=ALL&INSTRUMENT=ALL&} \
+ post \
+ } \
+ {{CADC} \
+ siacadc \
+ {http://www1.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/sia/query}\
+ {} \
+ post \
+ } \
+ {{Chandra (NASA/CXC)} \
+ siacxc \
+ {http://cda.harvard.edu/cxcsiap/queryImages}\
+ {} \
+ post \
+ } \
+ {{MAST (STSCI)} siamast \
+ {http://archive.stsci.edu/siap/search.php}\
+ {} \
+ post \
+ } \
+ {{SDSS DR12} \
+ siasdss \
+ {http://skyserver.sdss.org/SkyserverWS/dr12/SIAP/getSIAP}\
+ {} \
+ get \
+ } \
+ {{SkyView (NASA/HEASARC)} \
+ siaskyview \
+ {http://skyview.gsfc.nasa.gov/cgi-bin/vo/sia.pl}\
+ {} \
+ post \
+ } \
+ {{TGSSADR (GMRT)} \
+ siatgssadr \
+ {http://vo.astron.nl/tgssadr/q_fits/imgs/siap.xml}\
+ {} \
+ post \
+ } \
+ }
+
+# {{NASA/CXC Chandra} \
+# siacxc \
+# {http://cda.harvard.edu/cxcsiap/queryImages}\
+# {} \
+# post \
+# } \
+# {{MPE/MPG ROSAT} siarosat \
+# {http://gavo.mpe.mpg.de/rosat/SIAP} \
+# {action=queryImage&siap=siap.service.rosat&} \
+# get \
+# } \
+}
+
+proc SIAAnalysisMenu {mb} {
+ global isia
+ global ds9
+
+ foreach ff $isia(def) {
+ set title [lindex $ff 0]
+ set vars [lindex $ff 1]
+ set url [lindex $ff 2]
+ set opts [lindex $ff 3]
+ set method [lindex $ff 4]
+
+ $mb add command -label $title \
+ -command [list SIADialog $vars $title $url $opts $method apply]
+ }
+}
+
+proc SIAGetURL {varname url2} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAGetURL $varname $var(method) $url2?$var(query2)"
+ }
+
+ ARStatus $varname [msgcat::mc {Loading}]
+
+ # geturl --method does not work
+ switch $var(method) {
+ get {
+ set url $url2?$var(query2)
+ set query {}
+ }
+ default {
+ set url $url2
+ set query $var(query2)
+ }
+ }
+
+ global ihttp
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $url \
+ -query $query \
+ -timeout $ihttp(timeout) \
+ -headers "[ProxyHTTP]"]
+
+
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ SIAGetURLFinish $varname $var(token)
+ } else {
+ SIAError $varname "[msgcat::mc {Unable to locate URL}] $url2"
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $url \
+ -query $query \
+ -timeout $ihttp(timeout) \
+ -command \
+ [list SIAGetURLFinish $varname] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ SIAError $varname "[msgcat::mc {Unable to locate URL}] $url2"
+ }
+ }
+}
+
+proc SIAGetURLFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAGetURLFinish $varname"
+ }
+
+ if {!($var(active))} {
+ SIACancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set code [http::ncode $token]
+
+ # Meta
+ set meta $t(meta)
+
+ # Log it
+ HTTPLog $token
+
+ # Result?
+ switch -- $code {
+ {} -
+ 200 -
+ 203 -
+ 404 -
+ 503 {
+ VOTParse $var(tbldb) $token
+ SIADone $varname
+ SIALoadDone $varname
+ }
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAGetURLFinish redirect $code to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ SIAGetURL $varname $value
+ }
+ }
+ }
+
+ default {
+ SIAError $varname "[msgcat::mc {Error code was returned}] $code"
+ }
+ }
+}
+
+proc SIALoad {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # clear previous db
+ global $var(tbldb)
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIALoad $varname $var(url2)?$var(query2)"
+ }
+
+ SIAGetURL $varname $var(url2)
+ return
+}
+
+proc SIALoadDone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIALoadDone $varname"
+ }
+
+ SIATable $varname
+
+ SIADialogUpdate $varname
+}
+
+proc SIAOff {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global $var(tbldb)
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+ set db $var(tbldb)
+ set ${db}(Nrows) {}
+
+ $var(tbl) selection clear all
+
+ SIADialogUpdate $varname
+}
+
+proc SIATable {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+ global isia
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIATable $varname"
+ }
+
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ # clear the selection
+ $var(tbl) selection clear all
+
+ global $var(tbldb)
+ $var(found) configure -textvariable ${var(tbldb)}(Nrows)
+
+# starbase_writefp $var(tbldb) stdout
+
+ if {[starbase_nrows $var(tbldb)] == 0} {
+ ARStatus $varname [msgcat::mc {No Items Found}]
+ return
+ }
+
+ set nc [starbase_ncols $var(tbldb)]
+ if { $nc > $isia(mincols)} {
+ $var(tbl) configure -cols $nc
+ } else {
+ $var(tbl) configure -cols $isia(mincols)
+ }
+
+ # add header
+ set nr [expr [starbase_nrows $var(tbldb)]+1]
+ if {$nr > $isia(minrows)} {
+ $var(tbl) configure -rows $nr
+ } else {
+ $var(tbl) configure -rows $isia(minrows)
+ }
+}
+
+# Process Cmds
+
+proc ProcessSIACmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global isia
+
+ # we need to be realized
+ ProcessRealizeDS9
+
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ cancel -
+ clear -
+ close -
+ coordinate -
+ crosshair -
+ export -
+ name -
+ print -
+ retreive -
+ retrieve -
+ save -
+ size -
+ sky -
+ skyformat -
+ system -
+ update {ProcessSIA $varname $iname [lindex $isia(sias) end]}
+
+ default {
+ # existing sia or load new one?
+ set ref $item
+
+ incr i
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ cancel -
+ clear -
+ close -
+ coordinate -
+ crosshair -
+ export -
+ name -
+ print -
+ retreive -
+ retrieve -
+ save -
+ size -
+ sky -
+ skyformat -
+ system -
+ update {ProcessSIA $varname $iname sia${ref}}
+
+ default {
+ # ok, new sia
+ incr i -1
+ set item [string tolower [lindex $var $i]]
+
+ # see if its from our list of sias
+ foreach mm $isia(def) {
+ set title [lindex $mm 0]
+ set vars [lindex $mm 1]
+ set url [lindex $mm 2]
+ set opts [lindex $mm 3]
+ set method [lindex $mm 4]
+
+ if {$title != {-} && "sia${item}" == $vars} {
+ SIADialog $vars $title $url $opts $method sync
+ return
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+proc ProcessSIA {varname iname cvarname} {
+ upvar 2 $varname var
+ upvar 2 $iname i
+
+ global isia
+ global psia
+ global current
+
+ # we should have a sia now
+ global $cvarname
+ upvar #0 $cvarname cvar
+
+ if {![info exists cvar(top)]} {
+ Error "[msgcat::mc {Unable to find SIAP window}] $cvarname"
+ return
+ }
+ if {![winfo exists $cvar(top)]} {
+ Error "[msgcat:: mc {Unable to find SIAP window}] $cvarname"
+ return
+ }
+
+ # now, process it
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ cancel {ARCancel $cvarname}
+ clear {SIAOff $cvarname}
+ close {SIADestroy $cvarname}
+ coordinate {
+ incr i
+ set cvar(x) [lindex $var $i]
+ incr i
+ set cvar(y) [lindex $var $i]
+ incr i
+ set cvar(sky) [lindex $var $i]
+ }
+ crosshair {IMGSVRCrosshair $cvarname}
+ export -
+ save {
+ incr i
+ set writer VOTWrite
+ switch -- [lindex $var $i] {
+ xml -
+ vot {incr i; set writer VOTWrite}
+ sb -
+ starbase {incr i; set writer starbase_write}
+ csv -
+ tsv {incr i; set writer TSVWrite}
+ }
+
+ set fn [lindex $var $i]
+ CATSaveFn $cvarname $fn $writer
+ FileLast catfbox $fn
+ }
+ name {
+ incr i
+ set cvar(name) [lindex $var $i]
+ }
+ print {CATPrint $cvarname}
+ retrieve -
+ retreive {SIAApply $cvarname 1}
+ size {
+ incr i
+ set cvar(width) [lindex $var $i]
+ incr i
+ set cvar(height) [lindex $var $i]
+ incr i
+ set cvar(rformat) [lindex $var $i]
+ set cvar(rformat,msg) $cvar(rformat)
+ }
+ sky {
+ incr i
+ set cvar(sky) [lindex $var $i]
+ CoordMenuButtonCmd $cvarname system sky \
+ [list SIAWCSMenuUpdate $cvarname]
+ }
+ skyformat {
+ incr i
+ set cvar(skyformat) [lindex $var $i]
+ }
+ system {
+ incr i
+ set cvar(system) [lindex $var $i]
+ CoordMenuButtonCmd $cvarname system sky \
+ [list SIAWCSMenuUpdate $cvarname]
+ }
+ update {IMGSVRUpdate $cvarname}
+ }
+}
+
+proc ProcessSendSIACmd {proc id param sock fn} {
+ global isia
+
+ $proc $id "$isia(sias)\n"
+}
diff --git a/ds9/library/siadialog.tcl b/ds9/library/siadialog.tcl
new file mode 100644
index 0000000..3542c0f
--- /dev/null
+++ b/ds9/library/siadialog.tcl
@@ -0,0 +1,488 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# used by backup
+proc SIADialog {varname title url opts method action} {
+ global sia
+ global isia
+ global psia
+ global ds9
+
+ global wcs
+
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIADialog $varname:$title:$url:$opts:$action:$method"
+ }
+
+ # main dialog
+ set var(top) ".${varname}"
+ set var(mb) ".${varname}mb"
+
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ global current
+ if {$current(frame) == {}} {
+ return
+ }
+
+ # AR variables
+ ARInit $varname IMGSVRServer
+
+ # IMG variables
+ set var(proc,done) SIADone
+ set var(proc,exec) SIAVOT1
+ set var(proc,error) SIAError
+
+ # SIA variables
+ lappend isia(sias) $varname
+
+ set var(tbldb) ${varname}db
+
+ set var(system) $wcs(system)
+ set var(sky) $wcs(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $isia(rformat)
+ set var(width) $isia(width)
+ set var(height) $isia(height)
+ set var(save) $isia(save)
+ set var(mode) $isia(mode)
+
+ set var(url2) $url
+ set var(title) $title
+ set var(opts) $opts
+ set var(method) $method
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ set tt $title
+
+ Toplevel $w $mb 7 $tt "SIADestroy $varname"
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ NSVRServerMenu $varname
+ $mb add cascade -label [msgcat::mc {Preferences}] -menu $mb.prefs
+
+ # file
+ menu $mb.file
+ $mb.file add command -label "[msgcat::mc {Save}]..." \
+ -command [list CATSaveVOTFile $varname]
+ $mb.file add separator
+ $mb.file add cascade -label [msgcat::mc {Export}] -menu $mb.file.export
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Retrieve}] \
+ -command [list SIAApply $varname 0]
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command [list ARCancel $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Load}] \
+ -command [list SIAImageCmd $varname]
+ $mb.file add command -label [msgcat::mc {Clear}] \
+ -command [list SIAOff $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Update from Current Frame}] \
+ -command [list IMGSVRUpdate $varname]
+ $mb.file add command \
+ -label [msgcat::mc {Update from Current Crosshair}] \
+ -command [list IMGSVRCrosshair $varname]
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Print}]..." \
+ -command [list CATPrint $varname]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command [list SIADestroy $varname]
+
+ # Export
+ menu $mb.file.export
+ $mb.file.export add command -label "[msgcat::mc {Starbase}]..." \
+ -command [list CATSaveSBFile $varname]
+ $mb.file.export add command -label "[msgcat::mc {Tab-Separated-Value}]..." \
+ -command [list CATSaveTSVFile $varname]
+
+ # edit
+ menu $mb.edit
+ $mb.edit add command -label [msgcat::mc {Cut}] \
+ -command "CATCut $varname" -accelerator "${ds9(ctrl)}X"
+ $mb.edit add command -label [msgcat::mc {Copy}] \
+ -command "CATCopy $varname" -accelerator "${ds9(ctrl)}C"
+ $mb.edit add command -label [msgcat::mc {Paste}] \
+ -command "EntryPaste $var(top)" -accelerator "${ds9(ctrl)}V"
+ $mb.edit add separator
+ $mb.edit add command -label [msgcat::mc {Clear}] \
+ -command [list ARClear $varname]
+
+ # prefs
+ menu $mb.prefs
+ $mb.prefs add checkbutton -label [msgcat::mc {Save Image on Download}] \
+ -variable ${varname}(save)
+ $mb.prefs add separator
+ $mb.prefs add radiobutton -label [msgcat::mc {New Frame}] \
+ -variable ${varname}(mode) -value new
+ $mb.prefs add radiobutton -label [msgcat::mc {Current Frame}] \
+ -variable ${varname}(mode) -value current
+
+ # Object
+ set f [ttk::labelframe $w.obj -text [msgcat::mc {Object}] -padding 2]
+
+ ttk::label $f.nametitle -text [msgcat::mc {Name}]
+ ttk::entry $f.name -textvariable ${varname}(name) -width 60
+
+ set var(xname) [ttk::label $f.xtitle -text {} -width 1]
+ ttk::entry $f.x -textvariable ${varname}(x) -width 14
+ set var(yname) [ttk::label $f.ytitle -text {} -width 1]
+ ttk::entry $f.y -textvariable ${varname}(y) -width 14
+
+ CoordMenuButton $f.coord $varname system 0 sky skyformat \
+ [list SIAWCSMenuUpdate $varname]
+ CoordMenuEnable $f.coord.menu $varname system 0 sky skyformat
+
+ ttk::label $f.wtitle -text [msgcat::mc {Width}]
+ ttk::entry $f.w -textvariable ${varname}(width) -width 14
+ ttk::label $f.htitle -text [msgcat::mc {Height}]
+ ttk::entry $f.h -textvariable ${varname}(height) -width 14
+
+ ARRFormat $f.rformat $varname
+
+ grid $f.nametitle $f.name - - - - -padx 2 -pady 2 -sticky w
+ grid $f.xtitle $f.x $f.ytitle $f.y $f.coord -padx 2 -pady 2 -sticky w
+ grid $f.wtitle $f.w $f.htitle $f.h $f.rformat -padx 2 -pady 2 -sticky w
+
+ # Param
+ set f [ttk::labelframe $w.param -text [msgcat::mc {Table}] -padding 2]
+
+ ttk::label $f.ftitle -text [msgcat::mc {Found}]
+ set var(found) [ttk::label $f.found \
+ -width 14 -relief groove -anchor w]
+
+ grid $f.ftitle $f.found -padx 2 -pady 2 -sticky w
+
+ # Table
+ set f [ttk::frame $w.tbl]
+
+ set var(tbl) [table $f.t \
+ -state disabled \
+ -usecommand 0 \
+ -variable $var(tbldb) \
+ -colorigin 1 \
+ -roworigin 0 \
+ -cols $isia(mincols) \
+ -rows $isia(minrows) \
+ -width -1 \
+ -height -1 \
+ -maxwidth 300 \
+ -maxheight 300 \
+ -titlerows 1 \
+ -xscrollcommand [list $f.xscroll set]\
+ -yscrollcommand [list $f.yscroll set]\
+ -selecttype row \
+ -selectmode single \
+ -anchor w \
+ -font [font actual TkDefaultFont] \
+ -browsecommand [list SIASelectCmd $varname %s %S] \
+ ]
+
+ ttk::scrollbar $f.yscroll -command [list $var(tbl) yview] -orient vertical
+ ttk::scrollbar $f.xscroll -command [list $var(tbl) xview] -orient horizontal
+
+ grid $var(tbl) $f.yscroll -sticky news
+ grid $f.xscroll -stick news
+ grid rowconfigure $f 0 -weight 1
+ grid columnconfigure $f 0 -weight 1
+
+ # Status
+ set f [ttk::frame $w.status]
+
+ ttk::label $f.title -text [msgcat::mc {Status}]
+ ttk::label $f.item -textvariable ${varname}(status)
+
+ grid $f.title $f.item -padx 2 -pady 2 -sticky w
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+
+ set var(apply) [ttk::button $f.apply \
+ -text [msgcat::mc {Retrieve}] \
+ -command [list SIAApply $varname 0]]
+ set var(cancel) [ttk::button $f.cancel -text \
+ [msgcat::mc {Cancel}] \
+ -command [list ARCancel $varname] \
+ -state disabled]
+ set var(load) [ttk::button $f.load \
+ -text [msgcat::mc {Load}] \
+ -command [list SIAImageCmd $varname]]
+ ttk::button $f.clear -text [msgcat::mc {Clear}] \
+ -command [list SIAOff $varname]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command [list SIADestroy $varname]
+
+ pack $f.apply $f.cancel $f.load $f.clear $f.close \
+ -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ ttk::separator $w.stbl -orient horizontal
+ ttk::separator $w.sstatus -orient horizontal
+ pack $w.buttons $w.sstatus $w.status $w.stbl -side bottom -fill x
+ pack $w.obj $w.param -side top -fill x
+ pack $w.tbl -side top -fill both -expand true
+
+ ARCoord $varname
+ IMGSVRUpdate $varname
+ SIADialogUpdate $varname
+
+ ARStatus $varname {}
+
+ switch -- $action {
+ apply {SIAApply $varname 0}
+ sync {SIAApply $varname 1}
+ none {}
+ }
+
+ # return the actual varname
+ return $varname
+}
+
+proc SIAApply {varname sync} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAApply $varname $sync"
+ }
+
+ set var(sync) $sync
+ ARApply $varname
+ $var(mb).file entryconfig [msgcat::mc {Load}] -state disabled
+ $var(load) configure -state disabled
+
+ if {$var(name) != {}} {
+ set var(sky) fk5
+ CoordMenuButtonCmd $varname system sky {}
+ SIAWCSMenuUpdate $varname
+
+ NSVRServer $varname
+ } else {
+ IMGSVRServer $varname
+ }
+}
+
+proc SIADestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+ global $var(tbldb)
+ global isia
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIADestroy $varname"
+ }
+
+ if {[info exists $var(tbldb)]} {
+ unset $var(tbldb)
+ }
+
+ set ii [lsearch $isia(sias) $varname]
+ if {$ii>=0} {
+ set isia(sias) [lreplace $isia(sias) $ii $ii]
+ }
+
+ ARDestroy $varname
+}
+
+proc SIAApplyLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARApply $varname
+ $var(mb).file entryconfig [msgcat::mc {Load}] -state disabled
+ $var(load) configure -state disabled
+}
+
+proc SIADone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARDone $varname
+ $var(mb).file entryconfig [msgcat::mc {Load}] -state normal
+ $var(load) configure -state normal
+}
+
+proc SIACancelled {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARCancelled $varname
+ $var(mb).file entryconfig [msgcat::mc {Load}] -state normal
+ $var(load) configure -state normal
+}
+
+proc SIAError {varname message} {
+ upvar #0 $varname var
+ global $varname
+
+ ARError $varname $message
+ $var(mb).file entryconfig [msgcat::mc {Load}] -state normal
+ $var(load) configure -state normal
+}
+
+proc SIADialogUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+ global samp
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIADialogUpdate $varname"
+ }
+
+ # do we have a db?
+ if {[CATValidDB $var(tbldb)]} {
+ $var(mb).file entryconfig [msgcat::mc {Clear}] -state normal
+ $var(mb).file entryconfig "[msgcat::mc {Print}]..." -state normal
+
+ $var(top).buttons.clear configure -state normal
+ } else {
+ $var(mb).file entryconfig [msgcat::mc {Clear}] -state disabled
+ $var(mb).file entryconfig "[msgcat::mc {Print}]..." -state disabled
+
+ $var(top).buttons.clear configure -state disabled
+ }
+}
+
+proc SIAImageCmd {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ds9
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAImage $varname"
+ }
+
+ global $var(tbldb)
+ if {![CATValidDB $var(tbldb)]} {
+ return
+ }
+
+ set rowlist {}
+ foreach sel [$var(tbl) curselection] {
+ set rr [lindex [split $sel ,] 0]
+ lappend rowlist $rr
+ }
+ set rowlist [lsort -unique $rowlist]
+
+ set col [expr [lsearch [subst $${varname}db(Ucd)] {VOX:Image_AccessReference}] +1]
+ if {$col == 0} {
+ ARError $varname [msgcat::mc {Unable to find URL column}]
+ return
+ }
+
+ if {$rowlist != {}} {
+ set url [starbase_get $var(tbldb) $rowlist $col]
+ SIAApplyLoad $varname
+ ParseURL $url r
+ switch -- $r(scheme) {
+ http {
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ SIADone $varname
+ return
+ }
+ } else {
+ set var(fn) [tmpnam [file extension $r(path)]]
+ }
+
+ set var(query) {}
+ IMGSVRGetURL $varname $url
+ }
+ default {
+ SIAError $varname "$r(scheme) [msgcat::mc {Not Supported}]"
+ return
+ }
+ }
+ }
+}
+
+proc SIASelectCmd {varname ss rc} {
+ upvar #0 $varname var
+ global $varname
+
+ # starts at 1
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIASelectCmd $varname ss=$ss rc=$rc"
+ }
+}
+
+proc SIAVOT1 {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,sia)} {
+ puts stderr "SIAVOT1 $varname"
+ }
+
+ # coord (degrees)
+ switch $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ set xx [h2d [Sex2H $var(x)]]
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size (degrees)
+ switch $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+
+ # query
+ set var(query2) "$var(opts)[http::formatQuery POS "$xx,$yy" SIZE $rr FORMAT image/fits]"
+
+ SIALoad $varname
+}
+
+proc SIAWCSMenuUpdate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ ARCoord $varname
+
+ set var(psystem) $var(system)
+ set var(psky) $var(sky)
+ CoordMenuButtonCmd $varname psystem psky {}
+}
+
diff --git a/ds9/library/skyview.tcl b/ds9/library/skyview.tcl
new file mode 100644
index 0000000..5c0ef96
--- /dev/null
+++ b/ds9/library/skyview.tcl
@@ -0,0 +1,619 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SkyViewDef {} {
+ global skyview
+ global iskyview
+
+ set iskyview(top) .skyview
+ set iskyview(mb) .skyviewmb
+
+ set skyview(sky) fk5
+ set skyview(rformat) arcsec
+ set skyview(width) 300
+ set skyview(height) 300
+ set skyview(width,pixels) 300
+ set skyview(height,pixels) 300
+ set skyview(mode) new
+ set skyview(save) 0
+ set skyview(survey) dss
+}
+
+proc SkyViewDialog {} {
+ global skyview
+ global iskyview
+ global wcs
+
+ if {[winfo exists $iskyview(top)]} {
+ raise $iskyview(top)
+ return
+ }
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "SkyViewDialog"
+ }
+
+ set varname dskyview
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $iskyview(top)
+ set var(mb) $iskyview(mb)
+ set var(sky) $skyview(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $skyview(rformat)
+ set var(width) $skyview(width)
+ set var(height) $skyview(height)
+ set var(width,pixels) $skyview(width,pixels)
+ set var(height,pixels) $skyview(height,pixels)
+ set var(mode) $skyview(mode)
+ set var(save) $skyview(save)
+ set var(survey) $skyview(survey)
+
+ set w $var(top)
+ IMGSVRInit $varname "HEASARC-SkyView [msgcat::mc {Server}]" \
+ SkyViewExec SkyViewAck ARDone ARError
+
+ # pixels size
+ set f $w.param
+ ttk::label $f.pimage -text [msgcat::mc {Image}]
+ ttk::entry $f.pw -textvariable ${varname}(width,pixels) -width 14
+ ttk::entry $f.ph -textvariable ${varname}(height,pixels) -width 14
+ ttk::label $f.ptitle -text [msgcat::mc {Pixels}]
+
+ grid $f.pimage x $f.pw x $f.ph $f.ptitle -padx 2 -pady 2 -sticky w
+
+ menu $var(mb).survey
+ $var(mb) add cascade -label Survey -menu $var(mb).survey
+ $var(mb).survey add cascade -label {Gamma Ray} \
+ -menu $var(mb).survey.gamma
+ $var(mb).survey add cascade -label {Hard X-ray} \
+ -menu $var(mb).survey.hard
+ $var(mb).survey add cascade -label {X-ray: Swift BAT} \
+ -menu $var(mb).survey.bat
+ $var(mb).survey add cascade -label {Soft X-ray} \
+ -menu $var(mb).survey.soft
+ $var(mb).survey add cascade -label {Diffuse X-ray} \
+ -menu $var(mb).survey.diffuse
+ $var(mb).survey add cascade -label {UV} \
+ -menu $var(mb).survey.uv
+ $var(mb).survey add cascade -label {Optical: DSS} \
+ -menu $var(mb).survey.dss
+ $var(mb).survey add cascade -label {Optical: SDSS} \
+ -menu $var(mb).survey.sdss
+ $var(mb).survey add cascade -label {Other Optical} \
+ -menu $var(mb).survey.other
+ $var(mb).survey add cascade -label {IR: IRAS} \
+ -menu $var(mb).survey.iras
+ $var(mb).survey add cascade -label {IR: 2MASS} \
+ -menu $var(mb).survey.ir2mass
+ $var(mb).survey add cascade -label {IR: UKIDSS} \
+ -menu $var(mb).survey.irukidss
+ $var(mb).survey add cascade -label {IR: WISE} \
+ -menu $var(mb).survey.irwise
+ $var(mb).survey add cascade -label {IR: AKARI} \
+ -menu $var(mb).survey.irakari
+ $var(mb).survey add cascade -label {IR: Planck} \
+ -menu $var(mb).survey.planck
+ $var(mb).survey add cascade -label {IR: WMAP/COBE} \
+ -menu $var(mb).survey.wmap
+ $var(mb).survey add cascade -label {Radio: Ghz} \
+ -menu $var(mb).survey.radioghz
+ $var(mb).survey add cascade -label {Radio: Mhz} \
+ -menu $var(mb).survey.radiomhz
+ $var(mb).survey add cascade -label {All: GOODS/HDF/CDF} \
+ -menu $var(mb).survey.goods
+
+ set f $var(mb).survey.gamma
+ menu $f
+ $f add radiobutton -label {Fermi 5} \
+ -variable ${varname}(survey) -value {Fermi 5}
+ $f add radiobutton -label {Fermi 4} \
+ -variable ${varname}(survey) -value {Fermi 4}
+ $f add radiobutton -label {Fermi 3} \
+ -variable ${varname}(survey) -value {Fermi 3}
+ $f add radiobutton -label {Fermi 2} \
+ -variable ${varname}(survey) -value {Fermi 2}
+ $f add radiobutton -label {Fermi 1} \
+ -variable ${varname}(survey) -value {Fermi 1}
+ $f add separator
+ $f add radiobutton -label {EGRET (3D)} \
+ -variable ${varname}(survey) -value {EGRET (3D)}
+ $f add radiobutton -label {EGRET <100 Mev} \
+ -variable ${varname}(survey) -value {EGRET <100 Mev}
+ $f add radiobutton -label {EGRET >100 Mev} \
+ -variable ${varname}(survey) -value {EGRET >100 Mev}
+ $f add separator
+ $f add radiobutton -label {COMPTEL} \
+ -variable ${varname}(survey) -value {COMPTEL}
+
+ set f $var(mb).survey.hard
+ menu $f
+ $f add radiobutton -label {INT GAL 17-35 Flux} \
+ -variable ${varname}(survey) -value {INT GAL 17-35 Flux}
+ $f add radiobutton -label {INT GAL 17-60 Flux} \
+ -variable ${varname}(survey) -value {INT GAL 17-60 Flux}
+ $f add radiobutton -label {INT GAL 35-80 Flux} \
+ -variable ${varname}(survey) -value {INT GAL 35-80 Flux}
+ $f add separator
+ $f add radiobutton -label {INTEGRAL/SPI GC} \
+ -variable ${varname}(survey) -value {INTEGRAL/SPI GC}
+ $f add radiobutton -label {GRANAT/SIGMA} \
+ -variable ${varname}(survey) -value {GRANAT/SIGMA}
+ $f add separator
+ $f add radiobutton -label {RXTE Allsky 3-8keV Flux} \
+ -variable ${varname}(survey) -value {RXTE Allsky 3-8keV Flux}
+ $f add radiobutton -label {RXTE Allsky 3-20keV Flux} \
+ -variable ${varname}(survey) -value {RXTE Allsky 3-20keV Flux}
+ $f add radiobutton -label {RXTE Allsky 8-20keV Flux} \
+ -variable ${varname}(survey) -value {RXTE Allsky 8-20keV Flux}
+
+ set f $var(mb).survey.bat
+ menu $f
+ $f add radiobutton -label {BAT SNR 14-195} \
+ -variable ${varname}(survey) -value {BAT SNR 14-195}
+ $f add radiobutton -label {BAT SNR 14-20} \
+ -variable ${varname}(survey) -value {BAT SNR 14-20}
+ $f add radiobutton -label {BAT SNR 20-24} \
+ -variable ${varname}(survey) -value {BAT SNR 20-24}
+ $f add radiobutton -label {BAT SNR 24-35} \
+ -variable ${varname}(survey) -value {BAT SNR 24-35}
+ $f add radiobutton -label {BAT SNR 35-50} \
+ -variable ${varname}(survey) -value {BAT SNR 35-50}
+ $f add radiobutton -label {BAT SNR 50-75} \
+ -variable ${varname}(survey) -value {BAT SNR 50-75}
+ $f add radiobutton -label {BAT SNR 75-100} \
+ -variable ${varname}(survey) -value {BAT SNR 75-100}
+ $f add radiobutton -label {BAT SNR 100-150} \
+ -variable ${varname}(survey) -value {BAT SNR 100-150}
+ $f add radiobutton -label {BAT SNR 150-195} \
+ -variable ${varname}(survey) -value {BAT SNR 150-195}
+
+ set f $var(mb).survey.soft
+ menu $f
+ $f add radiobutton -label {RASS-Cnt Soft} \
+ -variable ${varname}(survey) -value {RASS-Cnt Soft}
+ $f add radiobutton -label {RASS-Cnt Hard} \
+ -variable ${varname}(survey) -value {RASS-Cnt Hard}
+ $f add radiobutton -label {RASS-Cnt Broad} \
+ -variable ${varname}(survey) -value {RASS-Cnt Broad}
+ $f add separator
+ $f add radiobutton -label {PSPC 2.0 Deg-Int} \
+ -variable ${varname}(survey) -value {PSPC 2.0 Deg-Int}
+ $f add radiobutton -label {PSPC 1.0 Deg-Int} \
+ -variable ${varname}(survey) -value {PSPC 1.0 Deg-Int}
+ $f add radiobutton -label {PSPC 0.6 Deg-Int} \
+ -variable ${varname}(survey) -value {PSPC 0.6 Deg-Int}
+ $f add separator
+ $f add radiobutton -label {HRI} \
+ -variable ${varname}(survey) -value {HRI}
+ $f add radiobutton -label {HEAO 1 A-2} \
+ -variable ${varname}(survey) -value {HEAO 1 A-2}
+
+ set f $var(mb).survey.diffuse
+ menu $f
+ $f add radiobutton -label {RASS Background 1} \
+ -variable ${varname}(survey) -value {RASS Background 1}
+ $f add radiobutton -label {RASS Background 2} \
+ -variable ${varname}(survey) -value {RASS Background 2}
+ $f add radiobutton -label {RASS Background 3} \
+ -variable ${varname}(survey) -value {RASS Background 3}
+ $f add radiobutton -label {RASS Background 4} \
+ -variable ${varname}(survey) -value {RASS Background 4}
+ $f add radiobutton -label {RASS Background 5} \
+ -variable ${varname}(survey) -value {RASS Background 5}
+ $f add radiobutton -label {RASS Background 6} \
+ -variable ${varname}(survey) -value {RASS Background 6}
+ $f add radiobutton -label {RASS Background 7} \
+ -variable ${varname}(survey) -value {RASS Background 7}
+
+ set f $var(mb).survey.uv
+ menu $f
+ $f add radiobutton -label {GALEX Near UV} \
+ -variable ${varname}(survey) -value {GALEX Near UV}
+ $f add radiobutton -label {GALEX Far UV} \
+ -variable ${varname}(survey) -value {GALEX Far UV}
+ $f add separator
+ $f add radiobutton -label {ROSAT WFC F1} \
+ -variable ${varname}(survey) -value {ROSAT WFC F1}
+ $f add radiobutton -label {ROSAT WFC F2} \
+ -variable ${varname}(survey) -value {ROSAT WFC F2}
+ $f add separator
+ $f add radiobutton -label {EUVE 171 A} \
+ -variable ${varname}(survey) -value {EUVE 171 A}
+ $f add radiobutton -label {EUVE 405 A} \
+ -variable ${varname}(survey) -value {EUVE 405 A}
+ $f add radiobutton -label {EUVE 555 A} \
+ -variable ${varname}(survey) -value {EUVE 555 A}
+
+ set f $var(mb).survey.dss
+ menu $f
+ $f add radiobutton -label {DSS} \
+ -variable ${varname}(survey) -value {DSS}
+ $f add separator
+ $f add radiobutton -label {DSS1 Blue} \
+ -variable ${varname}(survey) -value {DSS1 Blue}
+ $f add radiobutton -label {DSS1 Red} \
+ -variable ${varname}(survey) -value {DSS1 Red}
+ $f add separator
+ $f add radiobutton -label {DSS2 Red} \
+ -variable ${varname}(survey) -value {DSS2 Red}
+ $f add radiobutton -label {DSS2 Blue} \
+ -variable ${varname}(survey) -value {DSS2 Blue}
+ $f add separator
+ $f add radiobutton -label {DSS2 IR} \
+ -variable ${varname}(survey) -value {DSS2 IR}
+
+ set f $var(mb).survey.sdss
+ menu $f
+ $f add radiobutton -label {SDSSg} \
+ -variable ${varname}(survey) -value {SDSSg}
+ $f add radiobutton -label {SDSSi} \
+ -variable ${varname}(survey) -value {SDSSi}
+ $f add radiobutton -label {SDSSr} \
+ -variable ${varname}(survey) -value {SDSSr}
+ $f add radiobutton -label {SDSSu} \
+ -variable ${varname}(survey) -value {SDSSu}
+ $f add radiobutton -label {SDSSz} \
+ -variable ${varname}(survey) -value {SDSSz}
+ $f add separator
+ $f add radiobutton -label {SDSSdr7g} \
+ -variable ${varname}(survey) -value {SDSSdr7g}
+ $f add radiobutton -label {SDSSdr7i} \
+ -variable ${varname}(survey) -value {SDSSdr7i}
+ $f add radiobutton -label {SDSSdr7r} \
+ -variable ${varname}(survey) -value {SDSSdr7r}
+ $f add radiobutton -label {SDSSdr7u} \
+ -variable ${varname}(survey) -value {SDSSdr7u}
+ $f add radiobutton -label {SDSSdr7z} \
+ -variable ${varname}(survey) -value {SDSSdr7z}
+
+ set f $var(mb).survey.other
+ menu $f
+ $f add radiobutton -label {Mellinger Red} \
+ -variable ${varname}(survey) -value {Mellinger Red}
+ $f add radiobutton -label {Mellinger Green} \
+ -variable ${varname}(survey) -value {Mellinger Green}
+ $f add radiobutton -label {Mellinger Blue} \
+ -variable ${varname}(survey) -value {Mellinger Blue}
+ $f add separator
+ $f add radiobutton -label {NEAT} \
+ -variable ${varname}(survey) -value {NEAT}
+ $f add radiobutton -label {H-Alpha Comp} \
+ -variable ${varname}(survey) -value {H-Alpha Comp}
+ $f add separator
+ $f add radiobutton -label {SHASSA H} \
+ -variable ${varname}(survey) -value {SHASSA H}
+ $f add radiobutton -label {SHASSA CC} \
+ -variable ${varname}(survey) -value {SHASSA CC}
+ $f add radiobutton -label {SHASSA C} \
+ -variable ${varname}(survey) -value {SHASSA C}
+ $f add radiobutton -label {SHASSA Sm} \
+ -variable ${varname}(survey) -value {SHASSA Sm}
+
+ set f $var(mb).survey.iras
+ menu $f
+ $f add radiobutton -label {IRIS 12} \
+ -variable ${varname}(survey) -value {IRIS 12}
+ $f add radiobutton -label {IRIS 25} \
+ -variable ${varname}(survey) -value {IRIS 25}
+ $f add radiobutton -label {IRIS 60} \
+ -variable ${varname}(survey) -value {IRIS 160}
+ $f add radiobutton -label {IRIS 100} \
+ -variable ${varname}(survey) -value {IRIS 100}
+ $f add separator
+ $f add radiobutton -label {SFD100m} \
+ -variable ${varname}(survey) -value {SFD100m}
+ $f add radiobutton -label {SFD Dust Map} \
+ -variable ${varname}(survey) -value {SFD Dust Map}
+ $f add separator
+ $f add radiobutton -label {IRAS 12 micron} \
+ -variable ${varname}(survey) -value {IRAS 12 micron}
+ $f add radiobutton -label {IRAS 25 micron} \
+ -variable ${varname}(survey) -value {IRAS 25 micron}
+ $f add radiobutton -label {IRAS 60 micron} \
+ -variable ${varname}(survey) -value {IRAS 60 micron}
+ $f add radiobutton -label {IRAS 100 micron} \
+ -variable ${varname}(survey) -value {IRAS 100 micron}
+
+ set f $var(mb).survey.ir2mass
+ menu $f
+ $f add radiobutton -label {2MASS-J} \
+ -variable ${varname}(survey) -value {2MASS-J}
+ $f add radiobutton -label {2MASS-H} \
+ -variable ${varname}(survey) -value {2MASS-H}
+ $f add radiobutton -label {2MASS-K} \
+ -variable ${varname}(survey) -value {2MASS-K}
+
+ set f $var(mb).survey.irukidss
+ menu $f
+ $f add radiobutton -label {UKIDSS-Y} \
+ -variable ${varname}(survey) -value {UKIDSS-Y}
+ $f add radiobutton -label {UKIDSS-J} \
+ -variable ${varname}(survey) -value {UKIDSS-J}
+ $f add radiobutton -label {UKIDSS-H} \
+ -variable ${varname}(survey) -value {UKIDSS-H}
+ $f add radiobutton -label {UKIDSS-K} \
+ -variable ${varname}(survey) -value {UKIDSS-K}
+
+ set f $var(mb).survey.irwise
+ menu $f
+ $f add radiobutton -label {WISE 3.4} \
+ -variable ${varname}(survey) -value {WISE 3.4}
+ $f add radiobutton -label {WISE 4.6} \
+ -variable ${varname}(survey) -value {WISE 4.6}
+ $f add radiobutton -label {WISE 12} \
+ -variable ${varname}(survey) -value {WISE 12}
+ $f add radiobutton -label {WISE 22} \
+ -variable ${varname}(survey) -value {WISE 22}
+
+ set f $var(mb).survey.irakari
+ menu $f
+ $f add radiobutton -label {AKARI N60} \
+ -variable ${varname}(survey) -value {AKARI N60}
+ $f add radiobutton -label {AKARI WIDE-S} \
+ -variable ${varname}(survey) -value {AKARI WIDE-S}
+ $f add radiobutton -label {AKARI WIDE-L} \
+ -variable ${varname}(survey) -value {AKARI WIDE-L}
+ $f add radiobutton -label {AKARI N160} \
+ -variable ${varname}(survey) -value {AKARI N160}
+
+ set f $var(mb).survey.planck
+ menu $f
+ $f add radiobutton -label {Planck 857} \
+ -variable ${varname}(survey) -value {Planck 857}
+ $f add radiobutton -label {Planck 545} \
+ -variable ${varname}(survey) -value {Planck 545}
+ $f add radiobutton -label {Planck 353} \
+ -variable ${varname}(survey) -value {Planck 353}
+ $f add radiobutton -label {Planck 217} \
+ -variable ${varname}(survey) -value {Planck 217}
+ $f add radiobutton -label {Planck 143} \
+ -variable ${varname}(survey) -value {Planck 143}
+ $f add radiobutton -label {Planck 100} \
+ -variable ${varname}(survey) -value {Planck 100}
+ $f add radiobutton -label {Planck 070} \
+ -variable ${varname}(survey) -value {Planck 070}
+ $f add radiobutton -label {Planck 044} \
+ -variable ${varname}(survey) -value {Planck 044}
+ $f add radiobutton -label {Planck 030} \
+ -variable ${varname}(survey) -value {Planck 030}
+
+ set f $var(mb).survey.wmap
+ menu $f
+ $f add radiobutton -label {WMAP Ka} \
+ -variable ${varname}(survey) -value {WMAP Ka}
+ $f add radiobutton -label {WMAP K} \
+ -variable ${varname}(survey) -value {WMAP K}
+ $f add radiobutton -label {WMAP Q} \
+ -variable ${varname}(survey) -value {WMAP Q}
+ $f add radiobutton -label {WMAP V} \
+ -variable ${varname}(survey) -value {WMAP V}
+ $f add radiobutton -label {WMAP W} \
+ -variable ${varname}(survey) -value {WMAP W}
+ $f add separator
+ $f add radiobutton -label {COBE DIRBE/AAM} \
+ -variable ${varname}(survey) -value cobeaam
+ $f add radiobutton -label {COBE DIRBE/ZSMA} \
+ -variable ${varname}(survey) -value cobezsma
+
+ set f $var(mb).survey.radioghz
+ menu $f
+ $f add radiobutton -label {CO} \
+ -variable ${varname}(survey) -value {CO}
+ $f add radiobutton -label {GB6 (4850MHZ)} \
+ -variable ${varname}(survey) -value {GB6 (4850MHZ)}
+ $f add radiobutton -label {VLA FIRST (1.4 GHz)} \
+ -variable ${varname}(survey) -value {VLA FIRST (1.4 GHz)}
+ $f add radiobutton -label {NVSS} \
+ -variable ${varname}(survey) -value {NVSS}
+ $f add radiobutton -label {Stripe82VLA} \
+ -variable ${varname}(survey) -value {Stripe82VLA}
+ $f add radiobutton -label {1420MHz (Bonn)} \
+ -variable ${varname}(survey) -value {1420MHz (Bonn)}
+ $f add radiobutton -label {nH} \
+ -variable ${varname}(survey) -value {nH}
+
+ set f $var(mb).survey.radiomhz
+ menu $f
+ $f add radiobutton -label {SUMSS 843 MHz} \
+ -variable ${varname}(survey) -value {SUMSS 843 MHz}
+ $f add radiobutton -label {0408MHz} \
+ -variable ${varname}(survey) -value {0408MHz}
+ $f add radiobutton -label {WENSS} \
+ -variable ${varname}(survey) -value {WENSS}
+ $f add radiobutton -label {TGSS ADR1} \
+ -variable ${varname}(survey) -value {TGSS ADR1}
+ $f add radiobutton -label {VLSSr} \
+ -variable ${varname}(survey) -value {VLSSr}
+ $f add radiobutton -label {0035MHz} \
+ -variable ${varname}(survey) -value {0035MHz}
+
+ set f $var(mb).survey.goods
+ menu $f
+ $f add radiobutton -label {GOODS: Chandra ACIS HB} \
+ -variable ${varname}(survey) -value {GOODS: Chandra ACIS HB}
+ $f add radiobutton -label {GOODS: Chandra ACIS FB} \
+ -variable ${varname}(survey) -value {GOODS: Chandra ACIS FB}
+ $f add radiobutton -label {GOODS: Chandra ACIS SB} \
+ -variable ${varname}(survey) -value {GOODS: Chandra ACIS SB}
+ $f add separator
+ $f add radiobutton -label {GOODS: VLT VIMOS U} \
+ -variable ${varname}(survey) -value {GOODS: VLT VIMOS U}
+ $f add radiobutton -label {GOODS: VLT VIMOS R} \
+ -variable ${varname}(survey) -value {GOODS: VLT VIMOS R}
+ $f add separator
+ $f add radiobutton -label {GOODS: HST ACS B} \
+ -variable ${varname}(survey) -value {GOODS: HST ACS B}
+ $f add radiobutton -label {GOODS: HST ACS V} \
+ -variable ${varname}(survey) -value {GOODS: HST ACS V}
+ $f add radiobutton -label {GOODS: HST ACS I} \
+ -variable ${varname}(survey) -value {GOODS: HST ACS I}
+ $f add radiobutton -label {GOODS: HST ACS Z} \
+ -variable ${varname}(survey) -value {GOODS: HST ACS Z}
+ $f add separator
+ $f add radiobutton -label {Hawaii HDF U} \
+ -variable ${varname}(survey) -value {Hawaii HDF U}
+ $f add radiobutton -label {Hawaii HDF B} \
+ -variable ${varname}(survey) -value {Hawaii HDF B}
+ $f add radiobutton -label {Hawaii HDF V0201} \
+ -variable ${varname}(survey) -value {Hawaii HDF V0201}
+ $f add radiobutton -label {Hawaii HDF V0401} \
+ -variable ${varname}(survey) -value {Hawaii HDF V0401}
+ $f add radiobutton -label {Hawaii HDF R} \
+ -variable ${varname}(survey) -value {Hawaii HDF R}
+ $f add radiobutton -label {Hawaii HDF I} \
+ -variable ${varname}(survey) -value {Hawaii HDF I}
+ $f add radiobutton -label {Hawaii HDF Z} \
+ -variable ${varname}(survey) -value {Hawaii HDF Z}
+ $f add radiobutton -label {Hawaii HDF HK} \
+ -variable ${varname}(survey) -value {Hawaii HDF HK}
+ $f add separator
+ $f add radiobutton -label {GOODS: HST NICMOS} \
+ -variable ${varname}(survey) -value {GOODS: HST NICMOS}
+ $f add radiobutton -label {GOODS: VLT ISAAC J} \
+ -variable ${varname}(survey) -value {GOODS: VLT ISAAC J}
+ $f add radiobutton -label {GOODS: VLT ISAAC H} \
+ -variable ${varname}(survey) -value {GOODS: VLT ISAAC H}
+ $f add radiobutton -label {GOODS: VLT ISAAC Ks} \
+ -variable ${varname}(survey) -value {GOODS: VLT ISAAC Ks}
+ $f add radiobutton -label {HUDF: VLT ISAAC Ks} \
+ -variable ${varname}(survey) -value {HUDF: VLT ISAAC Ks}
+ $f add separator
+ $f add radiobutton -label {GOODS: Spitzer IRAC 3.6} \
+ -variable ${varname}(survey) -value {GOODS: Spitzer IRAC 3.6}
+ $f add radiobutton -label {GOODS: Spitzer IRAC 4.5} \
+ -variable ${varname}(survey) -value {GOODS: Spitzer IRAC 4.5}
+ $f add radiobutton -label {GOODS: Spitzer IRAC 5.8} \
+ -variable ${varname}(survey) -value {GOODS: Spitzer IRAC 5.8}
+ $f add radiobutton -label {GOODS: Spitzer IRAC 8.0} \
+ -variable ${varname}(survey) -value {GOODS: Spitzer IRAC 8.0}
+ $f add radiobutton -label {GOODS: Spitzer MIPS 24} \
+ -variable ${varname}(survey) -value {GOODS: Spitzer MIPS 24}
+ $f add separator
+ $f add radiobutton -label {GOODS: Herschel 100} \
+ -variable ${varname}(survey) -value {GOODS: Herschel 100}
+ $f add radiobutton -label {GOODS: Herschel 100} \
+ -variable ${varname}(survey) -value {GOODS: Herschel 100}
+ $f add radiobutton -label {GOODS: Herschel 250} \
+ -variable ${varname}(survey) -value {GOODS: Herschel 250}
+ $f add radiobutton -label {GOODS: Herschel 350} \
+ -variable ${varname}(survey) -value {GOODS: Herschel 350}
+ $f add radiobutton -label {GOODS: Herschel 500} \
+ -variable ${varname}(survey) -value {GOODS: Herschel 500}
+ $f add separator
+ $f add radiobutton -label {CDFS: LESS} \
+ -variable ${varname}(survey) -value {CDFS: LESS}
+ $f add radiobutton -label {GOODS: VLA North} \
+ -variable ${varname}(survey) -value {GOODS: VLA North}
+
+ IMGSVRUpdate $varname
+}
+
+proc SkyViewExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "SkyViewExec $varname"
+ }
+
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set var(fn) [tmpnam {.fits}]
+ }
+
+ # skyformat
+ switch -- $var(skyformat) {
+ degrees {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ sexagesimal {
+ set xx [h2d [Sex2H $var(x)]]
+ set yy [Sex2D $var(y)]
+ }
+ }
+
+ # size - convert to arcsec
+ switch -- $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+ if {$ww>5} {
+ set ww 5
+ }
+ if {$hh>5} {
+ set hh 5
+ }
+
+ # now average
+ set rr [expr ($ww+$hh)/2.]
+
+ # query
+ set var(query) [http::formatQuery Position $xx,$yy Survey $var(survey) Size $ww,$hh Pixels $var(width,pixels),$var(height,pixels) Return FITS]
+ set url "http://skyview.gsfc.nasa.gov/cgi-bin/images"
+ IMGSVRGetURL $varname $url
+}
+
+proc SkyViewAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,image)} {
+ puts stderr "SkyViewAck $varname"
+ }
+
+ set msg {Acknowledgments for the Skyview
+
+SkyView has been developed with generous support from the NASA AISR and ADP
+programs (P.I. Thomas A. McGlynn) under the auspices of the High Energy
+Astrophysics Science Archive Research Center (HEASARC) at the
+NASA/ GSFC Astrophysics Science Division.
+
+We gratefully acknowledge the support of NASA and contributors of
+SkyView surveys.
+
+Maintained by: Laura McDonald lmm@skyview.gsfc.nasa.gov
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+
+proc ProcessSkyViewCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ SkyViewDialog
+ IMGSVRProcessCmd $varname $iname dskyview
+}
+
+proc ProcessSendSkyViewCmd {proc id param} {
+ SkyViewDialog
+ IMGSVRProcessSendCmd $proc $id $param dskyview
+}
diff --git a/ds9/library/slider.tcl b/ds9/library/slider.tcl
new file mode 100644
index 0000000..2453ecd
--- /dev/null
+++ b/ds9/library/slider.tcl
@@ -0,0 +1,72 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc slider {w from to label varname cmd {num {5}} {width {7}}} {
+ ttk::frame $w
+ ttk::scale $w.slider \
+ -length 300 \
+ -orient horizontal \
+ -variable $varname \
+ -takefocus 0 \
+ -command [list SliderCmd $w $varname $cmd]
+
+ ttk::label $w.label -text $label
+ ttk::entry $w.entry -textvariable $varname -width $width
+ grid $w.label -sticky w -columnspan $num
+ grid $w.slider -row 1 -columnspan $num -padx 2 -pady 2 -sticky news
+ grid $w.entry -row 1 -column $num -padx 2 -pady 2
+
+ for {set ii 0} {$ii<$num} {incr ii} {
+ ttk::label $w.t$ii -width $width -anchor center
+ grid $w.t$ii -row 2 -column $ii
+ grid columnconfigure $w $ii -weight 1
+ }
+
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+ grid rowconfigure $w 2 -weight 1
+
+ bind $w.entry <Return> $cmd
+
+ SliderMinMax $w $from $to $num
+
+ return $w
+}
+
+proc SliderMinMax {w from to num} {
+ $w.slider configure -from $from -to $to
+
+ if {$from == $to} {
+ for {set ii 0} {$ii<$num} {incr ii} {
+ $w.t$ii configure -text {}
+ }
+ } else {
+ for {set ii 0} {$ii<$num} {incr ii} {
+ set vv [expr ($to*1.-$from)/($num-1)*$ii + $from]
+
+ if {[string is integer $from] && [string is integer $to]} {
+ set vv [expr int($vv)]
+ } else {
+ set vv [format {%.5g} $vv]
+ }
+ $w.t$ii configure -text $vv
+ }
+ }
+}
+
+proc SliderCmd {w varname cmd vv} {
+ upvar $varname var
+
+ set from [$w.slider cget -from]
+ set to [$w.slider cget -to]
+
+ if {[string is integer $from] && [string is integer $to]} {
+ set var [expr int($vv)]
+ }
+ if {$cmd != {}} {
+ eval $cmd
+ }
+}
diff --git a/ds9/library/smooth.tcl b/ds9/library/smooth.tcl
new file mode 100644
index 0000000..f116510
--- /dev/null
+++ b/ds9/library/smooth.tcl
@@ -0,0 +1,304 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc SmoothDef {} {
+ global smooth
+ global ismooth
+ global psmooth
+
+ set ismooth(top) .sm
+ set ismooth(mb) .smmb
+
+ set smooth(lock) 0
+ set smooth(view) 0
+ set smooth(function) gaussian
+ set smooth(radius) 3
+
+ array set psmooth [array get smooth]
+}
+
+proc SmoothUpdate {} {
+ global smooth
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ SetWatchCursor
+ if {$smooth(view)} {
+ RGBEvalLockCurrent rgb(lock,smooth) [list $current(frame) smooth $smooth(function) $smooth(radius)]
+ } else {
+ RGBEvalLockCurrent rgb(lock,smooth) [list $current(frame) smooth delete]
+ }
+ ResetWatchCursor
+ }
+
+ LockSmoothCurrent
+ UpdateCubeDialog
+ UpdateContourScale
+ UpdateContourDialog
+ UpdateScaleDialog
+ UpdateGraphXAxis $current(frame)
+ UpdateMain
+}
+
+proc SmoothDialog {} {
+ global ds9
+ global smooth
+ global ismooth
+
+ # see if we already have a window visible
+ if {[winfo exists $ismooth(top)]} {
+ raise $ismooth(top)
+ return
+ }
+
+ # create the window
+ set w $ismooth(top)
+ set mb $ismooth(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Smooth Parameters}] SmoothDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command SmoothApplyDialog
+ $mb.file add command -label [msgcat::mc {Clear}] -command SmoothOffDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command SmoothDestroyDialog
+
+ EditMenu $mb ismooth
+
+ # Function
+ set f [ttk::labelframe $w.func -text [msgcat::mc {Function}] -padding 2]
+ ttk::radiobutton $f.boxcar -text [msgcat::mc {Boxcar}] \
+ -variable smooth(function) -value boxcar
+ ttk::radiobutton $f.tophat -text [msgcat::mc {Tophat}] \
+ -variable smooth(function) -value tophat
+ ttk::radiobutton $f.gaussian -text [msgcat::mc {Gaussian}] \
+ -variable smooth(function) -value gaussian
+ grid $f.boxcar $f.tophat $f.gaussian -padx 2 -pady 2
+
+ # Kernal
+ set f [ttk::labelframe $w.rad -text [msgcat::mc {Kernel}] -padding 2]
+ slider $f.slider 1 20 {Radius} smooth(radius) {}
+ grid $f.slider -padx 2 -pady 2 -sticky ew
+ grid columnconfigure $f 0 -weight 1
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command SmoothApplyDialog
+ ttk::button $f.clear -text [msgcat::mc {Clear}] -command SmoothOffDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command SmoothDestroyDialog
+ pack $f.apply $f.clear $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ grid $w.func -sticky news
+ grid $w.rad -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+}
+
+proc SmoothApplyDialog {} {
+ global smooth
+
+ set smooth(view) 1
+ SmoothUpdate
+}
+
+proc SmoothDestroyDialog {} {
+ global ismooth
+
+ if {[winfo exists $ismooth(top)]} {
+ destroy $ismooth(top)
+ destroy $ismooth(mb)
+ }
+}
+
+proc SmoothOffDialog {} {
+ global smooth
+
+ set smooth(view) 0
+ SmoothUpdate
+}
+
+proc UpdateSmoothMenu {} {
+ global smooth
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateSmoothMenu"
+ }
+
+ if {$current(frame) != {}} {
+ set smooth(view) [$current(frame) has smooth]
+ set smooth(function) [$current(frame) get smooth function]
+ set smooth(radius) [$current(frame) get smooth radius]
+ }
+}
+
+proc MatchSmoothCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ MatchSmooth $current(frame)
+ }
+}
+
+proc MatchSmooth {which} {
+ global ds9
+ global rgb
+
+ set view [$which has smooth]
+ set function [$which get smooth function]
+ set radius [$which get smooth radius]
+
+ foreach ff $ds9(frames) {
+ if {$ff != $which} {
+ if {$view} {
+ RGBEvalLock rgb(lock,smooth) $ff [list $ff smooth $function $radius]
+ } else {
+ RGBEvalLock rgb(lock,smooth) $ff [list $ff smooth delete]
+ }
+ }
+ }
+}
+
+proc LockSmoothCurrent {} {
+ global current
+
+ if {$current(frame) != {}} {
+ LockSmooth $current(frame)
+ }
+}
+
+proc LockSmooth {which} {
+ global smooth
+
+ if {$smooth(lock)} {
+ MatchSmooth $which
+ }
+}
+
+proc SmoothBackup {ch which} {
+ switch [$which get type] {
+ base -
+ 3d {SmoothBackupBase $ch $which}
+ rgb {SmoothBackupRGB $ch $which}
+ }
+}
+
+proc SmoothBackupBase {ch which} {
+ if {[$which has smooth]} {
+ set function [$which get smooth function]
+ set radius [$which get smooth radius]
+ puts $ch "$which smooth $function $radius"
+ }
+}
+
+proc SmoothBackupRGB {ch which} {
+ set sav [$which get rgb channel]
+ foreach cc {red green blue} {
+ $which rgb channel $cc
+ puts $ch "$which rgb channel $cc"
+ SmoothBackupBase $ch $which
+ }
+ $which rgb channel $sav
+ puts $ch "$which rgb channel $sav"
+}
+
+proc PrefsDialogSmooth {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {Smooth}]
+ lappend dprefs(tabs) [ttk::frame $w.smooth]
+
+ set f [ttk::labelframe $w.smooth.param -text [msgcat::mc {Smooth}]]
+
+ ttk::label $f.title -text [msgcat::mc {Function}]
+ ttk::menubutton $f.function -textvariable psmooth(function) \
+ -menu $f.function.menu
+
+ menu $f.function.menu
+ $f.function.menu add radiobutton -label [msgcat::mc {Boxcar}] \
+ -variable psmooth(function) -value boxcar
+ $f.function.menu add radiobutton -label [msgcat::mc {Tophat}] \
+ -variable psmooth(function) -value tophat
+ $f.function.menu add radiobutton -label [msgcat::mc {Gaussian}] \
+ -variable psmooth(function) -value gaussian
+
+ grid $f.title $f.function -padx 2 -pady 2 -sticky w
+
+ pack $f -side top -fill both -expand true
+}
+
+proc ProcessSmoothCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global smooth
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {SmoothDialog}
+ close {SmoothDestroyDialog}
+ match {MatchSmoothCurrent}
+ lock {
+ incr i
+ if {!([string range [lindex $var $i] 0 0] == "-")} {
+ set smooth(lock) [FromYesNo [lindex $var $i]]
+ } else {
+ set smooth(lock) 1
+ incr i -1
+ }
+ LockSmoothCurrent
+ }
+ radius {
+ incr i
+ set smooth(radius) [lindex $var $i]
+ SmoothUpdate
+ }
+ function {
+ incr i
+ set smooth(function) [lindex $var $i]
+ SmoothUpdate
+ }
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ set smooth(view) [FromYesNo [lindex $var $i]]
+ SmoothUpdate
+ }
+
+ default {
+ set smooth(view) 1
+ SmoothUpdate
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendSmoothCmd {proc id param} {
+ global smooth
+
+ switch -- [lindex $param 0] {
+ lock {$proc $id [ToYesNo $smooth(lock)]}
+ function {$proc $id "$smooth(function)\n"}
+ radius {$proc $id "$smooth(radius)\n"}
+ default {$proc $id [ToYesNo $smooth(view)]}
+ }
+}
+
diff --git a/ds9/library/smosaic.tcl b/ds9/library/smosaic.tcl
new file mode 100644
index 0000000..37ee762
--- /dev/null
+++ b/ds9/library/smosaic.tcl
@@ -0,0 +1,25 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc ProcessSMosaicCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvar $var
+ set ii $i
+
+ switch -- [string tolower [lindex $var $i]] {
+ iraf {
+ incr ii
+ ProcessSMosaicIRAFCmd vvar ii $sock $fn
+ }
+ {} {
+ set vvar [linsert $var $i wcs]
+ ProcessSMosaicWCSCmd vvar ii $sock $fn
+ }
+ default {ProcessSMosaicWCSCmd vvar ii $sock $fn}
+ }
+}
diff --git a/ds9/library/smosaiciraf.tcl b/ds9/library/smosaiciraf.tcl
new file mode 100644
index 0000000..8534508
--- /dev/null
+++ b/ds9/library/smosaiciraf.tcl
@@ -0,0 +1,70 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadSMosaicIRAFFile {hdr fn layer} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {mosaic iraf}
+ set loadParam(load,type) smmap
+ set loadParam(file,name) $fn
+ set loadParam(file,header) $hdr
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc ProcessSMosaicIRAFCmd {varname iname sock fn layer} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ set opt [lindex $var $i]
+ if {$opt != {}} {
+ incr i
+ } else {
+ set opt wcs
+ }
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {0} {
+ # not supported
+ } else {
+ LoadSMosaicIRAFFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $opt
+ }
+ } else {
+ # comm
+ if {0} {
+ # not supported
+ } else {
+ LoadSMosaicIRAFFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $opt
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/smosaicwcs.tcl b/ds9/library/smosaicwcs.tcl
new file mode 100644
index 0000000..e751659
--- /dev/null
+++ b/ds9/library/smosaicwcs.tcl
@@ -0,0 +1,70 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadSMosaicWCSFitsFile {hdr fn layer sys} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) [list mosaic $sys]
+ set loadParam(load,type) smmap
+ set loadParam(file,name) $fn
+ set loadParam(file,header) $hdr
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc ProcessSMosaicWCSCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global loadParam
+ global current
+
+ set layer {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ set opt [lindex $var $i]
+ if {$opt != {}} {
+ incr i
+ } else {
+ set opt wcs
+ }
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {0} {
+ # not supported
+ } else {
+ LoadSMosaicWCSFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $opt
+ }
+ } else {
+ # comm
+ if {0} {
+ # not supported
+ } else {
+ LoadSMosaicWCSFile [lindex $var $i] [lindex $var [expr $i+1]] \
+ $layer $opt
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/source.tcl b/ds9/library/source.tcl
new file mode 100644
index 0000000..584a986
--- /dev/null
+++ b/ds9/library/source.tcl
@@ -0,0 +1,195 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+source $ds9(root)/library/2mass.tcl
+source $ds9(root)/library/3d.tcl
+source $ds9(root)/library/array.tcl
+source $ds9(root)/library/analysis.tcl
+source $ds9(root)/library/analysisparam.tcl
+source $ds9(root)/library/annulus.tcl
+source $ds9(root)/library/ar.tcl
+source $ds9(root)/library/backup.tcl
+source $ds9(root)/library/bin.tcl
+source $ds9(root)/library/block.tcl
+source $ds9(root)/library/box.tcl
+source $ds9(root)/library/boxannulus.tcl
+source $ds9(root)/library/bpanda.tcl
+source $ds9(root)/library/buttons.tcl
+source $ds9(root)/library/cat.tcl
+source $ds9(root)/library/catcds.tcl
+source $ds9(root)/library/catcdssrch.tcl
+source $ds9(root)/library/catcdssrchdialog.tcl
+source $ds9(root)/library/catcmd.tcl
+source $ds9(root)/library/catcxc.tcl
+source $ds9(root)/library/catdialog.tcl
+source $ds9(root)/library/catflt.tcl
+source $ds9(root)/library/catmatch.tcl
+source $ds9(root)/library/catned.tcl
+source $ds9(root)/library/catopt.tcl
+source $ds9(root)/library/catplot.tcl
+source $ds9(root)/library/catreg.tcl
+source $ds9(root)/library/catsdss.tcl
+source $ds9(root)/library/catsimbad.tcl
+source $ds9(root)/library/catskybot.tcl
+source $ds9(root)/library/catsym.tcl
+source $ds9(root)/library/catvot.tcl
+source $ds9(root)/library/centroid.tcl
+source $ds9(root)/library/circle.tcl
+source $ds9(root)/library/colorbar.tcl
+source $ds9(root)/library/comm.tcl
+source $ds9(root)/library/command.tcl
+source $ds9(root)/library/compass.tcl
+source $ds9(root)/library/composite.tcl
+source $ds9(root)/library/contour.tcl
+source $ds9(root)/library/convert.tcl
+source $ds9(root)/library/coord.tcl
+source $ds9(root)/library/cpanda.tcl
+source $ds9(root)/library/crop.tcl
+source $ds9(root)/library/crosshair.tcl
+source $ds9(root)/library/cube.tcl
+source $ds9(root)/library/debug.tcl
+source $ds9(root)/library/dialog.tcl
+source $ds9(root)/library/ellipse.tcl
+source $ds9(root)/library/ellipseannulus.tcl
+source $ds9(root)/library/envi.tcl
+source $ds9(root)/library/epanda.tcl
+source $ds9(root)/library/error.tcl
+source $ds9(root)/library/eso.tcl
+source $ds9(root)/library/examine.tcl
+source $ds9(root)/library/export.tcl
+source $ds9(root)/library/external.tcl
+source $ds9(root)/library/file.tcl
+source $ds9(root)/library/fits.tcl
+source $ds9(root)/library/frame.tcl
+source $ds9(root)/library/graph.tcl
+source $ds9(root)/library/grid.tcl
+source $ds9(root)/library/group.tcl
+source $ds9(root)/library/header.tcl
+source $ds9(root)/library/help.tcl
+source $ds9(root)/library/http.tcl
+source $ds9(root)/library/hv.tcl
+source $ds9(root)/library/hvform.tcl
+source $ds9(root)/library/hvsup.tcl
+source $ds9(root)/library/iexam.tcl
+source $ds9(root)/library/iis.tcl
+source $ds9(root)/library/ime.tcl
+source $ds9(root)/library/imgsvr.tcl
+source $ds9(root)/library/import.tcl
+source $ds9(root)/library/info.tcl
+source $ds9(root)/library/layout.tcl
+source $ds9(root)/library/line.tcl
+source $ds9(root)/library/load.tcl
+source $ds9(root)/library/magnifier.tcl
+source $ds9(root)/library/marker.tcl
+source $ds9(root)/library/markeranalysishist.tcl
+source $ds9(root)/library/markeranalysispanda.tcl
+source $ds9(root)/library/markeranalysisplot2d.tcl
+source $ds9(root)/library/markeranalysisplot3d.tcl
+source $ds9(root)/library/markeranalysisradial.tcl
+source $ds9(root)/library/markeranalysisstats.tcl
+source $ds9(root)/library/markerbase.tcl
+source $ds9(root)/library/markerbaseannulus.tcl
+source $ds9(root)/library/markerbaseannulusrect.tcl
+source $ds9(root)/library/markerbasecenter.tcl
+source $ds9(root)/library/markerbaseline.tcl
+source $ds9(root)/library/markerbasepanda.tcl
+source $ds9(root)/library/markerbasepandarect.tcl
+source $ds9(root)/library/markerdialog.tcl
+source $ds9(root)/library/mask.tcl
+source $ds9(root)/library/manalysis.tcl
+source $ds9(root)/library/mbin.tcl
+source $ds9(root)/library/mcolor.tcl
+source $ds9(root)/library/mecube.tcl
+source $ds9(root)/library/medit.tcl
+source $ds9(root)/library/menu.tcl
+source $ds9(root)/library/mfile.tcl
+source $ds9(root)/library/mframe.tcl
+source $ds9(root)/library/mhelp.tcl
+source $ds9(root)/library/mosaicimage.tcl
+source $ds9(root)/library/mosaicimageiraf.tcl
+source $ds9(root)/library/mosaicimagewcs.tcl
+source $ds9(root)/library/mosaicimagewfpc2.tcl
+source $ds9(root)/library/mosaic.tcl
+source $ds9(root)/library/mosaiciraf.tcl
+source $ds9(root)/library/mosaicwcs.tcl
+source $ds9(root)/library/movie.tcl
+source $ds9(root)/library/mregion.tcl
+source $ds9(root)/library/mscale.tcl
+source $ds9(root)/library/multiframe.tcl
+source $ds9(root)/library/mview.tcl
+source $ds9(root)/library/mwcs.tcl
+source $ds9(root)/library/mzoom.tcl
+source $ds9(root)/library/nameres.tcl
+source $ds9(root)/library/nsvr.tcl
+source $ds9(root)/library/nrrd.tcl
+source $ds9(root)/library/nvss.tcl
+source $ds9(root)/library/open.tcl
+source $ds9(root)/library/pagesetup.tcl
+source $ds9(root)/library/panner.tcl
+source $ds9(root)/library/panzoom.tcl
+source $ds9(root)/library/photo.tcl
+source $ds9(root)/library/pixel.tcl
+source $ds9(root)/library/plot.tcl
+source $ds9(root)/library/plotbar.tcl
+source $ds9(root)/library/plotdialog.tcl
+source $ds9(root)/library/plotelement.tcl
+source $ds9(root)/library/plotline.tcl
+source $ds9(root)/library/plotprint.tcl
+source $ds9(root)/library/plotprocess.tcl
+source $ds9(root)/library/plotscatter.tcl
+source $ds9(root)/library/point.tcl
+source $ds9(root)/library/polygon.tcl
+source $ds9(root)/library/prefs.tcl
+source $ds9(root)/library/prefsdialog.tcl
+source $ds9(root)/library/print.tcl
+source $ds9(root)/library/projection.tcl
+source $ds9(root)/library/rgb.tcl
+source $ds9(root)/library/rgbarray.tcl
+source $ds9(root)/library/rgbcube.tcl
+source $ds9(root)/library/rgbimage.tcl
+source $ds9(root)/library/ruler.tcl
+source $ds9(root)/library/samp.tcl
+source $ds9(root)/library/sao.tcl
+source $ds9(root)/library/save.tcl
+source $ds9(root)/library/saveimage.tcl
+source $ds9(root)/library/scale.tcl
+source $ds9(root)/library/sia.tcl
+source $ds9(root)/library/siadialog.tcl
+source $ds9(root)/library/segment.tcl
+source $ds9(root)/library/sfits.tcl
+source $ds9(root)/library/shm.tcl
+source $ds9(root)/library/skyview.tcl
+source $ds9(root)/library/slider.tcl
+source $ds9(root)/library/smosaic.tcl
+source $ds9(root)/library/smosaiciraf.tcl
+source $ds9(root)/library/smosaicwcs.tcl
+source $ds9(root)/library/smooth.tcl
+source $ds9(root)/library/srgbcube.tcl
+source $ds9(root)/library/starbase.tcl
+source $ds9(root)/library/stdfbox.tcl
+source $ds9(root)/library/stsci.tcl
+source $ds9(root)/library/template.tcl
+source $ds9(root)/library/text.tcl
+source $ds9(root)/library/tkfbox.tcl
+source $ds9(root)/library/tsv.tcl
+source $ds9(root)/library/url.tcl
+source $ds9(root)/library/util.tcl
+source $ds9(root)/library/var.tcl
+source $ds9(root)/library/vector.tcl
+source $ds9(root)/library/vla.tcl
+source $ds9(root)/library/vlss.tcl
+source $ds9(root)/library/vo.tcl
+source $ds9(root)/library/vot.tcl
+source $ds9(root)/library/wcs.tcl
+source $ds9(root)/library/xmfbox.tcl
+source $ds9(root)/library/xmlrpc.tcl
+source $ds9(root)/library/xpa.tcl
+
+switch [tk windowingsystem] {
+ x11 {}
+ aqua {source $ds9(root)/library/macosx.tcl}
+ win32 {source $ds9(root)/library/win32.tcl}
+}
diff --git a/ds9/library/srgbcube.tcl b/ds9/library/srgbcube.tcl
new file mode 100644
index 0000000..f460c51
--- /dev/null
+++ b/ds9/library/srgbcube.tcl
@@ -0,0 +1,68 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadSRGBCubeFile {hdr fn} {
+ global loadParam
+ global current
+
+ switch -- [$current(frame) get type] {
+ base -
+ 3d {
+ Error [msgcat::mc {Unable to load RGB image into a non-rgb frame}]
+ return
+ }
+ rgb {}
+ }
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) {rgb cube}
+ set loadParam(load,type) smmap
+ set loadParam(file,name) $fn
+ set loadParam(file,header) $hdr
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
+proc ProcessSRGBCubeCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateRGBFrame
+ }
+ mask {
+ incr i
+ # not supported
+ }
+ slice {
+ incr i
+ # not supported
+ }
+ }
+
+ StartLoad
+ if {$sock != {}} {
+ # xpa
+ if {0} {
+ # not supported
+ } else {
+ LoadSRGBCubeFile [lindex $var $i] [lindex $var [expr $i+1]]
+ }
+ } else {
+ # comm
+ if {0} {
+ # not supported
+ } else {
+ LoadSRGBCubeFile [lindex $var $i] [lindex $var [expr $i+1]]
+ }
+ }
+ FinishLoad
+}
diff --git a/ds9/library/starbase.tcl b/ds9/library/starbase.tcl
new file mode 100644
index 0000000..218115e
--- /dev/null
+++ b/ds9/library/starbase.tcl
@@ -0,0 +1,547 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# ####
+#
+# starbase.tcl -- Tcl interface to starbase
+#
+# ####
+
+# Starbase Tables Interface
+#
+
+set starbase_debug 0
+
+proc Starbase {} {
+ global Starbase
+ return $Starbase(version)
+}
+
+set Starbase(version) "Starbase Tcl Driver 1.0"
+
+proc starbase_nrows { D } { upvar $D data; return $data(Nrows) }
+proc starbase_ncols { D } { upvar $D data; return $data(Ncols) }
+proc starbase_get { D row col } { upvar $D data; return $data($row,$col) }
+proc starbase_set { D row col val } { upvar $D data; set data($row,$col) $val; }
+proc starbase_colname { D num } { upvar $D data; return $data(0,$num) }
+#proc starbase_columns { D } { upvar $D data; return $data(Header) }
+proc starbase_colnum { D name } { upvar $D data; return $data($name) }
+
+proc starbase_columns {t} {
+ upvar $t T
+
+ set row {}
+ set Ncols $T(Ncols)
+ for { set c 1 } { $c <= $Ncols } { incr c } {
+ lappend row $T(0,$c)
+ }
+
+ return $row
+}
+
+proc starbase_init { t } {
+ upvar t T
+
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) ""
+}
+
+# Set up a starbase data array for use with ted
+#
+proc starbase_driver { Dr } {
+ upvar $Dr driver
+
+ set driver(nrows) starbase_nrows
+ set driver(ncols) starbase_ncols
+ set driver(get) starbase_get
+ set driver(set) starbase_set
+ set driver(colname) starbase_colname
+ set driver(colnum) starbase_colnum
+ set driver(columns) starbase_columns
+ set driver(colins) starbase_colins
+ set driver(coldel) starbase_coldel
+ set driver(colapp) starbase_colapp
+ set driver(rowins) starbase_rowins
+ set driver(rowdel) starbase_rowdel
+ set driver(rowapp) starbase_rowapp
+}
+starbase_driver Starbase
+
+proc starbase_new { t args } {
+ upvar $t T
+
+ set T(Header) $args
+ set T(Ndshs) [llength $T(Header)]
+ set T(HLines) 2
+ starbase_colmap T
+
+ set T(Nrows) 0
+}
+
+proc starbase_colmap { h } {
+ upvar $h H
+
+ set c 0
+ foreach column $H(Header) {
+ incr c
+ set column [string trim $column]
+ set H($column) $c
+ set H(0,$c) $column
+ }
+ set H(Ncols) $c
+}
+
+proc starbase_coldel { t here } {
+ upvar $t T
+
+ set Ncols $T(Ncols)
+
+ set T(Header) [lreplace $T(Header) [expr $here - 1] [expr $here - 1]
+ starbase_colmap T
+
+ for { set row 1 } { $row <= $T(Nrows) } { incr row } {
+ for { set col $here } { $col < $Ncols } { incr col } {
+ if { [catch { set val $T($row,[expr $col + 1]) }] } {
+ set T($row,$col) ""
+ } else {
+ set T($row,$col) $val
+ }
+ }
+ }
+}
+
+proc starbase_colins { t name here } {
+ upvar $t T
+
+ if { [info exists $T(Header)] == 0 } {
+ set T(Header) $name
+ } else {
+ set T(Header) [linsert $T(Header) [expr $here - 1] $name]
+ }
+ starbase_colmap T
+
+ for { set row 1 } { $row <= $T(Nrows) } { incr row } {
+ for { set col $T(Ncol) } { $col > $here } { incr col -1 } {
+ if { [catch { set val $T($row,[expr $col - 1]) }] } {
+ set T($row,$col) ""
+ } else {
+ set T($row,$col) $val
+ }
+ }
+ }
+
+ for { set row 1 } { $row <= $T(Nrows) } { incr row } {
+ set T($row,$here) ""
+ }
+}
+
+proc starbase_header { h fp } {
+ upvar $h H
+ global starbase_line
+ set N 1
+
+ if { [info exists starbase_line] } {
+ set line $starbase_line
+ set n 1
+
+ set H(H_$n) $line
+ if { [regexp -- {^ *(-)+ *(\t *(-)+ *)*} $line] } break
+ if { $n >= 2 } {
+ set ind [string first "\t" $H(H_[expr $n-1])]
+ if { $ind >= 0 } {
+ set name [string range $H(H_[expr $n-1]) 0 [expr $ind - 1]]
+ incr ind
+ set H(H_$name) [string range $H(H_[expr $n-1]) $ind end]
+ set H(N_$name) [expr $n-1]
+ }
+# set l [split $H(H_[expr $n-1]) "\t"]
+# if { [llength $l] > 1 } {
+# set name [lindex $l 0]
+# set H(H_$name) [lrange $l 1 end]
+# set H(N_$name) [expr $n-1]
+# }
+ }
+
+ unset starbase_line
+ set N 2
+ }
+ for { set n $N } { [set eof [gets $fp line]] != -1 } { incr n } {
+ set H(H_$n) $line
+ if { [regexp -- {^ *(-)+ *(\t *(-)+ *)*} $line] } break
+
+ if { $n >= 2 } {
+ set ind [string first "\t" $H(H_[expr $n-1])]
+ if { $ind >= 0 } {
+ set name [string range $H(H_[expr $n-1]) 0 [expr $ind - 1]]
+ incr ind
+ set H(H_$name) [string range $H(H_[expr $n-1]) $ind end]
+ set H(N_$name) [expr $n-1]
+ }
+# set l [split $H(H_[expr $n-1]) "\t"]
+# if { [llength $l] > 1 } {
+# set name [lindex $l 0]
+# set H(H_$name) [lrange $l 1 end]
+# set H(N_$name) [expr $n-1]
+# }
+ }
+
+ }
+
+ if { $eof == -1 } {
+ error "ERROR: in starbase_header: unexpected eof"
+ }
+
+ set H(H_$n) $line
+ set H(HLines) $n
+ set H(Header) [split $H(H_[expr $n-1]) "\t"]
+ set H(Dashes) [split $H(H_$n) "\t"]
+ set H(Ndshs) [llength $H(Dashes)]
+
+ starbase_colmap H
+
+ return H(Header)
+}
+
+proc starbase_hdrget { h name } {
+ upvar $h H
+
+ return $H(H_$name)
+}
+
+proc starbase_hdrset { h name value } {
+ upvar #0 $h H
+
+ if { ![info exists H(H_$name)] } {
+ set n [incr H(HLines)]
+
+ set H(H_[expr $n-0]) $H(H_[expr $n-1])
+ set H(H_[expr $n-1]) $H(H_[expr $n-2])
+ set H(N_$name) [expr $n-2]
+ }
+ set H(H_$name) $value
+ set H(H_$H(N_$name)) "$name $value"
+}
+
+proc starbase_hdrput { h fp } {
+ upvar $h H
+
+ if { ![info exists H(HLines)] || ($H(HLines) == 0) } {
+ return
+ }
+
+ set nl [expr $H(HLines) - 2]
+ for { set l 1 } { $l <= $nl } { incr l } {
+ puts $fp $H(H_$l)
+ }
+
+ if { ![info exists H(Ncols)] || ($H(Ncols) == 0) } {
+ return
+ }
+
+ set nc $H(Ncols)
+ for { set c 1 } { $c <= $nc } { incr c } {
+ puts -nonewline $fp "$H(0,$c)"
+ if { $c != $nc } {
+ puts -nonewline $fp "\t"
+ } else {
+ puts -nonewline $fp "\n"
+ }
+ }
+
+ for { set c 1 } { $c <= $nc } { incr c } {
+ set len [string length $H(0,$c)]
+ for { set d 1 } { $d <= $len } { incr d } {
+ puts -nonewline $fp "-"
+ }
+ if { $c != $nc } {
+ puts -nonewline $fp "\t"
+ } else {
+ puts -nonewline $fp "\n"
+ }
+ }
+}
+
+proc starbase_hdrput_ { h varname } {
+ upvar $h H
+ upvar $varname var
+
+ if { ![info exists H(HLines)] || ($H(HLines) == 0) } {
+ return
+ }
+
+ set nl [expr $H(HLines) - 2]
+ for { set l 1 } { $l <= $nl } { incr l } {
+ append var "$H(H_$l)\n"
+ }
+
+ if { ![info exists H(Ncols)] || ($H(Ncols) == 0) } {
+ return
+ }
+
+ set nc $H(Ncols)
+ for { set c 1 } { $c <= $nc } { incr c } {
+ append var "$H(0,$c)"
+ if { $c != $nc } {
+ append var "\t"
+ } else {
+ append var "\n"
+ }
+ }
+
+ for { set c 1 } { $c <= $nc } { incr c } {
+ set len [string length $H(0,$c)]
+ for { set d 1 } { $d <= $len } { incr d } {
+ append var "-"
+ }
+ if { $c != $nc } {
+ append var "\t"
+ } else {
+ append var "\n"
+ }
+ }
+}
+
+proc starbase_readfp { t fp } {
+ upvar $t T
+
+ starbase_header T $fp
+
+ set NCols [starbase_ncols T]
+
+ for { set r 1 } { [gets $fp line] != -1 } { incr r } {
+ if { [string index $line 0] == "\f" } {
+ global starbase_line
+ set starbase_line [string range $line 1 end]
+ break
+ }
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) [string trim $val]
+ incr c
+ }
+ for { } { $c <= $NCols } { incr c } {
+ set T($r,$c) {}
+ }
+ }
+ set T(Nrows) [expr $r-1]
+}
+
+proc starbase_read { t file } {
+ upvar $t T
+
+ set fp [open $file]
+ starbase_readfp T $fp
+ close $fp
+
+ set T(filename) $file
+}
+
+proc starbase_writefp { t fp } {
+ upvar $t T
+
+ starbase_hdrput T $fp
+
+ if { ![info exists T(Nrows)] || ($T(Nrows) == 0) } {
+ return
+ }
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+ for { set r 1 } { $r <= $nr } { incr r } {
+ for { set c 1 } { $c < $nc } { incr c } {
+ if { [catch { set val $T($r,$c) }] } {
+ set val ""
+ }
+
+ puts -nonewline $fp "$val "
+ }
+ if { [catch { set val $T($r,$c) }] } {
+ set val ""
+ }
+ puts $fp $val
+ }
+}
+
+proc starbase_write { t file } {
+ upvar $t T
+
+ set fp [open $file w]
+ starbase_writefp T $fp
+ close $fp
+}
+
+proc starbase_write_ { t } {
+ upvar $t T
+
+ set rr {}
+ starbase_hdrput_ T rr
+
+ if { ![info exists T(Nrows)] || ($T(Nrows) == 0) } {
+ return
+ }
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+ for { set r 1 } { $r <= $nr } { incr r } {
+ for { set c 1 } { $c < $nc } { incr c } {
+ if { [catch { set val $T($r,$c) }] } {
+ set val ""
+ }
+
+ append rr "$val "
+ }
+ if { [catch { set val $T($r,$c) }] } {
+ set val ""
+ }
+ append rr "$val\n"
+ }
+ return $rr
+}
+
+proc starbase_rowins { t row } {
+ upvar $t T
+
+ incr T(Nrows)
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+ for { set r $nr } { $r > $row } { set r [expr $r-1] } {
+ for { set c 1 } { $c <= $nc } { incr c } {
+ if { [catch { set val $T([expr $r-1],$c) }] } {
+ set val ""
+ }
+
+ set T($r,$c) $val
+ }
+ }
+
+ for { set c 1 } { $c <= $nc } { incr c } {
+ set T($r,$c) ""
+ }
+}
+
+proc starbase_rowdel { t row } {
+ upvar $t T
+
+ incr T(Nrows) -1
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+ for { set r $row } { $r <= $nr } { incr r } {
+ for { set c 1 } { $c <= $nc } { incr c } {
+ if { [catch { set val $T([expr $r+1],$c) }] } {
+ set val ""
+ }
+
+ set T($r,$c) $val
+ }
+ }
+
+ for { set c 1 } { $c <= $nc } { incr c } {
+ set T($r,$c) ""
+ }
+}
+
+proc starbase_httpreader { t wait sock http } {
+ global $t
+ global starbase_debug
+ upvar #0 $wait W
+ upvar #0 $t T
+
+ set T(http) $http
+
+ if { ![info exists T(state)] } {
+ error "ERROR: starbase_httpreader not properly initialized"
+ }
+
+ switch -- $T(state) {
+ 0 {
+ fconfigure $sock -blocking 1
+ set T(state) 1
+ set T(Nrows) 0
+ set T(HLines) 0
+ }
+
+ 1 {
+ incr ${t}(HLines)
+ set n $T(HLines)
+
+ if { [gets $sock line] == -1 } {
+ set T(state) -1
+ set T(HLines) [expr $T(HLines) - 1]
+ set T(Nrows) 0
+ return
+ }
+
+ set T(H_$n) $line
+ set l [split $line]
+ if { [llength $l] > 1 } {
+ set T(H_[lindex $l 0]) [lrange $l 1 end]
+ }
+ set T(H_$n) $line
+
+ if { [regexp -- {^ *(-)+ *(\t *(-)+ *)*} $line] } {
+ set T(Header) [split $T(H_[expr $n-1]) "\t"]
+ set T(Dashes) [split $T(H_$n) "\t"]
+ set T(Ndshs) [llength $T(Dashes)]
+
+ starbase_colmap T
+ set T(state) 2
+ }
+ }
+
+ 2 {
+ if { [gets $sock line] == -1 } {
+ set T(state) 0
+ } else {
+ if { $starbase_debug } {
+ puts [format "starbase_httpreader: %s" $line]
+ }
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols T]
+ set c 1
+ foreach val [split $line "\t"] {
+ set T($r,$c) $val
+ incr c
+ }
+ for { } { $c <= $NCols } { incr c } {
+ set T($r,$c) {}
+ }
+ }
+ }
+
+ default {
+ error "ERROR: unknown switch in starbase_httpreader"
+ }
+ }
+}
+
+proc starbase_cancel { t wait http } {
+ upvar #0 $wait W
+ upvar #0 $t T
+
+# set T(state) 0
+ set W 1
+}
+
+proc starbase_http { t url wait } {
+ upvar #0 $t T
+
+ set T(state) 0
+ set T(http) [http::geturl $url \
+ -handler [list starbase_httpreader $t $wait] \
+ -command [list starbase_cancel $t $wait]]
+}
+
+proc starbase_httpkill { t } {
+ upvar #0 $t T
+
+ http::reset $T(http)
+}
+
diff --git a/ds9/library/stdfbox.tcl b/ds9/library/stdfbox.tcl
new file mode 100644
index 0000000..1fc0676
--- /dev/null
+++ b/ds9/library/stdfbox.tcl
@@ -0,0 +1,547 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# do this after the language has been defined and the prefs sourced
+proc InitDialogBox {} {
+ global ds9
+ global pds9
+ global env
+
+ global fitsurl
+ set fitsurl {}
+
+ global fitsfbox
+ set fitsfbox(file) {ds9.fits}
+ set fitsfbox(dir) {}
+ set fitsfbox(types) [list \
+ [list {FITS} {*.fits}] \
+ [list {FITS} {*.FITS}] \
+ [list {FITS} {*.fit}] \
+ [list {FITS} {*.FIT}] \
+ [list {FITS} {*.fts}] \
+ [list {FITS} {*.FTS}] \
+ [list {FITS} {*.ds}] \
+ [list {FITS} {*.DS}] \
+ [list {FITS} {*.fits.gz}] \
+ [list {FITS} {*.fits.bz2}] \
+ [list {FITS} {*.fits.Z}] \
+ [list {FITS} {*.fits.z}] \
+ [list {FITS} {*.fitz}] \
+ [list {FITS} {*.FITZ}] \
+ [list {FITS} {*.ftz}] \
+ [list {FITS} {*.FTZ}] \
+ [list {FITS} {*.fz}] \
+ [list {FITS} {*.FZ}] \
+ ]
+
+ global savefitsfbox
+ set savefitsfbox(file) {ds9.fits}
+ set savefitsfbox(dir) {}
+ set savefitsfbox(types) [list \
+ [list {FITS} {*.fits}] \
+ [list {FITS} {*.fit}] \
+ [list {FITS} {*.fts}] \
+ [list {FITS} {*.fits.gz}] \
+ [list {FITS} {*.fits.bz2}] \
+ [list {FITS} {*.fits.Z}] \
+ [list {FITS} {*.fits.z}] \
+ ]
+
+ global epsfbox
+ set epsfbox(file) {ds9.eps}
+ set epsfbox(dir) {}
+ set epsfbox(types) [list \
+ [list {EPS} {*.eps}] \
+ ]
+ global arrayfbox
+ set arrayfbox(file) {ds9.arr}
+ set arrayfbox(dir) {}
+ set arrayfbox(types) [list \
+ [list [::msgcat::mc {Array}] {*.arr}] \
+ ]
+ global rgbarrayfbox
+ set rgbarrayfbox(file) {ds9.rgb}
+ set rgbarrayfbox(dir) {}
+ set rgbarrayfbox(types) [list \
+ [list [::msgcat::mc {RGB Array}] {*.rgb}] \
+ ]
+ global nrrdfbox
+ set nrrdfbox(file) {ds9.nrrd}
+ set nrrdfbox(dir) {}
+ set nrrdfbox(types) [list \
+ [list {NRRD} {*.nrrd}] \
+ ]
+ global envifbox
+ set envifbox(file) {ds9.hdr}
+ set envifbox(dir) {}
+ set envifbox(types) [list \
+ [list {ENVI} {*.hdr}] \
+ ]
+ global envi2fbox
+ set envi2fbox(file) {ds9.bsq}
+ set envi2fbox(dir) {}
+ set envi2fbox(types) [list \
+ [list {ENVI2} {*.bil}] \
+ [list {ENVI2} {*.bip}] \
+ [list {ENVI2} {*.bsq}] \
+ [list {ENVI2} {*.cube}] \
+ ]
+ global giffbox
+ set giffbox(file) {ds9.gif}
+ set giffbox(dir) {}
+ set giffbox(types) [list \
+ [list {GIF} {*.gif}] \
+ ]
+ global jpegfbox
+ set jpegfbox(file) {ds9.jpeg}
+ set jpegfbox(dir) {}
+ set jpegfbox(types) [list \
+ [list {JPEG} {*.jpeg}] \
+ [list {JPEG} {*.jpg}] \
+ ]
+ global tifffbox
+ set tifffbox(file) {ds9.tiff}
+ set tifffbox(dir) {}
+ set tifffbox(types) [list \
+ [list {TIFF} {*.tiff}] \
+ [list {TIFF} {*.tif}] \
+ ]
+ global pngfbox
+ set pngfbox(file) {ds9.png}
+ set pngfbox(dir) {}
+ set pngfbox(types) [list \
+ [list {PNG} {*.png}] \
+ ]
+ global mpegfbox
+ set mpegfbox(file) {ds9.mpeg}
+ set mpegfbox(dir) {}
+ set mpegfbox(types) [list \
+ [list {MPEG} {*.mpeg}] \
+ [list {MPEG} {*.mpg}] \
+ ]
+
+ global pixelfbox
+ set pixelfbox(file) {ds9.pix}
+ set pixelfbox(dir) {}
+ set pixelfbox(types) [list \
+ [list {PIX} {*.pix}] \
+ ]
+
+ global markerfbox
+ set markerfbox(file) {ds9.reg}
+ set markerfbox(dir) {}
+ set markerfbox(types) [list \
+ [list {REG} {*.reg}] \
+ [list {FITS} {*.fits}] \
+ [list {XML} {*.xml}] \
+ ]
+
+ global templatefbox
+ set templatefbox(file) {ds9.tpl}
+ set templatefbox(dir) {}
+ set templatefbox(types) \
+ [list [list {TPL} {*.tpl}] [list [::msgcat::mc {All}] {*}] ]
+
+ global colorbarfbox
+ set colorbarfbox(file) {ds9.sao}
+ set colorbarfbox(dir) {}
+ set colorbarfbox(types) [list \
+ [list [::msgcat::mc {Colormap}] {*.sao}] \
+ [list [::msgcat::mc {Colormap}] {*.lut}] \
+ ]
+
+ global contrastbiasfbox
+ set contrastbiasfbox(file) {ds9.cb}
+ set contrastbiasfbox(dir) {}
+ set contrastbiasfbox(types) [list \
+ [list {CB} {*.cb}] \
+ ]
+
+ global colortagfbox
+ set colortagfbox(file) {ds9.tag}
+ set colortagfbox(dir) {}
+ set colortagfbox(types) [list \
+ [list {Colortag} {*.tag}] \
+ ]
+
+ global pssavfbox
+ set pssavfbox(file) {ds9.ps}
+ set pssavfbox(dir) {}
+ set pssavfbox(types) [list \
+ [list {PS} {*.ps}] \
+ ]
+
+ global prsavfbox
+ set prsavfbox(file) {ds9.txt}
+ set prsavfbox(dir) {}
+ set prsavfbox(types) [list \
+ [list {TXT} {*.txt}] \
+ ]
+
+ # contour load
+ global contourlfbox
+ set contourlfbox(file) {ds9.ctr}
+ set contourlfbox(dir) {}
+ set contourlfbox(types) [list \
+ [list {CTR} {*.ctr}] \
+ [list {CON} {*.con}] \
+ ]
+
+ # contour save
+ global contoursfbox
+ set contoursfbox(file) {ds9.ctr}
+ set contoursfbox(dir) {}
+ set contoursfbox(types) [list \
+ [list {CTR} {*.ctr}] \
+ ]
+
+ # contour level load
+ global contourlevlfbox
+ set contourlevlfbox(file) {ds9.ctr}
+ set contourlevlfbox(dir) {}
+ set contourlevlfbox(types) [list \
+ [list {CTR} {*.ctr}] \
+ [list {LEV} {*.lev}] \
+ ]
+
+ # contour level save
+ global contourlevsfbox
+ set contourlevsfbox(file) {ds9.lev}
+ set contourlevsfbox(dir) {}
+ set contourlevsfbox(types) [list \
+ [list {LEV} {*.lev}] \
+ ]
+
+ global gridfbox
+ set gridfbox(file) {ds9.grd}
+ set gridfbox(dir) {}
+ set gridfbox(types) [list \
+ [list {GRD} {*.grd}] \
+ ]
+
+ global catfbox
+ set catfbox(file) {ds9.cat}
+ set catfbox(dir) {}
+ set catfbox(types) [list \
+ [list [::msgcat::mc {Catalog}] {*.cat}] \
+ [list [::msgcat::mc {Catalog}] {*.rdb}] \
+ ]
+
+ global cattsvfbox
+ set cattsvfbox(file) {ds9.tsv}
+ set cattsvfbox(dir) {}
+ set cattsvfbox(types) [list \
+ [list [::msgcat::mc {Catalog}] {*.tsv}] \
+ [list [::msgcat::mc {Catalog}] {*.csv}] \
+ ]
+
+ global catvotfbox
+ set catvotfbox(file) {ds9.xml}
+ set catvotfbox(dir) {}
+ set catvotfbox(types) [list \
+ [list [::msgcat::mc {Catalog}] {*.xml}] \
+ [list [::msgcat::mc {Catalog}] {*.vot}] \
+ [list [::msgcat::mc {Catalog}] {*.votable}] \
+ ]
+
+ global catfltfbox
+ set catfltfbox(file) {ds9.flt}
+ set catfltfbox(dir) {}
+ set catfltfbox(types) [list \
+ [list {FLT} {*.flt}] \
+ ]
+
+ global catsymfbox
+ set catsymfbox(file) {ds9.sym}
+ set catsymfbox(dir) {}
+ set catsymfbox(types) [list \
+ [list {SYM} {*.sym}] \
+ ]
+
+ global catcdssrchfbox
+ set catcdssrchfbox(file) {ds9.cds}
+ set catcdssrchfbox(dir) {}
+ set catcdssrchfbox(types) [list \
+ [list {CDS} {*.cds}] \
+ ]
+
+ global analysisfbox
+ set analysisfbox(file) {ds9.ans}
+ set analysisfbox(dir) {}
+ set analysisfbox(types) [list \
+ [list [::msgcat::mc {Analysis}] {*.ans}] \
+ [list [::msgcat::mc {Analysis}] {*.ds9}] \
+ ]
+
+ global analysisparamfbox
+ set analysisparamfbox(file) {}
+ set analysisparamfbox(dir) {}
+ set analysisparamfbox(types) [list \
+ ]
+
+ global apsavfbox
+ set apsavfbox(file) {ds9.ps}
+ set apsavfbox(dir) {}
+ set apsavfbox(types) [list \
+ [list {PS} {*.ps}] \
+ ]
+
+ global apdatafbox
+ set apdatafbox(file) {ds9.dat}
+ set apdatafbox(dir) {}
+ set apdatafbox(types) [list \
+ [list {DAT} {*.dat}] \
+ ]
+
+ global apconfigfbox
+ set apconfigfbox(file) {ds9.plt}
+ set apconfigfbox(dir) {}
+ set apconfigfbox(types) [list \
+ [list {PLT} {*.plt}] \
+ ]
+
+ global textfbox
+ set textfbox(file) {ds9.txt}
+ set textfbox(dir) {}
+ set textfbox(types) [list \
+ [list {TXT} {*.txt}] \
+ ]
+
+ global tclfbox
+ set tclfbox(file) {ds9.tcl}
+ set tclfbox(dir) {}
+ set tclfbox(types) [list \
+ [list {TCL} {*.tcl}] \
+ ]
+
+ global hvhtmlfbox
+ set hvhtmlfbox(file) {ds9.html}
+ set hvhtmlfbox(dir) {}
+ set hvhtmlfbox(types) [list \
+ [list {HTML} {*.html}] \
+ [list {HTML} {*.htm}] \
+ ]
+
+ global wcsfbox
+ set wcsfbox(file) {ds9.wcs}
+ set wcsfbox(dir) {}
+ set wcsfbox(types) [list \
+ [list {WCS} {*.wcs}] \
+ ]
+
+ global backupfbox
+ set backupfbox(file) {ds9.bck}
+ set backupfbox(dir) {}
+ set backupfbox(types) [list \
+ [list {BCK} {*.bck}] \
+ ]
+
+}
+
+proc SetFileLast {format item} {
+ switch $format {
+ mecube -
+ multiframe -
+ mosaic -
+ mosaicimage -
+ rgbcube -
+ rgbimage -
+ fits {FileLast fitsfbox $item}
+
+ array {FileLast arrayfbox $item}
+ rgbarray {FileLast rgbarrayfbox $item}
+ envi {FileLast envifbox $item}
+ envi2 {FileLast envi2fbox $item}
+ gif {FileLast giffbox $item}
+ jpeg {FileLast jpegfbox $item}
+ nrrd {FileLast nrrdfbox $item}
+ tiff {FileLast tifffbox $item}
+ png {FileLast pngfbox $item}
+
+ sfits -
+ srgbcube -
+ sfits -
+ smosaic -
+ url {}
+ }
+}
+
+proc ExtToFormat {fn} {
+ switch -- [file extension $fn] {
+ .fits -
+ .FITS -
+ .fit -
+ .FIT -
+ .fts -
+ .FTS -
+ .ds -
+ .DS -
+ .fits.gz -
+ .fits.bz2 -
+ .fits.Z -
+ .fits.z -
+ .fitz -
+ .FITZ -
+ .ftz -
+ .FTZ -
+ .fz -
+ .FZ {return fits}
+ .arr -
+ .array {return array}
+ .rgb {return rgbarray}
+ .nrrd {return nrrd}
+ .eps -
+ .epsf {return eps}
+ .gif -
+ .giff {return gif}
+ .jpg -
+ .jpeg {return jpeg}
+ .tif -
+ .tiff {return tiff}
+ .png {return png}
+ .mpg -
+ .mpeg {return mpeg}
+ .hdr -
+ .bil -
+ .bip -
+ .bsq -
+ .cube {return envi}
+ }
+}
+
+# used by backup
+proc OpenFileDialog {varname} {
+ return [FileDialog $varname tk_getOpenFile]
+}
+
+proc SaveFileDialog {varname} {
+ return [FileDialog $varname tk_getSaveFile]
+}
+
+proc FileDialog {varname which} {
+ global pds9
+
+ switch -- $pds9(dialog) {
+ motif {return [FileDialogMotif $varname $which]}
+ windows {return [FileDialogWindows $varname $which]}
+ native {return [FileDialogNative $varname $which]}
+ }
+}
+
+proc FileDialogMotif {varname which} {
+ upvar #0 $varname var
+ global ds9
+ global pds9
+
+ switch -- $which {
+ tk_getOpenFile {set type open}
+ tk_getSaveFile {set type save}
+ }
+
+
+ if {$pds9(dialog,all)} {
+ set types [linsert $var(types) 0 [list [::msgcat::mc {All}] {*}]]
+ } else {
+ set types [linsert $var(types) end [list [::msgcat::mc {All}] {*}]]
+ }
+
+ set result [::tk::MotifFDialog $type \
+ -filetypes $types \
+ -initialdir $var(dir) \
+ -initialfile $var(file) \
+ -parent $ds9(top)]
+
+ if {$result != {}} {
+ set var(file) [file tail $result]
+ set var(dir) [file dirname $result]
+ }
+
+ return $result
+}
+
+proc FileDialogWindows {varname which} {
+ upvar #0 $varname var
+ global ds9
+ global pds9
+
+ switch -- $which {
+ tk_getOpenFile {set type open}
+ tk_getSaveFile {set type save}
+ }
+
+ if {$pds9(dialog,all)} {
+ set types [linsert $var(types) 0 [list [::msgcat::mc {All}] {*}]]
+ } else {
+ set types [linsert $var(types) end [list [::msgcat::mc {All}] {*}]]
+ }
+
+ set result [::tk::dialog::file:: $type \
+ -filetypes $types \
+ -initialdir $var(dir) \
+ -initialfile $var(file) \
+ -parent $ds9(top)]
+
+ if {$result != {}} {
+ set var(file) [file tail $result]
+ set var(dir) [file dirname $result]
+ }
+
+ return $result
+}
+
+proc FileDialogNative {varname which} {
+ upvar #0 $varname var
+ global ds9
+ global pds9
+
+ if {$pds9(dialog,all)} {
+ set types [linsert $var(types) 0 [list [::msgcat::mc {All}] {*}]]
+ } else {
+ set types [linsert $var(types) end [list [::msgcat::mc {All}] {*}]]
+ }
+
+ if {[catch {$which \
+ -filetypes $types \
+ -initialdir $var(dir) \
+ -initialfile $var(file) \
+ -parent $ds9(top)} result]} {
+
+ # must have a bad file name, just clear and try again
+ set var(file) {}
+ set var(dir) {}
+ if {[catch {$which \
+ -filetypes $types \
+ -parent $ds9(top)} result]} {
+
+ #ok, something is really wrong
+ catch {$which -parent $ds9(top)} result
+ }
+ }
+
+ if {$result != {}} {
+ set var(file) [file tail $result]
+ set var(dir) [file dirname $result]
+ }
+
+ return $result
+}
+
+
+proc FileLast {varname fn} {
+ upvar #0 $varname var
+ global ds9
+
+ switch $ds9(wm) {
+ x11 {
+ set var(file) [file tail $fn]
+ set var(dir) [file dirname $fn]
+ }
+ aqua {
+ # don't conflict with native dialog
+ }
+ win32 {}
+ }
+}
diff --git a/ds9/library/stsci.tcl b/ds9/library/stsci.tcl
new file mode 100644
index 0000000..a7799d7
--- /dev/null
+++ b/ds9/library/stsci.tcl
@@ -0,0 +1,182 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc STSCIDef {} {
+ global stsci
+ global istsci
+
+ set istsci(top) .stsci
+ set istsci(mb) .stscimb
+
+ set stsci(sky) fk5
+ set stsci(rformat) arcmin
+ set stsci(width) 15
+ set stsci(height) 15
+ set stsci(mode) new
+ set stsci(save) 0
+ set stsci(survey) {all}
+}
+
+proc STSCIDialog {} {
+ global stsci
+ global istsci
+ global wcs
+
+ if {[winfo exists $istsci(top)]} {
+ raise $istsci(top)
+ return
+ }
+
+ set varname dstscii
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $istsci(top)
+ set var(mb) $istsci(mb)
+ set var(sky) $stsci(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $stsci(rformat)
+ set var(width) $stsci(width)
+ set var(height) $stsci(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $stsci(mode)
+ set var(save) $stsci(save)
+ set var(survey) $stsci(survey)
+
+ set w $var(top)
+ IMGSVRInit $varname "STSCI-DSS [msgcat::mc {Server}]" \
+ STSCIExec STSCIAck ARDone ARError
+
+ menu $var(mb).survey
+ $var(mb) add cascade -label Survey -menu $var(mb).survey
+ $var(mb).survey add radiobutton -label {POSS2/UKSTU Red} \
+ -variable ${varname}(survey) -value poss2ukstu_red
+ $var(mb).survey add radiobutton -label {POSS2/UKSTU Infrared} \
+ -variable ${varname}(survey) -value poss2ukstu_ir
+ $var(mb).survey add radiobutton -label {POSS2/UKSTU Blue} \
+ -variable ${varname}(survey) -value poss2ukstu_blue
+ $var(mb).survey add radiobutton \
+ -label {POSS1 (First Generation) Blue} \
+ -variable ${varname}(survey) -value poss1_blue
+ $var(mb).survey add radiobutton \
+ -label {POSS1 (First Generation) Red} \
+ -variable ${varname}(survey) -value poss1_red
+ $var(mb).survey add radiobutton \
+ -label {Best of a combined list of all plates} \
+ -variable ${varname}(survey) -value all
+ $var(mb).survey add radiobutton \
+ -label {Quick-V Survey} \
+ -variable ${varname}(survey) -value quickv
+ $var(mb).survey add radiobutton \
+ -label {HST Phase 2 Target Positioning (GSC 2)} \
+ -variable ${varname}(survey) -value phase2_gsc2
+ $var(mb).survey add radiobutton \
+ -label {HST Phase 2 Target Positioning (GSC 1)} \
+ -variable ${varname}(survey) -value phase2_gsc1
+
+ IMGSVRUpdate $varname
+}
+
+proc STSCIExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set compress none
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set compress gz
+ set var(fn) [tmpnam {.fits.gz}]
+ }
+
+ # size - convert to arcmin
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+ if {$ww>60} {
+ set ww 60
+ }
+ if {$hh>60} {
+ set hh 60
+ }
+
+ # query
+ set var(query) [http::formatQuery r $var(x) d $var(y) e J2000 w $ww h $hh f fits c $compress v $var(survey)]
+ set url "http://stdatu.stsci.edu/cgi-bin/dss_search"
+ IMGSVRGetURL $varname $url
+}
+
+proc STSCIAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the DSS-STSCI
+
+The Digitized Sky Surveys were produced at the Space Telescope Science
+Institute under U.S. Government grant NAG W-2166. The images of these
+surveys are based on photographic data obtained using the Oschin
+Schmidt Telescope on Palomar Mountain and the UK Schmidt Telescope.
+The plates were processed into the present compressed digital form
+with the permission of these institutions.
+
+The National Geographic Society - Palomar Observatory Sky Atlas
+(POSS-I) was made by the California Institute of Technology with
+grants from the National Geographic Society.
+
+The Second Palomar Observatory Sky Survey (POSS-II) was made by the
+California Institute of Technology with funds from the National
+Science Foundation, the National Geographic Society, the Sloan
+Foundation, the Samuel Oschin Foundation, and the Eastman Kodak
+Corporation.
+
+The Oschin Schmidt Telescope is operated by the California Institute
+of Technology and Palomar Observatory.
+
+The UK Schmidt Telescope was operated by the Royal Observatory
+Edinburgh, with funding from the UK Science and Engineering Research
+Council (later the UK Particle Physics and Astronomy Research Council),
+until 1988 June, and thereafter by the Anglo-Australian
+Observatory. The blue plates of the southern Sky Atlas and its
+Equatorial Extension (together known as the SERC-J), as well as the
+Equatorial Red (ER), and the Second Epoch [red] Survey (SES) were all
+taken with the UK Schmidt.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessSTSCICmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ STSCIDialog
+ IMGSVRProcessCmd $varname $iname dstscii
+}
+
+proc ProcessSendSTSCICmd {proc id param} {
+ STSCIDialog
+ IMGSVRProcessSendCmd $proc $id $param dstscii
+}
diff --git a/ds9/library/template.tcl b/ds9/library/template.tcl
new file mode 100644
index 0000000..107dcbf
--- /dev/null
+++ b/ds9/library/template.tcl
@@ -0,0 +1,130 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc TemplateDef {} {
+ global itemplate
+
+ # chandra
+ set itemplate(chandra,acis,acis-i) {chandra/acis/acis-i.tpl}
+ set itemplate(chandra,acis,acis-s) {chandra/acis/acis-s.tpl}
+ set itemplate(chandra,acis,acis-is) {chandra/acis/acis-is.tpl}
+ set itemplate(chandra,acis,acis-si) {chandra/acis/acis-si.tpl}
+ set itemplate(chandra,hrc,hrc-i) {chandra/hrc/hrc-i.tpl}
+ set itemplate(chandra,hrc,hrc-s) {chandra/hrc/hrc-s.tpl}
+
+ # xmm
+ set itemplate(xmm,epicmos1) {xmm/epicmos1.tpl}
+ set itemplate(xmm,epicmos2) {xmm/epicmos2.tpl}
+ set itemplate(xmm,epicpn) {xmm/epicpn.tpl}
+
+ # heasarc
+ # suzaku
+ set itemplate(heasarc,suzaku,hxd) {heasarc/suzaku/hxd.tpl}
+ set itemplate(heasarc,suzaku,xis) {heasarc/suzaku/xis.tpl}
+ set itemplate(heasarc,suzaku,xrs) {heasarc/suzaku/xrs.tpl}
+
+ # mmt
+ # megacam
+ set itemplate(mmt,megacam,megacam-amp) {mmt/megacam/megacam-amp.tpl}
+ set itemplate(mmt,megacam,megacam-amp-guide) {mmt/megacam/megacam-amp-guide.tpl}
+ set itemplate(mmt,megacam,megacam-chip) {mmt/megacam/megacam-chip.tpl}
+ set itemplate(mmt,megacam,megacam-chip-guide) {mmt/megacam/megacam-chip-guide.tpl}
+ # hecto
+ set itemplate(mmt,hecto,hectospec) {mmt/hecto/hectospec.tpl}
+ set itemplate(mmt,hecto,hectochelle) {mmt/hecto/hectochelle.tpl}
+ # mmirs
+ set itemplate(mmt,mmirs,image) {mmt/mmirs/image.tpl}
+ set itemplate(mmt,mmirs,longslit) {mmt/mmirs/longslit.tpl}
+ set itemplate(mmt,mmirs,mask) {mmt/mmirs/mask.tpl}
+ # others
+ set itemplate(mmt,swirc) {mmt/swirc.tpl}
+ set itemplate(mmt,binospec) {mmt/binospec.tpl}
+}
+
+proc CreateFOVMenu {} {
+ global ds9
+ global itemplate
+ global marker
+
+ set mm $ds9(mb).region.fov
+ menu $mm
+
+ set l0 {}
+ set l1 {}
+ set l2 {}
+
+ foreach t [lsort [array names itemplate]] {
+ set tt [split $t ","]
+ set t0 [lindex $tt 0]
+ set t1 [lindex $tt 1]
+ set t2 [lindex $tt 2]
+
+ if {$l0 != $t0} {
+ menu $mm.$t0
+ $mm add cascade -label [string toupper $t0] -menu $mm.$t0
+ set l0 $t0
+ set l1 {}
+ set l2 {}
+ }
+
+ if {$l1 != $t1} {
+ if {$t2 != {}} {
+ menu $mm.$t0.$t1
+ $mm.$t0 add cascade -label [string toupper $t1] \
+ -menu $mm.$t0.$t1
+ set l1 $t1
+ set l2 {}
+ } else {
+ $mm.$t0 add radiobutton \
+ -label [string toupper $t1] -variable marker(shape) \
+ -value $t
+ continue
+ }
+ }
+
+ $mm.$t0.$t1 add radiobutton -label [string toupper $t2] \
+ -variable marker(shape) -value $t
+ }
+}
+
+proc OpenTemplateMarker {} {
+ LoadTemplateMarker [OpenFileDialog templatefbox]
+}
+
+proc LoadTemplateMarker {fn} {
+ global ds9
+ global current
+
+ if {$current(frame) != {} && $fn != {}} {
+ set cc [$ds9(canvas) coords $current(frame)]
+ set ww [lindex [$current(frame) configure -width] 4]
+ set hh [lindex [$current(frame) configure -height] 4]
+ set xx [expr [lindex $cc 0]+$ww/2.0]
+ set yy [expr [lindex $cc 1]+$hh/2.0]
+
+ catch {$current(frame) marker create template "\{$fn\}" $xx $yy}
+ }
+}
+
+proc LoadTemplateMarkerAt {fn ra dec sys sky} {
+ global current
+
+ if {$current(frame) != {} && $fn != {}} {
+ catch {$current(frame) marker create template "\{$fn\}" $sys $sky $ra $dec}
+ }
+}
+
+proc SaveAsTemplateMarker {} {
+ global current
+
+ if {$current(frame) != {}} {
+ set fn [SaveFileDialog templatefbox]
+
+ if {$fn != {}} {
+ $current(frame) marker save template "\{$fn\}"
+ }
+ }
+}
diff --git a/ds9/library/text.tcl b/ds9/library/text.tcl
new file mode 100644
index 0000000..0ada0a6
--- /dev/null
+++ b/ds9/library/text.tcl
@@ -0,0 +1,93 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc TextDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set var(canrotate) [$var(frame) get marker $var(id) text rotate]
+
+ # procs
+ set var(which) text
+ set var(proc,apply) TextApply
+ set var(proc,close) TextClose
+ set var(proc,coordCB) TextCoordCB
+
+ # base
+ MarkerBaseCenterDialog $varname
+
+ # init
+ MarkerBaseCenterRotateCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback rotate MarkerBaseCenterRotateCB \
+ $varname
+
+ set f $var(top).param
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ # Rotate
+ ttk::label $f.trotate -text [msgcat::mc {Rotate}]
+ ttk::checkbutton $f.rotate -variable ${varname}(canrotate) \
+ -command "TextRotate $varname"
+
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+ grid $f.trotate $f.rotate -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc TextClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback rotate MarkerBaseCenterRotateCB
+
+ MarkerBaseCenterClose $varname
+}
+
+proc TextApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ MarkerBaseCenterRotate $varname
+ MarkerBaseCenterApply $varname
+}
+
+proc TextRotate {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) text rotate $var(canrotate)
+}
+
+# callbacks
+
+proc TextCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "TextCoordCB"
+ }
+
+ MarkerBaseCoordCB $varname
+ MarkerBaseCenterMoveCB $varname
+ MarkerBaseCenterRotateCB $varname
+}
+
diff --git a/ds9/library/tkfbox.tcl b/ds9/library/tkfbox.tcl
new file mode 100644
index 0000000..66cd74e
--- /dev/null
+++ b/ds9/library/tkfbox.tcl
@@ -0,0 +1,1247 @@
+# tkfbox.tcl --
+#
+# Implements the "TK" standard file selection dialog box. This dialog
+# box is used on the Unix platforms whenever the tk_strictMotif flag is
+# not set.
+#
+# The "TK" standard file selection dialog box is similar to the file
+# selection dialog box on Win95(TM). The user can navigate the
+# directories by clicking on the folder icons or by selecting the
+# "Directory" option menu. The user can select files by clicking on the
+# file icons or by entering a filename in the "Filename:" entry.
+#
+# Copyright (c) 1994-1998 Sun Microsystems, Inc.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+
+namespace eval ::tk::dialog {}
+namespace eval ::tk::dialog::file {
+ namespace import -force ::tk::msgcat::*
+ variable showHiddenBtn 0
+ variable showHiddenVar 1
+
+ # Create the images if they did not already exist.
+ if {![info exists ::tk::Priv(updirImage)]} {
+ set ::tk::Priv(updirImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAABmJLR0QA/gD+AP7rGN
+ SCAAAACXBIWXMAAA3WAAAN1gGQb3mcAAAACXZwQWcAAAAWAAAAFgDcxelYAAAENUlE
+ QVQ4y7WUbWiVZRjHf/f9POcc9+Kc5bC2aIq5sGG0XnTzNU13zAIlFMNc9CEhTCKwCC
+ JIgt7AglaR0RcrolAKg14+GBbiGL6xZiYyy63cmzvu7MVznnOe537rw7bDyvlBoT/c
+ n+6L3/3nf13XLZLJJP+HfICysjKvqqpq+rWKysvLR1tbW+11g+fPn/+bEGIe4KYqCs
+ Owu66u7oG2trah6wJrrRc0NTVhjME5h7Vj5pxzCCE4duxYZUdHx/aGhoZmgJ+yb+wF
+ uCO19RmAffv25f8LFslkktraWtvU1CS6u7vRWmOtxVpbAPu+T0tLS04pFU/J34Wd3S
+ cdFtlfZWeZBU4IcaS5uXn1ZLAEMMY4ay1aa4wx/zpKKYIgoL6+vmjxqoXe5ZLTcsPq
+ bTyycjODpe1y3WMrvDAMV14jCuW0VhhjiJQpOJ5w7Zwjk8/y9R+vsHHNNq6oFMrkeX
+ BxI+8d2sktap3YvOPD0lRQrH+Z81fE7t3WB4gihVKazsuaA20aKSUgAG/seQdy2l6W
+ 37+EyopqTv39I6HJUT2zlnlza2jLdgiTaxwmDov6alLHcZUTzXPGGAauWJbfO4dHl9
+ bgJs3HyfNf0N4ZsOa+jbT3/ownY/hO09p1kBULtjBw+Tvq7xzwauds4dWPDleAcP5E
+ xlprgtBRUZRgYCRPTzoHwEi2g6OnX+eFrW/RM9qBE4p43CeTz5ATaU6nDrFm2cPs/+
+ E1SopqkZ7MFJqntXZaa7IKppckwIEvJbg8LWd28OT6nVihCPQQ8UScWCLGqO4hXuQx
+ qDtJ204eWrqWb1ufRspwtABWaqx5gRKUFSdwDnxPcuLcyyxbuIyaqntIBV34MY9YzC
+ Owg+S9YeJFkniRpGPkCLMrZzG3+jbktA/KClMxFoUhiKC0OAbAhd79CO8i6xe/STyW
+ 4O7KVRgUJ/sP0heeJV4kEVKw/vZd40sFKxat4mLvp6VLdvnb/XHHGGPIKwBBpC1/9n
+ 3DpfRZnn9/AwCxRII9O79kVPdjvByxuET6Ai8mePeTt4lyheXzhOSpCcdWa00uckTG
+ kckbGu76nEhbIm2xznH4VB3OWYaiXqQn8GKSWGIMHuXyPL76LBcupmhp69pz4uMnXi
+ w4VloTGcdQRtGdzmHs1f+RdYZslMZJhzUOHVnceN1ooEiP5JUzdqCQMWCD0JCIeQzn
+ NNpO+clhrCYf5rC+A2cxWmDUWG2oHEOZMEKIwclgMnnLrTeXUV7sUzpNXgU9DmijWV
+ v9LEKCkAIhKIBnlvpks6F21qUZ31u/sbExPa9h0/RzwzMov2nGlG5TmW1YOzzlnSfL
+ mVnyGf19Q7lwZHBp+1fPtflAIgiC7389n9qkihP+lWyeqfUO15ZwQTqlw9H+o2cOvN
+ QJCAHEgEqgYnI0NyALjAJdyWQy7wMa6AEujUdzo3LjcAXwD/XCTKIRjWytAAAAJXRF
+ WHRjcmVhdGUtZGF0ZQAyMDA5LTA0LTA2VDIxOjI1OjQxLTAzOjAw8s+uCAAAACV0RV
+ h0bW9kaWZ5LWRhdGUAMjAwOC0wMS0wM1QxNTowODoyMS0wMjowMJEc/44AAAAZdEVY
+ dFNvZnR3YXJlAHd3dy5pbmtzY2FwZS5vcmeb7jwaAAAAAElFTkSuQmCC
+ }]
+ }
+ if {![info exists ::tk::Priv(folderImage)]} {
+ set ::tk::Priv(folderImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiA
+ AAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBl
+ Lm9yZ5vuPBoAAAHCSURBVDiNpZAxa5NRFIafc+9XLCni4BC6FBycMnbrLpkcgtDVX6
+ C70D/g4lZX/4coxLlgxFkpiiSSUGm/JiXfveee45AmNlhawXc53HvPee55X+l2u/yP
+ qt3d3Tfu/viatwt3fzIYDI5uBJhZr9fr3TMzzAx3B+D09PR+v98/7HQ6z5fNOWdCCG
+ U4HH6s67oAVDlnV1UmkwmllBUkhMD29nYHeLuEAkyn06qU8qqu64MrgIyqYmZrkHa7
+ 3drc3KTVahFjJITAaDRiPB4/XFlQVVMtHH5IzJo/P4EA4MyB+erWPQB7++zs7ccYvl
+ U5Z08pMW2cl88eIXLZeDUpXzsBkNQ5eP1+p0opmaoCTgzw6fjs6gLLsp58FB60t0Dc
+ K1Ul54yIEIMQ43Uj68pquDmCeJVztpwzuBNE2LgBoMVpslHMCUEAFgDVxQbzVAiA+a
+ K5uGPmmDtZF3VpoUm2ArhqQaRiUjcMf81p1G60UEVhcjZfAFTVUkrgkS+jc06mDX9n
+ vq4YhJ9nlxZExMwMEaHJRutOdWuIIsJFUoBSuTvHJ4YIfP46unV4qdlsjsBRZRtb/X
+ fHd5+C8+P7+J8BIoxFwovfRxYhnhxjpzEAAAAASUVORK5CYII=
+ }]
+ }
+ if {![info exists ::tk::Priv(fileImage)]} {
+ set ::tk::Priv(fileImage) [image create photo -data {
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gva
+ eTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QQWFA84umAmQgAAANpJREFU
+ OMutkj1uhDAQhb8HSLtbISGfgZ+zbJkix0HmFhwhUdocBnMBGvqtTIqIFSReWKK8ai
+ x73nwzHrVt+zEMwwvH9FrX9TsA1trpqKy10+yUzME4jnjvAZB0LzXHkojjmDRNVyh3
+ A+89zrlVwlKSqKrqVy/J8lAUxSZBSMny4ZLgp54iyPM8UPHGNJ2IomibAKDv+9VlWZ
+ bABbgB5/0WQgSSkC4PF2JF4JzbHN430c4vhAm0TyCJruuClefph4yCBCGT3T3Isoy/
+ KDHGfDZNcz2SZIx547/0BVRRX7n8uT/sAAAAAElFTkSuQmCC
+ }]
+ }
+}
+
+# ::tk::dialog::file:: --
+#
+# Implements the TK file selection dialog. This dialog is used when the
+# tk_strictMotif flag is set to false. This procedure shouldn't be
+# called directly. Call tk_getOpenFile or tk_getSaveFile instead.
+#
+# Arguments:
+# type "open" or "save"
+# args Options parsed by the procedure.
+#
+
+proc ::tk::dialog::file:: {type args} {
+ variable ::tk::Priv
+ variable showHiddenBtn
+ set dataName __tk_filedialog
+ upvar ::tk::dialog::file::$dataName data
+
+ Config $dataName $type $args
+
+ if {$data(-parent) eq "."} {
+ set w .$dataName
+ } else {
+ set w $data(-parent).$dataName
+ }
+
+ # (re)create the dialog box if necessary
+ #
+ if {![winfo exists $w]} {
+ Create $w TkFDialog
+ } elseif {[winfo class $w] ne "TkFDialog"} {
+ destroy $w
+ Create $w TkFDialog
+ } else {
+ set data(dirMenuBtn) $w.contents.f1.menu
+ set data(dirMenu) $w.contents.f1.menu.menu
+ set data(upBtn) $w.contents.f1.up
+ set data(icons) $w.contents.icons
+ set data(ent) $w.contents.f2.ent
+ set data(typeMenuLab) $w.contents.f2.lab2
+ set data(typeMenuBtn) $w.contents.f2.menu
+ set data(typeMenu) $data(typeMenuBtn).m
+ set data(okBtn) $w.contents.f2.ok
+ set data(cancelBtn) $w.contents.f2.cancel
+ set data(hiddenBtn) $w.contents.f2.hidden
+ SetSelectMode $w $data(-multiple)
+ }
+ if {$showHiddenBtn} {
+ $data(hiddenBtn) configure -state normal
+ grid $data(hiddenBtn)
+ } else {
+ $data(hiddenBtn) configure -state disabled
+ grid remove $data(hiddenBtn)
+ }
+
+ # Make sure subseqent uses of this dialog are independent [Bug 845189]
+ unset -nocomplain data(extUsed)
+
+ # Dialog boxes should be transient with respect to their parent, so that
+ # they will always stay on top of their parent window. However, some
+ # window managers will create the window as withdrawn if the parent window
+ # is withdrawn or iconified. Combined with the grab we put on the window,
+ # this can hang the entire application. Therefore we only make the dialog
+ # transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]]} {
+ wm transient $w $data(-parent)
+ }
+
+ # Add traces on the selectPath variable
+ #
+
+ trace add variable data(selectPath) write \
+ [list ::tk::dialog::file::SetPath $w]
+ $data(dirMenuBtn) configure \
+ -textvariable ::tk::dialog::file::${dataName}(selectPath)
+
+ # Cleanup previous menu
+ #
+ $data(typeMenu) delete 0 end
+ $data(typeMenuBtn) configure -state normal -text ""
+
+ # Initialize the file types menu
+ #
+ if {[llength $data(-filetypes)]} {
+ # Default type and name to first entry
+ set initialtype [lindex $data(-filetypes) 0]
+ set initialTypeName [lindex $initialtype 0]
+ if {$data(-typevariable) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ if {[info exists typeVariable]} {
+ set initialTypeName $typeVariable
+ }
+ }
+ foreach type $data(-filetypes) {
+ set title [lindex $type 0]
+ set filter [lindex $type 1]
+ $data(typeMenu) add command -label $title \
+ -command [list ::tk::dialog::file::SetFilter $w $type]
+ # [string first] avoids glob-pattern char issues
+ if {[string first ${initialTypeName} $title] == 0} {
+ set initialtype $type
+ }
+ }
+ SetFilter $w $initialtype
+ $data(typeMenuBtn) configure -state normal
+ $data(typeMenuLab) configure -state normal
+ } else {
+ set data(filter) "*"
+ $data(typeMenuBtn) configure -state disabled -takefocus 0
+ $data(typeMenuLab) configure -state disabled
+ }
+ UpdateWhenIdle $w
+
+ # Withdraw the window, then update all the geometry information
+ # so we know how big it wants to be, then center the window in the
+ # display (Motif style) and de-iconify it.
+
+ ::tk::PlaceWindow $w widget $data(-parent)
+ wm title $w $data(-title)
+
+ # Set a grab and claim the focus too.
+
+ ::tk::SetFocusGrab $w $data(ent)
+ $data(ent) delete 0 end
+ $data(ent) insert 0 $data(selectFile)
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+
+ # Wait for the user to respond, then restore the focus and return the
+ # index of the selected button. Restore the focus before deleting the
+ # window, since otherwise the window manager may take the focus away so we
+ # can't redirect it. Finally, restore any grab that was in effect.
+
+ vwait ::tk::Priv(selectFilePath)
+
+ ::tk::RestoreFocusGrab $w $data(ent) withdraw
+
+ # Cleanup traces on selectPath variable
+ #
+
+ foreach trace [trace info variable data(selectPath)] {
+ trace remove variable data(selectPath) {*}$trace
+ }
+ $data(dirMenuBtn) configure -textvariable {}
+
+ return $Priv(selectFilePath)
+}
+
+# ::tk::dialog::file::Config --
+#
+# Configures the TK filedialog according to the argument list
+#
+proc ::tk::dialog::file::Config {dataName type argList} {
+ upvar ::tk::dialog::file::$dataName data
+
+ set data(type) $type
+
+ # 0: Delete all variable that were set on data(selectPath) the
+ # last time the file dialog is used. The traces may cause troubles
+ # if the dialog is now used with a different -parent option.
+
+ foreach trace [trace info variable data(selectPath)] {
+ trace remove variable data(selectPath) {*}$trace
+ }
+
+ # 1: the configuration specs
+ #
+ set specs {
+ {-defaultextension "" "" ""}
+ {-filetypes "" "" ""}
+ {-initialdir "" "" ""}
+ {-initialfile "" "" ""}
+ {-parent "" "" "."}
+ {-title "" "" ""}
+ {-typevariable "" "" ""}
+ }
+
+ # The "-multiple" option is only available for the "open" file dialog.
+ #
+ if {$type eq "open"} {
+ lappend specs {-multiple "" "" "0"}
+ }
+
+ # The "-confirmoverwrite" option is only for the "save" file dialog.
+ #
+ if {$type eq "save"} {
+ lappend specs {-confirmoverwrite "" "" "1"}
+ }
+
+ # 2: default values depending on the type of the dialog
+ #
+ if {![info exists data(selectPath)]} {
+ # first time the dialog has been popped up
+ set data(selectPath) [pwd]
+ set data(selectFile) ""
+ }
+
+ # 3: parse the arguments
+ #
+ tclParseConfigSpec ::tk::dialog::file::$dataName $specs "" $argList
+
+ if {$data(-title) eq ""} {
+ if {$type eq "open"} {
+ set data(-title) [mc "Open"]
+ } else {
+ set data(-title) [mc "Save As"]
+ }
+ }
+
+ # 4: set the default directory and selection according to the -initial
+ # settings
+ #
+ if {$data(-initialdir) ne ""} {
+ # Ensure that initialdir is an absolute path name.
+ if {[file isdirectory $data(-initialdir)]} {
+ set old [pwd]
+ cd $data(-initialdir)
+ set data(selectPath) [pwd]
+ cd $old
+ } else {
+ set data(selectPath) [pwd]
+ }
+ }
+ set data(selectFile) $data(-initialfile)
+
+ # 5. Parse the -filetypes option
+ #
+ set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)]
+
+ if {![winfo exists $data(-parent)]} {
+ return -code error -errorcode [list TK LOOKUP WINDOW $data(-parent)] \
+ "bad window path name \"$data(-parent)\""
+ }
+
+ # Set -multiple to a one or zero value (not other boolean types like
+ # "yes") so we can use it in tests more easily.
+ if {$type eq "save"} {
+ set data(-multiple) 0
+ } elseif {$data(-multiple)} {
+ set data(-multiple) 1
+ } else {
+ set data(-multiple) 0
+ }
+}
+
+proc ::tk::dialog::file::Create {w class} {
+ set dataName [lindex [split $w .] end]
+ upvar ::tk::dialog::file::$dataName data
+ variable ::tk::Priv
+ global tk_library
+
+ toplevel $w -class $class
+ if {[tk windowingsystem] eq "x11"} {wm attributes $w -type dialog}
+ pack [ttk::frame $w.contents] -expand 1 -fill both
+ #set w $w.contents
+
+ # f1: the frame with the directory option menu
+ #
+ set f1 [ttk::frame $w.contents.f1]
+ bind [::tk::AmpWidget ttk::label $f1.lab -text [mc "&Directory:"]] \
+ <<AltUnderlined>> [list focus $f1.menu]
+
+ set data(dirMenuBtn) $f1.menu
+ if {![info exists data(selectPath)]} {
+ set data(selectPath) ""
+ }
+ set data(dirMenu) $f1.menu.menu
+ ttk::menubutton $f1.menu -menu $data(dirMenu) -direction flush \
+ -textvariable [format %s(selectPath) ::tk::dialog::file::$dataName]
+ menu $data(dirMenu) -tearoff 0
+ $data(dirMenu) add radiobutton -label "" -variable \
+ [format %s(selectPath) ::tk::dialog::file::$dataName]
+ set data(upBtn) [ttk::button $f1.up]
+ $data(upBtn) configure -image $Priv(updirImage)
+
+ $f1.menu configure -takefocus 1;# -highlightthickness 2
+
+ pack $data(upBtn) -side right -padx 4 -fill both
+ pack $f1.lab -side left -padx 4 -fill both
+ pack $f1.menu -expand yes -fill both -padx 4
+
+ # data(icons): the IconList that list the files and directories.
+ #
+ if {$class eq "TkFDialog"} {
+ if { $data(-multiple) } {
+ set fNameCaption [mc "File &names:"]
+ } else {
+ set fNameCaption [mc "File &name:"]
+ }
+ set fTypeCaption [mc "Files of &type:"]
+ set iconListCommand [list ::tk::dialog::file::OkCmd $w]
+ } else {
+ set fNameCaption [mc "&Selection:"]
+ set iconListCommand [list ::tk::dialog::file::chooseDir::DblClick $w]
+ }
+ set data(icons) [::tk::IconList $w.contents.icons \
+ -command $iconListCommand -multiple $data(-multiple)]
+ bind $data(icons) <<ListboxSelect>> \
+ [list ::tk::dialog::file::ListBrowse $w]
+
+ # f2: the frame with the OK button, cancel button, "file name" field
+ # and file types field.
+ #
+ set f2 [ttk::frame $w.contents.f2]
+ bind [::tk::AmpWidget ttk::label $f2.lab -text $fNameCaption -anchor e]\
+ <<AltUnderlined>> [list focus $f2.ent]
+ # -pady 0
+ set data(ent) [ttk::entry $f2.ent]
+
+ # The font to use for the icons. The default Canvas font on Unix is just
+ # deviant.
+ set ::tk::$w.contents.icons(font) [$data(ent) cget -font]
+
+ # Make the file types bits only if this is a File Dialog
+ if {$class eq "TkFDialog"} {
+ set data(typeMenuLab) [::tk::AmpWidget ttk::label $f2.lab2 \
+ -text $fTypeCaption -anchor e]
+ # -pady [$f2.lab cget -pady]
+ set data(typeMenuBtn) [ttk::menubutton $f2.menu \
+ -menu $f2.menu.m]
+ # -indicatoron 1
+ set data(typeMenu) [menu $data(typeMenuBtn).m -tearoff 0]
+ # $data(typeMenuBtn) configure -takefocus 1 -relief raised -anchor w
+ bind $data(typeMenuLab) <<AltUnderlined>> [list \
+ focus $data(typeMenuBtn)]
+ }
+
+ # The hidden button is displayed when ::tk::dialog::file::showHiddenBtn is
+ # true. Create it disabled so the binding doesn't trigger if it isn't
+ # shown.
+ if {$class eq "TkFDialog"} {
+ set text [mc "Show &Hidden Files and Directories"]
+ } else {
+ set text [mc "Show &Hidden Directories"]
+ }
+ set data(hiddenBtn) [::tk::AmpWidget ttk::checkbutton $f2.hidden \
+ -text $text -state disabled \
+ -variable ::tk::dialog::file::showHiddenVar \
+ -command [list ::tk::dialog::file::UpdateWhenIdle $w]]
+# -anchor w -padx 3
+
+ # the okBtn is created after the typeMenu so that the keyboard traversal
+ # is in the right order, and add binding so that we find out when the
+ # dialog is destroyed by the user (added here instead of to the overall
+ # window so no confusion about how much <Destroy> gets called; exactly
+ # once will do). [Bug 987169]
+
+ set data(okBtn) [::tk::AmpWidget ttk::button $f2.ok \
+ -text [mc "&OK"] -default active];# -pady 3]
+ bind $data(okBtn) <Destroy> [list ::tk::dialog::file::Destroyed $w]
+ set data(cancelBtn) [::tk::AmpWidget ttk::button $f2.cancel \
+ -text [mc "&Cancel"] -default normal];# -pady 3]
+
+ # grid the widgets in f2
+ #
+ grid $f2.lab $f2.ent $data(okBtn) -padx 4 -pady 3 -sticky ew
+ grid configure $f2.ent -padx 2
+ if {$class eq "TkFDialog"} {
+ grid $data(typeMenuLab) $data(typeMenuBtn) $data(cancelBtn) \
+ -padx 4 -sticky ew
+ grid configure $data(typeMenuBtn) -padx 0
+ grid $data(hiddenBtn) -columnspan 2 -padx 4 -sticky ew
+ } else {
+ grid $data(hiddenBtn) - $data(cancelBtn) -padx 4 -sticky ew
+ }
+ grid columnconfigure $f2 1 -weight 1
+
+ # Pack all the frames together. We are done with widget construction.
+ #
+ pack $f1 -side top -fill x -pady 4
+ pack $f2 -side bottom -pady 4 -fill x
+ pack $data(icons) -expand yes -fill both -padx 4 -pady 1
+
+ # Set up the event handlers that are common to Directory and File Dialogs
+ #
+
+ wm protocol $w WM_DELETE_WINDOW [list ::tk::dialog::file::CancelCmd $w]
+ $data(upBtn) configure -command [list ::tk::dialog::file::UpDirCmd $w]
+ $data(cancelBtn) configure -command [list ::tk::dialog::file::CancelCmd $w]
+ bind $w <KeyPress-Escape> [list $data(cancelBtn) invoke]
+ bind $w <Alt-Key> [list tk::AltKeyInDialog $w %A]
+
+ # Set up event handlers specific to File or Directory Dialogs
+ #
+ if {$class eq "TkFDialog"} {
+ bind $data(ent) <Return> [list ::tk::dialog::file::ActivateEnt $w]
+ $data(okBtn) configure -command [list ::tk::dialog::file::OkCmd $w]
+ bind $w <Alt-t> [format {
+ if {[%s cget -state] eq "normal"} {
+ focus %s
+ }
+ } $data(typeMenuBtn) $data(typeMenuBtn)]
+ } else {
+ set okCmd [list ::tk::dialog::file::chooseDir::OkCmd $w]
+ bind $data(ent) <Return> $okCmd
+ $data(okBtn) configure -command $okCmd
+ bind $w <Alt-s> [list focus $data(ent)]
+ bind $w <Alt-o> [list $data(okBtn) invoke]
+ }
+ bind $w <Alt-h> [list $data(hiddenBtn) invoke]
+ bind $data(ent) <Tab> [list ::tk::dialog::file::CompleteEnt $w]
+
+ # Build the focus group for all the entries
+ #
+ ::tk::FocusGroup_Create $w
+ ::tk::FocusGroup_BindIn $w $data(ent) [list \
+ ::tk::dialog::file::EntFocusIn $w]
+ ::tk::FocusGroup_BindOut $w $data(ent) [list \
+ ::tk::dialog::file::EntFocusOut $w]
+}
+
+# ::tk::dialog::file::SetSelectMode --
+#
+# Set the select mode of the dialog to single select or multi-select.
+#
+# Arguments:
+# w The dialog path.
+# multi 1 if the dialog is multi-select; 0 otherwise.
+#
+# Results:
+# None.
+
+proc ::tk::dialog::file::SetSelectMode {w multi} {
+ set dataName __tk_filedialog
+ upvar ::tk::dialog::file::$dataName data
+ if { $multi } {
+ set fNameCaption [mc "File &names:"]
+ } else {
+ set fNameCaption [mc "File &name:"]
+ }
+ set iconListCommand [list ::tk::dialog::file::OkCmd $w]
+ ::tk::SetAmpText $w.contents.f2.lab $fNameCaption
+ $data(icons) configure -multiple $multi -command $iconListCommand
+ return
+}
+
+# ::tk::dialog::file::UpdateWhenIdle --
+#
+# Creates an idle event handler which updates the dialog in idle time.
+# This is important because loading the directory may take a long time
+# and we don't want to load the same directory for multiple times due to
+# multiple concurrent events.
+#
+proc ::tk::dialog::file::UpdateWhenIdle {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[info exists data(updateId)]} {
+ return
+ }
+ set data(updateId) [after idle [list ::tk::dialog::file::Update $w]]
+}
+
+# ::tk::dialog::file::Update --
+#
+# Loads the files and directories into the IconList widget. Also sets up
+# the directory option menu for quick access to parent directories.
+#
+proc ::tk::dialog::file::Update {w} {
+ # This proc may be called within an idle handler. Make sure that the
+ # window has not been destroyed before this proc is called
+ if {![winfo exists $w]} {
+ return
+ }
+ set class [winfo class $w]
+ if {($class ne "TkFDialog") && ($class ne "TkChooseDir")} {
+ return
+ }
+
+ set dataName [winfo name $w]
+ upvar ::tk::dialog::file::$dataName data
+ variable ::tk::Priv
+ variable showHiddenVar
+ global tk_library
+ unset -nocomplain data(updateId)
+
+ set folder $Priv(folderImage)
+ set file $Priv(fileImage)
+
+ set appPWD [pwd]
+ if {[catch {
+ cd $data(selectPath)
+ }]} then {
+ # We cannot change directory to $data(selectPath). $data(selectPath)
+ # should have been checked before ::tk::dialog::file::Update is
+ # called, so we normally won't come to here. Anyways, give an error
+ # and abort action.
+ tk_messageBox -type ok -parent $w -icon warning -message [mc \
+ "Cannot change to the directory \"%1\$s\".\nPermission denied."\
+ $data(selectPath)]
+ cd $appPWD
+ return
+ }
+
+ # Turn on the busy cursor. BUG?? We haven't disabled X events, though,
+ # so the user may still click and cause havoc ...
+ #
+ set entCursor [$data(ent) cget -cursor]
+ set dlgCursor [$w cget -cursor]
+ $data(ent) configure -cursor watch
+ $w configure -cursor watch
+ update idletasks
+
+ $data(icons) deleteall
+
+ set showHidden $showHiddenVar
+
+ # Make the dir list. Note that using an explicit [pwd] (instead of '.') is
+ # better in some VFS cases.
+ $data(icons) add $folder [GlobFiltered [pwd] d 1]
+
+ if {$class eq "TkFDialog"} {
+ # Make the file list if this is a File Dialog, selecting all but
+ # 'd'irectory type files.
+ #
+ $data(icons) add $file [GlobFiltered [pwd] {f b c l p s}]
+ }
+
+ # Update the Directory: option menu
+ #
+ set list ""
+ set dir ""
+ foreach subdir [file split $data(selectPath)] {
+ set dir [file join $dir $subdir]
+ lappend list $dir
+ }
+
+ $data(dirMenu) delete 0 end
+ set var [format %s(selectPath) ::tk::dialog::file::$dataName]
+ foreach path $list {
+ $data(dirMenu) add command -label $path -command [list set $var $path]
+ }
+
+ # Restore the PWD to the application's PWD
+ #
+ cd $appPWD
+
+ if {$class eq "TkFDialog"} {
+ # Restore the Open/Save Button if this is a File Dialog
+ #
+ if {$data(type) eq "open"} {
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
+ } else {
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
+ }
+ }
+
+ # turn off the busy cursor.
+ #
+ $data(ent) configure -cursor $entCursor
+ $w configure -cursor $dlgCursor
+}
+
+# ::tk::dialog::file::SetPathSilently --
+#
+# Sets data(selectPath) without invoking the trace procedure
+#
+proc ::tk::dialog::file::SetPathSilently {w path} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set cb [list ::tk::dialog::file::SetPath $w]
+ trace remove variable data(selectPath) write $cb
+ set data(selectPath) $path
+ trace add variable data(selectPath) write $cb
+}
+
+
+# This proc gets called whenever data(selectPath) is set
+#
+proc ::tk::dialog::file::SetPath {w name1 name2 op} {
+ if {[winfo exists $w]} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ UpdateWhenIdle $w
+ # On directory dialogs, we keep the entry in sync with the currentdir.
+ if {[winfo class $w] eq "TkChooseDir"} {
+ $data(ent) delete 0 end
+ $data(ent) insert end $data(selectPath)
+ }
+ }
+}
+
+# This proc gets called whenever data(filter) is set
+#
+proc ::tk::dialog::file::SetFilter {w type} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set data(filterType) $type
+ set data(filter) [lindex $type 1]
+ $data(typeMenuBtn) configure -text [lindex $type 0] ;#-indicatoron 1
+
+ # If we aren't using a default extension, use the one suppled by the
+ # filter.
+ if {![info exists data(extUsed)]} {
+ if {[string length $data(-defaultextension)]} {
+ set data(extUsed) 1
+ } else {
+ set data(extUsed) 0
+ }
+ }
+
+ if {!$data(extUsed)} {
+ # Get the first extension in the list that matches {^\*\.\w+$} and
+ # remove all * from the filter.
+ set index [lsearch -regexp $data(filter) {^\*\.\w+$}]
+ if {$index >= 0} {
+ set data(-defaultextension) \
+ [string trimleft [lindex $data(filter) $index] "*"]
+ } else {
+ # Couldn't find anything! Reset to a safe default...
+ set data(-defaultextension) ""
+ }
+ }
+
+ $data(icons) see 0
+
+ UpdateWhenIdle $w
+}
+
+# tk::dialog::file::ResolveFile --
+#
+# Interpret the user's text input in a file selection dialog. Performs:
+#
+# (1) ~ substitution
+# (2) resolve all instances of . and ..
+# (3) check for non-existent files/directories
+# (4) check for chdir permissions
+# (5) conversion of environment variable references to their
+# contents (once only)
+#
+# Arguments:
+# context: the current directory you are in
+# text: the text entered by the user
+# defaultext: the default extension to add to files with no extension
+# expandEnv: whether to expand environment variables (yes by default)
+#
+# Return vaue:
+# [list $flag $directory $file]
+#
+# flag = OK : valid input
+# = PATTERN : valid directory/pattern
+# = PATH : the directory does not exist
+# = FILE : the directory exists by the file doesn't exist
+# = CHDIR : Cannot change to the directory
+# = ERROR : Invalid entry
+#
+# directory : valid only if flag = OK or PATTERN or FILE
+# file : valid only if flag = OK or PATTERN
+#
+# directory may not be the same as context, because text may contain a
+# subdirectory name
+#
+proc ::tk::dialog::file::ResolveFile {context text defaultext {expandEnv 1}} {
+ set appPWD [pwd]
+
+ set path [JoinFile $context $text]
+
+ # If the file has no extension, append the default. Be careful not to do
+ # this for directories, otherwise typing a dirname in the box will give
+ # back "dirname.extension" instead of trying to change dir.
+ if {
+ ![file isdirectory $path] && ([file ext $path] eq "") &&
+ ![string match {$*} [file tail $path]]
+ } then {
+ set path "$path$defaultext"
+ }
+
+ # we want to strip any filtering/ext/blocking instructions
+ # from the file name
+
+ set aa [string first "\[" $path]
+ if {$aa > 0} {
+ set fn [string range $path 0 [expr $aa-1]]
+ } else {
+ set fn $path
+ }
+
+ if {[catch {file exists $fn}]} {
+ # This "if" block can be safely removed if the following code stop
+ # generating errors.
+ #
+ # file exists ~nonsuchuser
+ #
+ return [list ERROR $path ""]
+ }
+
+ if {[file exists $fn]} {
+ if {[file isdirectory $path]} {
+ if {[catch {cd $path}]} {
+ return [list CHDIR $path ""]
+ }
+ set directory [pwd]
+ set file ""
+ set flag OK
+ cd $appPWD
+ } else {
+ if {[catch {cd [file dirname $path]}]} {
+ return [list CHDIR [file dirname $path] ""]
+ }
+ set directory [pwd]
+ set file [file tail $path]
+ set flag OK
+ cd $appPWD
+ }
+ } else {
+ set dirname [file dirname $path]
+ if {[file exists $dirname]} {
+ if {[catch {cd $dirname}]} {
+ return [list CHDIR $dirname ""]
+ }
+ set directory [pwd]
+ cd $appPWD
+ set file [file tail $path]
+ # It's nothing else, so check to see if it is an env-reference
+ if {$expandEnv && [string match {$*} $file]} {
+ set var [string range $file 1 end]
+ if {[info exist ::env($var)]} {
+ return [ResolveFile $context $::env($var) $defaultext 0]
+ }
+ }
+ if {[regexp {[*?]} $file]} {
+ set flag PATTERN
+ } else {
+ set flag FILE
+ }
+ } else {
+ set directory $dirname
+ set file [file tail $path]
+ set flag PATH
+ # It's nothing else, so check to see if it is an env-reference
+ if {$expandEnv && [string match {$*} $file]} {
+ set var [string range $file 1 end]
+ if {[info exist ::env($var)]} {
+ return [ResolveFile $context $::env($var) $defaultext 0]
+ }
+ }
+ }
+ }
+
+ return [list $flag $directory $file]
+}
+
+
+# Gets called when the entry box gets keyboard focus. We clear the selection
+# from the icon list . This way the user can be certain that the input in the
+# entry box is the selection.
+#
+proc ::tk::dialog::file::EntFocusIn {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[$data(ent) get] ne ""} {
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+ } else {
+ $data(ent) selection clear
+ }
+
+ if {[winfo class $w] eq "TkFDialog"} {
+ # If this is a File Dialog, make sure the buttons are labeled right.
+ if {$data(type) eq "open"} {
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
+ } else {
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
+ }
+ }
+}
+
+proc ::tk::dialog::file::EntFocusOut {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ $data(ent) selection clear
+}
+
+
+# Gets called when user presses Return in the "File name" entry.
+#
+proc ::tk::dialog::file::ActivateEnt {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set text [$data(ent) get]
+ if {$data(-multiple)} {
+ foreach t $text {
+ VerifyFileName $w $t
+ }
+ } else {
+ VerifyFileName $w $text
+ }
+}
+
+# Verification procedure
+#
+proc ::tk::dialog::file::VerifyFileName {w filename} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set list [ResolveFile $data(selectPath) $filename $data(-defaultextension)]
+ foreach {flag path file} $list {
+ break
+ }
+
+ switch -- $flag {
+ OK {
+ if {$file eq ""} {
+ # user has entered an existing (sub)directory
+ set data(selectPath) $path
+ $data(ent) delete 0 end
+ } else {
+ SetPathSilently $w $path
+ if {$data(-multiple)} {
+ lappend data(selectFile) $file
+ } else {
+ set data(selectFile) $file
+ }
+ Done $w
+ }
+ }
+ PATTERN {
+ set data(selectPath) $path
+ set data(filter) $file
+ }
+ FILE {
+ if {$data(type) eq "open"} {
+ tk_messageBox -icon warning -type ok -parent $w \
+ -message [mc "File \"%1\$s\" does not exist." \
+ [file join $path $file]]
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+ } else {
+ SetPathSilently $w $path
+ if {$data(-multiple)} {
+ lappend data(selectFile) $file
+ } else {
+ set data(selectFile) $file
+ }
+ Done $w
+ }
+ }
+ PATH {
+ tk_messageBox -icon warning -type ok -parent $w \
+ -message [mc "Directory \"%1\$s\" does not exist." $path]
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+ }
+ CHDIR {
+ tk_messageBox -type ok -parent $w -icon warning -message \
+ [mc "Cannot change to the directory\
+ \"%1\$s\".\nPermission denied." $path]
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+ }
+ ERROR {
+ tk_messageBox -type ok -parent $w -icon warning -message \
+ [mc "Invalid file name \"%1\$s\"." $path]
+ $data(ent) selection range 0 end
+ $data(ent) icursor end
+ }
+ }
+}
+
+# Gets called when user presses the Alt-s or Alt-o keys.
+#
+proc ::tk::dialog::file::InvokeBtn {w key} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[$data(okBtn) cget -text] eq $key} {
+ $data(okBtn) invoke
+ }
+}
+
+# Gets called when user presses the "parent directory" button
+#
+proc ::tk::dialog::file::UpDirCmd {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {$data(selectPath) ne "/"} {
+ set data(selectPath) [file dirname $data(selectPath)]
+ }
+}
+
+# Join a file name to a path name. The "file join" command will break if the
+# filename begins with ~
+#
+proc ::tk::dialog::file::JoinFile {path file} {
+ if {[string match {~*} $file] && [file exists $path/$file]} {
+ return [file join $path ./$file]
+ } else {
+ return [file join $path $file]
+ }
+}
+
+# Gets called when user presses the "OK" button
+#
+proc ::tk::dialog::file::OkCmd {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set filenames {}
+ foreach item [$data(icons) selection get] {
+ lappend filenames [$data(icons) get $item]
+ }
+
+ if {
+ ([llength $filenames] && !$data(-multiple)) ||
+ ($data(-multiple) && ([llength $filenames] == 1))
+ } then {
+ set filename [lindex $filenames 0]
+ set file [JoinFile $data(selectPath) $filename]
+ if {[file isdirectory $file]} {
+ ListInvoke $w [list $filename]
+ return
+ }
+ }
+
+ ActivateEnt $w
+}
+
+# Gets called when user presses the "Cancel" button
+#
+proc ::tk::dialog::file::CancelCmd {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ variable ::tk::Priv
+
+ bind $data(okBtn) <Destroy> {}
+ set Priv(selectFilePath) ""
+}
+
+# Gets called when user destroys the dialog directly [Bug 987169]
+#
+proc ::tk::dialog::file::Destroyed {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ variable ::tk::Priv
+
+ set Priv(selectFilePath) ""
+}
+
+# Gets called when user browses the IconList widget (dragging mouse, arrow
+# keys, etc)
+#
+proc ::tk::dialog::file::ListBrowse {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set text {}
+ foreach item [$data(icons) selection get] {
+ lappend text [$data(icons) get $item]
+ }
+ if {[llength $text] == 0} {
+ return
+ }
+ if {$data(-multiple)} {
+ set newtext {}
+ foreach file $text {
+ set fullfile [JoinFile $data(selectPath) $file]
+ if { ![file isdirectory $fullfile] } {
+ lappend newtext $file
+ }
+ }
+ set text $newtext
+ set isDir 0
+ } else {
+ set text [lindex $text 0]
+ set file [JoinFile $data(selectPath) $text]
+ set isDir [file isdirectory $file]
+ }
+ if {!$isDir} {
+ $data(ent) delete 0 end
+ $data(ent) insert 0 $text
+
+ if {[winfo class $w] eq "TkFDialog"} {
+ if {$data(type) eq "open"} {
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
+ } else {
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
+ }
+ }
+ } elseif {[winfo class $w] eq "TkFDialog"} {
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
+ }
+}
+
+# Gets called when user invokes the IconList widget (double-click, Return key,
+# etc)
+#
+proc ::tk::dialog::file::ListInvoke {w filenames} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[llength $filenames] == 0} {
+ return
+ }
+
+ set file [JoinFile $data(selectPath) [lindex $filenames 0]]
+
+ set class [winfo class $w]
+ if {$class eq "TkChooseDir" || [file isdirectory $file]} {
+ set appPWD [pwd]
+ if {[catch {cd $file}]} {
+ tk_messageBox -type ok -parent $w -icon warning -message \
+ [mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $file]
+ } else {
+ cd $appPWD
+ set data(selectPath) $file
+ }
+ } else {
+ if {$data(-multiple)} {
+ set data(selectFile) $filenames
+ } else {
+ set data(selectFile) $file
+ }
+ Done $w
+ }
+}
+
+# ::tk::dialog::file::Done --
+#
+# Gets called when user has input a valid filename. Pops up a dialog
+# box to confirm selection when necessary. Sets the
+# tk::Priv(selectFilePath) variable, which will break the "vwait" loop
+# in ::tk::dialog::file:: and return the selected filename to the script
+# that calls tk_getOpenFile or tk_getSaveFile
+#
+proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ variable ::tk::Priv
+
+ if {$selectFilePath eq ""} {
+ if {$data(-multiple)} {
+ set selectFilePath {}
+ foreach f $data(selectFile) {
+ lappend selectFilePath [JoinFile $data(selectPath) $f]
+ }
+ } else {
+ set selectFilePath [JoinFile $data(selectPath) $data(selectFile)]
+ }
+
+ set Priv(selectFile) $data(selectFile)
+ set Priv(selectPath) $data(selectPath)
+
+ if {($data(type) eq "save") && $data(-confirmoverwrite) && [file exists $selectFilePath]} {
+ set reply [tk_messageBox -icon warning -type yesno -parent $w \
+ -message [mc "File \"%1\$s\" already exists.\nDo you want\
+ to overwrite it?" $selectFilePath]]
+ if {$reply eq "no"} {
+ return
+ }
+ }
+ if {
+ [info exists data(-typevariable)] && $data(-typevariable) ne ""
+ && [info exists data(-filetypes)] && [llength $data(-filetypes)]
+ && [info exists data(filterType)] && $data(filterType) ne ""
+ } then {
+ upvar #0 $data(-typevariable) typeVariable
+ set typeVariable [lindex $data(filterType) 0]
+ }
+ }
+ bind $data(okBtn) <Destroy> {}
+ set Priv(selectFilePath) $selectFilePath
+}
+
+# ::tk::dialog::file::GlobFiltered --
+#
+# Gets called to do globbing, returning the results and filtering them
+# according to the current filter (and removing the entries for '.' and
+# '..' which are never shown). Deals with evil cases such as where the
+# user is supplying a filter which is an invalid list or where it has an
+# unbalanced brace. The resulting list will be dictionary sorted.
+#
+# Arguments:
+# dir Which directory to search
+# type List of filetypes to look for ('d' or 'f b c l p s')
+# overrideFilter Whether to ignore the filter for this search.
+#
+# NB: Assumes that the caller has mapped the state variable to 'data'.
+#
+proc ::tk::dialog::file::GlobFiltered {dir type {overrideFilter 0}} {
+ variable showHiddenVar
+ upvar 1 data(filter) filter
+
+ if {$filter eq "*" || $overrideFilter} {
+ set patterns [list *]
+ if {$showHiddenVar} {
+ lappend patterns .*
+ }
+ } elseif {[string is list $filter]} {
+ set patterns $filter
+ } else {
+ # Invalid list; assume we can use non-whitespace sequences as words
+ set patterns [regexp -inline -all {\S+} $filter]
+ }
+
+ set opts [list -tails -directory $dir -type $type -nocomplain]
+
+ set result {}
+ catch {
+ # We have a catch because we might have a really bad pattern (e.g.,
+ # with an unbalanced brace); even [glob -nocomplain] doesn't like it.
+ # Using a catch ensures that it just means we match nothing instead of
+ # throwing a nasty error at the user...
+ foreach f [glob {*}$opts -- {*}$patterns] {
+ if {$f eq "." || $f eq ".."} {
+ continue
+ }
+ # See ticket [1641721], $f might be a link pointing to a dir
+ if {$type != "d" && [file isdir [file join $dir $f]]} {
+ continue
+ }
+ lappend result $f
+ }
+ }
+ return [lsort -dictionary -unique $result]
+}
+
+proc ::tk::dialog::file::CompleteEnt {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ set f [$data(ent) get]
+ if {$data(-multiple)} {
+ if {![string is list $f] || [llength $f] != 1} {
+ return -code break
+ }
+ set f [lindex $f 0]
+ }
+
+ # Get list of matching filenames and dirnames
+ set files [if {[winfo class $w] eq "TkFDialog"} {
+ GlobFiltered $data(selectPath) {f b c l p s}
+ }]
+ set dirs2 {}
+ foreach d [GlobFiltered $data(selectPath) d] {lappend dirs2 $d/}
+
+ set targets [concat \
+ [lsearch -glob -all -inline $files $f*] \
+ [lsearch -glob -all -inline $dirs2 $f*]]
+
+ if {[llength $targets] == 1} {
+ # We have a winner!
+ set f [lindex $targets 0]
+ } elseif {$f in $targets || [llength $targets] == 0} {
+ if {[string length $f] > 0} {
+ bell
+ }
+ return
+ } elseif {[llength $targets] > 1} {
+ # Multiple possibles
+ if {[string length $f] == 0} {
+ return
+ }
+ set t0 [lindex $targets 0]
+ for {set len [string length $t0]} {$len>0} {} {
+ set allmatch 1
+ foreach s $targets {
+ if {![string equal -length $len $s $t0]} {
+ set allmatch 0
+ break
+ }
+ }
+ incr len -1
+ if {$allmatch} break
+ }
+ set f [string range $t0 0 $len]
+ }
+
+ if {$data(-multiple)} {
+ set f [list $f]
+ }
+ $data(ent) delete 0 end
+ $data(ent) insert 0 $f
+ return -code break
+}
diff --git a/ds9/library/tsv.tcl b/ds9/library/tsv.tcl
new file mode 100644
index 0000000..628d1e9
--- /dev/null
+++ b/ds9/library/tsv.tcl
@@ -0,0 +1,162 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc TSVRead {t fn} {
+ upvar #0 $t T
+ global $t
+
+ global debug
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "TSVRead"
+ }
+
+ if {$fn == {}} {
+ return
+ }
+
+ catch {
+ set fp [open $fn r]
+
+
+ # init db
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+
+ # ok, get first non comment line
+ while (true) {
+ if {[gets $fp line] == -1} {
+ return
+ }
+
+ # skip any comments
+ if {[string range $line 0 0] != "#"} {
+ break;
+ }
+ }
+
+ # reduce number of spaces
+ regsub -all { +} $line { } line
+
+ # strip any quotes
+ regsub -all {\"} $line {} line
+
+ # determine separator
+ if {[llength [split $line "\t"]] > 1} {
+ set ss "\t"
+ } elseif {[llength [split $line ","]] > 1} {
+ set ss ","
+ } elseif {[llength [split $line ":"]] > 1} {
+ set ss ":"
+ } else {
+ set ss " "
+ }
+
+ # determine header
+ set first {}
+ set foo [split $line $ss]
+ if {([string is integer [lindex $foo 0]] || [string is double [lindex $foo 0]]) && ([string is integer [lindex $foo 1]] || [string is double [lindex $foo 1]])} {
+ # determine num cols
+ set cnt [llength $foo]
+
+ # we need to build an header
+ set first $line
+
+ set line "X${ss}Y"
+ for {set ii 2} {$ii<$cnt} {incr ii} {
+ append line "${ss}column[expr $ii+3]"
+ }
+ }
+
+ # process header
+ # cols
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) $line
+ set T(Header) [split $T(H_$n) $ss]
+
+ # dashes
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Dashes)]
+ starbase_colmap $t
+
+ # process table
+ if {$first == {}} {
+ gets $fp line
+ } else {
+ set line $first
+ }
+
+ while {![eof $fp]} {
+ # skip any comments
+ if {[string range $line 0 0] == "#"} {
+ set line {}
+ }
+
+ # reduce number of spaces
+ regsub -all { +} $line { } line
+ set line [string trim $line]
+
+ # do we have something?
+ if {$line != {}} {
+ # ok, save it
+ incr ${t}(Nrows)
+ set r $T(Nrows)
+
+ set NCols [starbase_ncols $t]
+ set c 1
+ foreach val [split $line $ss] {
+ set T($r,$c) $val
+ incr c
+ }
+ for {} {$c <= $NCols} {incr c} {
+ set T($r,$c) {}
+ }
+ }
+
+ gets $fp line
+ }
+
+ close $fp
+ }
+}
+
+proc TSVWrite {t fn} {
+ upvar #0 $t T
+ global $t
+
+ global debug
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "TSVWrite"
+ }
+
+ if {$fn == {}} {
+ return
+ }
+
+ set fp [open $fn w]
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+
+ # header
+ for {set cc 1} {$cc < $nc} {incr cc} {
+ puts -nonewline $fp "[lindex $T(Header) [expr $cc-1]]\t"
+ }
+ puts $fp "[lindex $T(Header) [expr $nc-1]]"
+
+ # data
+ for {set rr 1} {$rr <= $nr} {incr rr} {
+ for {set cc 1} {$cc < $nc} {incr cc} {
+ puts -nonewline $fp "$T($rr,$cc)\t"
+ }
+ puts $fp "$T($rr,$nc)"
+ }
+
+ close $fp
+}
+
diff --git a/ds9/library/url.tcl b/ds9/library/url.tcl
new file mode 100644
index 0000000..60a5a62
--- /dev/null
+++ b/ds9/library/url.tcl
@@ -0,0 +1,334 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+# get generic file via url
+# used by Analysis and SAMP
+
+proc GetFileURL {url fname} {
+ upvar $fname fn
+
+ ParseURL $url rr
+ switch -- $rr(scheme) {
+ ftp {GetFileFTP $rr(authority) $rr(path) $fn}
+ file {set fn $rr(path)}
+ http -
+ default {GetFileHTTP $url $fn}
+ }
+}
+
+proc GetFileFTP {host path fn} {
+ global debug
+
+ set ftp [ftp::Open $host {ftp} {-ds9@} -mode passive]
+ if {$ftp > -1} {
+ set ftp::VERBOSE $debug(tcl,ftp)
+ set "ftp::ftp${ftp}(Output)" FTPLog
+ ftp::Type $ftp binary
+ ftp::Get $ftp $path $fn
+ ftp::Close $ftp
+
+ # clear error from tcllib ftp
+ global errorInfo
+ set errorInfo {}
+ }
+}
+
+proc GetFileHTTP {url fn} {
+ global ihttp
+
+ set ch [open $fn w]
+ if {[catch {http::geturl $url \
+ -timeout $ihttp(timeout) \
+ -channel $ch \
+ -binary 1 \
+ -headers "[ProxyHTTP]"} token]} {
+ close $ch
+ return
+ }
+
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ close $ch
+ if {[info exists token]} {
+ HTTPLog $token
+ http::cleanup $token
+ }
+}
+
+# Load fits via url
+# sync with redirection
+# used by command line, SAMP, SIA
+
+proc OpenURLFits {{layer {}} {mode {}}} {
+ global fitsurl
+
+ set url $fitsurl
+ if {[EntryDialog [msgcat::mc {URL}] [msgcat::mc {Enter URL}] 80 url]} {
+ StartLoad
+ LoadURLFits $url $layer $mode
+ FinishLoad
+
+ set fitsurl $url
+ }
+}
+
+proc LoadURLFits {url layer mode} {
+ if {[string length $url] == 0} {
+ return
+ }
+
+ ParseURL $url r
+ switch -- $r(scheme) {
+ ftp {LoadURLFitsFTP $r(authority) $r(path) $layer $mode}
+ file {LoadURLFitsFile $r(path) $layer $mode}
+ http -
+ default {LoadURLFitsHTTP $url $layer $mode}
+ }
+}
+
+proc LoadURLFitsFTP {host path layer mode} {
+ global loadParam
+ global ds9
+ global debug
+
+ set ftp [ftp::Open $host "ftp" "-ds9@" -mode passive]
+ if {$ftp > -1} {
+ set fn [tmpnam [file extension $path]]
+ set ftp::VERBOSE $debug(tcl,ftp)
+ set "ftp::ftp${ftp}(Output)" FTPLog
+ ftp::Type $ftp binary
+ if {[ftp::Get $ftp $path $fn]} {
+ LoadURLFitsFile $fn $layer $mode
+ }
+
+ ftp::Close $ftp
+
+ if {[file exists $fn]} {
+ catch {file delete -force $fn}
+ }
+ }
+}
+
+proc LoadURLFitsFile {fn layer mode} {
+ global loadParam
+
+ # alloc it because we can't assume it will last
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $loadParam(file,name)
+ set loadParam(load,layer) $layer
+
+ ProcessLoad
+}
+
+proc LoadURLFitsHTTP {url layer mode} {
+ global ds9
+ global ihttp
+
+ ParseURL $url r
+ set fn [tmpnam [file extension $r(path)]]
+
+ set ch [open $fn w]
+ set token [http::geturl $url \
+ -timeout $ihttp(timeout) \
+ -channel $ch \
+ -binary 1 \
+ -headers "[ProxyHTTP]"]
+
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ catch {close $ch}
+
+ upvar #0 $token t
+
+ # Code
+ set code [http::ncode $token]
+
+ # Meta
+ set meta $t(meta)
+
+ # Mime-type
+ # we want to strip and extra info after ';'
+ regexp -nocase {([^;])*} $t(type) mime
+
+ # Content-Encoding
+ set encoding {}
+ foreach {name value} $meta {
+ if {[regexp -nocase ^content-encoding $name]} {
+ switch -- [string tolower $value] {
+ compress -
+ bzip2 {set encoding bzip2}
+ Z {set encoding compress}
+ pack -
+ z {set encoding pack}
+ default {}
+ }
+ }
+ }
+
+ HTTPLog $token
+ # Result?
+ switch -- $code {
+ 200 -
+ 203 {}
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,http)} {
+ puts stderr "LoadURLFitsHTTP redirect $code to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset token
+
+ if {[file exists $fn]} {
+ catch {file delete -force $fn}
+ }
+ set url $value
+ LoadURLFitsHTTP $url $layer $mode
+ return
+ }
+ }
+ }
+
+ default {
+ Error "HTTP [msgcat::mc {Error}] $code"
+ return
+ }
+ }
+
+ http::cleanup $token
+
+ global debug
+ if {$debug(tcl,http)} {
+ puts stderr "LoadURLFitsHTTP: fn $fn : code $code : meta $meta : mime $mime : encoding $encoding"
+ }
+
+ switch -- [string tolower $mime] {
+ "application/octet-stream" {
+ # its never fails, someone can't get there mime types correct.
+ # Override the mime type based on path
+ switch -- [file extension $fn] {
+ .bz2 {set var(encoding) bzip2}
+ .Z {set var(encoding) compress}
+ .z {set var(encoding) pack}
+ }
+ }
+
+ "image/fits" -
+ "application/fits" {}
+
+ "application/fits-image" -
+ "application/fits-table" -
+ "application/fits-group" {}
+
+ "image/x-fits" -
+ "binary/x-fits" -
+ "application/x-fits" {}
+
+ "image/x-gfits" -
+ "binary/x-gfits" -
+ "image/gz-fits" -
+ "application/x-gzip" -
+ "display/gz-fits" {}
+
+ "image/fits-hcompress" -
+ "image/x-fits-h" {}
+
+ "image/bz2-fits" -
+ "display/bz2-fits" {set encoding bzip2}
+
+ "image/x-cfits" -
+ "binary/x-cfits" {set encoding compress}
+
+ "image/x-zfits" -
+ "binary/x-zfits" {set encoding pack}
+
+ "text/html" -
+ "text/plain" -
+ default {
+ Error "[msgcat::mc {File not Found or Unable to load FITS data MIME type}] $mime"
+ return
+ }
+ }
+
+ # alloc it because we are going to delete it after load
+ StartLoad
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) allocgz
+ set loadParam(file,name) $fn
+ set loadParam(file,fn) $loadParam(file,name)
+ set loadParam(load,layer) $layer
+
+ # may have to convert the file, based on content-encoding
+ switch -- "$encoding" {
+ bzip2 {
+ catch {set ch [open "| bunzip2 < $fn " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ compress {
+ catch {set ch [open "| uncompress < $fn " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ pack {
+ catch {set ch [open "| pcat $fn " r]}
+ set loadParam(load,type) channel
+ set loadParam(channel,name) $ch
+ }
+ }
+
+ ProcessLoad
+ FinishLoad
+
+ if {[file exists $fn]} {
+ catch {file delete -force $fn}
+ }
+}
+
+proc ProcessURLFitsCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set layer {}
+ set mode {}
+
+ switch -- [string tolower [lindex $var $i]] {
+ new {
+ incr i
+ CreateFrame
+ }
+ mask {
+ incr i
+ set layer mask
+ }
+ slice {
+ incr i
+ set mode slice
+ }
+ }
+
+ LoadURLFits [lindex $var $i] $layer $mode
+}
+
diff --git a/ds9/library/util.tcl b/ds9/library/util.tcl
new file mode 100644
index 0000000..c71ef83
--- /dev/null
+++ b/ds9/library/util.tcl
@@ -0,0 +1,1555 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc CurrentDef {} {
+ global current
+ global pcurrent
+ global ds9
+
+ set current(frame) {}
+ set current(ext) {}
+ set current(colorbar) {}
+ set current(cursor) {}
+ set current(rgb) red
+
+ set current(display) single
+ set current(mode) none
+ set current(zoom) { 1 1 }
+ set current(rotate) 0
+ set current(orient) none
+ set current(align) 0
+
+ set pcurrent(display) $current(display)
+ set pcurrent(mode) $current(mode)
+ set pcurrent(zoom) $current(zoom)
+ set pcurrent(rotate) $current(rotate)
+ set pcurrent(orient) $current(orient)
+ set pcurrent(align) $current(align)
+}
+
+proc CursorDef {} {
+ global icursor
+
+ set icursor(save) {}
+ set icursor(id) 0
+ set icursor(timer) 0
+ set icursor(timer,abort) 0
+}
+
+proc GetNumCores {} {
+ global tcl_platform
+ global env
+
+ switch $tcl_platform(os) {
+ Linux {
+ if {![catch {open "/proc/cpuinfo"} f]} {
+ set cores [regexp -all -line {^processor\s} [read $f]]
+ close $f
+ if {$cores > 0} {
+ return $cores
+ }
+ }
+ }
+ Darwin {
+ if {![catch {exec sysctl -n "hw.ncpu"} cores]} {
+ return $cores
+ }
+ }
+ {Windows NT} {
+ return $env(NUMBER_OF_PROCESSORS)
+ }
+ }
+
+ return 1
+}
+
+proc UpdateDS9Static {} {
+ # This routine is only called when an frame is added or deleted
+ # we only change menu items which require at least one frame
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateDS9Static begin..."
+ }
+
+ UpdateFileMenuStatic
+ UpdateFrameMenuStatic
+ UpdateZoomMenuStatic
+ UpdateAnalysisMenuStatic
+
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateDS9Static end...\n"
+ }
+}
+
+proc UpdateDS9 {} {
+ global ds9
+ global current
+
+ # This routine is called when ever there is a state change within ds9
+ # for example, a image is loaded, current(frame) is changed, etc
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateDS9 begin..."
+ }
+
+ UpdateFileMenu
+ UpdateEditMenu
+ UpdateFrameMenu
+ UpdateBinMenu
+ UpdateZoomMenu
+ UpdateScaleMenu
+ UpdateColorMenu
+ UpdateRegionMenu
+ # wcs(system) set here
+ UpdateWCSMenu
+ UpdateAnalysisMenu
+
+ UpdateTaskMenu
+ UpdateMaskMenu
+ UpdateContourMenu
+ UpdateGridMenu
+ UpdateBlockMenu
+ UpdateSmoothMenu
+ UpdateCubeMenu
+ UpdateRGBMenu
+ UpdatePanZoomMenu
+
+ UpdateBinDialog
+ UpdatePanZoomDialog
+ UpdateCrosshairDialog
+ UpdateCropDialog
+ UpdateScaleDialog
+ UpdateColorDialog
+ UpdateWCSDialog
+
+ UpdateGroupDialog
+ UpdateCATDialog
+ UpdateCentroidDialog
+ UpdateCubeDialog
+ UpdateRGBDialog
+ Update3DDialog
+ UpdateContourDialog
+ UpdateGridDialog
+
+ UpdateGraphXAxis $current(frame)
+ UpdateGraphYAxis $current(frame)
+
+ RefreshInfoBox $current(frame)
+ UpdateColormapLevel
+
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateDS9 end...\n"
+ }
+}
+
+# changes to other dialogs can affect the infobox and pixeltable
+proc UpdateMain {} {
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateMain"
+ }
+
+ RefreshInfoBox $current(frame)
+ UpdateColormapLevel
+ switch -- $current(mode) {
+ crosshair -
+ analysis {
+ if {$current(frame) != {}} {
+ set coord [$current(frame) get crosshair canvas]
+ set x [lindex $coord 0]
+ set y [lindex $coord 1]
+
+ # just in case we hae a mosaic
+ UpdateColormapLevelMosaic $current(frame) $x $y canvas
+ UpdatePixelTableDialog $current(frame) $x $y canvas
+ UpdateGraph $current(frame) $x $y canvas
+ }
+ }
+ none -
+ pointer -
+ region -
+ catalog -
+ colorbar -
+ pan -
+ zoom -
+ rotate -
+ crop -
+ examine -
+ iexam {}
+ }
+}
+
+proc ProcessSend {proc id sock fn ext rr} {
+ if {$sock != {}} {
+ # not implemented
+ } elseif {$fn != {}} {
+ append fn $ext
+ set ch [open $fn w]
+ puts $ch $rr
+ close $ch
+ $proc $id {} $fn
+ } else {
+ $proc $id $rr
+ }
+}
+
+proc Toplevel {w mb style title proc} {
+ global ds9
+
+ toplevel $w
+ switch $ds9(wm) {
+ x11 {}
+ aqua {
+ switch $style {
+ 6 {::tk::unsupported::MacWindowStyle style $w document "closeBox collapseBox"}
+ 7 {::tk::unsupported::MacWindowStyle style $w document "closeBox fullZoom collapseBox resizable"}
+ }
+ }
+ win32 {}
+ }
+
+ wm title $w $title
+ wm iconname $w $title
+ wm group $w $ds9(top)
+ wm protocol $w WM_DELETE_WINDOW $proc
+
+ # we need this first, before the configure command
+ menu $mb
+ AppleMenu $mb
+ $w configure -menu $mb
+
+ global pds9
+ if {$pds9(dialog,center)} {
+ DialogCenter $w
+ }
+}
+
+proc SourceInitFileDir {ext} {
+ global ds9
+
+ foreach pp {{.} {}} {
+ set fn $pp$ds9(app)$ext
+ set ff [file join [GetEnvHome] $fn]
+ switch [SourceInitFile $ff] {
+ 1 {return 1}
+ default {return 0}
+ }
+ }
+ return 0
+}
+
+proc SourceInitFile {fn} {
+ global tcl_platform
+
+ # do this cause old scripts may assume access during source command
+ global ds9
+
+ if {[file exist $fn] && [file isfile $fn]} {
+ # check permissions
+ switch $tcl_platform(platform) {
+ unix {
+ set pp [split [file attributes $fn -perm] {}]
+ if {![ValidReadOnly [lindex $pp 3]] ||
+ ![ValidReadOnly [lindex $pp 4]]} {
+ set msg "[msgcat::mc {Invalid file permissions detected}]: $fn [msgcat::mc {Please change the file's permission to disable other users write access. Use anyway?}]"
+
+ if {[tk_messageBox -type yesno -icon question -message $msg] != {yes}} {
+ # failed to execute
+ return 0
+ }
+ }
+ }
+ windows {}
+ }
+
+ # can't make this a debug command line option
+ # prefs set before options parsed
+ if {[catch {source $fn}]} {
+ Error "[msgcat::mc {An error has occurred while executing}] $fn. [msgcat::mc {DS9 will complete the initialization process}]"
+ # failed to execute
+ return 0
+ }
+ # success execute
+ return 1
+ }
+
+ # not found
+ return -1
+}
+
+proc ValidReadOnly {perm} {
+ if {[string is integer $perm]} {
+ switch $perm {
+ 0 -
+ 1 -
+ 4 -
+ 5 {return 1}
+ default {return 0}
+ }
+ }
+ return 0;
+}
+
+proc LanguageToName {which} {
+ switch $which {
+ locale {return {Locale}}
+ cs {return "\u010Cesky"}
+ da {return {Dansk}}
+ de {return {Deutsch}}
+ en {return {English}}
+ es {return {Español}}
+ fr {return {Français}}
+ ja {return [encoding convertfrom euc-jp "\xc6\xfc\xcb\xdc\xb8\xec"]}
+ pt {return {Português}}
+ zh {return [encoding convertfrom big5 "\xA4\xA4\xA4\xE5"]}
+ }
+}
+
+proc SetLanguage {ll} {
+ global ds9
+ global pds9
+
+ set pds9(language,name) [LanguageToName $ll]
+
+ set x 0
+ msgcat::mclocale $ll
+
+ msgcat::mcload [file join $::tk_library msgs]
+
+ # we need to find if we support this language
+ if {[msgcat::mcload [file join $ds9(root) msgs]]} {
+ incr x
+ }
+ if {$pds9(language,dir) != {}} {
+ if {[msgcat::mcload $pds9(language,dir)]} {
+ incr x
+ }
+ }
+
+ # if english, always return found
+ if {[string equal [string range $ll 0 1] {en}]} {
+ incr x
+ }
+
+ if {$x} {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+proc GetEnvHome {} {
+ global env
+ global tcl_platform
+
+ switch $tcl_platform(platform) {
+ unix {
+ if {[info exists env(HOME)]} {
+ return $env(HOME)
+ }
+ }
+ windows {
+ if {[info exists env(HOME)]} {
+ set hh [file normalize [file nativename $env(HOME)]]
+ if {[file isdirectory $hh]} {
+ return $hh
+ }
+ }
+ # this is just a backup, the above should always work
+ if {[info exists env(HOMEDRIVE)] && [info exists env(HOMEPATH)]} {
+ return "$env(HOMEDRIVE)$env(HOMEPATH)"
+ }
+ }
+ }
+ return {}
+}
+
+proc InitTempDir {} {
+ global ds9
+ global env
+
+ # check environment vars first
+ # windows is very picky as to file name format
+ if {[info exists env(TEMP)]} {
+ set ds9(tmpdir) [file normalize [file nativename $env(TEMP)]]
+ } elseif {[info exists env(TMP)]} {
+ set ds9(tmpdir) [file normalize [file nativename $env(TMP)]]
+ }
+
+ # nothing so far, go with defaults
+ if {$ds9(tmpdir) == {}} {
+ global tcl_platform
+ switch $tcl_platform(platform) {
+ unix {set ds9(tmpdir) "/tmp"}
+ windows {set ds9(tmpdir) "C:/WINDOWS/Temp"}
+ }
+ }
+
+ # see if it is valid, else current directory
+ if {![file isdirectory $ds9(tmpdir)]} {
+ set ds9(tmpdir) {.}
+ }
+}
+
+proc tmpnam {ext} {
+ global ds9
+
+ for {set ii 0} {$ii<10} {incr ii} {
+ set fn "$ds9(tmpdir)/ds9[clock clicks]$ext"
+ if {![file exists $fn]} {
+ return $fn
+ }
+ }
+
+ # give up
+ return "$ds9(tmpdir)/ds9$ext"
+}
+
+# which compiler do we use for filtering?
+proc InitFilterCompiler {} {
+ global ds9
+ global env
+ global argv0
+
+ # if the user did not explicitly specify one ...
+ if {![info exists env(FILTER_CC)]} {
+ switch -- $ds9(wm) {
+ x11 {}
+ aqua {
+ if {![file exists /usr/bin/gcc]} {
+ # pcc is hardwired to be installed in /tmp
+ set pccroot "/tmp/pcc"
+ set pcc "$pccroot/bin/pcc"
+ set tar "pcc-i386-snowleopard.tar.gz"
+
+ if {[file readable "$ds9(root)/$tar"]} {
+ exec cp "$ds9(root)/$tar" "/tmp/$tar"
+ exec tar xfPz "/tmp/$tar" -C /tmp
+ exec rm -f "/tmp/$tar"
+ }
+
+ if {[file exists $pcc]} {
+ set env(FILTER_CC) $pcc
+ set env(FILTER_CFLAGS) "-isystem $pccroot/lib/pcc"
+ set env(PATH) "$pccroot/bin:$env(PATH)"
+ }
+ }
+ }
+ win32 {
+ set tcc [file join [file dirname $argv0] tcc/tcc.exe]
+ if {[file exists $tcc]} {
+ set env(FILTER_CC) [file nativename [file attributes [file normalize $tcc] -shortname]]
+ set env(FILTER_TMPDIR) [file nativename [file attributes [file normalize $ds9(tmpdir)] -shortname]]
+ }
+ }
+ }
+ }
+}
+
+proc ToYesNo {value} {
+ if {$value == 1} {
+ return "yes\n"
+ } else {
+ return "no\n"
+ }
+}
+
+proc FromYesNo {value} {
+ set v [string tolower $value]
+
+ if {$v == "no" || $v == "false" || $v == "off" || $v == 0} {
+ return 0
+ } else {
+ return 1
+ }
+}
+
+proc ProcessRealizeDS9 {} {
+ global ds9
+ global current
+
+ # this can really slow down scripts so use ds9(last)
+ # to remember last update
+ if {$ds9(last) != $current(frame)} {
+ RealizeDS9
+ set ds9(last) $current(frame)
+ }
+}
+
+proc RealizeDS9 {{preserve 0}} {
+ # this has to come first, to realize the canvas
+ global debug
+ if {$debug(tcl,idletasks)} {
+ puts stderr "RealizeDS9"
+ }
+
+ # update all frames
+ global ds9
+ foreach ff $ds9(frames) {
+ if {$preserve} {
+ $ff 3d preserve
+ }
+ $ff update now
+ }
+
+# idletasks fails for windows. we need to process all events to make
+# sure all windows are realized
+# update idletasks
+ update
+}
+
+proc Sex2H {str} {
+ scan $str "%d:%d:%f" h m s
+ return [expr $h+($m/60.)+($s/(60.*60.))]
+}
+
+proc Sex2Hs {str} {
+ scan $str "%d %d %f" h m s
+ return [expr $h+($m/60.)+($s/(60.*60.))]
+}
+
+proc Sex2D {str} {
+ set sign 1
+ set degree 0
+ set min 0
+ set sec 0
+ scan $str "%d:%f:%f" degree min sec
+
+ if {$degree != 0} {
+ if {$degree < 0} {
+ set sign -1
+ }
+ } else {
+ if {[string range $str 0 0] == {-}} {
+ set sign -1
+ }
+ }
+
+ return [expr $sign * (abs($degree)+($min/60.)+($sec/(60.*60.)))]
+}
+
+proc SetCursor {cursor} {
+ global ds9
+ global iis
+ global current
+
+ # if init phase, don't change cursor
+ if {$ds9(init)} {
+ return
+ }
+
+ # if iis cursor mode, don't change cursor
+ if {$iis(state)} {
+ return
+ }
+
+ if {($current(cursor) != $cursor)} {
+ set current(cursor) $cursor
+ if {$cursor != {}} {
+ $ds9(canvas) configure -cursor $cursor
+ } else {
+ $ds9(canvas) configure -cursor {}
+ }
+ }
+}
+
+proc SetWatchCursor {} {
+ global ds9
+ global icursor
+
+ # we don't want to update during initialization
+ if {$ds9(init)} {
+ return
+ }
+
+ set icursor(save) [$ds9(canvas) cget -cursor]
+ $ds9(canvas) configure -cursor {}
+ $ds9(main) configure -cursor watch
+
+ update
+}
+
+proc ResetWatchCursor {} {
+ global ds9
+ global icursor
+
+ # we don't want to update during initialization
+ if {$ds9(init)} {
+ return
+ }
+
+ $ds9(main) configure -cursor {}
+ $ds9(canvas) configure -cursor $icursor(save)
+}
+
+proc CursorTimer {} {
+ global ds9
+ global icursor
+
+ switch -- $icursor(timer) {
+ 0 {
+ set icursor(timer,abort) 0
+ set icursor(timer) 0
+ set icursor(id) 0
+ $ds9(canvas) configure -cursor {}
+ }
+ 1 {
+ $ds9(canvas) configure -cursor circle
+ set icursor(timer) 2
+ set icursor(id) [after 1000 CursorTimer]
+ }
+ 2 {
+ $ds9(canvas) configure -cursor dot
+ set icursor(timer) 1
+ set icursor(id) [after 1000 CursorTimer]
+ }
+ }
+}
+
+proc AboutBox {} {
+ global help
+ global ds9
+ global ed
+
+ set w {.abt}
+
+ set ed(ok) 0
+
+ DialogCreate $w [msgcat::mc {About SAOImage DS9}] ed(ok)
+
+ # Param
+ set f [frame $w.param -background white]
+ canvas $f.c -background white -height 450 -width 500
+ pack $f.c -fill both -expand true
+
+ # can't use -file for zvfs
+ # set ed(sun) [image create photo -format gif -file $ds9(root)/doc/sun.gif]
+ set ch [open $ds9(root)/doc/sun.gif r]
+ fconfigure $ch -translation binary -encoding binary
+ set dd [read $ch]
+ close $ch
+ unset ch
+
+ set ed(sun) [image create photo -format gif -data "$dd"]
+ unset dd
+
+ $f.c create image 0 0 -image $ed(sun) -anchor nw
+ $f.c create text 120 22 -text $help(about) -anchor nw -width 350
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.ok -text [msgcat::mc {OK}] -command {set ed(ok) 1} \
+ -default active
+ pack $f.ok -padx 2 -pady 2
+
+ bind $w <Return> {set ed(ok) 1}
+
+ # Fini
+ ttk::separator $w.sep -orient horizontal
+ pack $w.buttons $w.sep -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ DialogCenter $w
+ DialogWait $w ed(ok)
+ DialogDismiss $w
+
+ image delete $ed(sun)
+ unset ed
+}
+
+proc QuitDS9 {} {
+ global ds9
+
+ # shutdown SAMP
+ global samp
+ if {[info exists samp]} {
+ catch {SAMPDisconnect}
+ }
+
+ # close IIS ports
+ catch {IISClose}
+
+ # close out XPA
+ global xpa
+ if {[info exists xpa]} {
+ catch {xpafree $xpa}
+ }
+
+ # close all HV windows, they may have tmp files
+ global ihv
+ foreach hh $ihv(windows) {
+ if {[winfo exists $hh]} {
+ catch {HVDestroy $hh}
+ }
+ }
+
+ focus {}
+ exit
+}
+
+proc OpenSource {} {
+ set filename [OpenFileDialog tclfbox]
+ if {$filename != {}} {
+ uplevel #0 "source \{$filename\}"
+ }
+}
+
+proc OpenConsole {} {
+ if {[winfo exists ".tkcon"]} {
+ tkcon show
+ } else {
+ set ::tkcon::OPT(exec) {}
+ set ::tkcon::OPT(font) [font actual TkFixedFont]
+ tkcon::Init
+ }
+}
+
+proc ToggleBindEvents {} {
+ global ds9
+
+ if {$ds9(freeze)} {
+ set ds9(freeze) 0
+ BindEventsCanvas
+ BindEventsPanner
+ } else {
+ set ds9(freeze) 1
+ UnBindEventsCanvas
+ UnBindEventsPanner
+ }
+}
+
+proc ChangeMode {} {
+ global ds9
+ global current
+
+ bind $ds9(canvas) <Button-1> {}
+ bind $ds9(canvas) <B1-Motion> {}
+ bind $ds9(canvas) <ButtonRelease-1> {}
+
+ foreach ff $ds9(frames) {
+ $ff crosshair off
+ $ff analysis reset
+ $ff marker catalog unselect all
+ $ff marker catalog unhighlite all
+ $ff marker unselect all
+ $ff marker unhighlite all
+ }
+
+ UpdateRegionMenu
+
+ RefreshInfoBox $current(frame)
+ PixelTableClearDialog
+ ClearGraphData
+
+ switch -- $current(mode) {
+ none -
+ pointer -
+ region -
+ catalog {SetCursor {}}
+ crosshair {
+ foreach ff $ds9(frames) {
+ $ff crosshair on
+ }
+ SetCursor crosshair
+ }
+ colorbar {SetCursor center_ptr}
+ zoom {SetCursor sizing}
+ pan {SetCursor fleur}
+ rotate {SetCursor exchange}
+ crop {SetCursor {}}
+ analysis {
+ foreach ff $ds9(frames) {
+ $ff crosshair on
+ }
+ SetCursor crosshair
+ IMEChangeShape
+ }
+ examine {SetCursor target}
+ iexam {}
+ }
+}
+
+# Font procs
+
+proc InitDefaultFont {} {
+ global ds9
+ global pds9
+
+ set pds9(font) helvetica
+ set pds9(font,weight) normal
+ set pds9(font,slant) roman
+
+ switch $ds9(wm) {
+ x11 {set pds9(font,size) 9}
+ aqua {set pds9(font,size) 13}
+ win32 {set pds9(font,size) 10}
+ }
+}
+
+proc InitDefaultTextFont {} {
+ global ds9
+ global pds9
+
+ set pds9(text,font) courier
+ set pds9(text,font,weight) normal
+ set pds9(text,font,slant) roman
+
+ switch $ds9(wm) {
+ x11 {set pds9(text,font,size) 9}
+ aqua {set pds9(text,font,size) 12}
+ win32 {set pds9(text,font,size) 10}
+ }
+}
+
+proc ResetDefaultFont {} {
+ InitDefaultFont
+ SetDefaultFont true
+}
+
+proc ResetDefaultTextFont {} {
+ InitDefaultTextFont
+ SetDefaultTextFont true
+}
+
+proc SetDefaultFont {which} {
+ global ds9
+ global pds9
+
+ font configure TkDefaultFont -family $ds9($pds9(font)) \
+ -size $pds9(font,size) -weight $pds9(font,weight) \
+ -slant $pds9(font,slant)
+
+ switch $ds9(wm) {
+ x11 {
+ font configure TkMenuFont -family $ds9($pds9(font)) \
+ -size $pds9(font,size) -weight $pds9(font,weight) \
+ -slant $pds9(font,slant)
+ }
+ aqua -
+ win32 {
+ # can't change font defs, see font configure doc
+ }
+ }
+
+ if {$which} {
+ UpdateScaleDialogFont
+ UpdateGraphFont
+ CATUpdateFont
+ }
+}
+
+proc SetDefaultTextFont {which} {
+ global ds9
+ global pds9
+
+ font configure TkFixedFont -family $ds9($pds9(text,font)) \
+ -size $pds9(text,font,size) -weight $pds9(text,font,weight) \
+ -slant $pds9(text,font,slant)
+
+ if {$which} {
+ SimpleTextUpdateFont
+ }
+}
+
+proc PrefsBgColor {} {
+ global ds9
+ global pds9
+
+ foreach ff $ds9(frames) {
+ $ff bg color $pds9(bg)
+ }
+}
+
+proc PrefsNanColor {} {
+ global ds9
+ global pds9
+
+ foreach ff $ds9(frames) {
+ $ff nan color $pds9(nan)
+ }
+}
+
+proc ChangeThreads {} {
+ global ds9
+
+ foreach ff $ds9(frames) {
+ $ff threads $ds9(threads)
+ }
+}
+
+proc PrefsIRAFAlign {} {
+ global ds9
+ global pds9
+
+ foreach ff $ds9(frames) {
+ $ff iraf align $pds9(iraf)
+ }
+}
+
+proc DisplayLog {item} {
+ SimpleTextDialog ftptxt [msgcat::mc {Message Log}] 80 40 append bottom $item
+}
+
+proc ParseURL {url varname} {
+ upvar $varname r
+
+ set r(scheme) {}
+ set r(authority) {}
+ set r(path) {}
+ set r(query) {}
+ set r(fragment) {}
+ set exp {^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?}
+
+ if {![regexp -nocase $exp $url x a r(scheme) c r(authority) r(path) f r(query) h r(fragment)]} {
+ return 0
+ }
+
+ # check for windows disk drives
+ global tcl_platform
+ switch $tcl_platform(platform) {
+ unix {
+ switch -- $r(scheme) {
+ ftp {
+ # strip any username/passwd
+ set id [string first {@} $r(authority)]
+ if { $id != -1} {
+ set r(authority) [string range $r(authority) [expr $id+1] end]
+ }
+ }
+ }
+ }
+ windows {
+ switch -- $r(scheme) {
+ {} -
+ ftp -
+ http -
+ file {
+ if {[regexp {/([A-Z]:)(/.*)} $r(path) a b c]} {
+ set r(path) "$b$c"
+ }
+ }
+ default {
+ set r(path) "$r(scheme):$r(path)"
+ set r(scheme) {}
+ }
+ }
+ }
+ }
+
+ return 1
+}
+
+proc BreakUp {str} {
+ set r {}
+ set l [string length $str]
+ for {set i 0} {$i < $l} {incr i} {
+ set c [string index $str $i]
+ append r $c
+ if {$c=="\}"} {
+ append r "\n"
+ }
+ }
+ return $r
+}
+
+proc InPath {which} {
+ global env
+ global tcl_platform
+
+ switch $tcl_platform(platform) {
+ unix {
+ set target ${which}
+ set paths [split $env(PATH) :]
+ }
+ windows {
+ set target ${which}.exe
+ set paths [split $env(PATH) \;]
+ }
+ }
+
+ foreach p $paths {
+ if {[file executable [file join $p $target]]} {
+ return 1
+ }
+ }
+ return 0
+}
+
+proc FTPLog {s msg state} {
+ global debug
+
+ if {$debug(tcl,ftp)} {
+ DisplayLog "$s $msg $state\n"
+ }
+}
+
+proc HTTPLog {token} {
+ global debug
+
+ if {$debug(tcl,http)} {
+ upvar #0 $token t
+
+ DisplayLog "url: $t(url)\n"
+ DisplayLog "http: $t(http)\n"
+ DisplayLog "type: $t(type)\n"
+ DisplayLog "currentsize: $t(currentsize)\n"
+ DisplayLog "totalsize: $t(totalsize)\n"
+ DisplayLog "status: $t(status)\n"
+ if {[info exists t(error)]} {
+ DisplayLog "error: $t(error)\n"
+ }
+ DisplayLog "meta: [BreakUp $t(meta)]\n"
+ }
+}
+
+proc ConfigHTTP {} {
+ global phttp
+
+ # set the User-Agent
+ http::config -useragent ds9
+
+ # set the proxy if requested
+ if {$phttp(proxy)} {
+ http::config -proxyhost $phttp(proxy,host) -proxyport $phttp(proxy,port)
+ }
+}
+
+proc ProxyHTTP {} {
+ global phttp
+
+ set auth {}
+ if {$phttp(proxy) && $phttp(auth)} {
+ set auth [list "Proxy-Authorization" [concat "Basic" [base64::encode $phttp(auth,user):$phttp(auth,passwd)]]]
+ }
+
+ return $auth
+}
+
+proc FixSpec {sysname skyname formatname defsys defsky defformat} {
+ upvar $sysname sys
+ upvar $skyname sky
+ upvar $formatname format
+
+ set rr 0
+
+ switch -- $sys {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {incr rr}
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {
+ set format $sky
+ set sky $sys
+ set sys wcs
+ }
+
+ default {
+ set format $sky
+ set sky $sys
+ set sys $defsys
+ }
+ }
+
+ switch -- $sky {
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {incr rr}
+
+ default {
+ set format $sky
+ set sky $defsky
+ }
+ }
+
+ switch -- $format {
+ degrees -
+ arcmin -
+ arcsec -
+ sexagesimal {incr rr}
+
+ default {
+ set format $defformat
+ }
+ }
+
+ return $rr
+}
+
+proc FixSpecSystem {sysname defsys} {
+ upvar $sysname sys
+
+ set rr 0
+
+ switch -- $sys {
+ image -
+ physical -
+ detector -
+ amplifier -
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {incr rr}
+ default {
+ set sys $defsys
+ }
+ }
+
+ return $rr
+}
+
+proc DS9Backup {ch which} {
+ global pds9
+
+ puts $ch "$which bg color $pds9(bg)"
+ puts $ch "$which nan color $pds9(nan)"
+}
+
+# Process Cmds
+
+proc ProcessPrefsCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global pds9
+ global ds9
+
+ switch -- [string tolower [lindex $var $i]] {
+ clear {ClearPrefs}
+ bgcolor {
+ # backward compatibility
+ incr i
+ set pds9(bg) [lindex $var $i]
+ PrefsBgColor
+ }
+ nancolor {
+ # backward compatibility
+ incr i
+ set pds9(nan) [lindex $var $i]
+ PrefsNanColor
+ }
+ threads {
+ # backward compatibility
+ incr i
+ set ds9(threads) [lindex $var $i]
+ ChangeThreads
+ }
+ irafalign {
+ incr i
+ set pds9(iraf) [FromYesNo [lindex $var $i]]
+ PrefsIRAFAlign
+ }
+ }
+}
+
+proc ProcessSendPrefsCmd {proc id param} {
+ global pds9
+ global ds9
+
+ # backward compatibility
+ switch -- [string tolower [lindex $param 0]] {
+ bgcolor {$proc $id "$pds9(bg)\n"}
+ nancolor {$proc $id "$pds9(nan)\n"}
+ threads {$proc $id "$ds9(threads)\n"}
+ irafalign {$proc $id [ToYesNo $pds9(iraf)]}
+ }
+}
+
+proc ProcessBgCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global pds9
+ set pds9(bg) [lindex $var $i]
+ PrefsBgColor
+}
+
+proc ProcessSendBgCmd {proc id param} {
+ global pds9
+
+ $proc $id "$pds9(bg)\n"
+}
+
+proc ProcessNanCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global pds9
+ set pds9(nan) [lindex $var $i]
+ PrefsNanColor
+}
+
+proc ProcessSendNanCmd {proc id param} {
+ global pds9
+
+ $proc $id "$pds9(nan)\n"
+}
+
+proc ProcessThreadsCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ set ds9(threads) [lindex $var $i]
+ ChangeThreads
+}
+
+proc ProcessSendThreadsCmd {proc id param} {
+ global ds9
+
+ $proc $id "$ds9(threads)\n"
+}
+
+proc ProcessIRAFAlignCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global pds9
+ set pds9(iraf) [FromYesNo [lindex $var $i]]
+ PrefsIRAFAlign
+}
+
+proc ProcessSendIRAFAlignCmd {proc id param} {
+ global pds9
+
+ $proc $id [ToYesNo $pds9(iraf)]
+}
+
+proc ProcessCDCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ cd [lindex $var $i]
+}
+
+proc ProcessSendCDCmd {proc id param} {
+ $proc $id "[pwd]\n"
+}
+
+proc ProcessConsoleCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ OpenConsole
+
+ # ignore error message about ActiveTcl
+ global ds9
+ InitError $ds9(msg,src)
+}
+
+proc ProcessCursorCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+
+ if {$current(frame) != {}} {
+ set x [lindex $var $i]
+ incr i
+ set y [lindex $var $i]
+
+ switch -- $current(mode) {
+ none {$current(frame) warp $x $y}
+ pointer -
+ region {MarkerArrowKey $current(frame) $x $y}
+ catalog {MarkerArrowKey $current(frame) $x $y}
+ crosshair {CrosshairArrowKey $current(frame) $x $y}
+ colorbar {}
+ pan {Pan $x $y canvas}
+ zoom -
+ rotate -
+ crop {}
+ analysis {IMEArrowKey $current(frame) $x $y}
+ examine -
+ iexam {}
+ }
+ }
+}
+
+proc ProcessSendDataCmd {proc id param sock fn} {
+ global cube
+ global blink
+ global current
+
+ if {$current(frame) != {}} {
+ set sys [lindex $param 0]
+ set sky [lindex $param 1]
+ set x [lindex $param 2]
+ set y [lindex $param 3]
+ set w [lindex $param 4]
+ set h [lindex $param 5]
+ set strip [lindex $param 6]
+ switch -- $sys {
+ image -
+ physical -
+ detector -
+ amplifier {
+ set strip $h
+ set h $w
+ set w $y
+ set y $x
+ set x $sky
+ set sky fk5
+ }
+
+ fk4 -
+ b1950 -
+ fk5 -
+ j2000 -
+ icrs -
+ galactic -
+ ecliptic {
+ set strip $h
+ set h $w
+ set w $y
+ set y $x
+ set x $sky
+ set sky $sys
+ set sys wcs
+ }
+ }
+ set strip [FromYesNo $strip]
+
+ $current(frame) get data $sys $sky $x $y $w $h rr
+ set ss {}
+ foreach ii [array names rr] {
+ if {$strip} {
+ append ss "$rr($ii)\n"
+ } else {
+ append ss "$ii = $rr($ii)\n"
+ }
+ }
+ ProcessSend $proc $id $sock $fn {.dat} $ss
+ }
+}
+
+proc ProcessIconifyCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+
+ switch -- [string tolower [lindex $var $i]] {
+ yes -
+ true -
+ on -
+ 1 {wm iconify $ds9(top)}
+
+ no -
+ false -
+ off -
+ 0 {wm deiconify $ds9(top)}
+
+ default {
+ wm iconify $ds9(top)
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendIconifyCmd {proc id param} {
+ global ds9
+ if {[wm state $ds9(top)] == "normal"} {
+ $proc $id "no\n"
+ } else {
+ $proc $id "yes\n"
+ }
+}
+
+proc ProcessLowerCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ lower $ds9(top)
+}
+
+proc ProcessModeCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+
+ set current(mode) [string tolower [lindex $var $i]]
+ # backward compatibility
+ switch $current(mode) {
+ pointer {set current(mode) region}
+ }
+ ChangeMode
+}
+
+proc ProcessQuitCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ QuitDS9
+}
+
+proc ProcessSendModeCmd {proc id param} {
+ global current
+
+ $proc $id "$current(mode)\n"
+}
+
+proc ProcessRaiseCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ raise $ds9(top)
+}
+
+proc ProcessSleepCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # yes, we need this
+ UpdateDS9
+ RealizeDS9
+
+ set sec 1
+ if {[lindex $var $i] != {} && [string range [lindex $var $i] 0 0] != {-}} {
+ set sec [lindex $var $i]
+ } else {
+ incr i -1
+ }
+ after [expr int($sec*1000)]
+}
+
+proc ProcessSourceCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ # we need to be realized
+ # you never know what someone will try to do
+ ProcessRealizeDS9
+
+ set fn [lindex $var $i]
+ uplevel #0 "source $fn"
+}
+
+proc ProcessTclCmd {varname iname buf fn} {
+ upvar $varname var
+ upvar $iname i
+
+ # backward compatibility
+ switch -- [string tolower [lindex $var $i]] {
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ return
+ }
+ }
+
+ if {$buf != {}} {
+ uplevel #0 $buf
+ } elseif {$fn != {}} {
+ if {[file exists $fn]} {
+ set ch [open $fn r]
+ set cmd [read $ch]
+ close $ch
+ uplevel #0 $cmd
+ }
+ } elseif {[lindex $var $i] != {}} {
+ # special case
+ uplevel #0 [lindex $var $i]
+ }
+}
+
+# backward compatibility
+proc ProcessThemeCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+}
+
+# backward compatibility
+proc ProcessSendThemeCmd {proc id param} {
+ global pds9
+ $proc $id "native\n"
+}
+
+proc ProcessSendVersionCmd {proc id param} {
+ global ds9
+ $proc $id "$ds9(title) [lindex $ds9(version) 0]\n"
+}
+
+proc XMLQuote {val} {
+ return [string map {& &amp; < &lt; > &gt; \' &apos; \" &quot;} $val]
+}
+
+proc XMLUnQuote {val} {
+ return [string map {&amp; & &lt; < &gt; > &apos; \' &quot; \"} $val]
+}
+
diff --git a/ds9/library/var.tcl b/ds9/library/var.tcl
new file mode 100644
index 0000000..549756f
--- /dev/null
+++ b/ds9/library/var.tcl
@@ -0,0 +1,21 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc LoadVar {varname fn layer mode} {
+ global loadParam
+
+ set loadParam(file,type) fits
+ set loadParam(file,mode) $mode
+ set loadParam(load,type) var
+ set loadParam(var,name) $varname
+ set loadParam(file,name) "$fn"
+
+ # mask not supported
+ set loadParam(load,layer) {}
+
+ ProcessLoad
+}
+
diff --git a/ds9/library/vector.tcl b/ds9/library/vector.tcl
new file mode 100644
index 0000000..13876e4
--- /dev/null
+++ b/ds9/library/vector.tcl
@@ -0,0 +1,165 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc VectorDialog {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pmarker
+
+ # see if we already have a header window visible
+ if {[winfo exists $var(top)]} {
+ raise $var(top)
+ return
+ }
+
+ # variables
+ set rr [$var(frame) get wcs]
+ set var(dcoord) [lindex $rr 0]
+ set var(dformat) $pmarker(dformat)
+ AdjustCoordSystem $varname dcoord
+
+ set var(arrow) [$var(frame) get marker $var(id) vector arrow]
+
+ # procs
+ set var(which) vector
+ set var(proc,apply) VectorApply
+ set var(proc,close) VectorClose
+ set var(proc,coordCB) VectorCoordCB
+ set var(proc,editCB) VectorEditCB
+ set var(proc,distCB) VectorDistCB
+
+ # base
+ MarkerBaseDialog $varname
+
+ # analysis
+ $var(mb) add cascade -label [msgcat::mc {Analysis}] -menu $var(mb).analysis
+ menu $var(mb).analysis
+
+ # plot2d
+ MarkerAnalysisPlot2dDialog $varname
+ # raise plot?
+ global marker
+ set var(plot2d) $marker(plot2d)
+
+ # init
+ VectorDistCB $varname
+
+ # callbacks
+ $var(frame) marker $var(id) callback move "VectorEditCB" $varname
+ $var(frame) marker $var(id) callback edit "VectorEditCB" $varname
+
+ set f $var(top).param
+
+ # Point
+ ttk::label $f.tpt -text [msgcat::mc {Point}]
+ ttk::entry $f.x -textvariable ${varname}(x) -width 13
+ ttk::entry $f.y -textvariable ${varname}(y) -width 13
+ CoordMenuButton $f.upt $varname system 1 sky skyformat \
+ [list $var(proc,coordCB) $varname]
+
+ # Length
+ ttk::label $f.tdist -text [msgcat::mc {Length}]
+ ttk::entry $f.dist -textvariable ${varname}(dist) -width 13
+ DistMenuButton $f.udist $varname dcoord 1 dformat \
+ [list VectorDistCB $varname]
+ DistMenuEnable $f.udist.menu $varname dcoord 1 dformat
+
+ # Angle
+ ttk::label $f.tangle -text [msgcat::mc {Angle}]
+ ttk::entry $f.angle -textvariable ${varname}(angle) -width 13
+ ttk::label $f.uangle -text [msgcat::mc {Degrees}]
+
+ # Arrow
+ ttk::label $f.tarrow -text [msgcat::mc {Arrow}]
+ ttk::checkbutton $f.arrow -variable ${varname}(arrow) \
+ -command "VectorArrow $varname"
+
+ grid $f.tpt $f.x $f.y $f.upt -padx 2 -pady 2 -sticky w
+ grid $f.tdist $f.dist $f.udist -padx 2 -pady 2 -sticky w
+ grid $f.tangle $f.angle $f.uangle -padx 2 -pady 2 -sticky w
+ grid $f.tarrow $f.arrow -padx 2 -pady 2 -sticky w
+}
+
+# actions
+
+proc VectorClose {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) delete callback move "VectorEditCB"
+ $var(frame) marker $var(id) delete callback edit "VectorEditCB"
+
+ MarkerBaseClose $varname
+}
+
+proc VectorApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) vector point $var(system) $var(sky) \
+ $var(x) $var(y) $var(dcoord) $var(dformat) $var(dist) $var(angle)
+
+ MarkerBaseLineApply $varname
+}
+
+proc VectorArrow {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ $var(frame) marker $var(id) vector arrow $var(arrow)
+}
+
+# callbacks
+
+proc VectorCoordCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "VectorCoordCB"
+ }
+
+ MarkerAnalysisPlot2dSystem $varname
+ MarkerBaseCoordCB $varname
+ VectorEditCB $varname
+}
+
+proc VectorEditCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "VectorEditCB"
+ }
+
+ set p [$var(frame) get marker $var(id) vector point \
+ $var(system) $var(sky) $var(skyformat)]
+
+ set var(x) [lindex $p 0]
+ set var(y) [lindex $p 1]
+
+ set var(dist) [$var(frame) get marker $var(id) vector length \
+ $var(dcoord) $var(dformat)]
+
+ set var(angle) [$var(frame) get marker $var(id) angle \
+ $var(system) $var(sky)]
+}
+
+proc VectorDistCB {varname {dummy {}}} {
+ upvar #0 $varname var
+ global $varname
+
+ global debug
+ if {$debug(tcl,marker)} {
+ puts stderr "VectorDistCB"
+ }
+
+ set var(dist) [$var(frame) get marker $var(id) vector length \
+ $var(dcoord) $var(dformat)]
+}
diff --git a/ds9/library/vla.tcl b/ds9/library/vla.tcl
new file mode 100644
index 0000000..fab32bb
--- /dev/null
+++ b/ds9/library/vla.tcl
@@ -0,0 +1,173 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc VLADef {} {
+ global vla
+ global ivla
+
+ set ivla(top) .vla
+ set ivla(mb) .vlatmb
+
+ set vla(sky) fk5
+ set vla(rformat) arcmin
+ set vla(width) 15
+ set vla(height) 15
+ set vla(mode) new
+ set vla(save) 0
+ set vla(survey) first
+}
+
+proc VLADialog {} {
+ global vla
+ global ivla
+ global wcs
+
+ if {[winfo exists $ivla(top)]} {
+ raise $ivla(top)
+ return
+ }
+
+ set varname dvla
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $ivla(top)
+ set var(mb) $ivla(mb)
+ set var(sky) $vla(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $vla(rformat)
+ set var(width) $vla(width)
+ set var(height) $vla(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $vla(mode)
+ set var(save) $vla(save)
+ set var(survey) $vla(survey)
+
+ set w $var(top)
+ IMGSVRInit $varname "VLA [msgcat::mc {Server}]" \
+ VLAExec VLAAck ARDone ARError
+
+ menu $var(mb).survey
+ $var(mb) add cascade -label Survey -menu $var(mb).survey
+ $var(mb).survey add radiobutton -label {First} \
+ -variable ${varname}(survey) -value first
+ $var(mb).survey add radiobutton -label {Stripe 82} \
+ -variable ${varname}(survey) -value stripe82
+ $var(mb).survey add radiobutton -label {GPS} \
+ -variable ${varname}(survey) -value gps
+
+ IMGSVRUpdate $varname
+}
+
+proc VLAExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set var(fn) [tmpnam {.fits}]
+ }
+
+ # skyformat
+ switch -- $var(skyformat) {
+ degrees {
+ set xx [uformat d h: $var(x)]
+ set yy [uformat d d: $var(y)]
+ }
+ sexagesimal {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ }
+
+ # size - convert to arcmin
+ switch -- $var(rformat) {
+ degrees {
+ set ww [expr $var(width)*60.]
+ set hh [expr $var(height)*60.]
+ }
+ arcmin {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcsec {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ }
+
+ # now to radius
+ set rr [expr sqrt($ww*$ww+$hh*$hh)/2.]
+ if {$rr>60} {
+ set rr 60
+ }
+
+ set var(query) [http::formatQuery .submit "Extract the Cutout" RA "$xx $yy" Equinox J2000 ImageSize $rr MaxInt 10 .cgifields ImageType ImageType "FITS Image"]
+ set url "http://third.ucllnl.org/cgi-bin/$var(survey)cutout"
+ IMGSVRGetURL $varname $url
+}
+
+proc VLAAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the VLA
+
+This major undertaking has received the generous technical and
+scientific support of many individuals. The NRAO staff has provided
+extremely valuable assistance in many aspects of the observations
+themselves and in the area of software support; in particular, we are
+grateful to Rick Perley, Ken Sowinski, Barry Clark, and Bill Cotton in
+this regard. The support of the NRAO Director, Paul van den Bout, and
+the yeoman service provided by Frazer Owen as Chair of the Survey
+Oversight Committee are also greatly appreciated. We also thank the
+members of the Oversight Committee (Ken Chambers, Eric Feigelson,
+Jackie Hewitt, Gillian Knapp, and Rogier Windhorst) for their time and
+wise counsel in this enterprise.
+
+Acknowledgment is also due our colleagues who are involved in the
+ongoing FIRST effort, including Richard McMahon and Isobel Hook. This
+work is supported in part under the auspices of the Department of
+Energy by Lawrence Livermore National Laboratory under contract
+No. W-7405-ENG-48 and the Institute for Geophysics and Planetary
+Physics, whose director Charles Alcock has been particularly
+supportive. We also acknowledge a generous planning grant from the
+CalSpace Institute; support from the STScI archive group, STScI
+director Bob Williams, and the STScI Director's Discretionary Research
+Fund; computing resources from Columbia University; a grant from the
+National Science Foundation; a gift of computing equipment from Sun
+Microsystems; a NATO travel grant to support our collaboration with
+Richard McMahon; and an award from the National Geographic Society
+which, in the spirit of their support 40 years ago for the Palomar
+Observatory Sky Survey, will be providing funds to continue our
+charting of the Universe.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessVLACmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ VLADialog
+ IMGSVRProcessCmd $varname $iname dvla
+}
+
+proc ProcessSendVLACmd {proc id param} {
+ VLADialog
+ IMGSVRProcessSendCmd $proc $id $param dvla
+}
diff --git a/ds9/library/vlss.tcl b/ds9/library/vlss.tcl
new file mode 100644
index 0000000..d6f0a50
--- /dev/null
+++ b/ds9/library/vlss.tcl
@@ -0,0 +1,132 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc VLSSDef {} {
+ global vlss
+ global ivlss
+
+ set ivlss(top) .vlss
+ set ivlss(mb) .vlsstmb
+
+ set vlss(sky) fk5
+ set vlss(rformat) arcmin
+ set vlss(width) 15
+ set vlss(height) 15
+ set vlss(mode) new
+ set vlss(save) 0
+}
+
+proc VLSSDialog {} {
+ global vlss
+ global ivlss
+ global wcs
+
+ if {[winfo exists $ivlss(top)]} {
+ raise $ivlss(top)
+ return
+ }
+
+ set varname dvlss
+ upvar #0 $varname var
+ global $varname
+
+ set var(top) $ivlss(top)
+ set var(mb) $ivlss(mb)
+ set var(sky) $vlss(sky)
+ set var(skyformat) $wcs(skyformat)
+ set var(rformat) $vlss(rformat)
+ set var(width) $vlss(width)
+ set var(height) $vlss(height)
+ # not used
+ set var(width,pixels) 300
+ set var(height,pixels) 300
+ set var(mode) $vlss(mode)
+ set var(save) $vlss(save)
+
+ set w $var(top)
+ IMGSVRInit $varname "VLSS [msgcat::mc {Server}]" \
+ VLSSExec VLSSAck ARDone ARError
+
+ IMGSVRUpdate $varname
+}
+
+proc VLSSExec {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ if {$var(save)} {
+ set var(fn) [SaveFileDialog savefitsfbox]
+ if {$var(fn) == {}} {
+ ARDone $varname
+ return
+ }
+ } else {
+ set var(fn) [tmpnam {.fits}]
+ }
+
+ # skyformat
+ switch -- $var(skyformat) {
+ degrees {
+ set xx [uformat d h: $var(x)]
+ set yy [uformat d d: $var(y)]
+ }
+ sexagesimal {
+ set xx $var(x)
+ set yy $var(y)
+ }
+ }
+ regsub -all {:} $xx { } xx
+ regsub -all {:} $yy { } yy
+
+ # size - convert to arcmin
+ switch -- $var(rformat) {
+ degrees {
+ set ww $var(width)
+ set hh $var(height)
+ }
+ arcmin {
+ set ww [expr $var(width)/60.]
+ set hh [expr $var(height)/60.]
+ }
+ arcsec {
+ set ww [expr $var(width)/60./60.]
+ set hh [expr $var(height)/60./60.]
+ }
+ }
+
+ set var(query) [http::formatQuery submit Submit Equinox J2000 RA $xx Dec $yy Size "$ww $hh" Cells "25.0 25.0" MAPROJ SIN rotate 0.0 Type image/x-fits]
+ set url "http://www.cv.nrao.edu/cgi-bin/newVLSSpostage.pl"
+ IMGSVRGetURL $varname $url
+}
+
+proc VLSSAck {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set msg {Acknowledgments for the VLSS
+
+The VLSS survey is being carried out by the NRAO and the
+Naval Research Lab.
+ }
+
+ SimpleTextDialog ${varname}ack [msgcat::mc {Acknowledgment}] \
+ 80 40 insert top $msg
+}
+
+# Process Cmds
+
+proc ProcessVLSSCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ VLSSDialog
+ IMGSVRProcessCmd $varname $iname dvlss
+}
+
+proc ProcessSendVLSSCmd {proc id param} {
+ VLSSDialog
+ IMGSVRProcessSendCmd $proc $id $param dvlss
+}
diff --git a/ds9/library/vo.tcl b/ds9/library/vo.tcl
new file mode 100644
index 0000000..c7a397d
--- /dev/null
+++ b/ds9/library/vo.tcl
@@ -0,0 +1,613 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc VODef {} {
+ global ivo
+ global pvo
+
+ set ivo(top) .vo
+ set ivo(mb) .vomb
+
+ set ivo(server,host) {}
+ set ivo(server,title) {}
+ set ivo(server,url) {}
+ set ivo(server,button) {}
+
+ set ivo(ka,id) {}
+
+ # prefs only
+ set pvo(server) {http://cxc.harvard.edu/chandraed/list.txt}
+ set pvo(hv) 1
+ set pvo(method) mime
+ set pvo(delay) 15
+}
+
+proc VOKeepAlive {doka} {
+ global ivo
+ global pvo
+ global xpa
+
+ # if not xpa, return
+ if {$pvo(method) != {xpa}} {
+ return
+ }
+
+ # if keep-alive turned off, return
+ if {$pvo(delay) <= 0} {
+ return
+ }
+
+ # count the connections
+ set n 0
+ for {set ii 0} {$ii < [llength $ivo(server,button)]} {incr ii} {
+ if {$ivo(b$ii)} {
+ incr n
+ break
+ }
+ }
+
+ # no connections => kill existing keep-alive, if necessary
+ if {$n == 0} {
+ if {$ivo(ka,id) != {}} {
+ after cancel $ivo(ka,id)
+ set ivo(ka,id) {}
+ }
+ } else {
+ # yes connections
+ # send a keep-alive, if necessary
+ if {$doka} {
+ # puts [format "send keepalive: %s (%d)" [exec date] $pvo(delay)]
+ xpanskeepalive $xpa
+ }
+ # arrange for the next one
+ set ivo(ka,id) [after [expr $pvo(delay) * 60 * 1000] VOKeepAlive 1]
+ }
+}
+
+proc VOCancel {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # set state to 0 so that we don't process the finish proc
+ set var(active) 0
+
+ if {[info exists var(token)]} {
+ http::reset $var(token)
+ }
+}
+
+proc VODestroy {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ VOCancel $varname
+
+ if {[winfo exists $var(top)]} {
+ destroy $var(top)
+ destroy $var(mb)
+ }
+
+ unset $varname
+}
+
+proc VOReset {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ set var(active) 0
+
+ if {[info exists var(token)]} {
+ http::cleanup $var(token)
+ unset var(token)
+ }
+}
+
+proc VODone {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ VOReset $varname
+}
+
+proc VOCancelled {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ VOReset $varname
+}
+
+proc VOError {varname message} {
+ upvar #0 $varname var
+ global $varname
+
+ Error $message
+ VOReset $varname
+}
+
+proc VODialog {{sync 0}} {
+ global ivo
+ global pvo
+
+ global ds9
+
+ if {[winfo exists $ivo(top)]} {
+ raise $ivo(top)
+ return
+ }
+
+ set varname voi
+ upvar #0 $varname var
+ global $varname
+
+ # variables
+ set var(top) $ivo(top)
+ set var(mb) $ivo(mb)
+ set var(sync) $sync
+ set var(url) {}
+
+ # create the window
+ set w $var(top)
+ set mb $var(mb)
+
+ Toplevel $w $mb 6 [msgcat::mc {Virtual Observatory}] "VODestroy $varname"
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] \
+ -command "VOApply $varname"
+ $mb.file add command -label [msgcat::mc {Cancel}] \
+ -command "VOCancel $varname"
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Help Me Choose}] \
+ -command HelpVO
+ $mb.file add command -label [msgcat::mc {Configure}] \
+ -command [list PrefsDialog http]
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] \
+ -command "VODestroy $varname"
+
+ # Sites
+ ttk::labelframe $w.param -text [msgcat::mc {Sites}] -padding 2
+
+ # Browser
+ set f [ttk::labelframe $w.opt -text [msgcat::mc {Browser}] -padding 2]
+ set var(hv,button) [ttk::checkbutton $w.opt.hv \
+ -text [msgcat::mc {Use Internal Web Browser}] \
+ -variable pvo(hv) \
+ -command SavePrefs]
+ ttk::radiobutton $w.opt.xpa \
+ -text [msgcat::mc {Connect Directly}] \
+ -variable pvo(method) -value xpa -command PrefsVOMethod
+ ttk::radiobutton $w.opt.http \
+ -text [msgcat::mc {Connect Using Web Proxy}] \
+ -variable pvo(method) -value mime -command PrefsVOMethod
+ grid $w.opt.hv -padx 2 -pady 2 -sticky w
+ grid $w.opt.xpa $w.opt.http -padx 2 -pady 2 -sticky w
+
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.help -text [msgcat::mc {Help Me Choose}] \
+ -command HelpVO
+ ttk::button $f.proxy -text [msgcat::mc {Configure}] \
+ -command [list PrefsDialog http]
+ ttk::button $f.close -text [msgcat::mc {Close}] \
+ -command "VODestroy $varname"
+ pack $f.help $f.proxy $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ grid $w.param -sticky news
+ grid $w.opt -sticky news
+ grid $w.buttons -sticky ew
+ grid rowconfigure $w 0 -weight 1
+ grid rowconfigure $w 1 -weight 1
+ grid columnconfigure $w 0 -weight 1
+
+ if {[string length $ivo(server,host)] == 0} {
+ VOApply $varname
+ } else {
+ set l [llength $ivo(server,host)]
+ for {set ii 0} {$ii<$l} {incr ii} {
+ set b [lindex $ivo(server,button) $ii]
+ ttk::checkbutton $b -text "[lindex $ivo(server,title) $ii] ([lindex $ivo(server,url) $ii])" -variable ivo(b$ii) -command "VOCheck $varname $ii"
+ pack $b -anchor w -padx 2 -pady 2
+ }
+ }
+}
+
+proc VOApply {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ivo
+ global pvo
+ global xpa
+
+ set w $var(top)
+
+ # delete old servers
+ for {set ii 0} {$ii < [llength $ivo(server,button)]} {incr ii} {
+ catch {xparemote $xpa [lindex $ivo(server,host) $ii] - -proxy}
+ catch {destroy [lindex $ivo(server,button) $ii]}
+ catch {unset ivo(b$ii)}
+ }
+ set ivo(server,host) {}
+ set ivo(server,title) {}
+ set ivo(server,url) {}
+ set ivo(server,button) {}
+
+ VOFindServer $varname
+ if {$var(url) != {}} {
+ VOLoad $varname
+ } else {
+ VOLoadDefault $varname
+ }
+
+ # start or stop the keep-alive, as needed
+ VOKeepAlive 0
+}
+
+proc VOLoadDefault {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ # hardcode
+ VOError $varname "Unable to access VO server list, please verify internet connection. Using default list."
+
+ set rr {chandra-ed.cfa.harvard.edu:28571 CFA Chandra-Ed Archive Server http://chandra-ed.cfa.harvard.edu/archive.html
+xray1.physics.rutgers.edu:28571 Rutgers Primary MOOC X-ray Analysis Server http://xray1.physics.rutgers.edu/archive.html
+rinzai.rutgers.edu:28571 Rutgers X-ray Analysis Server #2 http://rinzai.rutgers.edu/archive.html}
+
+ VOParse $varname $rr
+}
+
+proc VOFindServer {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global pvo
+ if {[VOCheckServer $varname $pvo(server)]} {
+ return
+ }
+ if {[VOCheckServer $varname {http://cxc.harvard.edu/chandraed/list.txt}]} {
+ return
+ }
+ if {[VOCheckServer $varname {http://cxc.harvard.edu/chandraed/test.txt}]} {
+ return
+ }
+ if {[VOCheckServer $varname {http://chandra-ed.rutgers.edu/vo/list.txt}]} {
+ return
+ }
+ if {[VOCheckServer $varname {http://chandra-ed.cfa.harvard.edu/vo/list.txt}]} {
+ return
+ }
+}
+
+proc VOCheckServer {varname url} {
+ upvar #0 $varname var
+ global $varname
+
+ ParseURL $url rr
+ set var(url) $url
+
+ if {[checkdns $rr(authority) 3 1] == 0} {
+ set var(url) $url
+ return 1
+ } else {
+ set var(url) {}
+ return 0
+ }
+}
+
+proc VOLoad {varname} {
+ upvar #0 $varname var
+ global $varname
+
+ global ihttp
+ if {$var(sync)} {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -timeout $ihttp(timeout) \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ VOFinish $varname $var(token)
+ } else {
+ VOLoadDefault $varname
+ }
+ } else {
+ if {![catch {set var(token) [http::geturl $var(url) \
+ -timeout $ihttp(timeout) \
+ -command [list VOFinish $varname] \
+ -headers "[ProxyHTTP]"]
+ }]} {
+ # reset errorInfo (may be set in http::geturl)
+ global errorInfo
+ set errorInfo {}
+
+ set var(active) 1
+ } else {
+ VOLoadDefault $varname
+ }
+ }
+}
+
+proc VOFinish {varname token} {
+ upvar #0 $varname var
+ global $varname
+
+ if {!($var(active))} {
+ VOCancelled $varname
+ return
+ }
+
+ upvar #0 $token t
+
+ # Code
+ set code [http::ncode $token]
+
+ # Meta
+ set meta $t(meta)
+
+ # Log it
+ HTTPLog $token
+
+ # Result?
+ switch -- $code {
+ 200 -
+ 203 -
+ 503 {
+ VOParse $varname [http::data $var(token)]
+ VODone $varname
+ }
+
+ 201 -
+ 300 -
+ 301 -
+ 302 -
+ 303 -
+ 305 -
+ 307 {
+ foreach {name value} $meta {
+ if {[regexp -nocase ^location$ $name]} {
+ global debug
+ if {$debug(tcl,http)} {
+ puts stderr "VOFinish redirect $code to $value"
+ }
+ # clean up and resubmit
+ http::cleanup $token
+ unset var(token)
+
+ set var(url) $value
+ VOLoad $varname
+ }
+ }
+ }
+
+ default {VOError $varname [msgcat::mc {An error has occurred while updating VO server list}]}
+ }
+}
+
+proc VOParse {varname rr} {
+ upvar #0 $varname var
+ global $varname
+
+ global ivo
+
+ set w $var(top)
+
+ set data [string trimright $rr \n]
+ set lines [split $data \n]
+ set len [llength $lines]
+ for {set ii 0} {$ii<$len} {incr ii} {
+ set line [lindex $lines $ii]
+ set b "$w.param.b$ii"
+
+ set ll [split $line \t]
+ lappend ivo(server,host) [lindex $ll 0]
+ lappend ivo(server,title) [lindex $ll 1]
+ lappend ivo(server,url) [lindex $ll 2]
+ lappend ivo(server,button) $b
+ set ivo(b$ii) 0
+ ttk::checkbutton $b -text "[lindex $ivo(server,title) $ii] ([lindex $ivo(server,url) $ii])" -variable ivo(b$ii) -command "VOCheck $varname $ii"
+ pack $b -anchor w -padx 2 -pady 2
+ }
+}
+
+proc VOCheck {varname ii} {
+ upvar #0 $varname var
+ global $varname
+
+ global ivo
+ global pvo
+
+ global xpa
+
+ set w $var(top)
+ set b "$w.param.b$ii"
+
+ if {$ivo(b$ii)} {
+ switch $pvo(method) {
+ mime {}
+ xpa {
+ if {[info exists xpa]} {
+ if {[catch {xparemote $xpa [lindex $ivo(server,host) $ii] + -proxy}]} {
+ Info [msgcat::mc {Unable to connect directly: using Web Proxy}]
+ set pvo(method) mime
+ }
+ }
+ }
+ }
+
+ if {$pvo(hv)} {
+ set url [lindex $ivo(server,url) $ii]
+ ParseURL $url r
+ HV "vo$ii" "$r(authority)" $url {} $var(sync)
+ }
+ } else {
+ switch $pvo(method) {
+ mime {}
+ xpa {
+ catch {xparemote $xpa [lindex $var(server,host) $ii] - -proxy}
+ }
+ }
+ }
+
+ # start or stop the keep-alive, as needed
+ VOKeepAlive 0
+}
+
+proc PrefsVOMethod {} {
+ global pvo
+
+ switch $pvo(method) {
+ mime {set pvo(hv) 1}
+ xpa {}
+ }
+}
+
+proc PrefsDialogVO {} {
+ global dprefs
+
+ set w $dprefs(tab)
+
+ $dprefs(list) insert end [msgcat::mc {VO}]
+ lappend dprefs(tabs) [ttk::frame $w.vo]
+
+ # Browser
+ set f [ttk::labelframe $w.vo.browser -text [msgcat::mc {Browser}]]
+
+ ttk::checkbutton $f.web -text [msgcat::mc {Use Internal Web Browser}] \
+ -variable pvo(hv)
+ ttk::radiobutton $f.xpa -text [msgcat::mc {Connect Directly}] \
+ -variable pvo(method) -value xpa -command PrefsVOMethod
+ ttk::radiobutton $f.mime -text [msgcat::mc {Connect Using Web Proxy}] \
+ -variable pvo(method) -value mime -command PrefsVOMethod
+
+ grid $f.web -padx 2 -pady 2 -sticky w
+ grid $f.xpa $f.mime -padx 2 -pady 2 -sticky w
+
+ # Server
+ set f [ttk::labelframe $w.vo.server -text [msgcat::mc {VO Server}]]
+
+ ttk::label $f.stitle -text [msgcat::mc {Default}]
+ ttk::entry $f.server -textvariable pvo(server) -width 50
+
+ grid $f.stitle $f.server -padx 2 -pady 2 -sticky w
+
+ # Keep-Alive
+ set f [ttk::labelframe $w.vo.keep -text [msgcat::mc {Keep-Alive}]]
+
+ ttk::label $f.dtitle -text [msgcat::mc {Minutes}]
+ ttk::entry $f.delay -textvariable pvo(delay) -width 5
+
+ grid $f.dtitle $f.delay -padx 2 -pady 2 -sticky w
+
+ pack $w.vo.browser $w.vo.server $w.vo.keep -side top -fill both -expand true
+}
+
+proc ProcessVOCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ set vvarname voi
+ upvar #0 $vvarname vvar
+ global $vvarname
+
+ global ivo
+ global pvo
+
+ switch -- [string tolower [lindex $var $i]] {
+ open {VODialog}
+ close {VODestroy $vvarname}
+ method {
+ incr i
+ set pvo(method) [lindex $var $i]
+ }
+ server {
+ incr i
+ set pvo(server) [lindex $var $i]
+ }
+ internal {
+ incr i
+ set pvo(hv) [FromYesNo [lindex $var $i]]
+ }
+ delay {
+ incr i
+ set pvo(delay) [lindex $var $i]
+ }
+ connect {
+ incr i
+
+ VODialog 1
+
+ # find best match
+ set ii [lsearch $ivo(server,url) "*[lindex $var $i]*"]
+ if {$ii>=0} {
+ set ivo(b$ii) 1
+ VOCheck $vvarname $ii
+ }
+ }
+ disconnect {
+ incr i
+
+ VODialog 1
+
+ # find best match
+ set ii [lsearch $ivo(server,url) "*[lindex $var $i]*"]
+ if {$ii>=0} {
+ set ivo(b$ii) 0
+ VOCheck $vvarname $ii
+ }
+ }
+ default {
+ VODialog 1
+
+ # find best match
+ set ii [lsearch $ivo(server,url) "*[lindex $var $i]*"]
+ if {$ii>=0} {
+ set ivo(b$ii) 1
+ VOCheck $vvarname $ii
+ }
+ }
+ }
+}
+
+proc ProcessSendVOCmd {proc id param} {
+ global ivo
+ global pvo
+
+ switch -- [string tolower $param] {
+ method {$proc $id "$pvo(method)\n"}
+ server {$proc $id "$pvo(server)\n"}
+ internal {$proc $id [ToYesNo $pvo(hv)]}
+ delay {$proc $id "$pvo(delay)\n"}
+ connect {
+ # current connections
+ set len [llength $ivo(server,button)]
+ set rr {}
+ for {set ii 0} {$ii<$len} {incr ii} {
+ if {$ivo(b$ii)} {
+ append rr "[lindex $ivo(server,host) $ii] [lindex $ivo(server,title) $ii] [lindex $ivo(server,url) $ii] $ivo(b$ii)\n"
+ }
+ }
+ $proc $id $rr
+ }
+ default {
+ VODialog 1
+ # all possible connections
+ set len [llength $ivo(server,button)]
+ set rr {}
+ for {set ii 0} {$ii<$len} {incr ii} {
+ append rr "[lindex $ivo(server,host) $ii] [lindex $ivo(server,title) $ii] [lindex $ivo(server,url) $ii] $ivo(b$ii)\n"
+ }
+ $proc $id $rr
+ }
+ }
+}
+
diff --git a/ds9/library/vot.tcl b/ds9/library/vot.tcl
new file mode 100644
index 0000000..da7bc80
--- /dev/null
+++ b/ds9/library/vot.tcl
@@ -0,0 +1,386 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc VOTParse {t token} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ global debug
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "VOTParse"
+ }
+
+# set fp [open debug.xml w]
+# puts $fp [http::data $token]
+# close $fp
+
+ set xml [xml::parser \
+ -characterdatacommand [list VOTCharCB $t] \
+ -elementstartcommand [list VOTElemStartCB $t] \
+ -elementendcommand [list VOTElemEndCB $t] \
+ -ignorewhitespace 1 \
+ ]
+
+ set T(tree,state) {}
+ set T(tree,prev) {}
+ if {[catch {$xml parse [http::data $token]} err]} {
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "VOTParse: $err"
+ }
+ }
+
+ $xml free
+}
+
+proc VOTRead {t fn} {
+ upvar #0 $t T
+ global $t
+
+ global debug
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "VOTRead"
+ }
+
+ if {$fn == {}} {
+ return
+ }
+
+ catch {
+ set fp [open $fn r]
+
+ set xml [xml::parser \
+ -characterdatacommand [list VOTCharCB $t]\
+ -elementstartcommand [list VOTElemStartCB $t] \
+ -elementendcommand [list VOTElemEndCB $t] \
+ -ignorewhitespace 1 \
+ ]
+
+ set T(tree,state) {}
+ set T(tree,prev) {}
+ if {[catch {$xml parse [read $fp]} err]} {
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "VOTRead: $err"
+ }
+ }
+
+ $xml free
+
+ close $fp
+ }
+}
+
+proc VOTWrite {t fn} {
+ upvar #0 $t T
+ global $t
+
+ global debug
+ if {$debug(tcl,cat) || $debug(tcl,sia)} {
+ puts stderr "VOTWrite"
+ }
+
+ if {$fn == {}} {
+ return
+ }
+
+ set fp [open $fn w]
+
+ set nr $T(Nrows)
+ set nc $T(Ncols)
+
+ puts $fp {<?xml version="1.0" encoding="UTF-8"?>}
+ puts $fp {<VOTABLE version="1.1">}
+ puts $fp {<RESOURCE>}
+ puts $fp {<TABLE>}
+
+ # header
+ puts -nonewline $fp {<DESCRIPTION>}
+ set nh [expr $T(HLines)-1]
+ for {set hh 1} {$hh < $nh} {incr hh} {
+ puts $fp [XMLQuote "$T(H_$hh)"]
+ }
+ puts $fp {</DESCRIPTION>}
+
+ # cols
+ for {set cc 1} {$cc <= $nc} {incr cc} {
+ puts -nonewline $fp {<FIELD }
+ # required
+ puts -nonewline $fp "name=\"[XMLQuote [lindex $T(Header) [expr $cc-1]]]\" "
+ # required
+ if {[info exists ${t}(DataType)]} {
+ puts -nonewline $fp "datatype=\"[XMLQuote [lindex $T(DataType) [expr $cc-1]]]\" "
+ } else {
+ puts -nonewline $fp "datatype=\"char\" arraysize=\"*\" "
+ }
+
+ if {[info exists ${t}(Id)]} {
+ if {[lindex $T(Id) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "ID=\"[XMLQuote [lindex $T(Id) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(ArraySize)]} {
+ if {[lindex $T(ArraySize) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "arraysize=\"[XMLQuote [lindex $T(ArraySize) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(Width)]} {
+ if {[lindex $T(Width) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "width=\"[XMLQuote [lindex $T(Width) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(Precision)]} {
+ if {[lindex $T(Precision) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "precision=\"[XMLQuote [lindex $T(Precision) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(Unit)]} {
+ if {[lindex $T(Unit) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "unit=\"[XMLQuote [lindex $T(Unit) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(Ref)]} {
+ if {[lindex $T(Ref) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "ref=\"[XMLQuote [lindex $T(Ref) [expr $cc-1]]]\" "
+ }
+ }
+ if {[info exists ${t}(Ucd)]} {
+ if {[lindex $T(Ucd) [expr $cc-1]] != {}} {
+ puts -nonewline $fp "ucd=\"[XMLQuote [lindex $T(Ucd) [expr $cc-1]]]\" "
+ }
+ }
+
+ puts $fp {>}
+
+ if {[info exists ${t}(Description)]} {
+ if {[lindex $T(Description) [expr $cc-1]] != {}} {
+ puts -nonewline $fp {<DESCRIPTION>}
+ puts -nonewline $fp "[XMLQuote [lindex $T(Description) [expr $cc-1]]]"
+ puts $fp {</DESCRIPTION>}
+ }
+ }
+
+ puts $fp {</FIELD>}
+ }
+
+ # data
+ puts $fp {<DATA>}
+ puts $fp {<TABLEDATA>}
+
+ for {set rr 1} {$rr <= $nr} {incr rr} {
+ puts -nonewline $fp {<TR>}
+ for {set cc 1} {$cc <= $nc} {incr cc} {
+ puts -nonewline $fp "<TD>[XMLQuote $T($rr,$cc)]</TD>"
+ }
+ puts $fp {</TR>}
+ }
+
+ # clean up
+ puts $fp {</TABLEDATA>}
+ puts $fp {</DATA>}
+ puts $fp {</TABLE>}
+ puts $fp {</RESOURCE>}
+ puts $fp {</VOTABLE>}
+
+ close $fp
+}
+
+# Callbacks
+
+proc VOTCharCB {t data} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ switch -- $T(tree,state) {
+ TD {
+ set r $T(Nrows)
+ set c $T(cnt)
+ set T($r,$c) [string trim $data]
+ }
+ DESCRIPTION {
+ set data [string trim $data]
+ if {$data != {}} {
+ switch -- $T(tree,prev) {
+ VOTABLE -
+ RESOURCE -
+ TABLE {
+ foreach ll [split [string trim $data] "\n"] {
+ incr ${t}(HLines)
+ set n $T(HLines)
+ if {[string range $ll 0 0] == {#}} {
+ set T(H_$n) "$ll"
+ } else {
+ set T(H_$n) "# $ll"
+ }
+ }
+ }
+ FIELD {
+ set T(Description) \
+ [lreplace $T(Description) end end $data]
+ }
+ }
+ }
+ }
+ }
+
+ # sometimes, we get a bogus call, (ignore whitespace does not work)
+ set T(tree,state) {}
+ return {}
+}
+
+proc VOTElemStartCB {t name attlist args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ switch -- $name {
+ VOTABLE {
+ # init db
+ set T(Nrows) 0
+ set T(Ncols) 0
+ set T(Header) {}
+ set T(HLines) 0
+ set T(tree,prev) $name
+ }
+ FIELD {
+ set fname {}
+ set id {}
+ set datatype {}
+ set arraysize {}
+ set width {}
+ set precision {}
+ set unit {}
+ set ref {}
+ set ucd {}
+ foreach {key value} $attlist {
+ switch -- [string tolower $key] {
+ name {set fname "$value"}
+ id {set id "$value"}
+ datatype {set datatype $value}
+ arraysize {set arraysize $value}
+ width {set width $value}
+ precision {set precision $value}
+ unit {set unit "$value"}
+ ref {set ref "$value"}
+ ucd {set ucd "$value"}
+ }
+ }
+ if {$fname != {}} {
+ lappend ${t}(Header) "$fname"
+ } else {
+ lappend ${t}(Header) "$id"
+ }
+ lappend ${t}(Id) "$id"
+ lappend ${t}(DataType) $datatype
+ lappend ${t}(ArraySize) $arraysize
+ lappend ${t}(Width) $width
+ lappend ${t}(Precision) $precision
+ lappend ${t}(Unit) "$unit"
+ lappend ${t}(Ref) "$ref"
+ lappend ${t}(Ucd) "$ucd"
+
+ # filled in later
+ lappend ${t}(Description) {}
+
+ set T(tree,prev) $name
+ }
+ TABLEDATA {
+ # ok, we now need to build the header
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) [join $T(Header)]
+
+ set T(Dashes) [regsub -all {[A-Za-z0-9]} $T(H_$n) {-}]
+ set T(Ndshs) [llength $T(Header)]
+
+ incr ${t}(HLines)
+ set n $T(HLines)
+ set T(H_$n) [join $T(Dashes)]
+
+ starbase_colmap $t
+ }
+ TR {
+ incr ${t}(Nrows)
+ set T(cnt) 0
+ }
+ TD {
+ incr ${t}(cnt)
+
+ set r $T(Nrows)
+ set c $T(cnt)
+ set T($r,$c) {}
+ }
+
+ RESOURCE -
+ TABLE {
+ set T(tree,prev) $name
+ }
+
+ FIELDref -
+ DESCRIPTION -
+ COOSYS -
+ PARAM -
+ PARAMref -
+ INFO -
+ LINK -
+ GROUP -
+ DATA -
+ BINARY -
+ STREAM -
+ FITS -
+ VALUES -
+ MIN -
+ MAX -
+ OPTION -
+ DEFINITIONS {}
+
+ default {return -code error}
+ }
+
+ set ${t}(tree,state) $name
+ return {}
+}
+
+proc VOTElemEndCB {t name args} {
+ upvar #0 $t T
+ global $t
+ global debug
+
+ # we can't count on this being called for all end-tags
+ switch -- $name {
+ TABLEDATA {
+ # ok, we're done
+ return -code break
+ }
+ VOTABLE -
+ FIELD -
+ FIELDref -
+ TR -
+ TD -
+ RESOURCE -
+ TABLE -
+ DESCRIPTION -
+ COOSYS -
+ PARAM -
+ PARAMref -
+ INFO -
+ LINK -
+ GROUP -
+ DATA -
+ BINARY -
+ STREAM -
+ FITS -
+ VALUES -
+ MIN -
+ MAX -
+ OPTION -
+ DEFINITIONS {}
+
+ default {return -code error}
+ }
+ return {}
+}
+
diff --git a/ds9/library/wcs.tcl b/ds9/library/wcs.tcl
new file mode 100644
index 0000000..d6f80e6
--- /dev/null
+++ b/ds9/library/wcs.tcl
@@ -0,0 +1,1296 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc WCSDef {} {
+ global wcs
+ global pwcs
+ global iwcs
+
+ set iwcs(top) .wcs
+ set iwcs(mb) .wcsmb
+
+ set wcs(system) wcs
+ set wcs(sky) fk5
+ set wcs(skyformat) sexagesimal
+
+ array set pwcs [array get wcs]
+}
+
+proc UpdateWCS {} {
+ global wcs
+ global ds9
+ global current
+
+ # frame
+ if {$current(frame) != {}} {
+ $current(frame) wcs $wcs(system) $wcs(sky) $wcs(skyformat)
+
+ AlignWCSFrame
+ set wcs(frame) $current(frame)
+ if {[$current(frame) has fits]} {
+ CoordMenuEnable $ds9(mb).wcs wcs system 0 sky skyformat
+ } else {
+ CoordMenuReset $ds9(mb).wcs wcs system 0 sky skyformat
+ }
+ UpdateWCSInfoBox $current(frame)
+ }
+
+ # grid
+ global grid
+ set grid(system) $wcs(system)
+ set grid(sky) $wcs(sky)
+ set grid(skyformat) $wcs(skyformat)
+ GridUpdateCurrent
+
+ # panzoom dialog
+ global panzoom
+ set panzoom(system) $wcs(system)
+ set panzoom(sky) $wcs(sky)
+ set panzoom(skyformat) $wcs(skyformat)
+ UpdatePanZoomDialog
+
+ # crosshair dialog
+ global crosshair
+ set crosshair(system) $wcs(system)
+ set crosshair(sky) $wcs(sky)
+ set crosshair(skyformat) $wcs(skyformat)
+ UpdateCrosshairDialog
+
+ # crop dialog
+ global crop
+ set crop(system) $wcs(system)
+ set crop(sky) $wcs(sky)
+ set crop(skyformat) $wcs(skyformat)
+ UpdateCropDialog
+
+ # cube
+ global cube
+ set cube(system) $wcs(system)
+ UpdateCubeDialog
+
+ # rgb
+ global rgb
+ set rgb(system) $wcs(system)
+ RGBSystem
+
+ # regions
+ global marker
+ set marker(system) $wcs(system)
+ set marker(sky) $wcs(sky)
+ set marker(skyformat) $wcs(skyformat)
+ AdjustCoordSystem marker system
+}
+
+proc UpdateWCSInfoBox {which} {
+ global wcs
+ global view
+
+ # if one wcs coord system is visible, change it
+ set cnt 0
+ set vv {}
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ if {$view(info,wcs$ll)} {
+ incr cnt
+ set vv wcs$ll
+ }
+ }
+ if {$cnt == 1} {
+ set ww [lindex [$which get wcs] 0]
+ if {$view(info,$vv) != $view(info,$ww)} {
+ foreach ll {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set view(info,wcs$ll) 0
+ }
+ set view(info,$ww) 1
+ LayoutInfoPanel
+ }
+ }
+}
+
+proc WCSBackup {ch which fdir rdir} {
+ # simple case
+ puts $ch "$which wcs [$which get wcs]"
+ if {[$which has wcs alt]} {
+ set fn $fdir/ds9.wcs
+ set rfn $rdir/ds9.wcs
+
+ catch {file delete -force $fn}
+ WCSToVar [$which get fits header wcs 1]
+ WCSSaveFile $fn
+ puts $ch "WCSLoadFile $rfn"
+ puts $ch "$which wcs replace text 1 \\\{\[WCSFromVar\]\\\}"
+ }
+}
+
+proc WCSDialog {} {
+ global wcs
+ global iwcs
+ global dwcs
+ global ds9
+
+ # see if we already have a window visible
+ if {[winfo exists $iwcs(top)]} {
+ raise $iwcs(top)
+ return
+ }
+
+ # create the window
+ set w $iwcs(top)
+ set mb $iwcs(mb)
+
+ # vars
+ set dwcs(system) $wcs(system)
+ set dwcs(ext) 1
+ set dwcs(prev) {}
+
+ Toplevel $w $mb 6 [msgcat::mc {WCS Parameters}] WCSDestroyDialog
+
+ $mb add cascade -label [msgcat::mc {File}] -menu $mb.file
+ $mb add cascade -label [msgcat::mc {Edit}] -menu $mb.edit
+ $mb add cascade -label [msgcat::mc {WCS}] -menu $mb.wcs
+ $mb add cascade -label [msgcat::mc {Extention}] -menu $mb.ext
+
+ menu $mb.file
+ $mb.file add command -label [msgcat::mc {Apply}] -command WCSApplyDialog
+ $mb.file add command -label [msgcat::mc {Reset}] -command WCSResetDialog
+ $mb.file add separator
+ $mb.file add command -label "[msgcat::mc {Load}]..." -command WCSLoadDialog
+ $mb.file add command -label "[msgcat::mc {Save}]..." -command WCSSaveDialog
+ $mb.file add separator
+ $mb.file add command -label [msgcat::mc {Close}] -command WCSDestroyDialog
+
+ EditMenu $mb iwcs
+
+ menu $mb.wcs
+ $mb.wcs add radiobutton -label [msgcat::mc {WCS}] \
+ -variable dwcs(system) -value wcs -command ConfigWCSDialog
+ $mb.wcs add separator
+ foreach l {a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ $mb.wcs add radiobutton -label "[msgcat::mc {WCS}] $l" \
+ -variable dwcs(system) -value "wcs$l" -command ConfigWCSDialog
+ }
+
+ # configured later
+ menu $mb.ext
+
+ # Param
+ set tt [ttk::notebook $w.param]
+ set base [ttk::frame $tt.base]
+ set pv00 [ttk::frame $tt.pv00]
+ set pv12 [ttk::frame $tt.pv12]
+ set pv24 [ttk::frame $tt.pv24]
+ set ab0 [ttk::frame $tt.ab0]
+ set ab2 [ttk::frame $tt.ab2]
+ set ab4 [ttk::frame $tt.ab4]
+ set apbp0 [ttk::frame $tt.apbp0]
+ set apbp2 [ttk::frame $tt.apbp2]
+ set apbp4 [ttk::frame $tt.apbp4]
+ $tt add $base -text {Keyword}
+ $tt add $pv00 -text {PVi_00}
+ $tt add $pv12 -text {PVi_12}
+ $tt add $pv24 -text {PVi_24}
+ $tt add $ab0 -text {A_0}
+ $tt add $ab2 -text {A_2}
+ $tt add $ab4 -text {A_4}
+ $tt add $apbp0 -text {AP_0}
+ $tt add $apbp2 -text {AP_2}
+ $tt add $apbp4 -text {AP_4}
+ $tt select $base
+
+ ttk::label $base.tmjdobs -text "MJD-OBS"
+ ttk::entry $base.mjdobs -textvariable dwcs(mjd-obs) -width 14
+
+ ttk::label $base.tdateobs -text "DATE-OBS"
+ ttk::entry $base.dateobs -textvariable dwcs(date-obs) -width 14
+
+ ttk::label $base.tdate -text "DATE"
+ ttk::entry $base.date -textvariable dwcs(date) -width 14
+
+ ttk::label $base.tepoch -text "EPOCH"
+ ttk::entry $base.epoch -textvariable dwcs(epoch) -width 14
+
+ foreach aa {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set bb [string toupper $aa]
+
+ ttk::label $base.twcsname${aa} -text "WCSNAME${bb}"
+ ttk::entry $base.wcsname${aa} \
+ -textvariable dwcs(wcsname${aa}) -width 14
+
+ ttk::label $base.tradesys${aa} -text "RADESYS${bb}"
+ ttk::entry $base.radesys${aa} \
+ -textvariable dwcs(radesys${aa}) -width 14
+
+ ttk::label $base.tequinox${aa} -text "EQUINOX${bb}"
+ ttk::entry $base.equinox${aa} \
+ -textvariable dwcs(equinox${aa}) -width 14
+
+ ttk::label $base.tlatpole${aa} -text "LATPOLE${bb}"
+ ttk::entry $base.latpole${aa} \
+ -textvariable dwcs(latpole${aa}) -width 14
+
+ ttk::label $base.tlonpole${aa} -text "LONPOLE${bb}"
+ ttk::entry $base.lonpole${aa} \
+ -textvariable dwcs(lonpole${aa}) -width 14
+
+ for {set ii 1} {$ii<=3} {incr ii} {
+ ttk::label $base.tctype${ii}${aa} -text "CTYPE${ii}${bb}"
+ ttk::entry $base.ctype${ii}${aa} \
+ -textvariable dwcs(ctype${ii}${aa}) -width 14
+
+ ttk::label $base.tcrpix${ii}${aa} -text "CRPIX${ii}${bb}"
+ ttk::entry $base.crpix${ii}${aa} \
+ -textvariable dwcs(crpix${ii}${aa}) -width 14
+
+ ttk::label $base.tcrval${ii}${aa} -text "CRVAL${ii}${bb}"
+ ttk::entry $base.crval${ii}${aa} \
+ -textvariable dwcs(crval${ii}${aa}) -width 14
+
+ ttk::label $base.tcunit${ii}${aa} -text "CUNIT${ii}${bb}"
+ ttk::entry $base.cunit${ii}${aa} \
+ -textvariable dwcs(cunit${ii}${aa}) -width 14
+
+ ttk::label $base.tcdelt${ii}${aa} -text "CDELT${ii}${bb}"
+ ttk::entry $base.cdelt${ii}${aa} \
+ -textvariable dwcs(cdelt${ii}${aa}) -width 14
+ }
+
+ for {set ii 1} {$ii<=2} {incr ii} {
+ for {set jj 1} {$jj<=2} {incr jj} {
+ ttk::label $base.tcd${ii}_${jj}${aa} -text "CD${ii}_${jj}${bb}"
+ ttk::entry $base.cd${ii}_${jj}${aa} \
+ -textvariable dwcs(cd${ii}_${jj}${aa}) -width 14
+ }
+ for {set jj 1} {$jj<=2} {incr jj} {
+ ttk::label $base.tpc${ii}_${jj}${aa} \
+ -text "PC${ii}_${jj}${bb}"
+ ttk::entry $base.pc${ii}_${jj}${aa} \
+ -textvariable dwcs(pc${ii}_${jj}${aa}) -width 14
+ }
+
+ for {set mm 0} {$mm<12} {incr mm} {
+ ttk::label $pv00.tpv${ii}_${mm}${aa} \
+ -text "PV${ii}_${mm}${bb}"
+ ttk::entry $pv00.pv${ii}_${mm}${aa} \
+ -textvariable dwcs(pv${ii}_${mm}${aa}) -width 14
+ }
+ for {set mm 12} {$mm<24} {incr mm} {
+ ttk::label $pv12.tpv${ii}_${mm}${aa} \
+ -text "PV${ii}_${mm}${bb}"
+ ttk::entry $pv12.pv${ii}_${mm}${aa} \
+ -textvariable dwcs(pv${ii}_${mm}${aa}) -width 14
+ }
+ for {set mm 24} {$mm<36} {incr mm} {
+ ttk::label $pv24.tpv${ii}_${mm}${aa} \
+ -text "PV${ii}_${mm}${bb}"
+ ttk::entry $pv24.pv${ii}_${mm}${aa} \
+ -textvariable dwcs(pv${ii}_${mm}${aa}) -width 14
+ }
+ }
+
+ ttk::label $base.tcd3_3${aa} -text "CD3_3${bb}"
+ ttk::entry $base.cd3_3${aa} -textvariable dwcs(cd3_3${aa}) -width 14
+ ttk::label $base.tpc3_3${aa} -text "PC3_3${bb}"
+ ttk::entry $base.pc3_3${aa} -textvariable dwcs(pc3_3${aa}) -width 14
+ }
+
+ # only in primary
+ ttk::label $ab0.ta -text "A_ORDER"
+ ttk::entry $ab0.a -textvariable dwcs(a_order) -width 14
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab0.ta_${mm}_${nn} -text "A_${mm}_${nn}"
+ ttk::entry $ab0.a_${mm}_${nn} \
+ -textvariable dwcs(a_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab2.ta_${mm}_${nn} -text "A_${mm}_${nn}"
+ ttk::entry $ab2.a_${mm}_${nn} \
+ -textvariable dwcs(a_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab4.ta_${mm}_${nn} -text "A_${mm}_${nn}"
+ ttk::entry $ab4.a_${mm}_${nn} \
+ -textvariable dwcs(a_${mm}_${nn}) -width 14
+ }
+ }
+
+ ttk::label $ab0.tb -text "B_ORDER"
+ ttk::entry $ab0.b -textvariable dwcs(b_order) -width 14
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab0.tb_${mm}_${nn} -text "B_${mm}_${nn}"
+ ttk::entry $ab0.b_${mm}_${nn} \
+ -textvariable dwcs(b_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab2.tb_${mm}_${nn} -text "B_${mm}_${nn}"
+ ttk::entry $ab2.b_${mm}_${nn} \
+ -textvariable dwcs(b_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $ab4.tb_${mm}_${nn} -text "B_${mm}_${nn}"
+ ttk::entry $ab4.b_${mm}_${nn} \
+ -textvariable dwcs(b_${mm}_${nn}) -width 14
+ }
+ }
+
+ ttk::label $apbp0.tap -text "AP_ORDER"
+ ttk::entry $apbp0.ap -textvariable dwcs(ap_order) -width 14
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp0.tap_${mm}_${nn} -text "AP_${mm}_${nn}"
+ ttk::entry $apbp0.ap_${mm}_${nn} \
+ -textvariable dwcs(ap_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp2.tap_${mm}_${nn} -text "AP_${mm}_${nn}"
+ ttk::entry $apbp2.ap_${mm}_${nn} \
+ -textvariable dwcs(ap_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp4.tap_${mm}_${nn} -text "AP_${mm}_${nn}"
+ ttk::entry $apbp4.ap_${mm}_${nn} \
+ -textvariable dwcs(ap_${mm}_${nn}) -width 14
+ }
+ }
+
+ ttk::label $apbp0.tbp -text "BP_ORDER"
+ ttk::entry $apbp0.bp -textvariable dwcs(bp_order) -width 14
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp0.tbp_${mm}_${nn} -text "BP_${mm}_${nn}"
+ ttk::entry $apbp0.bp_${mm}_${nn} \
+ -textvariable dwcs(bp_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp2.tbp_${mm}_${nn} -text "BP_${mm}_${nn}"
+ ttk::entry $apbp2.bp_${mm}_${nn} \
+ -textvariable dwcs(bp_${mm}_${nn}) -width 14
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ ttk::label $apbp4.tbp_${mm}_${nn} -text "BP_${mm}_${nn}"
+ ttk::entry $apbp4.bp_${mm}_${nn} \
+ -textvariable dwcs(bp_${mm}_${nn}) -width 14
+ }
+ }
+
+ # Buttons
+ set f [ttk::frame $w.buttons]
+ ttk::button $f.apply -text [msgcat::mc {Apply}] -command WCSApplyDialog
+ ttk::button $f.reset -text [msgcat::mc {Reset}] -command WCSResetDialog
+ ttk::button $f.close -text [msgcat::mc {Close}] -command WCSDestroyDialog
+ pack $f.apply $f.reset $f.close -side left -expand true -padx 2 -pady 4
+
+ # Fini
+ pack $w.buttons -side bottom -fill x
+ pack $w.param -side top -fill both -expand true
+
+ ConfigWCSDialog
+ UpdateWCSDialog
+}
+
+proc WCSApplyDialog {} {
+ global dwcs
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLock rgb(lock,wcs) $current(frame) "$current(frame) wcs replace text $dwcs(ext) \{\{[WCSFromVar]\}\}"
+ UpdateWCS
+ CATUpdateWCS
+ }
+}
+
+proc WCSResetDialog {} {
+ global dwcs
+ global current
+ global rgb
+
+ if {$current(frame) != {}} {
+ RGBEvalLock rgb(lock,wcs) $current(frame) [list $current(frame) wcs reset $dwcs(ext)]
+ UpdateWCS
+ CATUpdateWCS
+ UpdateWCSDialog
+ }
+}
+
+proc WCSDestroyDialog {} {
+ global iwcs
+ global dwcs
+
+ if {[winfo exists $iwcs(top)]} {
+ destroy $iwcs(top)
+ destroy $iwcs(mb)
+ }
+
+ unset dwcs
+}
+
+proc WCSSaveDialog {} {
+ global dwcs
+
+ set fn [SaveFileDialog wcsfbox]
+ WCSSaveFile $fn
+}
+
+# used by backup
+proc WCSSaveFile {fn} {
+ if {[catch {open $fn w} fp]} {
+ Error "[msgcat::mc {Unable to open file}] $fn: $fp"
+ return
+ }
+ puts $fp [WCSFromVar]
+ catch {close $fp}
+}
+
+proc WCSLoadDialog {} {
+ global dwcs
+
+ set fn [OpenFileDialog wcsfbox]
+ WCSLoadFile $fn
+}
+
+# used by backup
+proc WCSLoadFile {fn} {
+ if {$fn != {}} {
+ if {[catch {open $fn r} fp]} {
+ Error "[msgcat::mc {Unable to open file}] $fn: $fp"
+ return
+ }
+ WCSToVar [read -nonewline $fp]
+ catch {close $fp}
+ }
+}
+
+proc UpdateWCSDialog {} {
+ global iwcs
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "UpdateWCSDialog"
+ }
+
+ if {![winfo exists $iwcs(top)]} {
+ return
+ }
+
+ ConfigWCSDialogExtMenu
+ UpdateWCSVars
+}
+
+proc UpdateWCSVars {} {
+ global dwcs
+ global current
+
+ if {$current(frame) != {}} {
+ if {[$current(frame) has fits]} {
+ WCSToVar [$current(frame) get fits header wcs $dwcs(ext)]
+ return
+ }
+ }
+
+ WCSToVar {}
+}
+
+proc ConfigWCSDialog {{force {0}}} {
+ global wcs
+ global iwcs
+ global dwcs
+ global current
+
+ global debug
+ if {$debug(tcl,update)} {
+ puts stderr "ConfigWCSDialog"
+ }
+
+ if {![winfo exists $iwcs(top)]} {
+ return
+ }
+
+ # do we need to re-grid wcs vars?
+ if {!$force && $dwcs(prev) == $dwcs(system)} {
+ return
+ }
+
+ set tt $iwcs(top).param
+ set base $tt.base
+ set pv00 $tt.pv00
+ set pv12 $tt.pv12
+ set pv24 $tt.pv24
+ set ab0 $tt.ab0
+ set ab2 $tt.ab2
+ set ab4 $tt.ab4
+ set apbp0 $tt.apbp0
+ set apbp2 $tt.apbp2
+ set apbp4 $tt.apbp4
+
+ grid forget $base.tmjdobs $base.mjdobs
+ grid forget $base.tdateobs $base.dateobs
+ grid forget $base.tdate $base.date
+ grid forget $base.tepoch $base.epoch
+
+ # forget current sys vars
+ set aa [string tolower [string range $dwcs(prev) 3 3]]
+
+ grid forget $base.twcsname${aa} $base.wcsname${aa}
+ grid forget $base.tradesys${aa} $base.radesys${aa}
+ grid forget $base.tequinox${aa} $base.equinox${aa}
+ grid forget $base.tlatpole${aa} $base.latpole${aa}
+ grid forget $base.tlonpole${aa} $base.lonpole${aa}
+
+ for {set ii 1} {$ii<=3} {incr ii} {
+ grid forget $base.tctype${ii}${aa} $base.ctype${ii}${aa}
+ grid forget $base.tcunit${ii}${aa} $base.cunit${ii}${aa}
+ grid forget $base.tcrpix${ii}${aa} $base.crpix${ii}${aa}
+ grid forget $base.tcrval${ii}${aa} $base.crval${ii}${aa}
+ grid forget $base.tcdelt${ii}${aa} $base.cdelt${ii}${aa}
+ }
+
+ for {set ii 1} {$ii<=2} {incr ii} {
+ for {set jj 1} {$jj<=2} {incr jj} {
+ grid forget $base.tcd${ii}_${jj}${aa} $base.cd${ii}_${jj}${aa}
+ grid forget $base.tpc${ii}_${jj}${aa} $base.pc${ii}_${jj}${aa}
+ }
+
+ for {set mm 0} {$mm<12} {incr mm} {
+ grid forget $pv00.tpv${ii}_${mm}${aa} $pv00.pv${ii}_${mm}${aa}
+ }
+ for {set mm 12} {$mm<24} {incr mm} {
+ grid forget $pv12.tpv${ii}_${mm}${aa} $pv12.pv${ii}_${mm}${aa}
+ }
+ for {set mm 24} {$mm<36} {incr mm} {
+ grid forget $pv24.tpv${ii}_${mm}${aa} $pv24.pv${ii}_${mm}${aa}
+ }
+ }
+
+ grid forget $base.tcd3_3${aa} $base.cd3_3${aa}
+ grid forget $base.tpc3_3${aa} $base.pc3_3${aa}
+
+ # only in primary
+ grid forget $ab0.ta $ab0.a
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab0.ta_${mm}_${nn} $ab0.a_${mm}_${nn}
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab2.ta_${mm}_${nn} $ab2.a_${mm}_${nn}
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab4.ta_${mm}_${nn} $ab4.a_${mm}_${nn}
+ }
+ }
+
+ grid forget $ab0.tb $ab0.b
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab0.tb_${mm}_${nn} $ab0.b_${mm}_${nn}
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab2.tb_${mm}_${nn} $ab2.b_${mm}_${nn}
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $ab4.tb_${mm}_${nn} $ab4.b_${mm}_${nn}
+ }
+ }
+
+ grid forget $apbp0.tap $apbp0.ap
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp0.tap_${mm}_${nn} $apbp0.ap_${mm}_${nn}
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp2.tap_${mm}_${nn} $apbp2.ap_${mm}_${nn}
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp4.tap_${mm}_${nn} $apbp4.ap_${mm}_${nn}
+ }
+ }
+
+ grid forget $apbp0.tbp $apbp0.bp
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp0.tbp_${mm}_${nn} $apbp0.bp_${mm}_${nn}
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp2.tbp_${mm}_${nn} $apbp2.bp_${mm}_${nn}
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid forget $apbp4.tbp_${mm}_${nn} $apbp4.bp_${mm}_${nn}
+ }
+ }
+
+ # display new sys vars
+ set dwcs(prev) $dwcs(system)
+ set aa [string tolower [string range $dwcs(system) 3 3]]
+
+ grid $base.twcsname${aa} $base.wcsname${aa} -padx 2 -pady 2 -sticky w
+ grid $base.tradesys${aa} $base.radesys${aa} -padx 2 -pady 2 -sticky w
+
+ grid $base.tequinox${aa} $base.equinox${aa} \
+ $base.tepoch $base.epoch -padx 2 -pady 2 -sticky w
+ grid $base.tmjdobs $base.mjdobs \
+ $base.tdateobs $base.dateobs \
+ $base.tdate $base.date \
+ -padx 2 -pady 2 -sticky w
+
+ grid $base.tctype1${aa} $base.ctype1${aa} \
+ $base.tctype2${aa} $base.ctype2${aa} \
+ $base.tctype3${aa} $base.ctype3${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tcrpix1${aa} $base.crpix1${aa} \
+ $base.tcrpix2${aa} $base.crpix2${aa} \
+ $base.tcrpix3${aa} $base.crpix3${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tcrval1${aa} $base.crval1${aa} \
+ $base.tcrval2${aa} $base.crval2${aa} \
+ $base.tcrval3${aa} $base.crval3${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tcunit1${aa} $base.cunit1${aa} \
+ $base.tcunit2${aa} $base.cunit2${aa} \
+ $base.tcunit3${aa} $base.cunit3${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tcdelt1${aa} $base.cdelt1${aa} \
+ $base.tcdelt2${aa} $base.cdelt2${aa} \
+ $base.tcdelt3${aa} $base.cdelt3${aa} \
+ -padx 2 -pady 2 -sticky w
+
+ grid $base.tcd1_1${aa} $base.cd1_1${aa} \
+ $base.tcd2_1${aa} $base.cd2_1${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tcd1_2${aa} $base.cd1_2${aa} \
+ $base.tcd2_2${aa} $base.cd2_2${aa} \
+ $base.tcd3_3${aa} $base.cd3_3${aa} \
+ -padx 2 -pady 2 -sticky w
+
+ grid $base.tpc1_1${aa} $base.pc1_1${aa} \
+ $base.tpc2_1${aa} $base.pc2_1${aa} \
+ -padx 2 -pady 2 -sticky w
+ grid $base.tpc1_2${aa} $base.pc1_2${aa} \
+ $base.tpc2_2${aa} $base.pc2_2${aa} \
+ $base.tpc3_3${aa} $base.pc3_3${aa} \
+ -padx 2 -pady 2 -sticky w
+
+ grid $base.tlatpole${aa} $base.latpole${aa} \
+ $base.tlonpole${aa} $base.lonpole${aa} -padx 2 -pady 2 -sticky w
+
+ for {set mm 0} {$mm<12} {incr mm} {
+ grid $pv00.tpv1_${mm}${aa} $pv00.pv1_${mm}${aa} \
+ $pv00.tpv2_${mm}${aa} $pv00.pv2_${mm}${aa} \
+ -padx 2 -pady 2 -sticky w
+ }
+ for {set mm 12} {$mm<24} {incr mm} {
+ grid $pv12.tpv1_${mm}${aa} $pv12.pv1_${mm}${aa} \
+ $pv12.tpv2_${mm}${aa} $pv12.pv2_${mm}${aa} \
+ -padx 2 -pady 2 -sticky w
+ }
+ for {set mm 24} {$mm<36} {incr mm} {
+ grid $pv24.tpv1_${mm}${aa} $pv24.pv1_${mm}${aa} \
+ $pv24.tpv2_${mm}${aa} $pv24.pv2_${mm}${aa} \
+ -padx 2 -pady 2 -sticky w
+ }
+
+ # only in primary
+ grid $ab0.ta $ab0.a $ab0.tb $ab0.b -padx 2 -pady 2 -sticky w
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $ab0.ta_${mm}_${nn} $ab0.a_${mm}_${nn} \
+ $ab0.tb_${mm}_${nn} $ab0.b_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $ab2.ta_${mm}_${nn} $ab2.a_${mm}_${nn} \
+ $ab2.tb_${mm}_${nn} $ab2.b_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $ab4.ta_${mm}_${nn} $ab4.a_${mm}_${nn} \
+ $ab4.tb_${mm}_${nn} $ab4.b_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+
+ grid $apbp0.tap $apbp0.ap $apbp0.tbp $apbp0.bp -padx 2 -pady 2 -sticky w
+ for {set mm 0} {$mm<2} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $apbp0.tap_${mm}_${nn} $apbp0.ap_${mm}_${nn} \
+ $apbp0.tbp_${mm}_${nn} $apbp0.bp_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+ for {set mm 2} {$mm<4} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $apbp2.tap_${mm}_${nn} $apbp2.ap_${mm}_${nn} \
+ $apbp2.tbp_${mm}_${nn} $apbp2.bp_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+ for {set mm 4} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ grid $apbp4.tap_${mm}_${nn} $apbp4.ap_${mm}_${nn} \
+ $apbp4.tbp_${mm}_${nn} $apbp4.bp_${mm}_${nn} \
+ -padx 2 -pady 2 -sticky w
+ }
+ }
+}
+
+proc ConfigWCSDialogExtMenu {} {
+ global iwcs
+ global dwcs
+ global ds9
+ global current
+
+ $iwcs(mb).ext delete $ds9(menu,start) end
+ set dwcs(ext) 1
+
+ set nn 0
+ set last {}
+ set cnt [$current(frame) get fits count]
+
+ for {set ii 1} {$ii <= $cnt} {incr ii} {
+ set fn [$current(frame) get fits file name $ii]
+ if {$fn != $last} {
+ incr nn
+ set item($nn) $fn
+ set val($nn) $ii
+ set last $fn
+ }
+ }
+
+ if {$nn > 1} {
+ $iwcs(mb) entryconfig [msgcat::mc {Extention}] -state normal
+
+ for {set ii 1} {$ii<=$nn} {incr ii} {
+ $iwcs(mb).ext add radiobutton -label $item($ii) \
+ -variable dwcs(ext) -value $val($ii) -command UpdateWCSVars
+ }
+ } else {
+ $iwcs(mb) entryconfig [msgcat::mc {Extention}] -state disabled
+ }
+}
+
+# used by backup
+proc WCSToVar {txt} {
+ global wcs
+ global dwcs
+ global iwcs
+
+ # clear all
+ set dwcs(mjd-obs) {}
+ set dwcs(date-obs) {}
+ set dwcs(date) {}
+ set dwcs(epoch) {}
+
+ foreach aa {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set dwcs(wcsname${aa}) {}
+ set dwcs(radesys${aa}) {}
+ set dwcs(equinox${aa}) {}
+ set dwcs(latpole${aa}) {}
+ set dwcs(lonpole${aa}) {}
+
+ for {set ii 1} {$ii<=3} {incr ii} {
+ set dwcs(ctype${ii}${aa}) {}
+ set dwcs(cunit${ii}${aa}) {}
+ set dwcs(crpix${ii}${aa}) {}
+ set dwcs(crval${ii}${aa}) {}
+ set dwcs(cdelt${ii}${aa}) {}
+ }
+
+ for {set ii 1} {$ii<=2} {incr ii} {
+ for {set jj 1} {$jj<=2} {incr jj} {
+ set dwcs(cd${ii}_${jj}${aa}) {}
+ set dwcs(pc${ii}_${jj}${aa}) {}
+ }
+
+ for {set mm 0} {$mm<36} {incr mm} {
+ set dwcs(pv${ii}_${mm}${aa}) {}
+ }
+ }
+
+ set dwcs(cd3_3${aa}) {}
+ set dwcs(pc3_3${aa}) {}
+ }
+
+ # primary only
+ set dwcs(a_order) {}
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ set dwcs(a_${mm}_${nn}) {}
+ }
+ }
+ set dwcs(b_order) {}
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ set dwcs(b_${mm}_${nn}) {}
+ }
+ }
+ set dwcs(ap_order) {}
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ set dwcs(ap_${mm}_${nn}) {}
+ }
+ }
+ set dwcs(bp_order) {}
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ set dwcs(bp_${mm}_${nn}) {}
+ }
+ }
+
+ set lines [split $txt "\n"]
+
+ # check for fits header, do it the hard way
+ if {[llength $lines] == 1} {
+ set lines {}
+ while {"$txt" != {}} {
+ lappend lines "[string range $txt 0 79]"
+ set txt "[string replace $txt 0 79]"
+ }
+ }
+
+ for {set ll 0} {$ll<[llength $lines]} {incr ll} {
+ set line [lindex $lines $ll]
+ set pp [split $line {=}]
+ set key [string tolower [string trim [lindex $pp 0]]]
+
+ # drop comments
+ # some keywords can have '/' in the value (such as a date)
+ # try the easy approach first
+ set ee [lindex $pp 1]
+ set dd [split $ee {/}]
+ switch [llength $dd] {
+ 0 -
+ 1 -
+ 2 {set aa [lindex $dd 0]}
+ default {
+ set ff [string first { /} $ee]
+ if {$ff > 0} {
+ set aa [string range $ee 0 $ff]
+ } else {
+ set aa [lindex $dd 0]
+ }
+ }
+ }
+
+ # drop any white space
+ set bb [string trim $aa]
+ # drop any single quotes
+ set cc [string trim $bb {'}]
+ # drop any white space
+ set val [string trim $cc]
+
+ # sanity check
+ if {$key == {longpole}} {
+ set key lonpole
+ }
+ if {$key == {radecsys}} {
+ set key radesys
+ }
+
+ switch [string range $key 0 6] {
+ mjd-obs -
+ date-ob {
+ set dwcs($key) $val
+ }
+ }
+ switch [string range $key 0 5] {
+ wcsnam -
+ radesy -
+ equino -
+ latpol -
+ lonpol -
+ ctype1 -
+ ctype2 -
+ ctype3 -
+ cunit1 -
+ cunit2 -
+ cunit3 -
+ crpix1 -
+ crpix2 -
+ crpix3 -
+ crval1 -
+ crval2 -
+ crval3 -
+ cdelt1 -
+ cdelt2 -
+ cdelt3 -
+ cd3_3 -
+ pc3_3 -
+ a_orde -
+ b_orde -
+ ap_ord -
+ bp_ord {
+ set dwcs($key) $val
+ }
+ }
+ switch [string range $key 0 3] {
+ epoc -
+ date -
+ cd1_ -
+ cd1_ -
+ cd2_ -
+ cd2_ -
+ pc1_ -
+ pc1_ -
+ pc2_ -
+ pc2_ -
+ pv1_ -
+ pv2_ {
+ set dwcs($key) $val
+ }
+ }
+ switch [string range $key 0 2] {
+ ap_ -
+ bp_ {
+ set dwcs($key) $val
+ }
+ }
+ switch [string range $key 0 1] {
+ a_ -
+ b_ {
+ set dwcs($key) $val
+ }
+ }
+ }
+}
+
+# used by backup
+proc WCSFromVar {} {
+ global wcs
+ global dwcs
+ global iwcs
+
+ set rr {}
+
+ if {$dwcs(mjd-obs) != {}} {
+ append rr "MJD-OBS = $dwcs(mjd-obs)\n"
+ }
+ if {$dwcs(date-obs) != {}} {
+ append rr "DATE-OBS = '$dwcs(date-obs)'\n"
+ }
+ if {$dwcs(date) != {}} {
+ append rr "DATE = '$dwcs(date)'\n"
+ }
+ if {$dwcs(epoch) != {}} {
+ append rr "EPOCH = $dwcs(epoch)\n"
+ }
+
+ foreach aa {{} a b c d e f g h i j k l m n o p q r s t u v w x y z} {
+ set bb [string toupper $aa]
+
+ if {$dwcs(wcsname${aa}) != {}} {
+ append rr "WCSNAME${bb} = '$dwcs(wcsname${aa})'\n"
+ }
+ if {$dwcs(radesys${aa}) != {}} {
+ append rr "RADESYS${bb} = '$dwcs(radesys${aa})'\n"
+ }
+ if {$dwcs(equinox${aa}) != {}} {
+ append rr "EQUINOX${bb} = $dwcs(equinox${aa})\n"
+ }
+ if {$dwcs(latpole${aa}) != {}} {
+ append rr "LATPOLE${bb} = $dwcs(latpole${aa})\n"
+ }
+ if {$dwcs(lonpole${aa}) != {}} {
+ append rr "LONPOLE${bb} = $dwcs(lonpole${aa})\n"
+ }
+
+ for {set ii 1} {$ii<=3} {incr ii} {
+ if {$dwcs(ctype${ii}${aa}) != {}} {
+ append rr "CTYPE${ii}${bb} = '$dwcs(ctype${ii}${aa})'\n"
+ }
+ if {$dwcs(cunit${ii}${aa}) != {}} {
+ append rr "CUNIT${ii}${bb} = '$dwcs(cunit${ii}${aa})'\n"
+ }
+ if {$dwcs(crpix${ii}${aa}) != {}} {
+ append rr "CRPIX${ii}${bb} = $dwcs(crpix${ii}${aa})\n"
+ }
+ if {$dwcs(crval${ii}${aa}) != {}} {
+ append rr "CRVAL${ii}${bb} = $dwcs(crval${ii}${aa})\n"
+ }
+ if {$dwcs(cdelt${ii}${aa}) != {}} {
+ append rr "CDELT${ii}${bb} = $dwcs(cdelt${ii}${aa})\n"
+ }
+ }
+
+ for {set ii 1} {$ii<=2} {incr ii} {
+ for {set jj 1} {$jj<=2} {incr jj} {
+ if {$dwcs(cd${ii}_${jj}${aa}) != {}} {
+ append rr "CD${ii}_${jj}${bb} = $dwcs(cd${ii}_${jj}${aa})\n"
+ }
+ if {$dwcs(pc${ii}_${jj}${aa}) != {}} {
+ append rr "PC${ii}_${jj}${bb} = $dwcs(pc${ii}_${jj}${aa})\n"
+ }
+ }
+
+ for {set mm 0} {$mm<36} {incr mm} {
+ if {$dwcs(pv${ii}_${mm}${aa}) != {}} {
+ append rr "PV${ii}_${mm}${bb} = $dwcs(pv${ii}_${mm}${aa})\n"
+ }
+ }
+ }
+
+ if {$dwcs(cd3_3${aa}) != {}} {
+ append rr "CD3_3${bb} = $dwcs(cd3_3${aa})\n"
+ }
+ if {$dwcs(pc3_3${aa}) != {}} {
+ append rr "PC3_3${bb} = $dwcs(pc3_3${aa})\n"
+ }
+ }
+
+ if {$dwcs(a_order) != {}} {
+ append rr "A_ORDER = $dwcs(a_order)\n"
+ }
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ if {$dwcs(a_${mm}_${nn}) != {}} {
+ append rr "A_${mm}_${nn} = $dwcs(a_${mm}_${nn})\n"
+ }
+ }
+ }
+ if {$dwcs(b_order) != {}} {
+ append rr "B_ORDER = $dwcs(b_order)\n"
+ }
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ if {$dwcs(b_${mm}_${nn}) != {}} {
+ append rr "B_${mm}_${nn} = $dwcs(b_${mm}_${nn})\n"
+ }
+ }
+ }
+
+ if {$dwcs(ap_order) != {}} {
+ append rr "AP_ORDER = $dwcs(ap_order)\n"
+ }
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ if {$dwcs(ap_${mm}_${nn}) != {}} {
+ append rr "AP_${mm}_${nn} = $dwcs(ap_${mm}_${nn})\n"
+ }
+ }
+ }
+ if {$dwcs(bp_order) != {}} {
+ append rr "BP_ORDER = $dwcs(bp_order)\n"
+ }
+ for {set mm 0} {$mm<6} {incr mm} {
+ for {set nn 0} {$nn<6} {incr nn} {
+ if {$dwcs(bp_${mm}_${nn}) != {}} {
+ append rr "BP_${mm}_${nn} = $dwcs(bp_${mm}_${nn})\n"
+ }
+ }
+ }
+
+ return $rr
+}
+
+# Process Cmds
+
+proc ProcessWCSCmd {varname iname sock fn} {
+ upvar $varname var
+ upvar $iname i
+
+ global wcs
+ global current
+ global rgb
+
+ set item [string tolower [lindex $var $i]]
+ switch -- $item {
+ open {WCSDialog}
+ close {WCSDestroyDialog}
+ system {
+ incr i
+ set wcs(system) [string tolower [lindex $var $i]]
+ UpdateWCS
+ }
+ sky {
+ incr i
+ set wcs(sky) [string tolower [lindex $var $i]]
+ UpdateWCS
+ }
+ format -
+ skyformat {
+ incr i
+ switch -- [string tolower [lindex $var $i]] {
+ deg -
+ degree -
+ degrees {set wcs(skyformat) degrees}
+ default {set wcs(skyformat) [string tolower [lindex $var $i]]}
+ }
+ UpdateWCS
+ }
+ align {
+ incr i
+ set current(align) [FromYesNo [lindex $var $i]]
+ AlignWCSFrame
+ }
+ reset {
+ set ext 1
+ set nn [lindex $var [expr $i+1]]
+ if {[string is integer -strict $nn]} {
+ incr i
+ set ext $nn
+ }
+
+ RGBEvalLock rgb(lock,wcs) $current(frame) [list $current(frame) wcs reset $ext]
+ UpdateWCS
+ }
+ replace -
+ append {
+ set ext 1
+ set nn [lindex $var [expr $i+1]]
+ if {[string is integer -strict $nn]} {
+ incr i
+ set ext $nn
+ }
+
+ if {$sock != {}} {
+ incr i
+ if {[lindex $var $i] == {}} {
+ RGBEvalLock rgb(lock,wcs) $current(frame) [list $current(frame) wcs $item $ext $sock]
+ incr i -1
+ } else {
+ RGBEvalLock rgb(lock,wcs) $current(frame) "$current(frame) wcs $item $ext \{\{[lindex $var $i]\}\}"
+ }
+ } elseif {$fn != {}} {
+ RGBEvalLock rgb(lock,wcs) $current(frame) "$current(frame) wcs $item $ext \{\{$fn\}\}"
+ } else {
+ incr i
+ if {[lindex $var $i] == "file"} {
+ incr i
+ }
+ RGBEvalLock rgb(lock,wcs) $current(frame) "$current(frame) wcs $item $ext \{\{[lindex $var $i]\}\}"
+ }
+ UpdateWCS
+ }
+
+ fk4 -
+ fk5 -
+ icrs -
+ galactic -
+ ecliptic {
+ set wcs(sky) $item
+ UpdateWCS
+ }
+
+ degrees -
+ sexagesimal {
+ set wcs(skyformat) $item
+ UpdateWCS
+ }
+
+ wcs -
+ wcsa -
+ wcsb -
+ wcsc -
+ wcsd -
+ wcse -
+ wcsf -
+ wcsg -
+ wcsh -
+ wcsi -
+ wcsj -
+ wcsk -
+ wcsl -
+ wcsm -
+ wcsn -
+ wcso -
+ wcsp -
+ wcsq -
+ wcsr -
+ wcss -
+ wcst -
+ wcsu -
+ wcsv -
+ wcsw -
+ wcsx -
+ wcsy -
+ wcsz {
+ set wcs(system) $item
+ UpdateWCS
+ }
+ }
+}
+
+proc ProcessSendWCSCmd {proc id param} {
+ global current
+ global wcs
+
+ switch -- [string tolower $param] {
+ align {$proc $id [ToYesNo $current(align)]}
+ system {$proc $id "$wcs(system)\n"}
+ sky {$proc $id "$wcs(sky)\n"}
+ format -
+ skyformat {$proc $id "$wcs(skyformat)\n"}
+ default {$proc $id "$wcs(system)\n"}
+ }
+}
+
+# backward compatibilty
+proc ProcessAlignCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global current
+ switch -- [string tolower [lindex $var $i]] {
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {
+ set current(align) [FromYesNo [lindex $var $i]]
+ AlignWCSFrame
+ }
+ default {
+ set current(align) 1
+ AlignWCSFrame
+ incr i -1
+ }
+ }
+}
+
+proc ProcessSendAlignCmd {proc id param} {
+ global current
+
+ $proc $id [ToYesNo $current(align)]
+}
+
diff --git a/ds9/library/win32.tcl b/ds9/library/win32.tcl
new file mode 100755
index 0000000..32a8a86
--- /dev/null
+++ b/ds9/library/win32.tcl
@@ -0,0 +1,27 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc Win32Print {} {
+ global ds9
+
+ # we need to be realized
+ RealizeDS9
+ # need the colorbar levels updated
+ UpdateColormapLevel
+
+ if {[win32 pm print begin [winfo width $ds9(canvas)] [winfo height $ds9(canvas)] yes]} {
+ foreach f $ds9(frames) {
+ $f win32 print
+ }
+ colorbar win32 print
+ colorbarrgb win32 print
+ win32 pm print end
+ }
+}
+
+proc Win32PageSetup {} {
+ win32 pm pagesetup
+}
diff --git a/ds9/library/xmfbox.tcl b/ds9/library/xmfbox.tcl
new file mode 100644
index 0000000..fb821c8
--- /dev/null
+++ b/ds9/library/xmfbox.tcl
@@ -0,0 +1,998 @@
+# xmfbox.tcl --
+#
+# Implements the "Motif" style file selection dialog for the
+# Unix platform. This implementation is used only if the
+# "::tk_strictMotif" flag is set.
+#
+# Copyright (c) 1996 Sun Microsystems, Inc.
+# Copyright (c) 1998-2000 Scriptics Corporation
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+namespace eval ::tk::dialog {}
+namespace eval ::tk::dialog::file {}
+
+
+# ::tk::MotifFDialog --
+#
+# Implements a file dialog similar to the standard Motif file
+# selection box.
+#
+# Arguments:
+# type "open" or "save"
+# args Options parsed by the procedure.
+#
+# Results:
+# When -multiple is set to 0, this returns the absolute pathname
+# of the selected file. (NOTE: This is not the same as a single
+# element list.)
+#
+# When -multiple is set to > 0, this returns a Tcl list of absolute
+# pathnames. The argument for -multiple is ignored, but for consistency
+# with Windows it defines the maximum amount of memory to allocate for
+# the returned filenames.
+
+proc ::tk::MotifFDialog {type args} {
+ variable ::tk::Priv
+ set dataName __tk_filedialog
+ upvar ::tk::dialog::file::$dataName data
+
+ set w [MotifFDialog_Create $dataName $type $args]
+
+ # Set a grab and claim the focus too.
+
+ ::tk::SetFocusGrab $w $data(sEnt)
+ $data(sEnt) selection range 0 end
+
+ # Wait for the user to respond, then restore the focus and
+ # return the index of the selected button. Restore the focus
+ # before deleting the window, since otherwise the window manager
+ # may take the focus away so we can't redirect it. Finally,
+ # restore any grab that was in effect.
+
+ vwait ::tk::Priv(selectFilePath)
+ set result $Priv(selectFilePath)
+ ::tk::RestoreFocusGrab $w $data(sEnt) withdraw
+
+ return $result
+}
+
+# ::tk::MotifFDialog_Create --
+#
+# Creates the Motif file dialog (if it doesn't exist yet) and
+# initialize the internal data structure associated with the
+# dialog.
+#
+# This procedure is used by ::tk::MotifFDialog to create the
+# dialog. It's also used by the test suite to test the Motif
+# file dialog implementation. User code shouldn't call this
+# procedure directly.
+#
+# Arguments:
+# dataName Name of the global "data" array for the file dialog.
+# type "Save" or "Open"
+# argList Options parsed by the procedure.
+#
+# Results:
+# Pathname of the file dialog.
+
+proc ::tk::MotifFDialog_Create {dataName type argList} {
+ upvar ::tk::dialog::file::$dataName data
+
+ MotifFDialog_Config $dataName $type $argList
+
+ if {$data(-parent) eq "."} {
+ set w .$dataName
+ } else {
+ set w $data(-parent).$dataName
+ }
+
+ # (re)create the dialog box if necessary
+ #
+ if {![winfo exists $w]} {
+ MotifFDialog_BuildUI $w
+ } elseif {[winfo class $w] ne "TkMotifFDialog"} {
+ destroy $w
+ MotifFDialog_BuildUI $w
+ } else {
+ set data(fEnt) $w.top.f1.ent
+ set data(dList) $w.top.f2.a.l
+ set data(fList) $w.top.f2.b.l
+ set data(sEnt) $w.top.f3.ent
+ set data(okBtn) $w.bot.ok
+ set data(filterBtn) $w.bot.filter
+ set data(cancelBtn) $w.bot.cancel
+ }
+ MotifFDialog_SetListMode $w
+
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
+ }
+
+ MotifFDialog_FileTypes $w
+ MotifFDialog_Update $w
+
+ # Withdraw the window, then update all the geometry information
+ # so we know how big it wants to be, then center the window in the
+ # display (Motif style) and de-iconify it.
+
+ ::tk::PlaceWindow $w
+ wm title $w $data(-title)
+
+ return $w
+}
+
+# ::tk::MotifFDialog_FileTypes --
+#
+# Checks the -filetypes option. If present this adds a list of radio-
+# buttons to pick the file types from.
+#
+# Arguments:
+# w Pathname of the tk_get*File dialogue.
+#
+# Results:
+# none
+
+proc ::tk::MotifFDialog_FileTypes {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set f $w.top.f3.types
+ destroy $f
+
+ # No file types: use "*" as the filter and display no radio-buttons
+ if {$data(-filetypes) eq ""} {
+ set data(filter) *
+ return
+ }
+
+ # The filetypes radiobuttons
+ # set data(fileType) $data(-defaulttype)
+ # Default type to first entry
+ set initialTypeName [lindex $data(-filetypes) 0 0]
+ if {$data(-typevariable) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ if {[info exists typeVariable]} {
+ set initialTypeName $typeVariable
+ }
+ }
+ set ix 0
+ set data(fileType) 0
+ foreach fltr $data(-filetypes) {
+ set fname [lindex $fltr 0]
+ if {[string first $initialTypeName $fname] == 0} {
+ set data(fileType) $ix
+ break
+ }
+ incr ix
+ }
+
+ MotifFDialog_SetFilter $w [lindex $data(-filetypes) $data(fileType)]
+
+ #don't produce radiobuttons for only one filetype
+ if {[llength $data(-filetypes)] == 1} {
+ return
+ }
+
+ ttk::frame $f
+ set cnt 0
+ if {$data(-filetypes) ne {}} {
+ foreach type $data(-filetypes) {
+ set title [lindex [lindex $type 0] 0]
+ set filter [lindex $type 1]
+ ttk::radiobutton $f.b$cnt \
+ -text $title \
+ -variable ::tk::dialog::file::[winfo name $w](fileType) \
+ -value $cnt \
+ -command [list tk::MotifFDialog_SetFilter $w $type]
+ pack $f.b$cnt -side left
+ incr cnt
+ }
+ }
+ $f.b$data(fileType) invoke
+
+ pack $f -side bottom -fill both
+
+ return
+}
+
+# This proc gets called whenever data(filter) is set
+#
+proc ::tk::MotifFDialog_SetFilter {w type} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ variable ::tk::Priv
+
+ set data(filter) [lindex $type 1]
+ set Priv(selectFileType) [lindex [lindex $type 0] 0]
+
+ MotifFDialog_Update $w
+}
+
+# ::tk::MotifFDialog_Config --
+#
+# Iterates over the optional arguments to determine the option
+# values for the Motif file dialog; gives default values to
+# unspecified options.
+#
+# Arguments:
+# dataName The name of the global variable in which
+# data for the file dialog is stored.
+# type "Save" or "Open"
+# argList Options parsed by the procedure.
+
+proc ::tk::MotifFDialog_Config {dataName type argList} {
+ upvar ::tk::dialog::file::$dataName data
+
+ set data(type) $type
+
+ # 1: the configuration specs
+ #
+ set specs {
+ {-defaultextension "" "" ""}
+ {-filetypes "" "" ""}
+ {-initialdir "" "" ""}
+ {-initialfile "" "" ""}
+ {-parent "" "" "."}
+ {-title "" "" ""}
+ {-typevariable "" "" ""}
+ }
+ if {$type eq "open"} {
+ lappend specs {-multiple "" "" "0"}
+ }
+ if {$type eq "save"} {
+ lappend specs {-confirmoverwrite "" "" "1"}
+ }
+
+ set data(-multiple) 0
+ set data(-confirmoverwrite) 1
+ # 2: default values depending on the type of the dialog
+ #
+ if {![info exists data(selectPath)]} {
+ # first time the dialog has been popped up
+ set data(selectPath) [pwd]
+ set data(selectFile) ""
+ }
+
+ # 3: parse the arguments
+ #
+ tclParseConfigSpec ::tk::dialog::file::$dataName $specs "" $argList
+
+ if {$data(-title) eq ""} {
+ if {$type eq "open"} {
+ if {$data(-multiple) != 0} {
+ set data(-title) "[mc {Open Multiple Files}]"
+ } else {
+ set data(-title) [mc "Open"]
+ }
+ } else {
+ set data(-title) [mc "Save As"]
+ }
+ }
+
+ # 4: set the default directory and selection according to the -initial
+ # settings
+ #
+ if {$data(-initialdir) ne ""} {
+ if {[file isdirectory $data(-initialdir)]} {
+ set data(selectPath) [lindex [glob $data(-initialdir)] 0]
+ } else {
+ set data(selectPath) [pwd]
+ }
+
+ # Convert the initialdir to an absolute path name.
+
+ set old [pwd]
+ cd $data(selectPath)
+ set data(selectPath) [pwd]
+ cd $old
+ }
+ set data(selectFile) $data(-initialfile)
+
+ # 5. Parse the -filetypes option. It is not used by the motif
+ # file dialog, but we check for validity of the value to make sure
+ # the application code also runs fine with the TK file dialog.
+ #
+ set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)]
+
+ if {![info exists data(filter)]} {
+ set data(filter) *
+ }
+ if {![winfo exists $data(-parent)]} {
+ return -code error -errorcode [list TK LOOKUP WINDOW $data(-parent)] \
+ "bad window path name \"$data(-parent)\""
+ }
+}
+
+# ::tk::MotifFDialog_BuildUI --
+#
+# Builds the UI components of the Motif file dialog.
+#
+# Arguments:
+# w Pathname of the dialog to build.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_BuildUI {w} {
+ set dataName [lindex [split $w .] end]
+ upvar ::tk::dialog::file::$dataName data
+
+ # Create the dialog toplevel and internal frames.
+ #
+ toplevel $w -class TkMotifFDialog
+ set top [ttk::frame $w.top -relief raised -borderwidth 1]
+ set bot [ttk::frame $w.bot -relief raised -borderwidth 1]
+
+ pack $w.bot -side bottom -fill x
+ pack $w.top -side top -expand yes -fill both
+
+ set f1 [ttk::frame $top.f1]
+ set f2 [ttk::frame $top.f2]
+ set f3 [ttk::frame $top.f3]
+
+ pack $f1 -side top -fill x
+ pack $f3 -side bottom -fill x
+ pack $f2 -expand yes -fill both
+
+ set f2a [ttk::frame $f2.a]
+ set f2b [ttk::frame $f2.b]
+
+ grid $f2a -row 0 -column 0 -rowspan 1 -columnspan 1 -padx 4 -pady 4 \
+ -sticky news
+ grid $f2b -row 0 -column 1 -rowspan 1 -columnspan 1 -padx 4 -pady 4 \
+ -sticky news
+ grid rowconfigure $f2 0 -minsize 0 -weight 1
+ grid columnconfigure $f2 0 -minsize 0 -weight 1
+ grid columnconfigure $f2 1 -minsize 150 -weight 2
+
+ # The Filter box
+ #
+ bind [::tk::AmpWidget ttk::label $f1.lab -text [mc "Fil&ter:"] -anchor w] \
+ <<AltUnderlined>> [list focus $f1.ent]
+ ttk::entry $f1.ent
+ pack $f1.lab -side top -fill x -padx 6 -pady 4
+ pack $f1.ent -side top -fill x -padx 4 -pady 0
+ set data(fEnt) $f1.ent
+
+ # The file and directory lists
+ #
+ set data(dList) [MotifFDialog_MakeSList $w $f2a \
+ [mc "&Directory:"] DList]
+ set data(fList) [MotifFDialog_MakeSList $w $f2b \
+ [mc "Fi&les:"] FList]
+
+ # The Selection box
+ #
+ bind [::tk::AmpWidget ttk::label $f3.lab -text [mc "&Selection:"] -anchor w] \
+ <<AltUnderlined>> [list focus $f3.ent]
+ ttk::entry $f3.ent
+ pack $f3.lab -side top -fill x -padx 6 -pady 0
+ pack $f3.ent -side top -fill x -padx 4 -pady 4
+ set data(sEnt) $f3.ent
+
+ # The buttons
+ #
+ set maxWidth [::tk::mcmaxamp &OK &Filter &Cancel]
+ set maxWidth [expr {$maxWidth<6?6:$maxWidth}]
+ set data(okBtn) [::tk::AmpWidget ttk::button $bot.ok -text [mc "&OK"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_OkCmd $w]]
+ set data(filterBtn) [::tk::AmpWidget ttk::button $bot.filter -text [mc "&Filter"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_FilterCmd $w]]
+ set data(cancelBtn) [::tk::AmpWidget ttk::button $bot.cancel -text [mc "&Cancel"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_CancelCmd $w]]
+
+ pack $bot.ok $bot.filter $bot.cancel -padx 10 -pady 10 -expand yes \
+ -side left
+
+ # Create the bindings:
+ #
+ bind $w <Alt-Key> [list ::tk::AltKeyInDialog $w %A]
+
+ bind $data(fEnt) <Return> [list tk::MotifFDialog_ActivateFEnt $w]
+ bind $data(sEnt) <Return> [list tk::MotifFDialog_ActivateSEnt $w]
+ bind $w <Escape> [list tk::MotifFDialog_CancelCmd $w]
+ bind $w.bot <Destroy> {set ::tk::Priv(selectFilePath) {}}
+
+ wm protocol $w WM_DELETE_WINDOW [list tk::MotifFDialog_CancelCmd $w]
+}
+
+proc ::tk::MotifFDialog_SetListMode {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {$data(-multiple) != 0} {
+ set selectmode extended
+ } else {
+ set selectmode browse
+ }
+ set f $w.top.f2.b
+ $f.l configure -selectmode $selectmode
+}
+
+# ::tk::MotifFDialog_MakeSList --
+#
+# Create a scrolled-listbox and set the keyboard accelerator
+# bindings so that the list selection follows what the user
+# types.
+#
+# Arguments:
+# w Pathname of the dialog box.
+# f Frame widget inside which to create the scrolled
+# listbox. This frame widget already exists.
+# label The string to display on top of the listbox.
+# under Sets the -under option of the label.
+# cmdPrefix Specifies procedures to call when the listbox is
+# browsed or activated.
+
+proc ::tk::MotifFDialog_MakeSList {w f label cmdPrefix} {
+ bind [::tk::AmpWidget ttk::label $f.lab -text $label -anchor w] \
+ <<AltUnderlined>> [list focus $f.l]
+ listbox $f.l -width 12 -height 5 -exportselection 0\
+ -xscrollcommand [list $f.h set] -yscrollcommand [list $f.v set]
+ ttk::scrollbar $f.v -orient vertical -takefocus 0 -command [list $f.l yview]
+ ttk::scrollbar $f.h -orient horizontal -takefocus 0 -command [list $f.l xview]
+ grid $f.lab -row 0 -column 0 -sticky news -rowspan 1 -columnspan 2 \
+ -padx 2 -pady 2
+ grid $f.l -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news
+ grid $f.v -row 1 -column 1 -rowspan 1 -columnspan 1 -sticky news
+ grid $f.h -row 2 -column 0 -rowspan 1 -columnspan 1 -sticky news
+
+ grid rowconfigure $f 0 -weight 0 -minsize 0
+ grid rowconfigure $f 1 -weight 1 -minsize 0
+ grid columnconfigure $f 0 -weight 1 -minsize 0
+
+ # bindings for the listboxes
+ #
+ set list $f.l
+ bind $list <<ListboxSelect>> [list tk::MotifFDialog_Browse$cmdPrefix $w]
+ bind $list <Double-ButtonRelease-1> \
+ [list tk::MotifFDialog_Activate$cmdPrefix $w]
+ bind $list <Return> "tk::MotifFDialog_Browse$cmdPrefix [list $w]; \
+ tk::MotifFDialog_Activate$cmdPrefix [list $w]"
+
+ bindtags $list [list Listbox $list [winfo toplevel $list] all]
+ ListBoxKeyAccel_Set $list
+
+ return $f.l
+}
+
+# ::tk::MotifFDialog_InterpFilter --
+#
+# Interpret the string in the filter entry into two components:
+# the directory and the pattern. If the string is a relative
+# pathname, give a warning to the user and restore the pattern
+# to original.
+#
+# Arguments:
+# w pathname of the dialog box.
+#
+# Results:
+# A list of two elements. The first element is the directory
+# specified # by the filter. The second element is the filter
+# pattern itself.
+
+proc ::tk::MotifFDialog_InterpFilter {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set text [string trim [$data(fEnt) get]]
+
+ # Perform tilde substitution
+ #
+ set badTilde 0
+ if {[string index $text 0] eq "~"} {
+ set list [file split $text]
+ set tilde [lindex $list 0]
+ if {[catch {set tilde [glob $tilde]}]} {
+ set badTilde 1
+ } else {
+ set text [eval file join [concat $tilde [lrange $list 1 end]]]
+ }
+ }
+
+ # If the string is a relative pathname, combine it
+ # with the current selectPath.
+
+ set relative 0
+ if {[file pathtype $text] eq "relative"} {
+ set relative 1
+ } elseif {$badTilde} {
+ set relative 1
+ }
+
+ if {$relative} {
+ tk_messageBox -icon warning -type ok \
+ -message "\"$text\" must be an absolute pathname"
+
+ $data(fEnt) delete 0 end
+ $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ $data(filter)]
+
+ return [list $data(selectPath) $data(filter)]
+ }
+
+ set resolved [::tk::dialog::file::JoinFile [file dirname $text] [file tail $text]]
+
+ if {[file isdirectory $resolved]} {
+ set dir $resolved
+ set fil $data(filter)
+ } else {
+ set dir [file dirname $resolved]
+ set fil [file tail $resolved]
+ }
+
+ return [list $dir $fil]
+}
+
+# ::tk::MotifFDialog_Update
+#
+# Load the files and synchronize the "filter" and "selection" fields
+# boxes.
+#
+# Arguments:
+# w pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_Update {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ $data(fEnt) delete 0 end
+ $data(fEnt) insert 0 \
+ [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)]
+ $data(sEnt) delete 0 end
+ $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ $data(selectFile)]
+
+ MotifFDialog_LoadFiles $w
+}
+
+# ::tk::MotifFDialog_LoadFiles --
+#
+# Loads the files and directories into the two listboxes according
+# to the filter setting.
+#
+# Arguments:
+# w pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_LoadFiles {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ $data(dList) delete 0 end
+ $data(fList) delete 0 end
+
+ set appPWD [pwd]
+ if {[catch {cd $data(selectPath)}]} {
+ cd $appPWD
+
+ $data(dList) insert end ".."
+ return
+ }
+
+ # Make the dir and file lists
+ #
+ # For speed we only have one glob, which reduces the file system
+ # calls (good for slow NFS networks).
+ #
+ # We also do two smaller sorts (files + dirs) instead of one large sort,
+ # which gives a small speed increase.
+ #
+ set top 0
+ set dlist ""
+ set flist ""
+ foreach f [glob -nocomplain .* *] {
+ if {[file isdir ./$f]} {
+ lappend dlist $f
+ } else {
+ foreach pat $data(filter) {
+ if {[string match $pat $f]} {
+ if {[string match .* $f]} {
+ incr top
+ }
+ lappend flist $f
+ break
+ }
+ }
+ }
+ }
+ eval [list $data(dList) insert end] [lsort -dictionary $dlist]
+ eval [list $data(fList) insert end] [lsort -dictionary $flist]
+
+ # The user probably doesn't want to see the . files. We adjust the view
+ # so that the listbox displays all the non-dot files
+ $data(fList) yview $top
+
+ cd $appPWD
+}
+
+# ::tk::MotifFDialog_BrowseDList --
+#
+# This procedure is called when the directory list is browsed
+# (clicked-over) by the user.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_BrowseDList {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ focus $data(dList)
+ if {[$data(dList) curselection] eq ""} {
+ return
+ }
+ set subdir [$data(dList) get [$data(dList) curselection]]
+ if {$subdir eq ""} {
+ return
+ }
+
+ $data(fList) selection clear 0 end
+
+ set list [MotifFDialog_InterpFilter $w]
+ set data(filter) [lindex $list 1]
+
+ switch -- $subdir {
+ . {
+ set newSpec [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)]
+ }
+ .. {
+ set newSpec [::tk::dialog::file::JoinFile [file dirname $data(selectPath)] \
+ $data(filter)]
+ }
+ default {
+ set newSpec [::tk::dialog::file::JoinFile [::tk::dialog::file::JoinFile \
+ $data(selectPath) $subdir] $data(filter)]
+ }
+ }
+
+ $data(fEnt) delete 0 end
+ $data(fEnt) insert 0 $newSpec
+}
+
+# ::tk::MotifFDialog_ActivateDList --
+#
+# This procedure is called when the directory list is activated
+# (double-clicked) by the user.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_ActivateDList {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[$data(dList) curselection] eq ""} {
+ return
+ }
+ set subdir [$data(dList) get [$data(dList) curselection]]
+ if {$subdir eq ""} {
+ return
+ }
+
+ $data(fList) selection clear 0 end
+
+ switch -- $subdir {
+ . {
+ set newDir $data(selectPath)
+ }
+ .. {
+ set newDir [file dirname $data(selectPath)]
+ }
+ default {
+ set newDir [::tk::dialog::file::JoinFile $data(selectPath) $subdir]
+ }
+ }
+
+ set data(selectPath) $newDir
+ MotifFDialog_Update $w
+
+ if {$subdir ne ".."} {
+ $data(dList) selection set 0
+ $data(dList) activate 0
+ } else {
+ $data(dList) selection set 1
+ $data(dList) activate 1
+ }
+}
+
+# ::tk::MotifFDialog_BrowseFList --
+#
+# This procedure is called when the file list is browsed
+# (clicked-over) by the user.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_BrowseFList {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ focus $data(fList)
+ set data(selectFile) ""
+ foreach item [$data(fList) curselection] {
+ lappend data(selectFile) [$data(fList) get $item]
+ }
+ if {[llength $data(selectFile)] == 0} {
+ return
+ }
+
+ $data(dList) selection clear 0 end
+
+ $data(fEnt) delete 0 end
+ $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ $data(filter)]
+# $data(fEnt) xview end
+
+ # if it's a multiple selection box, just put in the filenames
+ # otherwise put in the full path as usual
+ $data(sEnt) delete 0 end
+ if {$data(-multiple) != 0} {
+ $data(sEnt) insert 0 $data(selectFile)
+ } else {
+ $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ [lindex $data(selectFile) 0]]
+ }
+# $data(sEnt) xview end
+}
+
+# ::tk::MotifFDialog_ActivateFList --
+#
+# This procedure is called when the file list is activated
+# (double-clicked) by the user.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_ActivateFList {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ if {[$data(fList) curselection] eq ""} {
+ return
+ }
+ set data(selectFile) [$data(fList) get [$data(fList) curselection]]
+ if {$data(selectFile) eq ""} {
+ return
+ } else {
+ MotifFDialog_ActivateSEnt $w
+ }
+}
+
+# ::tk::MotifFDialog_ActivateFEnt --
+#
+# This procedure is called when the user presses Return inside
+# the "filter" entry. It updates the dialog according to the
+# text inside the filter entry.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_ActivateFEnt {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set list [MotifFDialog_InterpFilter $w]
+ set data(selectPath) [lindex $list 0]
+ set data(filter) [lindex $list 1]
+
+ MotifFDialog_Update $w
+}
+
+# ::tk::MotifFDialog_ActivateSEnt --
+#
+# This procedure is called when the user presses Return inside
+# the "selection" entry. It sets the ::tk::Priv(selectFilePath)
+# variable so that the vwait loop in tk::MotifFDialog will be
+# terminated.
+#
+# Arguments:
+# w The pathname of the dialog box.
+#
+# Results:
+# None.
+
+proc ::tk::MotifFDialog_ActivateSEnt {w} {
+ variable ::tk::Priv
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set selectFilePath [string trim [$data(sEnt) get]]
+
+ if {$selectFilePath eq ""} {
+ MotifFDialog_FilterCmd $w
+ return
+ }
+
+ if {$data(-multiple) == 0} {
+ set selectFilePath [list $selectFilePath]
+ }
+
+ if {[file isdirectory [lindex $selectFilePath 0]]} {
+ set data(selectPath) [lindex [glob $selectFilePath] 0]
+ set data(selectFile) ""
+ MotifFDialog_Update $w
+ return
+ }
+
+ set newFileList ""
+ foreach item $selectFilePath {
+ if {[file pathtype $item] ne "absolute"} {
+ set item [file join $data(selectPath) $item]
+ } elseif {![file exists [file dirname $item]]} {
+ tk_messageBox -icon warning -type ok \
+ -message [mc {Directory "%1$s" does not exist.} \
+ [file dirname $item]]
+ return
+ }
+
+ # we want to strip any filtering/ext/blocking instructions
+ # from the file name
+
+ set aa [string first "\[" $item]
+ if {$aa > 0} {
+ set fn [string range $item 0 [expr $aa-1]]
+ } else {
+ set fn $item
+ }
+
+ if {![file exists $fn]} {
+ if {$data(type) eq "open"} {
+ tk_messageBox -icon warning -type ok \
+ -message [mc {File "%1$s" does not exist.} $fn]
+ return
+ }
+ } elseif {$data(type) eq "save" && $data(-confirmoverwrite)} {
+ set message [format %s%s \
+ [mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \
+ [mc {Replace existing file?}]]
+ set answer [tk_messageBox -icon warning -type yesno \
+ -message $message]
+ if {$answer eq "no"} {
+ return
+ }
+ }
+
+ lappend newFileList $item
+ }
+
+ # Return selected filter
+ if {[info exists data(-typevariable)] && $data(-typevariable) ne ""
+ && [info exists data(-filetypes)] && $data(-filetypes) ne ""} {
+ upvar #0 $data(-typevariable) typeVariable
+ set typeVariable [lindex $data(-filetypes) $data(fileType) 0]
+ }
+
+ if {$data(-multiple) != 0} {
+ set Priv(selectFilePath) $newFileList
+ } else {
+ set Priv(selectFilePath) [lindex $newFileList 0]
+ }
+
+ # Set selectFile and selectPath to first item in list
+ set Priv(selectFile) [file tail [lindex $newFileList 0]]
+ set Priv(selectPath) [file dirname [lindex $newFileList 0]]
+}
+
+
+proc ::tk::MotifFDialog_OkCmd {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ MotifFDialog_ActivateSEnt $w
+}
+
+proc ::tk::MotifFDialog_FilterCmd {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ MotifFDialog_ActivateFEnt $w
+}
+
+proc ::tk::MotifFDialog_CancelCmd {w} {
+ variable ::tk::Priv
+
+ set Priv(selectFilePath) ""
+ set Priv(selectFile) ""
+ set Priv(selectPath) ""
+}
+
+proc ::tk::ListBoxKeyAccel_Set {w} {
+ bind Listbox <Any-KeyPress> ""
+ bind $w <Destroy> [list tk::ListBoxKeyAccel_Unset $w]
+ bind $w <Any-KeyPress> [list tk::ListBoxKeyAccel_Key $w %A]
+}
+
+proc ::tk::ListBoxKeyAccel_Unset {w} {
+ variable ::tk::Priv
+
+ catch {after cancel $Priv(lbAccel,$w,afterId)}
+ unset -nocomplain Priv(lbAccel,$w) Priv(lbAccel,$w,afterId)
+}
+
+# ::tk::ListBoxKeyAccel_Key--
+#
+# This procedure maintains a list of recently entered keystrokes
+# over a listbox widget. It arranges an idle event to move the
+# selection of the listbox to the entry that begins with the
+# keystrokes.
+#
+# Arguments:
+# w The pathname of the listbox.
+# key The key which the user just pressed.
+#
+# Results:
+# None.
+
+proc ::tk::ListBoxKeyAccel_Key {w key} {
+ variable ::tk::Priv
+
+ if { $key eq "" } {
+ return
+ }
+ append Priv(lbAccel,$w) $key
+ ListBoxKeyAccel_Goto $w $Priv(lbAccel,$w)
+ catch {
+ after cancel $Priv(lbAccel,$w,afterId)
+ }
+ set Priv(lbAccel,$w,afterId) [after 500 \
+ [list tk::ListBoxKeyAccel_Reset $w]]
+}
+
+proc ::tk::ListBoxKeyAccel_Goto {w string} {
+ variable ::tk::Priv
+
+ set string [string tolower $string]
+ set end [$w index end]
+ set theIndex -1
+
+ for {set i 0} {$i < $end} {incr i} {
+ set item [string tolower [$w get $i]]
+ if {[string compare $string $item] >= 0} {
+ set theIndex $i
+ }
+ if {[string compare $string $item] <= 0} {
+ set theIndex $i
+ break
+ }
+ }
+
+ if {$theIndex >= 0} {
+ $w selection clear 0 end
+ $w selection set $theIndex $theIndex
+ $w activate $theIndex
+ $w see $theIndex
+ event generate $w <<ListboxSelect>>
+ }
+}
+
+proc ::tk::ListBoxKeyAccel_Reset {w} {
+ variable ::tk::Priv
+
+ unset -nocomplain Priv(lbAccel,$w)
+}
+
+proc ::tk_getFileType {} {
+ variable ::tk::Priv
+
+ return $Priv(selectFileType)
+}
+
diff --git a/ds9/library/xmlrpc.tcl b/ds9/library/xmlrpc.tcl
new file mode 100644
index 0000000..c255ea8
--- /dev/null
+++ b/ds9/library/xmlrpc.tcl
@@ -0,0 +1,875 @@
+# xmlrpc0.3
+# Written by Eric Yeh
+#
+# Server API:
+# xmlrpc::serve
+# Note: all callable functions should be defined in the global scope
+#
+# Client API:
+# xmlrpc::call url methodName params
+# url is of the form "http://hostname:port"
+# methodName is the name of the method to call
+# and params is a list of arguments to the method
+# where each argument is a "typed tcl" value defined below
+# xmlrpc::buildRequest
+# return an XML-RPC client request
+# xmlrpc::marshall
+# return a marshalled "typed tcl" value
+# xmlrpc::unmarshall
+# return an unmarshalled "typed tcl" value
+# xmlrpc::assoc
+# return a cons of a list if the key matches
+#
+# Typed Tcl values:
+# Because Tcl has no types for variables, all values will be represented
+# as a 2 element tuple of the form:
+# {type, value} where value is the original value
+# and type is a string describing its type.
+# Valid types (case sensitive, must be lowercase):
+# int
+# boolean
+# string
+# double
+# dateTime.iso8601
+# base64
+# struct
+# array
+# Note:
+# When marshalling dictionaries(tcl arrays), tcl has no
+# way of creating unnamed dictionaries. Therefore,
+# the way to use a dictionary is to create it as normal,
+# and refer to its name in the "tcl type".
+# For example:
+# set dict(first) {string eric}
+# xmlrpc::marshall {struct dict}
+#
+# the marshall procedure will attempt to "find" dict
+# using upvar(yuck!) and checking the global scope.
+#
+# Unmarshalling of a dictionary results in a 2 element
+# list of the form (remaining, alist)
+# where remaining is unused marshalled data (should be empty)
+# and alist is an A-list.
+# An A-list has the form:
+# {key, datum} where key is the key and datum is its value.
+# The method "assoc" is provided to access information from
+# this data structure. It behaves like the LISP assoc, in that
+# it will return the (key, datum) pair if a match is found.
+
+# TODO:
+# -currently server functions can't return dictionaries
+# -add more error handling
+# -Check for [{}] in unmarshalling
+# -Empty dictionaries
+
+package provide xmlrpc 0.3
+
+namespace eval xmlrpc {
+ namespace export call buildRequest marshall unmarshall assoc
+ namespace export serve
+
+ variable READSIZE 4096; # read size
+
+ variable WS "\[ |\n|\t\|\r]"; # WhiteSpace
+ variable W "\[^ |\n|\t\]"; # a word with no spaces
+ variable DIGIT "\[0-9\]"; # Digit
+
+ variable response ""; # response to return
+ variable acceptfd ""; # socket to listen on
+ variable DEBUG 0; # debug
+}
+
+# Given a port, create a new socket
+# and start listening on it
+#
+proc xmlrpc::serve {port} {
+ variable acceptfd
+
+ set acceptfd [socket -server xmlrpc::serveOnce $port]
+ return $acceptfd
+}
+
+# Accept a new connection
+#
+proc xmlrpc::serveOnce {sock addr port} {
+ variable READSIZE
+
+ debug "in serveOnce: addr: $addr"
+ debug "in serveOnce: port: $port"
+ fconfigure $sock -translation {lf lf} -buffersize $READSIZE
+ fconfigure $sock -blocking off
+ fileevent $sock readable [list xmlrpc::doRequest $sock]
+}
+
+# Given a socket,
+# Handle an XML-RPC request
+#
+proc xmlrpc::doRequest {sock} {
+ variable WS
+
+ set res [readHeader $sock]
+ set headerStatus [lindex $res 0]; # Header + Status
+ set body [lindex $res 1]; # Body, if any
+
+ set RE "\[^\n\]+\n(.*)"
+ if {![regexp $RE $headerStatus {} header]} {
+ return [errReturn "Malformed Request"]
+ }
+
+ set body [getBody $sock $header $body]
+
+ set RE "<\?xml.version=."; # xml version
+ append RE "\[^\?\]+.\?>$WS*"; # version number
+ append RE "<methodCall>$WS*"; # methodCall tag
+ append RE "<methodName>"; # methodName tag
+ append RE "(\[a-zA-Z0-9_:\/\\.\]+)"; # method Name
+ append RE "</methodName>$WS*"; # end methodName tag
+ append RE "(.*)"; # parameters, if any
+ append RE "</methodCall>.*"; # end methodCall tag
+
+ if {![regexp $RE $body {} mname params]} {
+ return [errReturn "Malformed methodCall"]
+ }
+
+ set args {}
+ set param [string range $params 8 end]
+ set param [string trim $param]
+ while {[string range $param 0 6] == "<param>" ||
+ [string range $param 0 7] == "</param>"} {
+ # check for empty element
+ if {[string range $param 0 7] == "</param>"} {
+ lappend args {}
+ set param [string range $param 8 end]
+ set param [string trim $param]
+ continue
+ }
+
+ set param [string range $param 7 end]
+ set param [string trim $param]
+
+ set res [unmarshall $param]
+ set param [lindex $res 0]
+ set el [lindex $res 1]
+ lappend args $el
+ if {[string range $param 0 7] != "</param>"} {
+ return [errReturn "Invalid End Param"]
+ }
+ set param [string range $param 8 end]
+ set param [string trim $param]
+ }
+ if {$param != "</params>"} {
+ return [errReturn "Invalid End Params"]
+ }
+ if {[catch {set result [eval ::$mname $args]}]} {
+ set response [buildFault 100 "eval() failed"]
+ } else {
+ set response [buildResponse $result]
+ }
+ debug "in doRequest: response:\n$response"
+ puts -nonewline $sock $response
+ flush $sock
+ catch {close $sock}
+}
+
+# Given a "typed tcl" value,
+# build an XML-RPC response
+#
+proc buildResponse {result} {
+ # build the body
+ set body "<?xml version=\"1.0\"?>\n"
+ append body "<methodResponse>\n"
+ append body "\t<params>\n"
+ append body "\t\t<param>\n"
+ append body [xmlrpc::marshall $result 3 2]
+ append body "\n\t\t</param>\n"
+ append body "\t</params>\n"
+ append body "</methodResponse>\n"
+
+ set lenbod [string length $body]
+
+ # build the header
+ set header "HTTP/1.1 200 OK\n"
+ append header "Content-Type: text/xml\n"
+ append header "Content-length: $lenbod\n"
+
+ set response "$header\n$body"
+ return $response
+ #return [string trim $response]
+}
+
+# Given an error code (integer)
+# and an errmsg (string)
+# build an XML-RPC fault
+#
+proc buildFault {errcode errmsg} {
+ set err(faultCode) [list int $errcode]
+ set err(faultString) [list string $errmsg]
+
+ # build the body
+ set body "<?xml version=\"1.0\"?>\n"
+ append body "<methodResponse>\n"
+ append body "\t<fault>\n"
+ append body [xmlrpc::marshall {struct err} 2]
+ append body "\t</fault>\n"
+ append body "</methodResponse>\n"
+
+ set lenbod [string length $body]
+
+ # build the header
+ set header "HTTP/1.1 200 OK\n"
+ append header "Content-Type: text/xml\n"
+ append header "Content-length: $lenbod\n"
+
+ set response "$header\n$body"
+ return [string trim $response]
+}
+
+# send an XML-RPC request
+#
+proc xmlrpc::call {url method methodName params {ntabs 4} {distance 3}} {
+ variable READSIZE
+ variable response
+ global readdone
+ global xmlcall
+
+ set readdone 0
+ set xmlcall 1
+ set RE {http://([^:]+):([0-9]+)}
+ if {![regexp $RE $url {} host port]} {
+ return [errReturn "Malformed URL"]
+ }
+
+ set sock [socket $host $port]
+ fconfigure $sock -translation {lf lf} -buffersize $READSIZE
+ fconfigure $sock -blocking off
+ if {[catch {set request [buildRequest $method $methodName $params $ntabs $distance]}]} {
+ return
+ }
+ puts -nonewline $sock $request
+ flush $sock
+ fileevent $sock readable [list xmlrpc::getResponse $sock]
+ vwait readdone
+ catch {close $sock}
+ if {$readdone > 0} {
+ return $response
+ } else {
+ return [errReturn "xmlrpc::call failed"]
+ }
+}
+
+# Given a socket to read on,
+# get and parse the response from the server
+#
+proc xmlrpc::getResponse {sock} {
+ variable response
+ global readdone
+
+ set res [readHeader $sock]
+ set headerStatus [lindex $res 0]; # Header + Status
+ set body [lindex $res 1]; # Body, if any
+
+ set header [parseHTTPCode $headerStatus]
+ set body [getBody $sock $header $body]
+ set response [parseResponse $body]
+ set readdone 1
+}
+
+# Given a socket to read on,
+# a string of header information
+# and a string, body,
+# return a string representing the entire body
+#
+proc xmlrpc::getBody {sock header body} {
+ set res [parseHTTPHeaders $header]
+ set headersl [lindex $res 1]; # A-list of headers
+
+ set expLenl [assoc "Content-Length" $headersl]
+ if {$expLenl == {}} {
+ return [errReturn "No Content-Length found"]
+ }
+ set expLen [lindex $expLenl 1]
+ set body [readBody $body $expLen $sock]
+ return $body
+}
+
+# Given a socket to read on,
+# Return a 2 element list of the form:
+# {header, body} where both are strings
+# Note: header will include the first line which is the status
+#
+proc xmlrpc::readHeader {sock} {
+ set buffer ""
+ while {1} {
+ if {[catch {set buff [nbRead $sock]}]} {
+ return [errReturn "Premature eof"]
+ }
+ append buffer $buff
+ set nindex [string first "\n\n" $buffer]
+ if {$nindex > 0} {
+ break
+ }
+ set bindex [string first "\r\n\r\n" $buffer]
+ if {$bindex > 0} {
+ break
+ }
+ }
+ if {$nindex > 0} {
+ set header [string range $buffer 0 [expr $nindex - 1]]
+ set body [string range $buffer [expr $nindex + 2] end]
+ } elseif {$bindex > 0} {
+ set header [string range $buffer 0 [expr $bindex - 1]]
+ set body [string range $buffer [expr $bindex + 4] end]
+ }
+ return [list $header $body]
+}
+
+# Given the body buffer,
+# the number of bytes expected in the body (Content-Length)
+# and a socket to read on,
+# return the entire body buffer
+#
+proc xmlrpc::readBody {body expLen sock} {
+ set newbody $body
+ while {1} {
+ if {[catch {set buff [nbRead $sock]}]} {
+ return [errReturn "Premature eof"]
+ }
+ append newbody $buff
+ set bodLen [string length $newbody]
+ if {$bodLen == $expLen} {
+ break
+ } elseif {$bodLen > $expLen} {
+ return [errReturn "Content-length:$expLen does not match Body Length:$bodLen"]
+ }
+ }
+ return $newbody
+}
+
+# Given a string, str,
+# check the HTTP status
+# and return the unused portion of str
+#
+proc xmlrpc::parseHTTPCode {str} {
+ variable DIGIT
+
+ set RE "HTTP/"; # HTTP message
+ append RE "($DIGIT+\\.*$DIGIT*)."; # version
+ append RE "($DIGIT+)."; # status code
+ append RE "(\[^\n\]+)\n(.*)"; # status message
+
+ if {![regexp $RE $str {} vern status code rest]} {
+ return [errReturn "Unrecognized HTTP code:\n$str"]
+ }
+ if {$status != "200"} {
+ return [errReturn "Bad HTTP status: $status"]
+ }
+ return $rest
+}
+
+# Given a string, str,
+# return a 2 element list of the form:
+# {remaining, alist}
+# where remaining is the unused portion of str
+# and alist is an A-list of header information
+#
+proc xmlrpc::parseHTTPHeaders {str} {
+ set headers {}
+ set remain {}
+ set remainp 0
+ set RE {([^:]+):(.*)}
+
+ set parts [split $str "\n"]
+ foreach {part} $parts {
+ if {$part == ""
+ && !$remainp} {
+ set remainp 1
+ continue
+ }
+ if {$remainp} {
+ lappend remain $part
+ continue
+ }
+ if {![regexp $RE $part {} key value]} {
+ return [errReturn "Unrecognized HTTP Header format: $part"]
+ }
+ set value [string trim $value]
+ lappend headers [list $key $value]
+ }
+ set rest [join $remain "\n"]
+ return [list $rest $headers]
+}
+
+# Given a string, str
+# parse the response from the server
+# returning the unmarshalled data
+#
+proc xmlrpc::parseResponse {str} {
+ variable WS
+
+ set RE "<\?xml.version=."; # xml version
+ append RE "(\[^\?\]+).\?>$WS*"; # version number
+ append RE "<methodResponse>$WS*"; # method response tag
+ append RE "<params>$WS*"; # params tag
+ append RE "<param>$WS*"; # param tag
+ append RE "(<value>.*)"; # value
+ append RE "</param>$WS*"; # end param tag
+ append RE "</params>$WS*"; # end params tag
+ append RE "</methodResponse>"; # end method response tag
+
+ if {![regexp $RE $str {} vern value]} {
+ set RE "<\?xml.version=."; # xml version
+ append RE "(\[^\?\]+).\?>$WS*"; # version number
+ append RE "<methodResponse>$WS*"; # method response tag
+ append RE "<fault>$WS*"; # fault tag
+ append RE "(.*)$WS*"; # fault values
+ append RE "</fault>$WS*"; # end fault tag
+ append RE "</methodResponse>"; # end method response tag
+
+ if {![regexp $RE $str {} vern value]} {
+ return [errReturn "Unrecognized response from server"]
+ }
+ }
+ set result [unmarshall $value]
+ return $result
+}
+
+# Given a non-blocking file descriptor, fd
+# do a read
+#
+proc xmlrpc::nbRead {fd} {
+ variable READSIZE
+
+ fileevent $fd readable ""
+ set buffer ""
+ while {1} {
+ if {[eof $fd]} {
+ catch {close $fd}
+ break
+ }
+ set temp [read $fd $READSIZE]
+ if {$temp == ""} {
+ break
+ }
+ append buffer $temp
+ }
+ return $buffer
+}
+
+# Given a methodName,
+# and a list of parameters,
+# return an XML-RPC request
+#
+proc xmlrpc::buildRequest {method methodName params {ntabs 4} {distance 2}} {
+ # build the body
+ set body "<?xml version=\"1.0\"?>\n"
+ append body "<methodCall>\n"
+ append body "\t<methodName>$methodName</methodName>\n"
+ if {$params != {}} {
+ append body "\t\t<params>\n"
+ foreach {param} $params {
+ append body "\t\t\t<param>\n"
+ append body [xmlrpc::marshall $param $ntabs $distance]
+ append body "\n\t\t\t</param>\n"
+ }
+ append body "\t\t</params>\n"
+ }
+ append body "</methodCall>\n"
+# set body [regsub -all "\n" $body "\r\n"]
+ set lenbod [string length $body]
+
+ # build the header
+ set header "POST /$method HTTP/1.0\n"
+ append header "Content-Type: text/xml\n"
+ append header "Content-length: $lenbod\n"
+# set header [regsub -all "\n" $header "\r\n"]
+
+# set request "$header\r\n$body"
+ set request "$header\n$body"
+ return $request
+}
+
+# Given a "typed tcl" value
+# return the marshalled representation
+#
+proc xmlrpc::marshall {param {ntabs 0} {distance 1}} {
+ if {![validParam $param]} {
+ return [errReturn "Malformed Parameter: $param"]
+ }
+
+ set strtabs ""
+ for {set x 0} {$x < $ntabs} {incr x} {
+ append strtabs "\t"
+ }
+
+ set type [lindex $param 0]
+ set val [lindex $param 1]
+
+ if {$type == "int"} {
+ return "$strtabs<value><int>$val</int></value>"
+ } elseif {$type == "i4"} {
+ return "$strtabs<value><i4>$val</i4></value>"
+ } elseif {$type == "boolean"} {
+ return "$strtabs<value><boolean>$val</boolean></value>"
+ } elseif {$type == "string"} {
+ return "$strtabs<value><string>$val</string></value>"
+ } elseif {$type == "double"} {
+ return "$strtabs<value><double>$val</double></value>"
+ } elseif {$type == "dateTime.iso8601"} {
+ return "$strtabs<value><dateTime.iso8601>$val</dateTime.iso8601></value>"
+ } elseif {$type == "base64"} {
+ return "$strtabs<value><base64>$val</base64></value>"
+ } elseif {$type == "struct"} {
+ # get the original caller's scope
+ upvar $distance $val dict
+ # try the global scope
+ if {![array exists dict]} {
+ upvar #0 $val dict
+ }
+
+ set str "$strtabs<value>\n"
+ append str "$strtabs\t<struct>\n"
+ foreach {k v} [array get dict] {
+ append str "$strtabs\t\t<member>\n"
+ append str "$strtabs\t\t\t<name>$k</name>\n"
+ append str [marshall $v [expr $ntabs + 3] [expr $distance + 1]]
+ append str "\n$strtabs\t\t</member>\n"
+ }
+ append str "$strtabs\t</struct>\n"
+ append str "$strtabs</value>\n"
+ return $str
+ } elseif {$type == "array"} {
+ set str "$strtabs<value>\n"
+ append str "$strtabs\t<array>\n"
+ append str "$strtabs\t\t<data>\n"
+ foreach el $val {
+ append str [marshall $el [expr $ntabs + 3] [expr $distance + 1]]
+ append str "\n"
+ }
+ append str "$strtabs\t\t</data>\n"
+ append str "$strtabs\t</array>\n"
+ append str "$strtabs</value>\n"
+ return $str
+ } else {
+ return [errReturn "Unknown type: $type"]
+ }
+}
+
+# Given a value param,
+# return 1 if it a valid parameter
+# return 0 if not
+# A valid parameter is a 2 element tuple
+#
+proc xmlrpc::validParam {param} {
+ if {[llength $param] != 2} {
+ return 0
+ }
+ return 1
+}
+
+# Given a marshalled value,
+# unmarshall it and return it
+#
+proc xmlrpc::unmarshall {str} {
+ set str [string trim $str]
+ if {[string range $str 0 6] != "<value>"} {
+ # check for empty element
+ if {[string range $str 0 7] != "</value>"} {
+ return [errReturn "Bad value tag"]
+ }
+ set rest [string range $str 8 end]
+ set rest [string trim $rest]
+ return [list $rest {}]
+ }
+
+ set str [string range $str 7 end]
+ set str [string trimleft $str]
+ set RE {<([^>]+)>}
+ if {![regexp $RE $str {} btag]} {
+ return [errReturn "No beginning tag found: $str"]
+ }
+
+ if {$btag == "int" || $btag == "i4"} {
+ set res [umInt $str]
+ } elseif {$btag== "boolean"} {
+ set res [umBool $str]
+ } elseif {$btag == "string"} {
+ set res [umString $str]
+ } elseif {$btag == "double"} {
+ set res [umDouble $str]
+ } elseif {$btag == "dateTime.iso8601"} {
+ set res [umDateTime $str]
+ } elseif {$btag == "base64"} {
+ set res [umBase64 $str]
+ } elseif {$btag == "array"} {
+ set res [umArray $str]
+ } elseif {$btag == "struct"} {
+ set res [umStruct $str]
+ } else {
+ #check for empty element
+ if {[string range $btag 0 1]=={/}} {
+ set id [string first "]" $str ]
+ if {$id != -1} {
+ set rest [string range $str $id end]
+ set rest [string trim $rest]
+ return [list $rest {}]
+ }
+ }
+
+ # return [errReturn "Unknown type: $str"]
+ # assume string
+ set id [string first "<" $str ]
+ if {$id != -1} {
+ set vv [string range $str 0 [expr $id-1]]
+ set rr [string range $str $id end]
+ set str "<string>${vv}</string>${rr}"
+ set res [umString $str]
+ } else {
+ return [errReturn "Unknown type: $str"]
+ }
+ }
+
+ set rest [lindex $res 0]
+ set val [lindex $res 1]
+
+ if {[string range $rest 0 7] != "</value>"} {
+ return [errReturn "Invalid close of value tag"]
+ }
+ set rest [string range $rest 8 end]
+ set rest [string trim $rest]
+ return [list $rest $val]
+}
+
+proc xmlrpc::umInt {str} {
+ variable WS
+ variable DIGIT
+
+ set RE "<(int|i4)>$WS*"; # int tag
+ append RE "(-*)($DIGIT+)$WS*"; # int value
+ append RE "</(int|i4)>$WS*"; # end int tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} tag negp digits engtag rest]} {
+ return [errReturn "Invalid Integer"]
+ }
+ if {$negp != ""} {
+ set digits [expr -1 * $digits]
+ } else {
+ set digits [expr 1 * $digits]
+ }
+ set rest [string trim $rest]
+ return [list $rest $digits]
+}
+
+proc xmlrpc::umBool {str} {
+ variable WS
+
+ set RE "<boolean>$WS*"; # boolean tag
+ append RE "(0|1)$WS*"; # boolean value
+ append RE "</boolean>$WS*"; # end boolean tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} bool rest]} {
+ return [errReturn "Invalid Boolean"]
+ }
+ set rest [string trim $rest]
+ return [list $rest $bool]
+}
+
+proc xmlrpc::umString {str} {
+ variable WS
+
+ set RE "<string>"; # string tag
+ append RE "(\[^<\]*)"; # string value
+ append RE "</string>$WS*"; # end string tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} s rest]} {
+ return [errReturn "Invalid String"]
+ }
+ set rest [string trim $rest]
+ return [list $rest $s]
+}
+
+proc xmlrpc::umDouble {str} {
+ variable WS
+ variable DIGIT
+
+ set RE "<double>$WS*"; # double tag
+ append RE "(-*)($DIGIT*\.?$DIGIT*)$WS*"; # double value
+ append RE "</double>$WS*"; # end double tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} negp d rest]} {
+ return [errReturn "Invalid Double"]
+ }
+ if {$negp != ""} {
+ set d [expr -1 * $d]
+ } else {
+ set d [expr 1 * $d]
+ }
+ set rest [string trim $rest]
+ return [list $rest $d]
+}
+
+proc xmlrpc::umDateTime {str} {
+ variable WS
+ variable DIGIT
+
+ set RE "<dateTime\\.iso8601>$WS*"; # dateTime tag
+ append RE "($DIGIT+T$DIGIT+:$DIGIT+:$DIGIT+)$WS*"; # dateTime value
+ append RE "</dateTime\\.iso8601>$WS*"; # end string tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} dateTime rest]} {
+ return [errReturn "Invalid DateTime"]
+ }
+ set rest [string trim $rest]
+ return [list $rest $dateTime]
+}
+
+proc xmlrpc::umBase64 {str} {
+ variable WS
+
+ set RE "<base64>"; # string tag
+ append RE "(\[^<\]*)"; # string value
+ append RE "</base64>$WS*"; # end string tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} s rest]} {
+ return [errReturn "Invalid Base64"]
+ }
+ set rest [string trim $rest]
+ return [list $rest $s]
+}
+
+proc xmlrpc::umArray {str} {
+ variable WS
+
+ set RE "<array>$WS*"; # array tag
+ append RE "<data>$WS*"; # data tag
+ append RE "(.*)"; # leftover
+
+ if {![regexp $RE $str {} rest]} {
+ return [errReturn "Invalid Array"]
+ }
+ set l {}
+ while {[string range $rest 0 6] == "<value>"} {
+ set res [unmarshall $rest]
+ set rest [lindex $res 0]
+ set el [lindex $res 1]
+ lappend l $el
+ }
+
+ set REAREND "</data>$WS*"; # end data tag
+ append REAREND "</array>$WS*"; # end array tag
+ append REAREND "(.*)"; # leftover
+
+ if {![regexp $REAREND $rest {} leftover]} {
+ return [errReturn "Invalid End Array"]
+ }
+ return [list $leftover $l]
+}
+
+proc xmlrpc::umStruct {str} {
+ variable WS
+ variable W
+
+ if {[string range $str 0 7] != "<struct>"} {
+ return [errReturn "Invalid Struct"]
+ }
+
+ set RE "<name>$WS*"; # name tag
+ append RE "($W+?)$WS*"; # key
+ append RE "</name>$WS*"; # end name tag
+ append RE "(<value>.*)"; # value tag
+
+ set l {}
+ set str [string range $str 8 end]
+ set str [string trim $str]
+ while {[string range $str 0 7] == "<member>"} {
+ set str [string range $str 8 end]
+ set str [string trim $str]
+ if {![regexp $RE $str {} key val]} {
+ return [errReturn "Invalid Struct Member"]
+ }
+ set res [unmarshall $val]
+ set str [lindex $res 0]
+ set el [lindex $res 1]
+ lappend l [list $key $el]
+ if {[string range $str 0 8] != "</member>"} {
+ return [errReturn "Invalid End Struct Member"]
+ }
+ set str [string range $str 9 end]
+ set str [string trim $str]
+ }
+ if {[string range $str 0 8] != "</struct>"} {
+ return [errReturn "Invalid End Struct"]
+ }
+ set str [string range $str 9 end]
+ set str [string trim $str]
+ return [list $str $l]
+}
+
+# Given a key, and a list of elements where each element is of the form:
+# {key, datum}, return {key, datum} if the requested key matches
+# a key in the list.
+# Returns the first match found in the list.
+# Return {} on failure
+#
+proc xmlrpc::assoc {key list} {
+ foreach {cons} $list {
+ set tkey [lindex $cons 0]
+ if {[string tolower $key] == [string tolower $tkey]} {
+ return $cons
+ }
+ }
+ return {}
+}
+
+proc xmlrpc::warn {msg} {
+ puts stderr $msg
+}
+
+proc xmlrpc::debug {msg} {
+ variable DEBUG
+
+ if {$DEBUG} {
+ puts "$msg"
+ }
+}
+
+proc xmlrpc::errReturn {msg} {
+ warn $msg
+ return -code error
+}
+
+proc xmlrpc::test {} {
+ set person(first) {string "eric m"}
+ set person(last) {string yeh}
+ set employed(programmer) {struct person}
+
+ #set xml [marshall {struct employed}]
+ #set w [list {int 1}]
+ #set q [list "array \{$w\}" {int 2} {string eric}]
+ #puts [marshall "array \{$q\}"]
+
+ #set xml [marshall {array {{int 1} {string {hello everybody}}}}]
+ set xml [marshall {struct person}]
+ debug "xml:\n$xml"
+ set data [unmarshall $xml]
+ debug "data: $data"
+ set data [lindex $data 1]
+ debug "data: $data"
+ puts [assoc "first" $data]
+}
+
+#proc bgerror {error} {
+# global xmlcall
+# if {$xmlcall} {
+# global readdone
+# set readdone -1
+# set xmlcall 0
+# }
+#}
+
+#xmlrpc::test
diff --git a/ds9/library/xpa.tcl b/ds9/library/xpa.tcl
new file mode 100644
index 0000000..8e587d9
--- /dev/null
+++ b/ds9/library/xpa.tcl
@@ -0,0 +1,2251 @@
+# Copyright (C) 1999-2016
+# Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+# For conditions of distribution and use, see copyright notice in "copyright"
+
+package provide DS9 1.0
+
+proc InitXPA {} {
+ global ds9
+ global pds9
+ global env
+
+ if {!$pds9(xpa)} {
+ return
+ }
+
+ # this is needed
+ # if there is a problem (usually with VPN), XPA will hang
+ # so preempt and set to local before XPAINIT
+ if {[info exists env(XPA_METHOD)]} {
+ if {$env(XPA_METHOD) != {local}} {
+ if {[checkdns {} 5]} {
+ set env(XPA_METHOD) local
+ Error [msgcat::mc {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}]
+ }
+ }
+ } else {
+ if {[checkdns {} 5]} {
+ set env(XPA_METHOD) local
+ Error [msgcat::mc {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}]
+ }
+ }
+
+ switch -- $ds9(wm) {
+ x11 -
+ win32 {}
+ aqua {set env(PATH) "$ds9(root):$env(PATH)"}
+ }
+
+ catch {CreateXPA}
+ UpdateFileMenu
+}
+
+proc CreateXPA {} {
+ global xpa
+ global ds9
+
+ set xpa [xpacmdnew "DS9" $ds9(title)]
+
+ xpacmdadd $xpa 2mass \
+ {} \
+ XPASend2MASS {} {} \
+ XPARcvd2MASS {} "fillbuf=false"
+
+ xpacmdadd $xpa 3d \
+ {} \
+ XPASend3D {} {} \
+ XPARcvd3D {} "fillbuf=false"
+
+ xpacmdadd $xpa 3D \
+ {} \
+ XPASend3D {} {} \
+ XPARcvd3D {} "fillbuf=false"
+
+ xpacmdadd $xpa about \
+ {} \
+ XPASendAbout {} {} \
+ {} {} {}
+
+ xpacmdadd $xpa align \
+ {} \
+ XPASendAlign {} {} \
+ XPARcvdAlign {} {}
+
+ xpacmdadd $xpa analysis \
+ {} \
+ XPASendAnalysis {} {} \
+ XPARcvdAnalysis {} {}
+
+ xpacmdadd $xpa array \
+ {} \
+ XPASendArray {} {} \
+ XPARcvdArray {} "fillbuf=false"
+
+ xpacmdadd $xpa background \
+ {} \
+ XPASendBg {} {} \
+ XPARcvdBg {} {}
+
+ xpacmdadd $xpa backup \
+ {} \
+ {} {} {} \
+ XPARcvdBackup {} {}
+
+ xpacmdadd $xpa bg \
+ {} \
+ XPASendBg {} {} \
+ XPARcvdBg {} {}
+
+ xpacmdadd $xpa blink \
+ {} \
+ XPASendBlink {} {} \
+ XPARcvdBlink {} "fillbuf=false"
+
+ xpacmdadd $xpa bin \
+ {} \
+ XPASendBin {} {} \
+ XPARcvdBin {} "fillbuf=false"
+
+ xpacmdadd $xpa block \
+ {} \
+ XPASendBlock {} {} \
+ XPARcvdBlock {} "fillbuf=false"
+
+ xpacmdadd $xpa cat \
+ {} \
+ XPASendCAT {} {} \
+ XPARcvdCAT {} "fillbuf=false"
+
+ xpacmdadd $xpa catalog \
+ {} \
+ XPASendCAT {} {} \
+ XPARcvdCAT {} "fillbuf=false"
+
+ xpacmdadd $xpa cd \
+ {} \
+ XPASendCD {} {} \
+ XPARcvdCD {} "fillbuf=false"
+
+ xpacmdadd $xpa cmap \
+ {} \
+ XPASendCmap {} {} \
+ XPARcvdCmap {} "fillbuf=false"
+
+ xpacmdadd $xpa colorbar \
+ {} \
+ XPASendColorbar {} {} \
+ XPARcvdColorbar {} "fillbuf=false"
+
+ xpacmdadd $xpa console \
+ {} \
+ {} {} {} \
+ XPARcvdConsole {} "fillbuf=false"
+
+ xpacmdadd $xpa contour \
+ {} \
+ XPASendContour {} {} \
+ XPARcvdContour {} "fillbuf=false"
+
+ xpacmdadd $xpa contours \
+ {} \
+ XPASendContour {} {} \
+ XPARcvdContour {} "fillbuf=false"
+
+ xpacmdadd $xpa crop \
+ {} \
+ XPASendCrop {} {} \
+ XPARcvdCrop {} "fillbuf=false"
+
+ xpacmdadd $xpa crosshair \
+ {} \
+ XPASendCrosshair {} {} \
+ XPARcvdCrosshair {} "fillbuf=false"
+
+ xpacmdadd $xpa cube \
+ {} \
+ XPASendCube {} {} \
+ XPARcvdCube {} "fillbuf=false"
+
+ xpacmdadd $xpa cursor \
+ {} \
+ {} {} {} \
+ XPARcvdCursor {} "fillbuf=false"
+
+ xpacmdadd $xpa data \
+ {} \
+ XPASendData {} {} \
+ {} {} {}
+
+ xpacmdadd $xpa datacube \
+ {} \
+ XPASendCube {} {} \
+ XPARcvdCube {} "fillbuf=false"
+
+ xpacmdadd $xpa dss \
+ {} \
+ XPASendSAO {} {} \
+ XPARcvdSAO {} "fillbuf=false"
+
+ xpacmdadd $xpa dsssao \
+ {} \
+ XPASendSAO {} {} \
+ XPARcvdSAO {} "fillbuf=false"
+
+ xpacmdadd $xpa dsseso \
+ {} \
+ XPASendESO {} {} \
+ XPARcvdESO {} "fillbuf=false"
+
+ xpacmdadd $xpa dssstsci \
+ {} \
+ XPASendSTSCI {} {} \
+ XPARcvdSTSCI {} "fillbuf=false"
+
+ xpacmdadd $xpa envi \
+ {} \
+ {} {} {} \
+ XPARcvdENVI {} "fillbuf=false"
+
+ xpacmdadd $xpa exit \
+ {} \
+ {} {} {} \
+ XPARcvdExit {} "fillbuf=false"
+
+ xpacmdadd $xpa export \
+ {} \
+ {} {} {} \
+ XPARcvdExport {} "fillbuf=false"
+
+ xpacmdadd $xpa file \
+ {} \
+ XPASendFile {} {} \
+ XPARcvdFile {} "fillbuf=false"
+
+ xpacmdadd $xpa first \
+ {} \
+ XPASendVLA {} {} \
+ XPARcvdVLA {} "fillbuf=false"
+
+ xpacmdadd $xpa fits \
+ {} \
+ XPASendFits {} "fillbuf=false" \
+ XPARcvdFits {} "fillbuf=false"
+
+ xpacmdadd $xpa frame \
+ {} \
+ XPASendFrame {} {} \
+ XPARcvdFrame {} "fillbuf=false"
+
+ xpacmdadd $xpa gif \
+ {} \
+ XPASendGIF {} {} \
+ XPARcvdGIF {} "fillbuf=false"
+
+ xpacmdadd $xpa grid \
+ {} \
+ XPASendGrid {} {} \
+ XPARcvdGrid {} "fillbuf=false"
+
+ xpacmdadd $xpa header \
+ {} \
+ {} {} {} \
+ XPARcvdHeader {} "fillbuf=false"
+
+ xpacmdadd $xpa height \
+ {} \
+ XPASendHeight {} {} \
+ XPARcvdHeight {} "fillbuf=false"
+
+ xpacmdadd $xpa iconify \
+ {} \
+ XPASendIconify {} {} \
+ XPARcvdIconify {} "fillbuf=false"
+
+ xpacmdadd $xpa iexam \
+ {} \
+ XPASendIExam {} {} \
+ {} {} {}
+
+ xpacmdadd $xpa iis \
+ {} \
+ XPASendIIS {} {} \
+ XPARcvdIIS {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa imexam \
+ {} \
+ XPASendIExam {} {} \
+ {} {} {}
+
+ xpacmdadd $xpa jpg \
+ {} \
+ XPASendJPEG {} {} \
+ XPARcvdJPEG {} "fillbuf=false"
+
+ xpacmdadd $xpa jpeg \
+ {} \
+ XPASendJPEG {} {} \
+ XPARcvdJPEG {} "fillbuf=false"
+
+ xpacmdadd $xpa lock \
+ {} \
+ XPASendLock {} {} \
+ XPARcvdLock {} "fillbuf=false"
+
+ xpacmdadd $xpa lower \
+ {} \
+ {} {} {} \
+ XPARcvdLower {} "fillbuf=false"
+
+ xpacmdadd $xpa magnifier \
+ {} \
+ XPASendMagnifier {} {} \
+ XPARcvdMagnifier {} "fillbuf=false"
+
+ xpacmdadd $xpa mask \
+ {} \
+ XPASendMask {} {} \
+ XPARcvdMask {} "fillbuf=false"
+
+ xpacmdadd $xpa match \
+ {} \
+ {} {} {} \
+ XPARcvdMatch {} "fillbuf=false"
+
+ xpacmdadd $xpa mecube \
+ {} \
+ XPASendMECube {} "fillbuf=false" \
+ XPARcvdMECube {} "fillbuf=false"
+
+ xpacmdadd $xpa memf \
+ {} \
+ {} {} {} \
+ XPARcvdMultiFrame {} "fillbuf=false"
+
+ xpacmdadd $xpa minmax \
+ {} \
+ XPASendMinMax {} {} \
+ XPARcvdMinMax {} "fillbuf=false"
+
+ xpacmdadd $xpa mode \
+ {} \
+ XPASendMode {} {} \
+ XPARcvdMode {} "fillbuf=false"
+
+ xpacmdadd $xpa mosaic \
+ {} \
+ XPASendMosaic {} {} \
+ XPARcvdMosaic {} "fillbuf=false"
+
+ xpacmdadd $xpa mosaicimage \
+ {} \
+ XPASendMosaicImage {} {} \
+ XPARcvdMosaicImage {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa mosaicwcs \
+ {} \
+ XPASendMosaicWCS {} {} \
+ XPARcvdMosaicWCS {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa mosaiciraf \
+ {} \
+ {} {} {} \
+ XPARcvdMosaicIRAF {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa mosaicimagewcs \
+ {} \
+ XPASendMosaicImageWCS {} {} \
+ XPARcvdMosaicImageWCS {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa mosaicimageiraf \
+ {} \
+ {} {} {} \
+ XPARcvdMosaicImageIRAF {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa mosaicimagewfpc2 \
+ {} \
+ {} {} {} \
+ XPARcvdMosaicImageWFPC2 {} "fillbuf=false"
+
+ xpacmdadd $xpa multiframe \
+ {} \
+ {} {} {} \
+ XPARcvdMultiFrame {} "fillbuf=false"
+
+ xpacmdadd $xpa movie \
+ {} \
+ {} {} {} \
+ XPARcvdMovie {} "fillbuf=false"
+
+ xpacmdadd $xpa nameserver \
+ {} \
+ XPASendNRES {} {} \
+ XPARcvdNRES {} "fillbuf=false"
+
+ xpacmdadd $xpa nan \
+ {} \
+ XPASendNan {} {} \
+ XPARcvdNan {} {}
+
+ xpacmdadd $xpa nrrd \
+ {} \
+ XPASendNRRD {} {} \
+ XPARcvdNRRD {} "fillbuf=false"
+
+ xpacmdadd $xpa nvss \
+ {} \
+ XPASendNVSS {} {} \
+ XPARcvdNVSS {} "fillbuf=false"
+
+ xpacmdadd $xpa orient \
+ {} \
+ XPASendOrient {} {} \
+ XPARcvdOrient {} "fillbuf=false"
+
+ xpacmdadd $xpa {page setup} \
+ {} \
+ XPASendPageSetup {} {} \
+ XPARcvdPageSetup {} "fillbuf=false"
+
+ xpacmdadd $xpa pagesetup \
+ {} \
+ XPASendPageSetup {} {} \
+ XPARcvdPageSetup {} "fillbuf=false"
+
+ xpacmdadd $xpa pspagesetup \
+ {} \
+ XPASendPSPageSetup {} {} \
+ XPARcvdPSPageSetup {} "fillbuf=false"
+
+ xpacmdadd $xpa pan \
+ {} \
+ XPASendPan {} {} \
+ XPARcvdPan {} "fillbuf=false"
+
+ xpacmdadd $xpa pixeltable \
+ {} \
+ XPASendPixelTable {} {} \
+ XPARcvdPixelTable {} "fillbuf=false"
+
+ xpacmdadd $xpa plot \
+ {} \
+ XPASendPlot {} {} \
+ XPARcvdPlot {} {}
+
+ xpacmdadd $xpa png \
+ {} \
+ XPASendPNG {} {} \
+ XPARcvdPNG {} "fillbuf=false"
+
+ xpacmdadd $xpa prefs \
+ {} \
+ XPASendPrefs {} {} \
+ XPARcvdPrefs {} "fillbuf=false"
+
+ xpacmdadd $xpa preserve \
+ {} \
+ XPASendPreserve {} {} \
+ XPARcvdPreserve {} "fillbuf=false"
+
+ xpacmdadd $xpa print \
+ {} \
+ XPASendPrint {} {} \
+ XPARcvdPrint {} "fillbuf=false"
+
+ xpacmdadd $xpa psprint \
+ {} \
+ XPASendPSPrint {} {} \
+ XPARcvdPSPrint {} "fillbuf=false"
+
+ xpacmdadd $xpa quit \
+ {} \
+ {} {} {} \
+ XPARcvdExit {} "fillbuf=false"
+
+ xpacmdadd $xpa raise \
+ {} \
+ {} {} {} \
+ XPARcvdRaise {} "fillbuf=false"
+
+ xpacmdadd $xpa region \
+ {} \
+ XPASendRegions {} {} \
+ XPARcvdRegions {} "fillbuf=false"
+
+ xpacmdadd $xpa regions \
+ {} \
+ XPASendRegions {} {} \
+ XPARcvdRegions {} "fillbuf=false"
+
+ xpacmdadd $xpa restore \
+ {} \
+ {} {} {} \
+ XPARcvdRestore {} {}
+
+ xpacmdadd $xpa rgb \
+ {} \
+ XPASendRGB {} {} \
+ XPARcvdRGB {} "fillbuf=false"
+
+ xpacmdadd $xpa rgbarray \
+ {} \
+ XPASendRGBArray {} {} \
+ XPARcvdRGBArray {} "fillbuf=false"
+
+ xpacmdadd $xpa rgbcube \
+ {} \
+ XPASendRGBCube {} {} \
+ XPARcvdRGBCube {} "fillbuf=false"
+
+ xpacmdadd $xpa rgbimage \
+ {} \
+ XPASendRGBImage {} {} \
+ XPARcvdRGBImage {} "fillbuf=false"
+
+ xpacmdadd $xpa rotate \
+ {} \
+ XPASendRotate {} {} \
+ XPARcvdRotate {} "fillbuf=false"
+
+ xpacmdadd $xpa save \
+ {} \
+ {} {} {} \
+ XPARcvdSave {} "fillbuf=false"
+
+ xpacmdadd $xpa saveimage \
+ {} \
+ {} {} {} \
+ XPARcvdSaveImage {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa savefits \
+ {} \
+ {} {} {} \
+ XPARcvdSave {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa savempeg \
+ {} \
+ {} {} {} \
+ XPARcvdMovie {} "fillbuf=false"
+
+ xpacmdadd $xpa scale \
+ {} \
+ XPASendScale {} {} \
+ XPARcvdScale {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa sfits \
+ {} \
+ {} {} {} \
+ XPARcvdSFits {} "fillbuf=false"
+
+ xpacmdadd $xpa sia \
+ {} \
+ XPASendSIA {} {} \
+ XPARcvdSIA {} "fillbuf=false"
+
+ xpacmdadd $xpa single \
+ {} \
+ XPASendSingle {} {} \
+ XPARcvdSingle {} "fillbuf=false"
+
+ xpacmdadd $xpa shm \
+ {} \
+ XPASendShm {} {} \
+ XPARcvdShm {} "fillbuf=false"
+
+ xpacmdadd $xpa skyview \
+ {} \
+ XPASendSkyView {} {} \
+ XPARcvdSkyView {} "fillbuf=false"
+
+ xpacmdadd $xpa sleep \
+ {} \
+ {} {} {} \
+ XPARcvdSleep {} "fillbuf=false"
+
+ xpacmdadd $xpa slice \
+ {} \
+ XPASendCube {} {} \
+ XPARcvdCube {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa smosaic \
+ {} \
+ {} {} {} \
+ XPARcvdSMosaic {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa smosaicwcs \
+ {} \
+ {} {} {} \
+ XPARcvdSMosaicWCS {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa smosaiciraf \
+ {} \
+ {} {} {} \
+ XPARcvdSMosaicIRAF {} "fillbuf=false"
+
+ xpacmdadd $xpa smooth \
+ {} \
+ XPASendSmooth {} {} \
+ XPARcvdSmooth {} "fillbuf=false"
+
+ xpacmdadd $xpa source \
+ {} \
+ {} {} {} \
+ XPARcvdSource {} "fillbuf=false"
+
+ # backward compatibility
+ xpacmdadd $xpa srgbcube \
+ {} \
+ {} {} {} \
+ XPARcvdSRGBCube {} "fillbuf=false"
+
+ xpacmdadd $xpa tcl \
+ {} \
+ {} {} {} \
+ XPARcvdTcl {} {}
+
+ # backward compatibility
+ xpacmdadd $xpa theme \
+ {} \
+ XPASendTheme {} {} \
+ XPARcvdTheme {} "fillbuf=false"
+
+ xpacmdadd $xpa threads \
+ {} \
+ XPASendThreads {} {} \
+ XPARcvdThreads {} {}
+
+ xpacmdadd $xpa tif \
+ {} \
+ XPASendTIFF {} {} \
+ XPARcvdTIFF {} "fillbuf=false"
+
+ xpacmdadd $xpa tiff \
+ {} \
+ XPASendTIFF {} {} \
+ XPARcvdTIFF {} "fillbuf=false"
+
+ xpacmdadd $xpa tile \
+ {} \
+ XPASendTile {} {} \
+ XPARcvdTile {} "fillbuf=false"
+
+ xpacmdadd $xpa update \
+ {} \
+ {} {} {} \
+ XPARcvdUpdate {} "fillbuf=false"
+
+ xpacmdadd $xpa url \
+ {} \
+ {} {} {} \
+ XPARcvdURLFits {} {}
+
+ xpacmdadd $xpa version \
+ {} \
+ XPASendVersion {} {} \
+ {} {} {}
+
+ xpacmdadd $xpa view \
+ {} \
+ XPASendView {} {} \
+ XPARcvdView {} "fillbuf=false"
+
+ xpacmdadd $xpa vla \
+ {} \
+ XPASendVLA {} {} \
+ XPARcvdVLA {} "fillbuf=false"
+
+ xpacmdadd $xpa vlss \
+ {} \
+ XPASendVLSS {} {} \
+ XPARcvdVLSS {} "fillbuf=false"
+
+ xpacmdadd $xpa vo \
+ {} \
+ XPASendVO {} {} \
+ XPARcvdVO {} "fillbuf=false"
+
+ xpacmdadd $xpa wcs \
+ {} \
+ XPASendWCS {} {} \
+ XPARcvdWCS {} "fillbuf=false"
+
+ xpacmdadd $xpa web \
+ {} \
+ XPASendWeb {} {} \
+ XPARcvdWeb {} "fillbuf=false"
+
+ xpacmdadd $xpa width \
+ {} \
+ XPASendWidth {} {} \
+ XPARcvdWidth {} "fillbuf=false"
+
+ xpacmdadd $xpa xpa \
+ {} \
+ XPASendXPA {} {} \
+ XPARcvdXPA {} "fillbuf=false"
+
+ xpacmdadd $xpa zscale \
+ {} \
+ XPASendZScale {} {} \
+ XPARcvdZScale {} "fillbuf=false"
+
+ xpacmdadd $xpa zoom \
+ {} \
+ XPASendZoom {} {} \
+ XPARcvdZoom {} "fillbuf=false"
+}
+
+proc XPASend2MASS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSend2MASSCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvd2MASS {xpa cdata param buf len} {
+ XPADebug "XPARcvd2MASS" $param
+ InitError xpa
+ catch {set i 0; Process2MASSCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASend3D {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSend3DCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvd3D {xpa cdata param buf len} {
+ XPADebug "XPARcvd3D" $param
+ InitError xpa
+ catch {set i 0; Process3DCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendAbout {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendAboutCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPASendAlign {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendAlignCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdAlign {xpa cdata param buf len} {
+ XPADebug "XPARcvdAlign" $param
+ InitError xpa
+ catch {set i 0; ProcessAlignCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendAnalysis {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendAnalysisCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdAnalysis {xpa cdata param buf len} {
+ XPADebug "XPARcvdAnalysis" $param
+ InitError xpa
+ catch {set i 0; ProcessAnalysisCmd param i $buf {}}
+ XPACatchError $xpa
+}
+
+proc XPASendArray {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendArrayCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdArray {xpa cdata param buf len} {
+ XPADebug "XPARcvdArray" $param
+ InitError xpa
+ catch {set i 0; ProcessArrayCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendBg {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendBgCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdBg {xpa cdata param buf len} {
+ XPADebug "XPARcvdBg" $param
+ InitError xpa
+ catch {set i 0; ProcessBgCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdBackup {xpa cdata param buf len} {
+ XPADebug "XPARcvdBackup" $param
+ InitError xpa
+ catch {set i 0; ProcessBackupCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendBlink {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendBlinkCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdBlink {xpa cdata param buf len} {
+ XPADebug "XPARcvdBlink" $param
+ InitError xpa
+ catch {set i 0; ProcessBlinkCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendBin {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendBinCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdBin {xpa cdata param buf len} {
+ XPADebug "XPARcvdBin" $param
+ InitError xpa
+ catch {set i 0; ProcessBinCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendBlock {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendBlockCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdBlock {xpa cdata param buf len} {
+ XPADebug "XPARcvdBlock" $param
+ InitError xpa
+ catch {set i 0; ProcessBlockCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCAT {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCatalogCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCAT {xpa cdata param buf len} {
+ XPADebug "XPARcvdCat" $param
+ InitError xpa
+ catch {set i 0; ProcessCatalogCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCD {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCDCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCD {xpa cdata param buf len} {
+ XPADebug "XPARcvdCD" $param
+ InitError xpa
+ catch {set i 0; ProcessCDCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdConsole {xpa cdata param buf len} {
+ XPADebug "XPARcvdConsole" $param
+ InitError xpa
+ catch {set i 0; ProcessConsoleCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendContour {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendContourCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdContour {xpa cdata param buf len} {
+ XPADebug "XPARcvdContour" $param
+ InitError xpa
+ catch {set i 0; ProcessContourCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCmap {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCmapCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCmap {xpa cdata param buf len} {
+ XPADebug "XPARcvdCmap" $param
+ InitError xpa
+ catch {set i 0; ProcessCmapCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendColorbar {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendColorbarCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdColorbar {xpa cdata param buf len} {
+ XPADebug "XPARcvdColorbar" $param
+ InitError xpa
+ catch {set i 0; ProcessColorbarCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCrop {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCropCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCrop {xpa cdata param buf len} {
+ XPADebug "XPARcvdCrop" $param
+ InitError xpa
+ catch {set i 0; ProcessCropCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCrosshair {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCrosshairCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCrosshair {xpa cdata param buf len} {
+ XPADebug "XPARcvdCrosshair" $param
+ InitError xpa
+ catch {set i 0; ProcessCrosshairCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendCube {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendCubeCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCube {xpa cdata param buf len} {
+ XPADebug "XPARcvdCube" $param
+ InitError xpa
+ catch {set i 0; ProcessCubeCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdCursor {xpa cdata param buf len} {
+ XPADebug "XPARcvdCursor" $param
+ InitError xpa
+ catch {set i 0; ProcessCursorCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendData {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendDataCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPASendSAO {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSAOCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSAO {xpa cdata param buf len} {
+ XPADebug "XPARcvdSAO" $param
+ InitError xpa
+ catch {set i 0; ProcessSAOCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendESO {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendESOCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdESO {xpa cdata param buf len} {
+ XPADebug "XPARcvdESO" $param
+ InitError xpa
+ catch {set i 0; ProcessESOCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendSTSCI {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSTSCICmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSTSCI {xpa cdata param buf len} {
+ XPADebug "XPARcvdSTSCI" $param
+ InitError xpa
+ catch {set i 0; ProcessSTSCICmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdENVI {xpa cdata param buf len} {
+ XPADebug "XPARcvdENVI" $param
+ InitError xpa
+ catch {set i 0; ProcessENVICmd param i {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdExit {xpa cdata param buf len} {
+ XPADebug "XPARcvdExit" $param
+ InitError xpa
+ catch {set i 0; ProcessQuitCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdExport {xpa cdata param buf len} {
+ XPADebug "XPARcvdExport" $param
+ InitError xpa
+ catch {set i 0; ProcessExportCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendFile {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendFileCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdFile {xpa cdata param buf len} {
+ XPADebug "XPARcvdFile" $param
+ InitError xpa
+ catch {
+ # do not send socket as it does not contain data, only filenames
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessFileCmd param i {} [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessFileCmd param i {} dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendFits {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendFitsCmd xpasetbuf $xpa $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdFits {xpa cdata param buf len} {
+ XPADebug "XPARcvdFits" $param
+ InitError xpa
+ catch {set i 0; ProcessFitsCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendFrame {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendFrameCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdFrame {xpa cdata param buf len} {
+ XPADebug "XPARcvdFrame" $param
+ InitError xpa
+ catch {set i 0; ProcessFrameCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendGIF {xpa cdata param} {
+ InitError xpa
+ catch {
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessSendGIFCmd {} {} $param [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessSendGIFCmd {} {} $param dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPARcvdGIF {xpa cdata param buf len} {
+ XPADebug "XPARcvdGIF" $param
+ InitError xpa
+ catch {
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessGIFCmd param i [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessGIFCmd param i dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendGrid {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendGridCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdGrid {xpa cdata param buf len} {
+ XPADebug "XPARcvdGrid" $param
+ InitError xpa
+ catch {set i 0; ProcessGridCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdHeader {xpa cdata param buf len} {
+ XPADebug "XPARcvdHeader" $param
+ InitError xpa
+ catch {set i 0; ProcessHeaderCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendHeight {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendHeightCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdHeight {xpa cdata param buf len} {
+ XPADebug "XPARcvdHeight" $param
+ InitError xpa
+ catch {set i 0; ProcessHeightCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendIconify {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendIconifyCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdIconify {xpa cdata param buf len} {
+ XPADebug "XPARcvdIconify" $param
+ InitError xpa
+ catch {set i 0; ProcessIconifyCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendIExam {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendIExamCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPASendIIS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendIISCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdIIS {xpa cdata param buf len} {
+ XPADebug "XPARcvdIIS" $param
+ InitError xpa
+ catch {set i 0; ProcessIISCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendJPEG {xpa cdata param} {
+ InitError xpa
+ catch {
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessSendJPEGCmd {} {} $param [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessSendJPEGCmd {} {} $param dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPARcvdJPEG {xpa cdata param buf len} {
+ XPADebug "XPARcvdJPEG" $param
+ InitError xpa
+ catch {
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessJPEGCmd param i [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessJPEGCmd param i dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendLock {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendLockCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdLock {xpa cdata param buf len} {
+ XPADebug "XPARcvdLock" $param
+ InitError xpa
+ catch {set i 0; ProcessLockCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdLower {xpa cdata param buf len} {
+ XPADebug "XPARcvdLower" $param
+ InitError xpa
+ catch {set i 0; ProcessLowerCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendMagnifier {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMagnifierCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMagnifier {xpa cdata param buf len} {
+ XPADebug "XPARcvdMagnifier" $param
+ InitError xpa
+ catch {set i 0; ProcessMagnifierCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendMask {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMaskCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMask {xpa cdata param buf len} {
+ XPADebug "XPARcvdMask" $param
+ InitError xpa
+ catch {set i 0; ProcessMaskCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMatch {xpa cdata param buf len} {
+ XPADebug "XPARcvdMatch" $param
+ InitError xpa
+ catch {set i 0; ProcessMatchCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendMECube {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMECubeCmd xpasetbuf $xpa $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMECube {xpa cdata param buf len} {
+ XPADebug "XPARcvdMECube" $param
+ InitError xpa
+ catch {set i 0; ProcessMECubeCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendMinMax {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMinMaxCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMinMax {xpa cdata param buf len} {
+ XPADebug "XPARcvdMinMax" $param
+ InitError xpa
+ catch {set i 0; ProcessMinMaxCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendMode {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendModeCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMode {xpa cdata param buf len} {
+ XPADebug "XPARcvdMode" $param
+ InitError xpa
+ catch {set i 0; ProcessModeCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendMosaic {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMosaicCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMosaic {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaic" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendMosaicImage {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMosaicImageCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMosaicImage {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicImage" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicImageCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPASendMosaicWCS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMosaicWCSCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdMosaicWCS {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicWCS" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicWCSCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdMosaicIRAF {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicIRAF" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicIRAFCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPASendMosaicImageWCS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendMosaicImageWCSCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdMosaicImageWCS {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicImageWCS" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicImageWCSCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdMosaicImageIRAF {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicImageIRAF" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicImageIRAFCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdMosaicImageWFPC2 {xpa cdata param buf len} {
+ XPADebug "XPARcvdMosaicImageWFPC2" $param
+ InitError xpa
+ catch {set i 0; ProcessMosaicImageWFPC2Cmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMovie {xpa cdata param buf len} {
+ XPADebug "XPARcvdMovie" $param
+ InitError xpa
+ catch {set i 0; ProcessMovieCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdMultiFrame {xpa cdata param buf len} {
+ XPADebug "XPARcvdMultiFrame" $param
+ InitError xpa
+ catch {
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessMultiFrameCmd param i [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessMultiFrameCmd param i dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendNan {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendNanCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdNan {xpa cdata param buf len} {
+ XPADebug "XPARcvdNan" $param
+ InitError xpa
+ catch {set i 0; ProcessNanCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendNRES {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendNRESCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdNRES {xpa cdata param buf len} {
+ XPADebug "XPARcvdNRES" $param
+ InitError xpa
+ catch {set i 0; ProcessNRESCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendNRRD {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendNRRDCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdNRRD {xpa cdata param buf len} {
+ XPADebug "XPARcvdNRRD" $param
+ InitError xpa
+ catch {set i 0; ProcessNRRDCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendNVSS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendNVSSCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdNVSS {xpa cdata param buf len} {
+ XPADebug "XPARcvdNVSS" $param
+ InitError xpa
+ catch {set i 0; ProcessNVSSCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendOrient {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendOrientCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdOrient {xpa cdata param buf len} {
+ XPADebug "XPARcvdOrient" $param
+ InitError xpa
+ catch {set i 0; ProcessOrientCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPageSetup {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPageSetupCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPageSetup {xpa cdata param buf len} {
+ XPADebug "XPARcvdPageSetup" $param
+ InitError xpa
+ catch {set i 0; ProcessPageSetupCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPSPageSetup {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPSPageSetupCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPSPageSetup {xpa cdata param buf len} {
+ XPADebug "XPARcvdPSPageSetup" $param
+ InitError xpa
+ catch {set i 0; ProcessPSPageSetupCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPan {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPanCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPan {xpa cdata param buf len} {
+ XPADebug "XPARcvdPan" $param
+ InitError xpa
+ catch {set i 0; ProcessPanCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPixelTable {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPixelTableCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPixelTable {xpa cdata param buf len} {
+ XPADebug "XPARcvdPixelTable" $param
+ InitError xpa
+ catch {set i 0; ProcessPixelTableCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPlot {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPlotCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPlot {xpa cdata param buf len} {
+ XPADebug "XPARcvdPlot" $param
+ InitError xpa
+ catch {set i 0; ProcessPlotCmd param i $buf {}}
+ XPACatchError $xpa
+}
+
+proc XPASendPNG {xpa cdata param} {
+ InitError xpa
+ catch {
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessSendPNGCmd {} {} $param [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessSendPNGCmd {} {} $param dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPARcvdPNG {xpa cdata param buf len} {
+ XPADebug "XPARcvdPNG" $param
+ InitError xpa
+ catch {
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessPNGCmd param i [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessPNGCmd param i dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendPrefs {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPrefsCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPrefs {xpa cdata param buf len} {
+ XPADebug "XPARcvdPrefs" $param
+ InitError xpa
+ catch {set i 0; ProcessPrefsCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPreserve {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPreserveCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPreserve {xpa cdata param buf len} {
+ XPADebug "XPARcvdPreserve" $param
+ InitError xpa
+ catch {set i 0; ProcessPreserveCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendPrint {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPrintCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPrint {xpa cdata param buf len} {
+ XPADebug "XPARcvdPrint" $param
+ InitError xpa
+ catch {
+ if {[XPAIsLocal]} {
+ set i 0
+ ProcessPrintCmd param i
+ } else {
+ Error [msgcat::mc {This function is not available.}]
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendPSPrint {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendPSPrintCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdPSPrint {xpa cdata param buf len} {
+ XPADebug "XPARcvdPSPrint" $param
+ InitError xpa
+ catch {
+ if {[XPAIsLocal]} {
+ set i 0
+ ProcessPSPrintCmd param i
+ } else {
+ Error [msgcat::mc {This function is not available.}]
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPARcvdRaise {xpa cdata param buf len} {
+ XPADebug "XPARcvdRaise" $param
+ InitError xpa
+ catch {set i 0; ProcessRaiseCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendRegions {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRegionsCmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRegions {xpa cdata param buf len} {
+ XPADebug "XPARcvdRegions" $param
+ InitError xpa
+ catch {set i 0; ProcessRegionsCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRestore {xpa cdata param buf len} {
+ XPADebug "XPARcvdRestore" $param
+ InitError xpa
+ catch {set i 0; ProcessRestoreCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendRGB {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRGBCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRGB {xpa cdata param buf len} {
+ XPADebug "XPARcvdRGB" $param
+ InitError xpa
+ catch {set i 0; ProcessRGBCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendRGBArray {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRGBArrayCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRGBArray {xpa cdata param buf len} {
+ XPADebug "XPARcvdRGBArray" $param
+ InitError xpa
+ catch {set i 0; ProcessRGBArrayCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendRGBCube {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRGBCubeCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRGBCube {xpa cdata param buf len} {
+ XPADebug "XPARcvdRGBCube" $param
+ InitError xpa
+ catch {set i 0; ProcessRGBCubeCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendRGBImage {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRGBImageCmd {} {} $param [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRGBImage {xpa cdata param buf len} {
+ XPADebug "XPARcvdRGBImage" $param
+ InitError xpa
+ catch {set i 0; ProcessRGBImageCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendRotate {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendRotateCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdRotate {xpa cdata param buf len} {
+ XPADebug "XPARcvdRotate" $param
+ InitError xpa
+ catch {set i 0; ProcessRotateCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSave {xpa cdata param buf len} {
+ XPADebug "XPARcvdSave" $param
+ InitError xpa
+ catch {set i 0; ProcessSaveCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSaveImage {xpa cdata param buf len} {
+ XPADebug "XPARcvdSaveImage" $param
+ InitError xpa
+ catch {set i 0; ProcessSaveImageCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendScale {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendScaleCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdScale {xpa cdata param buf len} {
+ XPADebug "XPARcvdScale" $param
+ InitError xpa
+ catch {set i 0; ProcessScaleCmd param i}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdSFits {xpa cdata param buf len} {
+ XPADebug "XPARcvdSFits" $param
+ InitError xpa
+ catch {set i 0; ProcessSFitsCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendSIA {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSIACmd xpasetbuf $xpa $param {} {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSIA {xpa cdata param buf len} {
+ XPADebug "XPARcvdSIA" $param
+ InitError xpa
+ catch {set i 0; ProcessSIACmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendSingle {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSingleCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSingle {xpa cdata param buf len} {
+ XPADebug "XPARcvdSingle" $param
+ InitError xpa
+ catch {set i 0; ProcessSingleCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendShm {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendShmCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdShm {xpa cdata param buf len} {
+ XPADebug "XPARcvdShm" $param
+ InitError xpa
+ catch {set i 0; ProcessShmCmd param i 0}
+ XPACatchError $xpa
+}
+
+proc XPASendSkyView {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSkyViewCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSkyView {xpa cdata param buf len} {
+ XPADebug "XPARcvdSkyView" $param
+ InitError xpa
+ catch {set i 0; ProcessSkyViewCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSleep {xpa cdata param buf len} {
+ XPADebug "XPARcvdSleep" $param
+ InitError xpa
+ catch {set i 0; ProcessSleepCmd param i}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdSMosaic {xpa cdata param buf len} {
+ XPADebug "XPARcvdSMosaic" $param
+ InitError xpa
+ catch {set i 0; ProcessSMosaicCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdSMosaicWCS {xpa cdata param buf len} {
+ XPADebug "XPARcvdSMosaicWCS" $param
+ InitError xpa
+ catch {set i 0; ProcessSMosaicWCSCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdSMosaicIRAF {xpa cdata param buf len} {
+ XPADebug "XPARcvdSMosaicIRAF" $param
+ InitError xpa
+ catch {set i 0; ProcessSMosaicIRAFCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendSmooth {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendSmoothCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSmooth {xpa cdata param buf len} {
+ XPADebug "XPARcvdSmooth" $param
+ InitError xpa
+ catch {set i 0; ProcessSmoothCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdSource {xpa cdata param buf len} {
+ XPADebug "XPARcvdSource" $param
+ InitError xpa
+ catch {
+ if {[XPAIsLocal]} {
+ set i 0
+ ProcessSourceCmd param i
+ } else {
+ Error [msgcat::mc {This function is not available.}]
+ }
+ }
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdSRGBCube {xpa cdata param buf len} {
+ XPADebug "XPARcvdSRGBCube" $param
+ InitError xpa
+ catch {set i 0; ProcessSRGBCubeCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPARcvdTcl {xpa cdata param buf len} {
+ XPADebug "XPARcvdTcl" $param
+ InitError xpa
+ catch {
+ if {[XPAIsLocal]} {
+ set i 0
+ ProcessTclCmd param i $buf {}
+ } else {
+ Error [msgcat::mc {This function is not available.}]
+ }
+ }
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPASendTheme {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendThemeCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+# backward compatibility
+proc XPARcvdTheme {xpa cdata param buf len} {
+ XPADebug "XPARcvdTheme" $param
+ InitError xpa
+ catch {set i 0; ProcessThemeCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendThreads {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendThreadsCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdThreads {xpa cdata param buf len} {
+ XPADebug "XPARcvdThreads" $param
+ InitError xpa
+ catch {set i 0; ProcessThreadsCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendTIFF {xpa cdata param} {
+ InitError xpa
+ catch {
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessSendTIFFCmd {} {} $param [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessSendTIFFCmd {} {} $param dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPARcvdTIFF {xpa cdata param buf len} {
+ XPADebug "XPARcvdTIFF" $param
+ InitError xpa
+ catch {
+ set i 0
+ global tcl_platform
+ switch $tcl_platform(os) {
+ Linux -
+ Darwin -
+ SunOS {ProcessTIFFCmd param i [xparec $xpa datachan] {}}
+ {Windows NT} {ProcessTIFFCmd param i dummy {}}
+ }
+ }
+ XPACatchError $xpa
+}
+
+proc XPASendTile {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendTileCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdTile {xpa cdata param buf len} {
+ XPADebug "XPARcvdTile" $param
+ InitError xpa
+ catch {set i 0; ProcessTileCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdUpdate {xpa cdata param buf len} {
+ XPADebug "XPARcvdUpdate" $param
+ InitError xpa
+ catch {set i 0; ProcessUpdateCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPARcvdURLFits {xpa cdata param buf len} {
+ XPADebug "XPARcvdURLFits" $param
+ InitError xpa
+ catch {set i 0; ProcessURLFitsCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendVersion {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendVersionCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPASendView {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendViewCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdView {xpa cdata param buf len} {
+ XPADebug "XPARcvdView" $param
+ InitError xpa
+ catch {set i 0; ProcessViewCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendVLA {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendVLACmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdVLA {xpa cdata param buf len} {
+ XPADebug "XPARcvdVLA" $param
+ InitError xpa
+ catch {set i 0; ProcessVLACmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendVLSS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendVLSSCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdVLSS {xpa cdata param buf len} {
+ XPADebug "XPARcvdVLSS" $param
+ InitError xpa
+ catch {set i 0; ProcessVLSSCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendVO {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendVOCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdVO {xpa cdata param buf len} {
+ XPADebug "XPARcvdVO" $param
+ InitError xpa
+ catch {set i 0; ProcessVOCmd param i}
+ # someone is setting the error state
+ InitError xpa
+}
+
+proc XPASendWCS {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendWCSCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdWCS {xpa cdata param buf len} {
+ XPADebug "XPARcvdWCS" $param
+ InitError xpa
+ catch {set i 0; ProcessWCSCmd param i [xparec $xpa datafd] {}}
+ XPACatchError $xpa
+}
+
+proc XPASendWeb {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendWebCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdWeb {xpa cdata param buf len} {
+ XPADebug "XPARcvdWeb" $param
+ InitError xpa
+ catch {set i 0; ProcessWebCmd param i}
+ # someone is setting an error state
+ InitError xpa
+}
+
+proc XPASendWidth {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendWidthCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdWidth {xpa cdata param buf len} {
+ XPADebug "XPARcvdWidth" $param
+ InitError xpa
+ catch {set i 0; ProcessWidthCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendXPA {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendXPACmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdXPA {xpa cdata param buf len} {
+ XPADebug "XPARcvdXPA" $param
+ InitError xpa
+ catch {set i 0; ProcessXPACmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendZoom {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendZoomCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdZoom {xpa cdata param buf len} {
+ XPADebug "XPARcvdZoom" $param
+ InitError xpa
+ catch {set i 0; ProcessZoomCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPASendZScale {xpa cdata param} {
+ InitError xpa
+ catch {ProcessSendZScaleCmd xpasetbuf $xpa $param}
+ XPACatchError $xpa
+}
+
+proc XPARcvdZScale {xpa cdata param buf len} {
+ XPADebug "XPARcvdZScale" $param
+ InitError xpa
+ catch {set i 0; ProcessZScaleCmd param i}
+ XPACatchError $xpa
+}
+
+proc XPAConnect {} {
+ global xpa
+
+ if {[info exists xpa]} {
+ catch {xpafree $xpa}
+ unset xpa
+ }
+ InitXPA
+
+ UpdateFileMenu
+}
+
+proc XPADisconnect {} {
+ global xpa
+
+ if {[info exists xpa]} {
+ if {[catch {xpafree $xpa} result]} {
+ Error "$result"
+ }
+ unset xpa
+ } else {
+ Error "[msgcat::mc {XPA not initialized}]"
+ }
+
+ UpdateFileMenu
+}
+
+proc XPAInfo {} {
+ global xpa
+
+ if {[info exists xpa]} {
+ SimpleTextDialog xpatxt "[msgcat::mc {XPA Information}]" \
+ 80 20 append bottom "[XPAInfoResult]"
+ } else {
+ Error "[msgcat::mc {XPA not initialized}]"
+ }
+}
+
+proc XPAInfoResult {} {
+ global xpa
+
+ set rr {}
+ if {[info exists xpa]} {
+ append rr "[format "XPA_VERSION:\t%s" [xparec $xpa version]]\n"
+ append rr "[format "XPA_CLASS:\t%s" [xparec $xpa class]]\n"
+ append rr "[format "XPA_NAME:\t%s" [xparec $xpa name]]\n"
+ append rr "[format "XPA_METHOD:\t%s" [xparec $xpa method]]\n"
+ }
+
+ return $rr
+}
+
+# unwind xpa errors
+# requires catch {} to allow a check to take place
+proc XPADebug {which param} {
+ global debug
+
+ if {$debug(tcl,xpa)} {
+ puts stderr "$which $param"
+ }
+}
+
+proc XPACatchError {xpa} {
+ global ds9
+ global icursor
+
+ global errorInfo
+ if {$errorInfo != {} || $ds9(msg) != {}} {
+ if {$ds9(msg) != {}} {
+ xpaerror $xpa $ds9(msg)
+ } else {
+ xpaerror $xpa [lindex [split $errorInfo "\n"] 0]
+ }
+ InitError xpa
+ }
+}
+
+proc XPAMethod {} {
+ global xpa
+
+ if {[info exists xpa]} {
+ return [xparec $xpa method]
+ } else {
+ return {}
+ }
+}
+
+proc XPAIsLocal {} {
+ global xpa
+ global env
+
+ if {[info exists env(XPA_METHOD)]} {
+ switch $env(XPA_METHOD) {
+ unix -
+ local {return 1}
+ }
+ }
+ return 0;
+}
+
+# Process Cmds
+
+proc ProcessXPAFirstCmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ global pds9
+ global env
+
+ switch -- [string tolower [lindex $var $i]] {
+ unix -
+ inet -
+ local -
+ localhost {set env(XPA_METHOD) [lindex $var $i]}
+ noxpans {set env(XPA_NSREGISTER) false}
+
+ yes -
+ true -
+ on -
+ 1 -
+ no -
+ false -
+ off -
+ 0 {set pds9(xpa) [FromYesNo [lindex $var $i]]}
+ }
+}
+
+proc ProcessXPACmd {varname iname} {
+ upvar $varname var
+ upvar $iname i
+
+ global ds9
+ global pds9
+
+ switch -- [string tolower [lindex $var $i]] {
+ tcl {
+ # backward compatibility
+ incr i
+ }
+
+ connect {XPAConnect}
+ disconnect {XPADisconnect}
+ info {XPAInfo}
+ }
+}
+
+proc ProcessSendXPACmd {proc id param} {
+ switch -- [string tolower [lindex $param 0]] {
+ info {$proc $id [XPAInfoResult]}
+ }
+}
diff --git a/ds9/macosx/Makefile.in b/ds9/macosx/Makefile.in
new file mode 100644
index 0000000..fc26af9
--- /dev/null
+++ b/ds9/macosx/Makefile.in
@@ -0,0 +1,201 @@
+include ../../make.pkgs
+
+TCL_LIB_SPEC = @TCL_LIB_SPEC@
+TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@
+TK_LIBS = @TK_LIBS@
+TK_LIB_SPEC = @TK_LIB_SPEC@
+TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@
+
+CC = @CC@
+CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
+CFLAGS_WARNING = @CFLAGS_WARNING@
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+
+INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
+
+PKG_CFLAGS = @PKG_CFLAGS@
+DEFS = @DEFS@ $(PKG_CFLAGS)
+
+CPPFLAGS = @CPPFLAGS@
+LIBS = @PKG_LIBS@ @LIBS@
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+
+.SUFFIXES: .c .C .$(OBJEXT)
+
+.c.@OBJEXT@:
+ $(COMPILE) -c $< -o $@
+
+.C.@OBJEXT@:
+ $(COMPILE) -c $< -o $@
+
+#--------------------------defines
+
+ID = $(shell finger $(shell whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo)
+
+OBJS = ds9.o tkAppInit.o
+
+LLIBS = \
+ ../../lib/tksao$(TKSAOVER)/libtksao$(TKSAOVER).a \
+ ../../lib/libfuntools.a \
+ ../../lib/libast.a \
+ ../../lib/libast_err.a \
+ ../../lib/libast_pal.a \
+ ../../lib/tksao$(TKSAOVER)/libtksao$(TKSAOVER).a \
+ ../../lib/tkhtml1$(TKHTMLVER)/libtkhtml1$(TKHTMLVER).a \
+ ../../lib/tkmpeg$(TKMPEGVER)/libtkmpeg$(TKMPEGVER).a \
+ ../../lib/Tclxml$(TCLXMLVER)/libTclxml$(TCLXMLVER).a \
+ ../../lib/Tktable$(TKTABLEVER)/libTktable$(TKTABLEVER).a \
+ ../../lib/Img$(TKIMGVER)/libtkimgpng1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libpngtcl1.4.12.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgtiff1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libtifftcl3.9.4.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgjpeg1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libjpegtcl8.4.a \
+ ../../lib/Img$(TKIMGVER)/libtkimggif1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgwindow1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libzlibtcl1.2.8.a \
+ ../../lib/Img$(TKIMGVER)/libtkimg1.4.2.a \
+ ../../lib/libxpa.a \
+ ../../lib/tcliis$(TCLIISVER)/libtcliis$(TCLIISVER).a \
+ ../../lib/tclcheckdns$(TCLCHECKDNSVER)/libtclcheckdns$(TCLCHECKDNSVER).a \
+ ../../lib/tclsignal$(TCLSIGNALVER)/libtclsignal$(TCLSIGNALVER).a \
+ ../../lib/tkblt$(TKBLTVER)/libtkbltstub$(TKBLTVER).a \
+ ../../lib/tkblt$(TKBLTVER)/libtkblt$(TKBLTVER).a \
+ ../../lib/tkmacosx$(TKMACOSXVER)/libtkmacosx$(TKMACOSXVER).a
+
+APPDIR = ../../bin/SAOImage\ DS9.app
+TKSAOFW = ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tksao.framework
+TKSAORES= ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tksao.framework/Resources
+TCLFW = ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tcl.framework
+TCLRES = ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tcl.framework/Resources
+TKFW = ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tk.framework
+TKRES = ../../bin/SAOImage\ DS9.app/Contents/Frameworks/Tk.framework/Resources
+
+#--------------------------main
+
+.NOTPARALLEL :
+.PHONY : ds9 debug appdir framework tcl tcl_debug tk tk_debug tcllib tkcon
+.PHONY : tkblt xpa compiler cleanup
+
+ds9 : ds9base appdir framework tcl tk tcllib tkcon tkblt xpa compiler cleanup
+ cp -p ds9base $(APPDIR)/Contents/MacOS/ds9
+ strip $(APPDIR)/Contents/MacOS/ds9
+ install_name_tool -change \
+ /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl \
+ @executable_path/../Frameworks/Tcl.framework/Tcl \
+ $(APPDIR)/Contents/MacOS/ds9
+ install_name_tool -change \
+ /Library/Frameworks/Tk.framework/Versions/8.6/Tk \
+ @executable_path/../Frameworks/Tk.framework/Tk \
+ $(APPDIR)/Contents/MacOS/ds9
+ cd ../../bin; codesign --deep -f -s "$(ID)" SAOImage\ DS9.app
+
+debug : ds9base appdir framework tcl tk tcllib tkcon tkblt xpa compiler cleanup
+ cp -p ds9base $(APPDIR)/Contents/MacOS/ds9
+ install_name_tool -change \
+ /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl \
+ @executable_path/../Frameworks/Tcl.framework/Tcl \
+ $(APPDIR)/Contents/MacOS/ds9
+ install_name_tool -change \
+ /Library/Frameworks/Tk.framework/Versions/8.6/Tk \
+ @executable_path/../Frameworks/Tk.framework/Tk \
+ $(APPDIR)/Contents/MacOS/ds9
+ cd ../../bin; codesign --deep -f -s "$(ID)" SAOImage\ DS9.app
+
+tkAppInit.o : tkAppInit.c
+ $(COMPILE) -DTK_LOCAL_APPINIT=SAOAppInit \
+ -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook -c tkAppInit.c -o $@
+
+tkAppInit.c : ../../tk$(TCLVER)/unix/tkAppInit.c
+ cp ../../tk$(TCLVER)/unix/tkAppInit.c .
+
+ds9base : $(OBJS) $(LLIBS)
+ $(RM) $@
+ $(CC) $(CFLAGS) -o $@ \
+ $(OBJS) \
+ $(LLIBS) \
+ $(LIBS) \
+ $(TK_STUB_LIB_SPEC) $(TK_LIB_SPEC) \
+ $(TCL_STUB_LIB_SPEC) $(TCL_LIB_SPEC) \
+ $(TK_LIBS)
+
+appdir :
+ rm -rf $(APPDIR)
+ cp -rp SAOImage\ DS9.app ../../bin/.
+
+framework:
+ cp -pr ../library $(TKSAORES)/.
+ cp -pr ../msgs $(TKSAORES)/.
+ cp -pr ../doc $(TKSAORES)/.
+ cp -pr ../cmaps $(TKSAORES)/.
+ cp -pr ../template $(TKSAORES)/.
+
+ rm $(TKSAORES)/library/source.tcl
+ echo "pkg_mkIndex $(TKSAORES)/library *.tcl; exit" | ../../bin/tclsh8.6
+
+tcl :
+ cp -p ../../build/tcl/Tcl.framework/Versions/8.6/Tcl $(TCLFW)/.
+ cp -pr ../../build/tcl/Tcl.framework/Versions/8.6/Resources/* $(TCLRES)/.
+
+tcl_debug:
+ cp -p ../../build/tcl/Tcl.framework/Versions/8.6/Tcl_debug $(TCLFW)/Tcl
+ cp -pr ../../build/tcl/Tcl.framework/Versions/8.6/Resources/* $(TCLRES)/.
+
+tk :
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Tk $(TKFW)/.
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Resources/Info.plist \
+ $(TKRES)/.
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Resources/license.terms \
+ $(TKRES)/.
+ cp -rp ../../build/tk/Tk.framework/Versions/8.6/Resources/Scripts \
+ $(TKRES)/.
+
+tk_debug:
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Tk_debug $(TKFW)/Tk
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Resources/Info.plist \
+ $(TKRES)/.
+ cp -p ../../build/tk/Tk.framework/Versions/8.6/Resources/license.terms \
+ $(TKRES)/.
+ cp -rp ../../build/tk/Tk.framework/Versions/8.6/Resources/Scripts \
+ $(TKRES)/.
+
+tcllib :
+ cp -pr ../../tcllib/modules/base64 $(TKSAORES)/.
+ cp -pr ../../tcllib/modules/ftp $(TKSAORES)/.
+ cp -pr ../../tcllib/modules/log $(TKSAORES)/.
+ cp -pr ../../tcllib/modules/textutil $(TKSAORES)/.
+ cp -pr ../../tcllib/modules/math $(TKSAORES)/.
+
+tkcon :
+ mkdir $(TKSAORES)/tkcon
+ cp -p ../../tkcon/*.tcl $(TKSAORES)/tkcon/.
+
+tkblt :
+ mkdir $(TKSAORES)/tkblt
+ cp -p ../../tkblt/library/graph.tcl $(TKSAORES)/tkblt/.
+ echo "pkg_mkIndex $(TKSAORES)/tkblt *.tcl; exit" | ../../bin/tclsh8.6
+
+xpa :
+ cp -pr ../../bin/xpans $(TKSAORES)/.
+
+compiler:
+ cp -p ../../compilers/pcc-i386-snowleopard.tar.gz $(TKSAORES)/.
+
+cleanup:
+ cd $(APPDIR); find . -depth -name CVS -exec rm -rf {} \;
+ cd $(APPDIR); find . -name keepme -exec rm -rf {} \;
+
+#--------------------------cleanup
+
+.PHONY : clean distclean
+
+clean :
+ cd ../library; $(MAKE) clean
+ $(RM) core *~ *# ds9Base ds9 *.o
+
+distclean: clean
+ -rm -f Makefile config.cache config.log config.status
+
+
diff --git a/ds9/macosx/README b/ds9/macosx/README
new file mode 100644
index 0000000..6b52930
--- /dev/null
+++ b/ds9/macosx/README
@@ -0,0 +1,5 @@
+ To install SAOimage DS9, drag and drop the DS9 icon onto the Applications
+ Folder. You also can drag the DS9 icon from Applications to your Dock in
+ order to make DS9 more easily accessible.
+
+ Email us with questions and comments: saord@cfa.harvard.edu
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tcl.framework/Resources/keepme b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tcl.framework/Resources/keepme
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tcl.framework/Resources/keepme
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tk.framework/Resources/keepme b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tk.framework/Resources/keepme
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tk.framework/Resources/keepme
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tksao.framework/Resources/Info.plist b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tksao.framework/Resources/Info.plist
new file mode 100644
index 0000000..8059750
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Frameworks/Tksao.framework/Resources/Info.plist
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!--
+ Copyright (C) 1999-2015
+ Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+ For conditions of distribution and use, see copyright notice in "copyright"
+ this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Tk</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Tk AQUA 8.6.1,
+Copyright © 1989-2013 Tcl Core Team,
+Copyright © 2002-2013 Daniel A. Steffen,
+Copyright © 2001-2009 Apple Inc.,
+Copyright © 2001-2002 Jim Ingham &amp; Ian Reid</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.tcltk.tklibrary</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Tk AQUA 8.6</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>8.6.1</string>
+ <key>CFBundleSignature</key>
+ <string>Tk </string>
+ <key>CFBundleVersion</key>
+ <string>8.6.1</string>
+</dict>
+</plist>
+-->
+
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Tk</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Tksao 7.4,
+Copyright 1999-2015
+Smithsonian Astrophysical Observatory"</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sao.tksao</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>7.4</string>
+ <key>CFBundleSignature</key>
+ <string>Tksao </string>
+ <key>CFBundleVersion</key>
+ <string>7.4</string>
+</dict>
+</plist>
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Info.plist b/ds9/macosx/SAOImage DS9.app/Contents/Info.plist
new file mode 100644
index 0000000..af4d70f
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Info.plist
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>fits</string>
+ <string>fit</string>
+ <string>fts</string>
+ <string>fitz</string>
+ <string>ftz</string>
+ <string>fz</string>
+ </array>
+ <key>CFBundleTypeIconFile</key>
+ <string>fits.icns</string>
+ <key>CFBundleTypeMIMETypes</key>
+ <array>
+ <string>image/fits</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>Flexible Image Transport System</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>FITS</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
+ <key>CFBundleExecutable</key>
+ <string>ds9</string>
+ <key>CFBundleGetInfoString</key>
+ <string>"SAOImage DS9 7.5rc2
+Copyright 1999-2016
+Smithsonian Astrophysical Observatory"</string>
+ <key>CFBundleIconFile</key>
+ <string>App.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.sao.SAOImageDS9</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>SAOImage DS9</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>7.5rc2</string>
+ <key>CFBundleSignature</key>
+ <string>DS9</string>
+ <key>CFBundleVersion</key>
+ <string>7.5rc2</string>
+ <key>NSHighResolutionCapable</key>
+ <string>True</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.8.0</string>
+ <key>LSRequiresCarbon</key>
+ <true/>
+ <key>LSEnvironment</key>
+ <dict>
+ <key>PATH</key>
+ <string>/sw/bin:/usr/local/bin:/opt/local/bin:/usr/bin:/bin/:/usr/sbin:/sbin</string>
+ </dict>
+</dict>
+</plist>
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/MacOS/keepme b/ds9/macosx/SAOImage DS9.app/Contents/MacOS/keepme
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/MacOS/keepme
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Resources/App.icns b/ds9/macosx/SAOImage DS9.app/Contents/Resources/App.icns
new file mode 100644
index 0000000..bf30e38
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Resources/App.icns
Binary files differ
diff --git a/ds9/macosx/SAOImage DS9.app/Contents/Resources/fits.icns b/ds9/macosx/SAOImage DS9.app/Contents/Resources/fits.icns
new file mode 100644
index 0000000..0afa214
--- /dev/null
+++ b/ds9/macosx/SAOImage DS9.app/Contents/Resources/fits.icns
Binary files differ
diff --git a/ds9/macosx/aclocal.m4 b/ds9/macosx/aclocal.m4
new file mode 100755
index 0000000..0b05739
--- /dev/null
+++ b/ds9/macosx/aclocal.m4
@@ -0,0 +1,9 @@
+#
+# Include the TEA standard macro set
+#
+
+builtin(include,tclconfig/tcl.m4)
+
+#
+# Add here whatever m4 macros you want to define for your package
+#
diff --git a/ds9/macosx/configure b/ds9/macosx/configure
new file mode 100755
index 0000000..c73eed8
--- /dev/null
+++ b/ds9/macosx/configure
@@ -0,0 +1,10291 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for ds9 7.5.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='ds9'
+PACKAGE_TARNAME='ds9'
+PACKAGE_VERSION='7.5'
+PACKAGE_STRING='ds9 7.5'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+VC_MANIFEST_EMBED_EXE
+VC_MANIFEST_EMBED_DLL
+RANLIB_STUB
+MAKE_STUB_LIB
+MAKE_STATIC_LIB
+MAKE_SHARED_LIB
+MAKE_LIB
+TCL_DBGX
+LDFLAGS_DEFAULT
+CFLAGS_DEFAULT
+LD_LIBRARY_PATH_VAR
+SHLIB_CFLAGS
+SHLIB_LD_LIBS
+SHLIB_LD
+STLIB_LD
+CFLAGS_WARNING
+CFLAGS_OPTIMIZE
+CFLAGS_DEBUG
+RC
+CELIB_DIR
+AR
+TCL_THREADS
+XMKMF
+TK_INCLUDES
+TCL_INCLUDES
+MATH_LIBS
+EGREP
+GREP
+RANLIB
+SET_MAKE
+INSTALL
+CPP
+TK_XINCLUDES
+TK_LIBS
+TK_STUB_LIB_SPEC
+TK_STUB_LIB_FLAG
+TK_STUB_LIB_FILE
+TK_LIB_SPEC
+TK_LIB_FLAG
+TK_LIB_FILE
+TK_SRC_DIR
+TK_BIN_DIR
+TK_VERSION
+TCL_SHLIB_LD_LIBS
+TCL_LD_FLAGS
+TCL_EXTRA_CFLAGS
+TCL_DEFS
+TCL_LIBS
+CLEANFILES
+OBJEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+TCL_STUB_LIB_SPEC
+TCL_STUB_LIB_FLAG
+TCL_STUB_LIB_FILE
+TCL_LIB_SPEC
+TCL_LIB_FLAG
+TCL_LIB_FILE
+TCL_SRC_DIR
+TCL_BIN_DIR
+TCL_PATCH_LEVEL
+TCL_VERSION
+PKG_CFLAGS
+PKG_LIBS
+PKG_INCLUDES
+PKG_HEADERS
+PKG_TCL_SOURCES
+PKG_STUB_OBJECTS
+PKG_STUB_SOURCES
+PKG_STUB_LIB_FILE
+PKG_LIB_FILE
+EXEEXT
+CYGPATH
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_tcl
+with_tk
+with_tclinclude
+with_tkinclude
+with_x
+enable_threads
+enable_64bit
+enable_64bit_vis
+enable_rpath
+enable_wince
+with_celib
+enable_symbols
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+XMKMF'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ds9 7.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/ds9]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+X features:
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ds9 7.5:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-threads build with threads
+ --enable-64bit enable 64bit support (default: off)
+ --enable-64bit-vis enable 64bit Sparc VIS support (default: off)
+ --disable-rpath disable rpath support (default: on)
+ --enable-wince enable Win/CE support (where applicable)
+ --enable-symbols build with debugging symbols (default: off)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-tcl directory containing tcl configuration
+ (tclConfig.sh)
+ --with-tk directory containing tk configuration (tkConfig.sh)
+ --with-tclinclude directory containing the public Tcl header files
+ --with-tkinclude directory containing the public Tk header files
+ --with-x use the X Window System
+ --with-celib=DIR use Windows/CE support library from DIR
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ XMKMF Path to xmkmf, Makefile generator for X Window System
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ds9 configure 7.5
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5
+$as_echo_n "checking for correct TEA configuration... " >&6; }
+ if test x"${PACKAGE_NAME}" = x ; then
+ as_fn_error $? "
+The PACKAGE_NAME variable must be defined by your TEA configure.in" "$LINENO" 5
+ fi
+ if test x"3.9" = x ; then
+ as_fn_error $? "
+TEA version not specified." "$LINENO" 5
+ elif test "3.9" != "${TEA_VERSION}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5
+$as_echo "warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5
+$as_echo "ok (TEA ${TEA_VERSION})" >&6; }
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ # Extract the first word of "cygpath", so it can be a program name with args.
+set dummy cygpath; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CYGPATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CYGPATH"; then
+ ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CYGPATH="cygpath -w"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
+fi
+fi
+CYGPATH=$ac_cv_prog_CYGPATH
+if test -n "$CYGPATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
+$as_echo "$CYGPATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5
+$as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;}
+
+
+
+
+ # This package name must be replaced statically for AC_SUBST to work
+
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in tclconfig "$srcdir"/tclconfig; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in tclconfig \"$srcdir\"/tclconfig" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+
+
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+
+# Check whether --with-tcl was given.
+if test "${with_tcl+set}" = set; then :
+ withval=$with_tcl; with_tclconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5
+$as_echo_n "checking for Tcl configuration... " >&6; }
+ if ${ac_cv_c_tclconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+ fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; }
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5
+$as_echo_n "checking platform... " >&6; }
+ hold_cc=$CC; CC="$TCL_CC"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _WIN32
+ #error win32
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ TEA_PLATFORM="unix"
+else
+ TEA_PLATFORM="windows"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CC=$hold_cc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5
+$as_echo "$TEA_PLATFORM" >&6; }
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_${PACKAGE_NAME} /**/
+_ACEOF
+
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+
+# Check whether --with-tk was given.
+if test "${with_tk+set}" = set; then :
+ withval=$with_tk; with_tkconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5
+$as_echo_n "checking for Tk configuration... " >&6; }
+ if ${ac_cv_c_tkconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;}
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ as_fn_error $? "Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" "$LINENO" 5
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; }
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+
+$as_echo "#define MAC_OSX_TK 1" >>confdefs.h
+
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # TEA specific:
+
+
+
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
+$as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
+ prefix=${TCL_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5
+$as_echo "$as_me: --prefix defaulting to /usr/local" >&6;}
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
+ exec_prefix=$prefix
+ fi
+ fi
+
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
+$as_echo_n "checking if the compiler understands -pipe... " >&6; }
+if ${tcl_cv_cc_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cc_pipe=yes
+else
+ tcl_cv_cc_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
+$as_echo "$tcl_cv_cc_pipe" >&6; }
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+ if test "${TEA_PLATFORM}" = "unix" ; then
+
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin"
+if test "x$ac_cv_func_sin" = xyes; then :
+ MATH_LIBS=""
+else
+ MATH_LIBS="-lm"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5
+$as_echo_n "checking for main in -lieee... " >&6; }
+if ${ac_cv_lib_ieee_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lieee $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ieee_main=yes
+else
+ ac_cv_lib_ieee_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5
+$as_echo "$ac_cv_lib_ieee_main" >&6; }
+if test "x$ac_cv_lib_ieee_main" = xyes; then :
+ MATH_LIBS="-lieee $MATH_LIBS"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5
+$as_echo_n "checking for main in -linet... " >&6; }
+if ${ac_cv_lib_inet_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-linet $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_inet_main=yes
+else
+ ac_cv_lib_inet_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5
+$as_echo "$ac_cv_lib_inet_main" >&6; }
+if test "x$ac_cv_lib_inet_main" = xyes; then :
+ LIBS="$LIBS -linet"
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_errno_h" = xyes; then :
+
+
+$as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
+if test "x$ac_cv_func_connect" = xyes; then :
+ tcl_checkSocket=0
+else
+ tcl_checkSocket=1
+fi
+
+ if test "$tcl_checkSocket" = 1; then
+ ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setsockopt ();
+int
+main ()
+{
+return setsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_setsockopt=yes
+else
+ ac_cv_lib_socket_setsockopt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
+ LIBS="$LIBS -lsocket"
+else
+ tcl_checkBoth=1
+fi
+
+fi
+
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept"
+if test "x$ac_cv_func_accept" = xyes; then :
+ tcl_checkNsl=0
+else
+ LIBS=$tk_oldLibs
+fi
+
+ fi
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+ LIBS="$LIBS -lnsl"
+fi
+
+fi
+
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5
+$as_echo_n "checking dirent.h... " >&6; }
+if ${tcl_cv_dirent_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_dirent_h=yes
+else
+ tcl_cv_dirent_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5
+$as_echo "$tcl_cv_dirent_h" >&6; }
+
+ if test $tcl_cv_dirent_h = no; then
+
+$as_echo "#define NO_DIRENT_H 1" >>confdefs.h
+
+ fi
+
+ # TEA specific:
+ ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default"
+if test "x$ac_cv_header_float_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_FLOAT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default"
+if test "x$ac_cv_header_values_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_VALUES_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default"
+if test "x$ac_cv_header_limits_h" = xyes; then :
+
+$as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h
+
+else
+
+$as_echo "#define NO_LIMITS_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtol" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtoul" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtod" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STDLIB_H 1" >>confdefs.h
+
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
+if test "x$ac_cv_header_string_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strstr" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strerror" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STRING_H 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_wait_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_DLFCN_H 1" >>confdefs.h
+
+fi
+
+
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ for ac_header in sys/param.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PARAM_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+
+ vars="-lstdc++"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlInitParser in -lxml2" >&5
+$as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
+if ${ac_cv_lib_xml2_xmlInitParser+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitParser ();
+int
+main ()
+{
+return xmlInitParser ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xml2_xmlInitParser=yes
+else
+ ac_cv_lib_xml2_xmlInitParser=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlInitParser" >&5
+$as_echo "$ac_cv_lib_xml2_xmlInitParser" >&6; }
+if test "x$ac_cv_lib_xml2_xmlInitParser" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML2 1
+_ACEOF
+
+ LIBS="-lxml2 $LIBS"
+
+fi
+
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
+$as_echo_n "checking for Tcl public headers... " >&6; }
+
+
+# Check whether --with-tclinclude was given.
+if test "${with_tclinclude+set}" = set; then :
+ withval=$with_tclinclude; with_tclinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tclh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5
+$as_echo "${ac_cv_c_tclh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+#TEA_PRIVATE_TCL_HEADERS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5
+$as_echo_n "checking for Tk public headers... " >&6; }
+
+
+# Check whether --with-tkinclude was given.
+if test "${with_tkinclude+set}" = set; then :
+ withval=$with_tkinclude; with_tkinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tkh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ as_fn_error $? "tk.h not found. Please specify its location with --with-tkinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5
+$as_echo "${ac_cv_c_tkh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
+$as_echo_n "checking for X11 header files... " >&6; }
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5
+$as_echo "${INCLUDE_DIR_NATIVE}" >&6; }
+ fi
+
+#TEA_PRIVATE_TK_HEADERS
+
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then :
+ withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ case $x_includes,$x_libraries in #(
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+ *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+ cd conftest.dir
+ cat >Imakefile <<'_ACEOF'
+incroot:
+ @echo incroot='${INCROOT}'
+usrlibdir:
+ @echo usrlibdir='${USRLIBDIR}'
+libdir:
+ @echo libdir='${LIBDIR}'
+_ACEOF
+ if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+ for ac_var in incroot usrlibdir libdir; do
+ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+ done
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl dylib la dll; do
+ if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+ test -f "$ac_im_libdir/libX11.$ac_extension"; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case $ac_im_incroot in
+ /usr/include) ac_x_includes= ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+ esac
+ case $ac_im_usrlibdir in
+ /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+ esac
+ fi
+ cd ..
+ rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R7/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R7
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R7/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R7
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+ # First, try using that file with no special directory specified.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ for ac_dir in $ac_x_header_dirs; do
+ if test -r "$ac_dir/X11/Xlib.h"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+done
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+ # Check for the libraries.
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS=$LIBS
+ LIBS="-lX11 $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+ # Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl dylib la dll; do
+ if test -r "$ac_dir/libX11.$ac_extension"; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
+ # Didn't find X, or a directory has "'" in its name.
+ ac_cv_have_x="have_x=no";; #(
+ *)
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$ac_x_includes'\
+ ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+ *) have_x=yes;;
+ esac
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$x_includes'\
+ ac_x_libraries='$x_libraries'"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ not_really_there="yes"
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ else
+ if test ! -r $x_includes/X11/Xlib.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
+$as_echo_n "checking for X11 header files... " >&6; }
+ found_xincludes="no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ found_xincludes="yes"
+else
+ found_xincludes="no"
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Xlib.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
+$as_echo "$i" >&6; }
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test "$found_xincludes" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5
+$as_echo "couldn't find any!" >&6; }
+ fi
+
+ if test "$no_x" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5
+$as_echo_n "checking for X11 libraries... " >&6; }
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
+$as_echo "$i" >&6; }
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5
+$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; }
+if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXwindow $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XCreateWindow ();
+int
+main ()
+{
+return XCreateWindow ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_Xwindow_XCreateWindow=yes
+else
+ ac_cv_lib_Xwindow_XCreateWindow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5
+$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; }
+if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then :
+ XLIBSW=-lXwindow
+fi
+
+ fi
+ if test "$XLIBSW" = nope ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find any! Using -lX11." >&5
+$as_echo "could not find any! Using -lX11." >&6; }
+ XLIBSW=-lX11
+ fi
+ # TEA specific:
+ if test x"${XLIBSW}" != x ; then
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
+ fi
+
+ fi
+
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+
+ # Check whether --enable-threads was given.
+if test "${enable_threads+set}" = set; then :
+ enableval=$enable_threads; tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi
+
+
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ # We are always OK on Windows, so check what this platform wants:
+
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+
+$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+ if test "`uname -s`" = "SunOS" ; then
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ fi
+
+$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
+$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_mutex_init=yes
+else
+ ac_cv_lib_pthread_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
+$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char __pthread_mutex_init ();
+int
+main ()
+{
+return __pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread___pthread_mutex_init=yes
+else
+ ac_cv_lib_pthread___pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
+$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; }
+if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthreads_pthread_mutex_init=yes
+else
+ ac_cv_lib_pthreads_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
+$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; }
+if ${ac_cv_lib_c_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_pthread_mutex_init=yes
+else
+ ac_cv_lib_c_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
+$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_mutex_init=yes
+else
+ ac_cv_lib_c_r_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5
+$as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;}
+ fi
+ fi
+ fi
+ fi
+ fi
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5
+$as_echo_n "checking for building with threads... " >&6; }
+ if test "${TCL_THREADS}" = 1; then
+
+$as_echo "#define TCL_THREADS 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
+$as_echo "yes (default)" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ # TCL_THREADS sanity checking. See if our request for building with
+ # threads is the same as the way Tcl was built. If not, warn the user.
+ case ${TCL_DEFS} in
+ *THREADS=1*)
+ if test "${TCL_THREADS}" = "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads." >&5
+$as_echo "$as_me: WARNING:
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads." >&2;}
+ fi
+ ;;
+ *)
+ if test "${TCL_THREADS}" = "1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core." >&5
+$as_echo "$as_me: WARNING:
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core." >&2;}
+ fi
+ ;;
+ esac
+
+
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+
+ # Step 0.a: Enable 64 bit support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5
+$as_echo_n "checking if 64bit support is requested... " >&6; }
+ # Check whether --enable-64bit was given.
+if test "${enable_64bit+set}" = set; then :
+ enableval=$enable_64bit; do64bit=$enableval
+else
+ do64bit=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5
+$as_echo "$do64bit" >&6; }
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5
+$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; }
+ # Check whether --enable-64bit-vis was given.
+if test "${enable_64bit_vis+set}" = set; then :
+ enableval=$enable_64bit_vis; do64bitVIS=$enableval
+else
+ do64bitVIS=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5
+$as_echo "$do64bitVIS" >&6; }
+ # Force 64bit on with VIS
+ if test "$do64bitVIS" = "yes"; then :
+ do64bit=yes
+fi
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5
+$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; }
+if ${tcl_cv_cc_visibility_hidden+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}
+int
+main ()
+{
+f();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_visibility_hidden=yes
+else
+ tcl_cv_cc_visibility_hidden=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5
+$as_echo "$tcl_cv_cc_visibility_hidden" >&6; }
+ if test $tcl_cv_cc_visibility_hidden = yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h
+
+
+$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h
+
+
+fi
+
+ # Step 0.d: Disable -rpath support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5
+$as_echo_n "checking if rpath support is requested... " >&6; }
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; doRpath=$enableval
+else
+ doRpath=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5
+$as_echo "$doRpath" >&6; }
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ if test "${TEA_PLATFORM}" = windows; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5
+$as_echo_n "checking if Windows/CE build is requested... " >&6; }
+ # Check whether --enable-wince was given.
+if test "${enable_wince+set}" = set; then :
+ enableval=$enable_wince; doWince=$enableval
+else
+ doWince=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5
+$as_echo "$doWince" >&6; }
+
+fi
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5
+$as_echo_n "checking system version... " >&6; }
+if ${tcl_cv_sys_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
+$as_echo "$as_me: WARNING: can't find uname command" >&2;}
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
+$as_echo "$tcl_cv_sys_version" >&6; }
+ system=$tcl_cv_sys_version
+
+
+ # Require ranlib early so we can override it in special cases below.
+
+
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ if test "$GCC" = yes; then :
+
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+
+else
+
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+
+fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ if test "x$SHLIB_VERSION" = x; then :
+ SHLIB_VERSION="1.0"
+fi
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
+$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5
+$as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
+ do64bit="no"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5
+$as_echo " Using 64-bit $MACHINE mode" >&6; }
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5
+ fi
+ if test "$GCC" = "yes" ; then
+ as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5
+ fi
+
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+
+# Check whether --with-celib was given.
+if test "${with_celib+set}" = set; then :
+ withval=$with_celib; with_celibconfig=${withval}
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5
+$as_echo_n "checking for Windows/CE celib directory... " >&6; }
+ if ${ac_cv_c_celibconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5
+$as_echo "found $CELIB_DIR" >&6; }
+ fi
+ fi
+
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
+ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
+ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
+ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+
+ vars="bufferoverflowU.lib"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower($0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+
+cat >>confdefs.h <<_ACEOF
+#define $i 1
+_ACEOF
+
+ done
+
+cat >>confdefs.h <<_ACEOF
+#define _WIN32_WCE $CEVERSION
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNDER_CE $CEVERSION
+_ACEOF
+
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RC"; then
+ ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RC="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
+$as_echo "$RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+ ac_ct_RC=$RC
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RC"; then
+ ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RC="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5
+$as_echo "$ac_ct_RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RC" = x; then
+ RC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RC=$ac_ct_RC
+ fi
+else
+ RC="$ac_cv_prog_RC"
+fi
+
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5
+$as_echo_n "checking for cross-compile version of gcc... " >&6; }
+if ${ac_cv_cross+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_cross=yes
+else
+ ac_cv_cross=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5
+$as_echo "$ac_cv_cross" >&6; }
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then :
+
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
+$as_echo "Using $CC for compiling with threads" >&6; }
+
+fi
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+
+fi
+
+fi
+
+ if test "`uname -m`" = ia64; then :
+
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ if test "$GCC" = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+
+else
+
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+
+fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+else
+
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+
+else
+
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+
+fi
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5
+$as_echo_n "checking for inet_ntoa in -lbind... " >&6; }
+if ${ac_cv_lib_bind_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbind $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bind_inet_ntoa=yes
+else
+ ac_cv_lib_bind_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lbind -lsocket"
+fi
+
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5
+$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; }
+if ${ac_cv_lib_network_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetwork $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_network_inet_ntoa=yes
+else
+ ac_cv_lib_network_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lnetwork"
+fi
+
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+
+$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
+
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ if test "`uname -m`" = ia64; then :
+
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+
+else
+
+ SHLIB_SUFFIX=".sl"
+
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+
+fi
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes"; then :
+
+ if test "$GCC" = yes; then :
+
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+ ;;
+ esac
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+
+fi
+
+fi ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+
+else
+
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+
+fi
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
+
+else
+
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+
+fi
+
+fi
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "`uname -m`" = "alpha"; then :
+ CFLAGS="$CFLAGS -mieee"
+fi
+ if test $do64bit = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5
+$as_echo_n "checking if compiler accepts -m64 flag... " >&6; }
+if ${tcl_cv_cc_m64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_m64=yes
+else
+ tcl_cv_cc_m64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5
+$as_echo "$tcl_cv_cc_m64" >&6; }
+ if test $tcl_cv_cc_m64 = yes; then :
+
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+
+fi
+
+fi
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ if test x"${USE_COMPAT}" != x; then :
+ CFLAGS="$CFLAGS -fno-inline"
+fi
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+
+fi
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$@"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
+ if test $do64bit = yes; then :
+
+ case `arch` in
+ ppc)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; }
+if ${tcl_cv_cc_arch_ppc64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_ppc64=yes
+else
+ tcl_cv_cc_arch_ppc64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
+$as_echo "$tcl_cv_cc_arch_ppc64" >&6; }
+ if test $tcl_cv_cc_arch_ppc64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+
+fi;;
+ i386)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; }
+if ${tcl_cv_cc_arch_x86_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_x86_64=yes
+else
+ tcl_cv_cc_arch_x86_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5
+$as_echo "$tcl_cv_cc_arch_x86_64" >&6; }
+ if test $tcl_cv_cc_arch_x86_64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+
+fi;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
+$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
+ esac
+
+else
+
+ # Check for combined 32-bit and 64-bit fat build
+ if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then :
+
+ fat_32_64=yes
+fi
+
+fi
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
+$as_echo_n "checking if ld accepts -single_module flag... " >&6; }
+if ${tcl_cv_ld_single_module+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_single_module=yes
+else
+ tcl_cv_ld_single_module=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5
+$as_echo "$tcl_cv_ld_single_module" >&6; }
+ if test $tcl_cv_ld_single_module = yes; then :
+
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+
+fi
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then :
+
+ LDFLAGS="$LDFLAGS -prebind"
+fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
+$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
+if ${tcl_cv_ld_search_paths_first+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_search_paths_first=yes
+else
+ tcl_cv_ld_search_paths_first=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5
+$as_echo "$tcl_cv_ld_search_paths_first" >&6; }
+ if test $tcl_cv_ld_search_paths_first = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+
+fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h
+
+ tcl_cv_cc_visibility_hidden=yes
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then :
+
+ if test "${TEA_WINDOWINGSYSTEM}" = x11; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5
+$as_echo_n "checking for 64-bit X11... " >&6; }
+if ${tcl_cv_lib_x11_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_x11_64=yes
+else
+ tcl_cv_lib_x11_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5
+$as_echo "$tcl_cv_lib_x11_64" >&6; }
+
+fi
+ if test "${TEA_WINDOWINGSYSTEM}" = aqua; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5
+$as_echo_n "checking for 64-bit Tk... " >&6; }
+if ${tcl_cv_lib_tk_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <tk.h>
+int
+main ()
+{
+Tk_InitStubs(NULL, "", 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_tk_64=yes
+else
+ tcl_cv_lib_tk_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5
+$as_echo "$tcl_cv_lib_tk_64" >&6; }
+
+fi
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5
+$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done
+fi
+
+fi
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+
+$as_echo "#define _OE_SOCKETS 1" >>confdefs.h
+
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ if test "$SHARED_BUILD" = 1; then :
+
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+
+else
+
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+
+fi
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+ CFLAGS="$CFLAGS -mieee"
+else
+
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
+fi
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ if test "${TCL_THREADS}" = 1; then :
+
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = yes; then :
+
+ LIBS="$LIBS -lpthread -lmach -lexc"
+
+else
+
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+
+fi
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ if test "$GCC" = yes; then :
+
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+
+else
+
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+
+fi
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[0-6])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ arch=`isainfo`
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ if test "$GCC" = yes; then :
+
+ if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+
+fi
+
+else
+
+ do64bit_ok=yes
+ if test "$do64bitVIS" = yes; then :
+
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+
+else
+
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+
+fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+
+fi
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
+ esac
+
+else
+
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
+fi
+fi
+
+fi
+
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$do64bit_ok" = yes; then :
+
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+
+fi
+fi
+
+fi
+
+else
+
+ case $system in
+ SunOS-5.[1-9][0-9]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+fi
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5
+$as_echo_n "checking for ld accepts -Bexport flag... " >&6; }
+if ${tcl_cv_ld_Bexport+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_Bexport=yes
+else
+ tcl_cv_ld_Bexport=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5
+$as_echo "$tcl_cv_ld_Bexport" >&6; }
+ if test $tcl_cv_ld_Bexport = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ if test "$do64bit" = yes -a "$do64bit_ok" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
+$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
+
+fi
+
+
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac
+fi
+
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern" >>confdefs.h
+
+
+fi
+
+ if test "$SHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
+fi
+ if test "$UNSHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
+fi
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5
+$as_echo_n "checking for SEH support in compiler... " >&6; }
+if ${tcl_cv_seh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ tcl_cv_seh=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ tcl_cv_seh=yes
+else
+ tcl_cv_seh=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5
+$as_echo "$tcl_cv_seh" >&6; }
+ if test "$tcl_cv_seh" = "no" ; then
+
+$as_echo "#define HAVE_NO_SEH 1" >>confdefs.h
+
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5
+$as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; }
+if ${tcl_cv_eh_disposition+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ EXCEPTION_DISPOSITION x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_eh_disposition=yes
+else
+ tcl_cv_eh_disposition=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5
+$as_echo "$tcl_cv_eh_disposition" >&6; }
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+
+$as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h
+
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5
+$as_echo_n "checking for winnt.h that ignores VOID define... " >&6; }
+if ${tcl_cv_winnt_ignore_void+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ CHAR c;
+ SHORT s;
+ LONG l;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_winnt_ignore_void=yes
+else
+ tcl_cv_winnt_ignore_void=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5
+$as_echo "$tcl_cv_winnt_ignore_void" >&6; }
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+
+$as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h
+
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
+$as_echo_n "checking for cast to union support... " >&6; }
+if ${tcl_cv_cast_to_union+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cast_to_union=yes
+else
+ tcl_cv_cast_to_union=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
+$as_echo "$tcl_cv_cast_to_union" >&6; }
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+
+$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5
+$as_echo_n "checking for required early compiler flags... " >&6; }
+ tcl_flags=""
+
+ if ${tcl_cv_flag__isoc99_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _ISOC99_SOURCE 1
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=yes
+else
+ tcl_cv_flag__isoc99_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
+
+$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _ISOC99_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile64_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE64_SOURCE 1
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=yes
+else
+ tcl_cv_flag__largefile64_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile_source64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE64 1
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=yes
+else
+ tcl_cv_flag__largefile_source64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
+ fi
+
+ if test "x${tcl_flags}" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5
+$as_echo "${tcl_flags}" >&6; }
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5
+$as_echo_n "checking for 64-bit integer type... " >&6; }
+ if ${tcl_cv_type_64bit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+__int64 value = (__int64) 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_type_64bit=__int64
+else
+ tcl_type_64bit="long long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+switch (0) {
+ case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_64bit=${tcl_type_64bit}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "${tcl_cv_type_64bit}" = none ; then
+
+$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5
+$as_echo "using long" >&6; }
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5
+$as_echo "using Tcl header defaults" >&6; }
+ else
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5
+$as_echo "${tcl_cv_type_64bit}" >&6; }
+
+ # Now check for auxiliary declarations
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
+$as_echo_n "checking for struct dirent64... " >&6; }
+if ${tcl_cv_struct_dirent64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+struct dirent64 p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_dirent64=yes
+else
+ tcl_cv_struct_dirent64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5
+$as_echo "$tcl_cv_struct_dirent64" >&6; }
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
+$as_echo_n "checking for struct stat64... " >&6; }
+if ${tcl_cv_struct_stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 p;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_stat64=yes
+else
+ tcl_cv_struct_stat64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
+$as_echo "$tcl_cv_struct_stat64" >&6; }
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
+
+ fi
+
+ for ac_func in open64 lseek64
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
+$as_echo_n "checking for off64_t... " >&6; }
+ if ${tcl_cv_type_off64_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+off64_t offset;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_off64_t=yes
+else
+ tcl_cv_type_off64_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+
+$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ fi
+
+
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5
+$as_echo_n "checking for build with symbols... " >&6; }
+ # Check whether --enable-symbols was given.
+if test "${enable_symbols+set}" = set; then :
+ enableval=$enable_symbols; tcl_ok=$enableval
+else
+ tcl_ok=no
+fi
+
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5
+$as_echo "yes (standard debugging)" >&6; }
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+
+
+
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+
+$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h
+
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5
+$as_echo "enabled symbols mem debugging" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5
+$as_echo "enabled $tcl_ok debugging" >&6; }
+ fi
+ fi
+
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "manifest needed" >/dev/null 2>&1; then :
+
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+
+ CLEANFILES="$CLEANFILES *.manifest"
+
+
+fi
+rm -f conftest*
+
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+ds9 config.status 7.5
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/ds9/macosx/configure.in b/ds9/macosx/configure.in
new file mode 100755
index 0000000..2c919e4
--- /dev/null
+++ b/ds9/macosx/configure.in
@@ -0,0 +1,188 @@
+#!/bin/bash -norc
+dnl This file is an input file used by the GNU "autoconf" program to
+dnl generate the file "configure", which is run during Tcl installation
+dnl to configure the system for the local environment.
+
+#-----------------------------------------------------------------------
+# Sample configure.in for Tcl Extensions. The only places you should
+# need to modify this file are marked by the string __CHANGE__
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Set your package name and version numbers here.
+#
+# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
+# set as provided. These will also be added as -D defs in your Makefile
+# so you can encode the package version directly into the source files.
+# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
+# so that we create the export library with the dll.
+#-----------------------------------------------------------------------
+
+AC_INIT([ds9], [7.5])
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+TEA_INIT([3.9])
+
+AC_CONFIG_AUX_DIR(tclconfig)
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+TEA_PATH_TCLCONFIG
+TEA_LOAD_TCLCONFIG
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+TEA_PATH_TKCONFIG
+TEA_LOAD_TKCONFIG
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+TEA_PREFIX
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+TEA_SETUP_COMPILER
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+TEA_ADD_LIBS([-lstdc++])
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+AC_CHECK_LIB([xml2],[xmlInitParser])
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+TEA_PUBLIC_TCL_HEADERS
+#TEA_PRIVATE_TCL_HEADERS
+
+TEA_PUBLIC_TK_HEADERS
+#TEA_PRIVATE_TK_HEADERS
+TEA_PATH_X
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_THREADS
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+TEA_CONFIG_CFLAGS
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_SYMBOLS
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+TEA_MAKE_LIB
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+AC_OUTPUT([Makefile])
diff --git a/ds9/macosx/ds9.C b/ds9/macosx/ds9.C
new file mode 100644
index 0000000..17fe17a
--- /dev/null
+++ b/ds9/macosx/ds9.C
@@ -0,0 +1,232 @@
+// Copyright (C) 1999-2015
+// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+// For conditions of distribution and use, see copyright notice in "copyright"
+
+#include <stdlib.h>
+
+#include <iostream>
+#include <sstream>
+using namespace std;
+
+#include <tcl.h>
+#include <tk.h>
+
+#define DEBUGS(x) {FILE* fp=fopen("/Users/joye/debug.txt","a+");fprintf(fp,"%s\n",x);fclose(fp);}
+
+extern "C" {
+ int SAOAppInit(Tcl_Interp *interp);
+ int SAOLocalMainHook(int* argc, char*** argv);
+
+ void TclSetStartupScriptFileName(const char*);
+
+ int Tkblt_Init(Tcl_Interp*);
+ int Tktable_Init(Tcl_Interp*);
+ int Tclcheckdns_Init(Tcl_Interp*);
+ int Tksao_Init(Tcl_Interp*);
+ int Tkhtml1_Init(Tcl_Interp*);
+ int Tkmpeg_Init(Tcl_Interp*);
+
+ int Tkimg_Init(Tcl_Interp*);
+ int Zlibtcl_Init(Tcl_Interp*);
+ int Jpegtcl_Init(Tcl_Interp*);
+ int Tkimgjpeg_Init(Tcl_Interp*);
+ int Tifftcl_Init(Tcl_Interp*);
+ int Tkimgtiff_Init(Tcl_Interp*);
+ int Pngtcl_Init(Tcl_Interp*);
+ int Tkimgpng_Init(Tcl_Interp*);
+ int Tkimggif_Init(Tcl_Interp*);
+ int Tkimgwindow_Init(Tcl_Interp*);
+
+ int Tclxpa_Init(Tcl_Interp*);
+ int Tcliis_Init(Tcl_Interp*);
+
+ int Tclxml_Init(Tcl_Interp*);
+ int Tclxml_libxml2_Init(Tcl_Interp*);
+
+ int Signal_ext_Init(Tcl_Interp*);
+
+ int Tkmacosx_Init(Tcl_Interp*);
+}
+
+Tcl_Interp *global_interp;
+
+void internalError(const char* msg)
+{
+ Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY);
+}
+
+extern char* dupstr(const char* str);
+
+#define PATHSIZE 2048
+int SAOLocalMainHook(int* argcPtr, char*** argvPtr)
+{
+ // sync C++ io calls with C io calls
+ ios::sync_with_stdio();
+
+ // use exec path
+ char** argv = *argvPtr;
+ char ss[PATHSIZE];
+ strncpy(ss,argv[0],PATHSIZE);
+
+ // now remove "MacOSX/ds9"
+ char* ptr = ss+strlen(ss);
+ while (*ptr != '/' && ptr != ss)
+ ptr--;
+ ptr--;
+ while (*ptr != '/' && ptr != ss)
+ ptr--;
+ *ptr = '\0';
+
+ // do this first
+ Tcl_FindExecutable((*argvPtr)[0]);
+
+ // and add startup script
+ strncat(ss,"/Frameworks/Tksao.framework/Resources/library/ds9.tcl",PATHSIZE);
+
+ Tcl_Obj *path = Tcl_NewStringObj(ss,-1);
+ Tcl_SetStartupScript(path, NULL);
+
+ return TCL_OK;
+}
+
+int SAOAppInit(Tcl_Interp *interp)
+{
+ // save interp for cputs function
+ global_interp = interp;
+
+ // Tcl
+ if (Tcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tk
+ if (Tk_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
+
+ // Tkblt
+ if (Tkblt_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp, "tkblt", Tkblt_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tktable
+ if (Tktable_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tktable", Tktable_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclcheckdns
+ if (Tclcheckdns_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tclcheckdns", Tclcheckdns_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tksao
+ if (Tksao_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tksao", Tksao_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkhtml1
+ if (Tkhtml1_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkhtml1", Tkhtml1_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxpa
+ if (Tclxpa_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tcliis
+ if (Tcliis_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tcliis", Tcliis_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkmpeg
+ if (Tkmpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkmpeg", Tkmpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxml
+ if (Tclxml_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tkimg
+ if (Tkimg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "img", Tkimg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // zlibtcl
+ if (Zlibtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "zlibtcl", Zlibtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // jpegtcl
+ if (Jpegtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpegtcl", Jpegtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgjpeg
+ if (Tkimgjpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpeg", Tkimgjpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tifftcl
+ if (Tifftcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tifftcl", Tifftcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgtiff
+ if (Tkimgtiff_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tiff", Tkimgtiff_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Pngtcl
+ if (Pngtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "pngtcl", Pngtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgpng
+ if (Tkimgpng_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "png", Tkimgpng_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimggif
+ if (Tkimggif_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "gif", Tkimggif_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgwindow
+ if (Tkimgwindow_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "window", Tkimgwindow_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Signal_Ext
+ if (Signal_ext_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "signal", Signal_ext_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkmacosx
+ if (Tkmacosx_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkmacosx", Tkmacosx_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ return TCL_OK;
+}
diff --git a/ds9/macosx/tclconfig/ChangeLog b/ds9/macosx/tclconfig/ChangeLog
new file mode 100644
index 0000000..ffda2bb
--- /dev/null
+++ b/ds9/macosx/tclconfig/ChangeLog
@@ -0,0 +1,980 @@
+2013-07-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [3324676]: AC_PROG_INSTALL incompat,
+ Bug [3606445]: Unneeded -DHAVE_NO_SEH=1 when not building on Windows
+
+2013-07-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4
+ (thanks to Brian Griffin)
+
+2013-06-20 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Use X11/Xlib.h for checking where X11 can be found
+ in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti.
+
+2013-06-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Eliminate NO_VIZ macro as current
+ zlib uses HAVE_HIDDEN in stead. One more last-moment
+ fix for FreeBSD by Pietro Cerutti
+
+2013-05-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Fix for FreeBSD, and remove support for old
+ FreeBSD versions. Patch by Pietro Cerutti
+
+2013-03-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Patch by Andrew Shadura, providing better support for
+ * three architectures they have in Debian.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Added "-DNDEBUG" to CFLAGS_DEFAULT
+ when building with --disable-symbols.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3555058]: Checkin [30736d63f0] broke
+ CFLAGS_DEFAULT, LDFLAGS_DEFAULT
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-08-07 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-07-25 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: My previous commit (2012-04-03) broke the ActiveTcl
+ build for AMD64, because of the quotes in "C:/<path>/AMD64/cl.exe".
+ It turns out that the AC_TRY_COMPILE macro cannot handle that.
+
+2012-07-22 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Tidy: consistency, spelling, phrasing, whitespace.
+ No functional change.
+
+2012-04-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806] Compiler checks too early
+ This change allows to build the cygwin and mingw32 ports of
+ Tcl/Tk extensions to build out-of-the-box using a native or
+ cross-compiler, e.g. on Cygwin, Linux or Darwin.
+
+2011-04-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh: Fix issue with library stripping in install-sh
+ (backported from kevin_walzer's patch from Tcl 8.6 trunk)
+
+2011-04-05 Andreas Kupries <andreask@activestate.com>
+
+ * tcl.m4: Applied patch by Jeff Lawson. Nicer error message when
+ tclConfig.sh was not found.
+
+2010-12-15 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * install-sh: Upgrade to newer install-sh and use it.
+ * tcl.m4:
+
+2010-12-14 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Better building on OpenBSD.
+
+2010-12-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: when using gcc, don't try to determine Win64 SDK
+
+2010-12-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Determine correctly a cross-compiler-windres
+
+2010-11-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: add some cross-compile support, borrowed from Tcl 8.6
+
+2010-09-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX LDFLAGS (only used when building big shell)
+
+2010-09-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add extra if check for .manifest file generation
+ Add notice about package name and version being built.
+
+2010-09-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [FREQ #3058486] TEA_LOAD_CONFIG doesn't set all BUILD_ vars
+ Slightly related: defining BUILD_$1 on all platforms - not only win -
+ allows the -fvisibility feature to be used in extensions as well, at
+ least if you compile against tcl >= 8.5.
+
+2010-08-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: ensure safe quoting for autoheader usage
+
+2010-08-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add TEA_ADD_CLEANFILES macro to make adding cleanfiles
+ easier, and add *.exp to CLEANFILES Windows default.
+ (TEA_MAKE_LIB): Enhanced to check for MSVC that requires manifests
+ and auto-embed it into proj DLL via MAKE_SHARED_LIB. Also define
+ VC_MANIFEST_EMBED_DLL and VC_MANIFEST_EMBED_EXE that do the same
+ magic in case it is needed for extended TEA projects.
+
+2010-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.9 ***
+ If upgrading from TEA_VERSION 3.8, copy over tcl.m4, change
+ TEA_INIT to use 3.9 and reconfigure (ac-2.59+).
+ BUILD_${PACKAGE_NAME} will be auto-defined on Windows for
+ correct setting of TCL_STORAGE_CLASS.
+ TEA_LOAD_CONFIG users should remove the SHLIB_LD_LIBS setting done
+ in configure.in (LIBS will be automagically populated by
+ TEA_LOAD_CONFIG).
+ TEA_EXPORT_CONFIG has been added for ${pkg}Config.sh creators
+ SHLIB_LD_FLAGS was deprecated a while ago, remove it if it is
+ still in your Makefile.in.
+
+ * tcl.m4: add /usr/lib64 to set of auto-search dirs. [Bug 1230554]
+ Auto-define BUILD_$PACKAGE_NAME so users don't need to. This
+ needs to correspond with $pkg.h define magic for TCL_STORAGE_CLASS.
+ Auto-define CLEANFILES. Users can expand it.
+ (SHLIB_LD_LIBS): define to '${LIBS}' default and change it only if
+ necessary. Platforms not using this may simply not work or have
+ very funky linkers.
+ (TEA_LOAD_CONFIG): When loading config for another extension,
+ auto-add stub libraries found with TEA_ADD_LIBS. Eases
+ configure.in for modules like itk and img::*.
+ (TEA_EXPORT_CONFIG): Add standardized function for exporting a
+ ${pkg}Config.sh. See use by img::* and itcl.
+
+2010-08-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.8 ***
+ If upgrading from TEA_VERSION 3.7, copy over tcl.m4, change
+ TEA_INIT to use 3.8 and reconfigure (ac-2.59+).
+ No other changes should be necessary.
+
+ * tcl.m4: remove more vestigial bits from removed platforms.
+ Add back SCO_SV-3.2*.
+ Remove use of DL_LIBS and DL_OBJS and related baggage - these are
+ only needed by the core to support 'load'.
+ Allow for macosx in TEA_ADD_SOURCES.
+ Correct check for found_xincludes=no in TEA_PATH_UNIX_X.
+
+2010-08-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove the following old platform configurations:
+ UNIX_SV*|UnixWare-5*, SunOS-4.*, SINIX*5.4*, SCO_SV-3.2*<readded>,
+ OSF1-1.*, NEXTSTEP-*, NetBSD-1.*|FreeBSD-[[1-2]].*, MP-RAS-*,
+ IRIX-5.*, HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*, dgux*,
+ BSD/OS-2.1*|BSD/OS-3*
+ (AIX): drop AIX-pre4 support and use of ldAix, use -bexpall/-brtl
+
+2010-07-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Patch #1055668] removal of exported internals from
+ tclInt.h (EXTERN macro)
+
+2010-04-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4 - Backport a lot of quoting fixes from tcl8.6/unix/tcl.m4
+ - Fix determination of CYGPATH for CYGWIN
+ With those fixes, itcl and tdbc compile fine with CYGWIN
+
+2010-04-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh [Bug 2982540] configure and install* script files
+ should always have LF
+
+2010-02-19 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Correct compiler/linker flags for threaded builds on
+ OpenBSD.
+
+2010-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Detect CYGWIN variant: win32 or unix
+
+2010-01-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tcl.m4 (TEA_CONFIG_CFLAGS): [Tcl Bug 1636685]: Use the
+ configuration for modern FreeBSD suggested by the FreeBSD porter.
+
+2009-10-22 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Tcl Patch #2883533] tcl.m4 support for Haiku OS
+
+2009-04-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): harden the check to add _r to CC on
+ AIX with threads.
+
+2009-04-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): check for 64-bit TkAqua.
+
+2009-03-26 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tclconfig/tcl.m4: Adapt LDFLAGS and LD_SEARCH_FLAGS
+ together with SHLIB_LD definition to unbreak building on HPUX.
+
+2009-03-20 Andreas Kupries <andreask@activestate.com>
+
+ * tclconfig/tcl.m4: Changed SHLIB_LD definition to unbreak
+ building on HPUX.
+
+2009-03-16 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4(TEA_PUBLIC_TK_HEADERS): Look at ${TK_INCLUDE_SPEC}
+ (found in tkConfig.sh) when trying to guess where tk.h might be
+ [Patch 1960628].
+
+2009-03-11 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Allow ${SHLIB_SUFFIX} to be overridden at
+ configure-time [Patch 1960628]. Also fix some comment typos,
+ and an uninitialized variable bug-waiting-to-happen.
+
+2008-12-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 2073255] Tcl_GetString(NULL) doesn't crash on HP-UX
+ (this bug report was for Tcl, but holds for TEA as well.)
+
+2008-12-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: sync with tdbc tcl.m4 changes
+ (SunOS-5.11): Sun cc SHLIB_LD: use LDFLAGS_DEFAULT instead of LDFLAGS
+
+2008-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.7 ***
+
+ * tcl.m4: in private header check, check for <plat>Port.h instead
+ of Int.h to ensure all private headers are available.
+
+2008-11-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): sync TEA_PRIVATE_TK_HEADERS handling of
+ Tk.framework PrivateHeaders with TEA_PRIVATE_TCL_HEADERS.
+
+2008-11-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG, TEA_PATH_TKCONFIG): exit with error
+ when tclConfig.sh cannot be found. [Bug #1997760]
+ (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): allow for
+ finding the headers installed in the public areas, e.g. a result of
+ make install-private-headers. [Bug #1631922]
+
+2008-08-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): link shlib with current and compatiblity version
+ flags; look for libX11.dylib when searching for X11 libraries.
+
+2008-06-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
+
+2008-03-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166]
+
+2008-02-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Updated to work at least in part with
+ more modern VC versions. Currently just made the linker flags more
+ flexible; more work may be needed.
+
+2007-10-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for 64-bit X11.
+
+2007-10-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Tagged tea-3-branch to start TEA 4 development on HEAD ***
+
+2007-09-17 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable'
+ to build shared libraries on current NetBSDs [Bug 1749251].
+
+2007-09-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: replace all direct references to compiler by ${CC} to
+ enable CC overriding at configure & make time.
+ (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by
+ 'cc' compiler driver.
+
+2007-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check Ttk dir for Tk private headers (8.5).
+ Add some comments to other bits.
+
+2007-06-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): move where / is added.
+
+2007-06-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: fix --with-tkinclude alignment. [Bug 1506111]
+
+2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fix 64bit arch removal in fat 32&64bit builds.
+
+2007-05-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4: Added quoting so that paths with spaces cause fewer
+ problems.
+
+2007-03-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in -mmacosx-version-min check.
+
+2007-02-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct private header check to search in generic subdir
+
+2007-02-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.6 ***
+
+ * tcl.m4: correct -d to -f
+ (TEA_CONFIG_CFLAGS): SHLIB_SUFFIX is .so on HP ia64 [Bug 1615058]
+
+2007-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): check
+ that the dirs actually have private headers. [Bug 1631922]
+
+2007-02-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching to -pipe check.
+
+2007-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and
+ move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to
+ avoid errors about multiple -isysroot flags from some older gcc builds.
+
+2006-01-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861]
+ (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
+ present in CFLAGS to avoid discrepancies between what headers configure
+ sees during preprocessing tests and compiling tests.
+
+2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch flag
+ succeeds before enabling 64bit build.
+
+2006-12-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): fix previous change to use makefile variable
+ LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker
+ flags in sampleextension Makefile are picked up.
+
+2006-11-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558]
+
+2006-08-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
+ universal builds including x86_64 and for use of -mmacosx-version-min
+ instead of MACOSX_DEPLOYMENT_TARGET. For Tk extensions, remove 64-bit
+ arch flags from CFLAGS like in the Tk configure, as neither TkAqua nor
+ TkX11 can be built for 64-bit at present.
+
+2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: []-quote AC_DEFUN functions.
+ (TEA_PATH_TKCONFIG): Fixed Windows-specific check for tkConfig.sh.
+ (TEA_MAKE_LIB): Prepend 'lib' for Windows-gcc configs.
+
+2006-03-07 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD,
+ as per the other *BSD variants [Bug 1334613].
+
+2006-01-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA version 3.5 ***
+
+ * tcl.m4: keep LD_SEARCH_FLAGS and CC_SEARCH_FLAGS synchronous
+ with core tcl.m4 meaning.
+
+2006-01-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): use makefile variable LDFLAGS_DEFAULT instead of
+ LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile
+ are picked up. [Bug 1403343]
+
+2006-01-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add C:/Tcl/lib and C:/Progra~1/Tcl/lib dirs to check for
+ *Config.sh on Windows. [Bug 1407544]
+
+2006-01-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): for Tk extensions, remove -arch ppc64 from CFLAGS
+ like in the Tk configure, as neither TkAqua nor TkX11 can be built for
+ 64bit at present (no 64bit GUI libraries).
+
+2006-01-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: restore system=windows on Windows.
+ Remove error if 'ar' isn't found (it may not be on Windows).
+ Do not add -lxnet or define _XOPEN_SOURCE on HP-UX by default.
+ Ensure the C|LDFLAGS_DEFAULT gets the fully sub'd value at
+ configure time.
+
+2006-01-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching, use AC_CACHE_CHECK instead of AC_CACHE_VAL
+ where possible, consistent message quoting, sync relevant
+ tcl/unix/tcl.m4 HEAD changes and gratuitous formatting differences
+ (notably sunc removal of support for for ancient BSD's, IRIX 4,
+ RISCos and Ultrix by kennykb), Darwin improvements to
+ TEA_LOAD_*CONFIG to make linking work against Tcl/Tk frameworks
+ installed in arbitrary location, change TEA_PROG_* search order
+ (look in *_BIN_DIR parents before *_PREFIX).
+
+2006-01-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add dkf's system config refactor
+
+2006-01-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove extraneous ' that causes bash 3.1 to choke
+
+2005-12-19 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG &c): Look for tclConfig.sh &c
+ in ${libdir}, where they are installed by default [Patch #1377407].
+
+2005-12-05 Don Porter <dgp@users.sf.net>
+
+ * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding
+ header files for uninstalled Tcl and Tk.
+
+2005-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correctly bump TEA_VERSION var to 3.4
+
+2005-12-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
+
+2005-11-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Bump to TEA version 3.4 ***
+ Add Windows x64 build support.
+ Remove TEA_PATH_NOSPACE and handle the problem with ""s where
+ necessary - the macro relied on TCLSH_PROG which didn't work for
+ cross-compiles.
+
+2005-11-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to
+ support passing -isysroot in env(CFLAGS) to configure (flag can't
+ be present twice, so can't be in both CFLAGS and LDFLAGS during
+ configure), don't use -prebind when deploying on 10.4.
+ (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching.
+
+2005-10-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that
+ should have been for `uname -s` = "Darwin" instead; added some
+ missing quoting.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that
+ install location of tclConfig.sh/tkConfig.sh allows to determine
+ the tclsh/wish install dir via ../bin. Indeed tcl/tk can be
+ configured with arbitrary --libdir and --bindir (independent of
+ prefix) and such a configuration is in fact standard with Darwin
+ framework builds. At least now also check ${TCL_PREFIX}/bin
+ resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk
+ have been configured with arbitrary --bindir, this will still not
+ find them, for a general solution *Config.sh would need to contain
+ the values of bindir/libdir/includedir passed to configure).
+
+2005-10-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds.
+
+2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro
+ (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func
+
+2005-09-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Update to TEA version 3.3 ***
+ define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG.
+ Make --enable-threads the default (users can --disable-threads).
+ Improve AIX ${CC}_r fix to better check existing ${CC} value.
+ Do the appropriate evals to not require the *TOP_DIR_NATIVE vars
+ be set for extensions that use private headers.
+ Make aqua check for Xlib compat headers the same as win32.
+
+2005-07-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH): Remove
+ TEA_BUILD_TCLSH and TEA_BUILD_WISH because
+ of complaints that it broke the build when
+ only an installed version of Tcl was available
+ at extension build time. The TEA_PROG_TCLSH and
+ TEA_PROG_WISH macros will no longer search the
+ path at all. The build tclsh or installed
+ tclsh shell will now be found by TEA_PROG_TCLSH.
+
+2005-07-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH):
+ Split confused search for tclsh on PATH and
+ build and install locations into two macros.
+ TEA_PROG_TCLSH and TEA_PROG_WISH search the
+ system PATH for an installed tclsh or wish.
+ The TEA_BUILD_TCLSH and TEA_BUILD_WISH
+ macros determine the name of tclsh or
+ wish in the Tcl or Tk build directory even
+ if tclsh or wish has not yet been built.
+ [Tcl bug 1160114]
+ [Tcl patch 1244153]
+
+2005-06-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to
+ TK_INCLUDES when building against TkAqua.
+
+ * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE
+
+ * tcl.m4: changes to better support framework builds of Tcl and Tk out
+ of the box: search framework install locations for *Config.sh, and if in
+ presence of a framework build, use the framework's Headers and
+ PrivateHeaders directories for public and private includes. [FR 947735]
+
+2005-06-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to
+ ensure we can always relocate binaries with install_name_tool.
+
+2005-06-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib
+ compat headers are available in tkheaders location, otherwise add xlib
+ sourcedir to TK_XINCLUDES.
+
+2005-04-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow
+ use with autoheader.
+ (Darwin): added configure checks for recently added linker flags
+ -single_module and -search_paths_first to allow building with older
+ tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD.
+ (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check.
+ (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4).
+
+2005-03-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide
+ int type only on Windows when __int64 is detected as valid.
+
+2005-03-24 Don Porter <dgp@users.sf.net>
+
+ * README.txt: Update reference to "SC_* macros" to "TEA_* macros".
+ * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG
+ and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG.
+ Corrected search path in TEA_PATH_CONFIG and added
+ AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load
+ the configuration of another package can know where they loaded
+ it from.
+
+2005-03-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have
+ variant LD_SEARCH_FLAGS for gcc and cc builds.
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check.
+
+2005-03-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Correct gcc build and HP-UX-11.
+
+2005-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -.
+ (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build.
+ (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed).
+
+2005-02-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: redo of 2005-01-27 changes to correctly handle paths
+ with spaces. Win/CE and Win/64 builds now require a prebuilt
+ tclsh to handle conversion to short pathnames. This is done in
+ the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the
+ compiler and move the necessary includes to CFLAGS.
+ (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to
+ be set in the env and prevent resetting.
+ (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib
+ args to -lfoo, for use with mingw.
+ *** POTENTIAL INCOMPATABILITY ***
+ (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box.
+ Bumped TEA to 3.2.
+
+2005-01-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove cygpath calls to support msys.
+ Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003".
+ Make STLIB_LD use $LINKBIN -lib.
+
+2005-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fixed bug with static build linking to dynamic
+ library in /usr/lib etc instead of linking to static library earlier
+ in search path. [Tcl Bug 956908]
+ Removed obsolete references to Rhapsody.
+
+2004-12-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS
+ options, using better default -O levels. [Bug 1092952, 1091967]
+
+2004-12-29 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Do not use ${DBGX} suffix when building
+ shared libraries [patch #1081595, TIP #34]
+
+2004-09-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds
+
+2004-08-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to
+ work around subdir configures since autoconf only propagates the
+ prefix (not exec_prefix).
+
+2004-07-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with
+ Tcl 8.5 HEAD config, removed core specific & obsolete settings.
+
+2004-07-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if
+ we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that
+ reflects 'tk windowingsystem' value.
+
+2004-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when
+ building against a threaded core.
+ (CFLAGS_WARNING): Remove -Wconversion for gcc builds
+ (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build
+ configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058]
+ Update to latest Tcl 8.5 head config settings.
+ Call this TEA version 3.1.
+
+2004-04-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with
+ AC_TRY_COMPILE for the long vs. long long check. (kenny)
+
+2004-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to
+ define TCL_WIDE_INT_IS_LONG if 'using long'.
+
+2004-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB
+
+2004-02-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it
+ doesn't need the eval.
+
+2004-02-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the
+ DIR_NATIVE vars defined when using private headers on unix.
+ Allow $... to TEA_ADD_SOURCES for constructs like
+ TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to
+ place more in the Makefile.in.
+ tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+ CHECK on limits.h
+
+2003-12-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and
+ * configure: TEA_ADD_CFLAGS to configurable parameters with
+ * configure.in: PKG_* equivs in the Makefile. This allows the
+ * tclconfig/tcl.m4: user to worry less about actual magic VAR names.
+ Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires
+ exact file names.
+
+2003-12-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff)
+
+2003-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure:
+ * configure.in:
+ * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the
+ first part of VPATH can get chopped off.
+ Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes.
+ * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub
+ generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as
+ the way the user specifies library files.
+
+2003-12-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure: Update of TEA spec to (hopefully) simplify
+ * configure.in: some aspects of TEA by making use of more
+ * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead
+ * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of
+ * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA
+ package name and version.
+ Provide a version argument to TEA_INIT - starting with 3.0.
+ Drop all use of interior shell substs that older makefiles didn't
+ like. Use PKG_* naming convention instead.
+ Move specification of source files and public headers into
+ configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will
+ be munged during ./configure into the right obj file names (no
+ $(SOURCES:.c=.obj) needed).
+ There is almost nothing that should be touched in Makefile.in now
+ for the developer. May want to add a TEA_ADD_TCL_SOURCES for the
+ RUNTIME_SOURCES that remains.
+ Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does.
+ Only specify the user requested LDFLAGS/CFLAGS in the Makefile,
+ don't mention the _OPTIMIZE/_DEBUG variants.
+
+2003-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the
+ TEA_SETUP_COMPILER macro. They are split so the check for CC
+ occurs before any use of CC. Also add AC_PROG_CPP to the compiler
+ checks.
+
+2003-10-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updated for autoconf 2.5x prereq.
+ Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks
+ in tcl.h, which also handles TCL_LL_MODIFIER* properly.
+
+2003-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct default setting of ARCH for WinCE builds.
+ Correct \ escaping for CE sed macros.
+
+2003-04-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: replace $(syscal) construct with older `syscall` for
+ systems where sh != bash.
+
+2003-04-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib
+ options for Windows/CE compilation support. Requires the
+ Microsoft eMbedded SDK and Keuchel's celib emulation layer.
+
+2003-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on
+ the link line when checking for the pthread_attr_setstacksize
+ symbol. (dejong)
+
+ * tcl.m4 (TEA_SETUP_COMPILER): added default calls to
+ TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS,
+ TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD.
+
+2003-02-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX ia64 --enable-64bit build flags
+
+2003-01-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when
+ looking for tcl|tkConfig.sh, as this check is done before we would
+ set exec_prefix when the user does not define it.
+
+2003-01-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support
+ for mingw, the previous implementation would
+ use VC++ when compiling with mingw gcc. Don't
+ pass -fPIC since gcc always compiles pic code
+ under win32. Change some hard coded cases
+ of gcc to ${CC}.
+
+2002-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to
+ TEA_MAKE_LIB because setting too early confuses other AC_* macros.
+ Correct the HP-11 SHLIB_LD_LIBS setting.
+
+ * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and
+ make it pick up the env CFLAGS at configure time.
+
+2002-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG.
+ Improved AIX 64-bit build support, allow it on AIX-4 as well.
+ Enable 64-bit HP-11 compilation with gcc.
+ Enable 64-bit IRIX64-6 cc build support.
+ Correct FreeBSD thread library linkage.
+ Add OSF1 static build support.
+ Improve SunOS-5 shared build SHLIB_LD macro.
+
+2002-07-20 Zoran Vasiljevic <zoran@archiware.com>
+
+ * tcl.m4: Added MINGW32 to list of systems checked for Windows build.
+ Also, fixes some indentation issues with "--with-XXX" options.
+
+2002-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to
+ use new threaded allocatory by default on Unix for Tcl 8.4.
+ (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+.
+
+2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that
+ we can use autoconf 2.5x as well as 2.13. This prevents us from
+ being able to warn against the use of cygwin gcc at configure
+ time, but allows autoconf 2.5x, which is what is shipped with most
+ newer systems.
+
+2002-04-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Enabled COFF as well as CV style debug info with
+ --enable-symbols to allow Dr. Watson users to see function info.
+ More info on debugging levels can be obtained at:
+ http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+
+2002-04-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for
+ Scriptics, which is no more. TEA represents a better, independent
+ prefix that won't need changing.
+ Added preliminary mingw gcc support. [Patch #538772]
+ Added TEA_PREFIX macro that handles defaulting the prefix and
+ exec_prefix vars to those used by Tcl if none were specified.
+ Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC
+ check and several other basic AC_PROG checks needed for making
+ executables. This greatly simplifies user's configure.in files.
+ Collapsed AIX-5 defines into AIX-* with extra checks for doing the
+ ELF stuff on AIX-5-ia64.
+ Updated TEA_ENABLE_THREADS to take an optional arg to allow
+ switching it on by default (for Thread) and add sanity checking to
+ warn the user if configuring threads incompatibly.
+
+2002-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT.
+ Removed --enable-64bit support for AIX-4 because it wasn't correct.
+ Added -MT or -MD Windows linker switches to properly support
+ symbols-enabled builds.
+
+2002-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first
+ instead of calling it as that inlines it each time in shell code.
+ Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti.
+ Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds.
+ A few changes to support itcl (and perhaps others):
+ Added support for making your own stub libraries to SC_MAKE_LIB.
+ New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg
+ and find that ${pkg}Config.sh file. itk uses this for itcl.
+
+2002-03-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk
+ build dir setup.
+ Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS.
+ Added XLIBSW onto LIBS when it is defined.
+ Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS
+ instead to not rely as much on tclConfig.sh cached info.
+ Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH.
+ These move towards making TEA much more independent of *Config.sh.
+
+2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and
+ SHLIB_SUFFIX defines for Win.
+ (SC_PATH_X): made this only do the check on unix platforms.
+
+2002-03-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README.txt: updated to reflect fewer files
+
+2002-03-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * config.guess (removed):
+ * config.sub (removed): removed unnecessary files
+
+ * installFile.tcl (removed):
+ * mkinstalldirs (removed): these aren't really necessary for
+ making TEA work
+
+ * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't
+ check /usr(/local)/include for includes on Windows when not using
+ gcc
+
+2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: added warnings on Windows, removed RELPATH define and
+ added TCL_LIBS to MAKE_LIB macro.
+
+ This import represents 2.0.0, or a new start at attempting to
+ make TEA much easier for C extension developers.
+
+ **** moved from tclpro project to core tcl project, ****
+ **** renamed to 'tclconfig' ****
+
+2001-03-15 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added updating of the modification time of
+ the target file whether we overwrote it or decided that it
+ hadn't changed. This was necessary for us to be able to
+ determine whether or not a module install touched the file.
+
+2001-03-08 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added support for converting new-style (1.1+)
+ Cygnus drive paths to Tcl-style.
+
+2001-01-15 <brent.welch@interwoven.com>
+
+ * tcl.m4: Added FreeBSD clause.
+
+2001-01-03 <brent.welch@interwoven.com>
+
+ * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking
+ for exec-prefix.
+
+2000-12-01 <brent.welch@interwoven.com>
+
+ * tcl.m4: Concatenated most of the Ajuba acsite.m4 file
+ so we don't need to modify the autoconf installation.
+ * config.guess:
+ * config.sub:
+ * installFile.tcl:
+ Added files from the itcl config subdirectory,
+ which should go away.
+
+2000-7-29 <welch@ajubasolutions.com>
+
+ * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within
+ TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent
+ change from $(srcdir) to $(srcdir)/..
diff --git a/ds9/macosx/tclconfig/README.txt b/ds9/macosx/tclconfig/README.txt
new file mode 100644
index 0000000..59b5a3e
--- /dev/null
+++ b/ds9/macosx/tclconfig/README.txt
@@ -0,0 +1,26 @@
+These files comprise the basic building blocks for a Tcl Extension
+Architecture (TEA) extension. For more information on TEA see:
+
+ http://www.tcl.tk/doc/tea/
+
+This package is part of the Tcl project at SourceForge, and latest
+sources should be available there:
+
+ http://tcl.sourceforge.net/
+
+This package is a freely available open source package. You can do
+virtually anything you like with it, such as modifying it, redistributing
+it, and selling it either in whole or in part.
+
+CONTENTS
+========
+The following is a short description of the files you will find in
+the sample extension.
+
+README.txt This file
+
+install-sh Program used for copying binaries and script files
+ to their install locations.
+
+tcl.m4 Collection of Tcl autoconf macros. Included by a package's
+ aclocal.m4 to define TEA_* macros.
diff --git a/ds9/macosx/tclconfig/install-sh b/ds9/macosx/tclconfig/install-sh
new file mode 100755
index 0000000..7c34c3f
--- /dev/null
+++ b/ds9/macosx/tclconfig/install-sh
@@ -0,0 +1,528 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-04-20.01; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -S $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -S) stripcmd="$stripprog $2"
+ shift;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ds9/macosx/tclconfig/tcl.m4 b/ds9/macosx/tclconfig/tcl.m4
new file mode 100644
index 0000000..8bc9c83
--- /dev/null
+++ b/ds9/macosx/tclconfig/tcl.m4
@@ -0,0 +1,4150 @@
+# tcl.m4 --
+#
+# This file provides a set of autoconf macros to help TEA-enable
+# a Tcl extension.
+#
+# Copyright (c) 1999-2000 Ajuba Solutions.
+# Copyright (c) 2002-2005 ActiveState Corporation.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+AC_PREREQ(2.57)
+
+dnl TEA extensions pass us the version of TEA they think they
+dnl are compatible with (must be set in TEA_INIT below)
+dnl TEA_VERSION="3.9"
+
+# Possible values for key variables defined:
+#
+# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
+# TEA_PLATFORM - windows unix
+#
+
+#------------------------------------------------------------------------
+# TEA_PATH_TCLCONFIG --
+#
+# Locate the tclConfig.sh file and perform a sanity check on
+# the Tcl compile flags
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the directory containing
+# the tclConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TCLCONFIG], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+ AC_ARG_WITH(tcl,
+ AC_HELP_STRING([--with-tcl],
+ [directory containing tcl configuration (tclConfig.sh)]),
+ with_tclconfig="${withval}")
+ AC_MSG_CHECKING([for Tcl configuration])
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_TKCONFIG --
+#
+# Locate the tkConfig.sh file
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tk=...
+#
+# Defines the following vars:
+# TK_BIN_DIR Full path to the directory containing
+# the tkConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TKCONFIG], [
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+ AC_ARG_WITH(tk,
+ AC_HELP_STRING([--with-tk],
+ [directory containing tk configuration (tkConfig.sh)]),
+ with_tkconfig="${withval}")
+ AC_MSG_CHECKING([for Tk configuration])
+ AC_CACHE_VAL(ac_cv_c_tkconfig,[
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TCLCONFIG --
+#
+# Load the tclConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TCL_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_BIN_DIR
+# TCL_SRC_DIR
+# TCL_LIB_FILE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TCLCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
+ AC_SUBST(TCL_PATCH_LEVEL)
+ AC_SUBST(TCL_BIN_DIR)
+ AC_SUBST(TCL_SRC_DIR)
+
+ AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
+
+ AC_MSG_CHECKING([platform])
+ hold_cc=$CC; CC="$TCL_CC"
+ AC_TRY_COMPILE(,[
+ #ifdef _WIN32
+ #error win32
+ #endif
+ ], TEA_PLATFORM="unix",
+ TEA_PLATFORM="windows"
+ )
+ CC=$hold_cc
+ AC_MSG_RESULT($TEA_PLATFORM)
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+ AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [],
+ [Building extension source?])
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+ AC_SUBST(CLEANFILES)
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(TCL_DEFS)
+ AC_SUBST(TCL_EXTRA_CFLAGS)
+ AC_SUBST(TCL_LD_FLAGS)
+ AC_SUBST(TCL_SHLIB_LD_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TKCONFIG --
+#
+# Load the tkConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TK_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tkConfig.sh:
+# TK_BIN_DIR
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TKCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+ AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+ AC_SUBST(TK_VERSION)
+ AC_SUBST(TK_BIN_DIR)
+ AC_SUBST(TK_SRC_DIR)
+
+ AC_SUBST(TK_LIB_FILE)
+ AC_SUBST(TK_LIB_FLAG)
+ AC_SUBST(TK_LIB_SPEC)
+
+ AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TK_STUB_LIB_FLAG)
+ AC_SUBST(TK_STUB_LIB_SPEC)
+
+ # TEA specific:
+ AC_SUBST(TK_LIBS)
+ AC_SUBST(TK_XINCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_TCLSH
+# Determine the fully qualified path name of the tclsh executable
+# in the Tcl build directory or the tclsh installed in a bin
+# directory. This macro will correctly determine the name
+# of the tclsh executable even if tclsh has not yet been
+# built in the build directory. The tclsh found is always
+# associated with a tclConfig.sh file. This tclsh should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# TCLSH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_TCLSH], [
+ AC_MSG_CHECKING([for tclsh])
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ # tclConfig.sh is in Tcl build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
+ fi
+ else
+ # tclConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
+ fi
+ list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${TCLSH_PROG}" ; then
+ REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
+ fi
+ AC_MSG_RESULT([${TCLSH_PROG}])
+ AC_SUBST(TCLSH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_WISH
+# Determine the fully qualified path name of the wish executable
+# in the Tk build directory or the wish installed in a bin
+# directory. This macro will correctly determine the name
+# of the wish executable even if wish has not yet been
+# built in the build directory. The wish found is always
+# associated with a tkConfig.sh file. This wish should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# WISH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_WISH], [
+ AC_MSG_CHECKING([for wish])
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ # tkConfig.sh is in Tk build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="${TK_BIN_DIR}/wish"
+ fi
+ else
+ # tkConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
+ fi
+ list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${WISH_PROG}" ; then
+ REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
+ fi
+ AC_MSG_RESULT([${WISH_PROG}])
+ AC_SUBST(WISH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SHARED --
+#
+# Allows the building of shared libraries
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-shared=yes|no
+#
+# Defines the following vars:
+# STATIC_BUILD Used for building import/export libraries
+# on Windows.
+#
+# Sets the following vars:
+# SHARED_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SHARED], [
+ AC_MSG_CHECKING([how to build libraries])
+ AC_ARG_ENABLE(shared,
+ AC_HELP_STRING([--enable-shared],
+ [build and link with shared libraries (default: on)]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([shared])
+ SHARED_BUILD=1
+ else
+ AC_MSG_RESULT([static])
+ SHARED_BUILD=0
+ AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
+ fi
+ AC_SUBST(SHARED_BUILD)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled. If "yes" is specified
+# as an arg (optional), threads are enabled by default, "no" means
+# threads are disabled. "yes" is the default.
+#
+# TCL_THREADS is checked so that if you are compiling an extension
+# against a threaded core, your extension must be compiled threaded
+# as well.
+#
+# Note that it is legal to have a thread enabled extension run in a
+# threaded or non-threaded Tcl core, but a non-threaded extension may
+# only run in a non-threaded Tcl core.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads
+#
+# Sets the following vars:
+# THREADS_LIBS Thread library(s)
+#
+# Defines the following vars:
+# TCL_THREADS
+# _REENTRANT
+# _THREAD_SAFE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_THREADS], [
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads],
+ [build with threads]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ # We are always OK on Windows, so check what this platform wants:
+
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC, 1,
+ [Do we want to use the threaded memory allocator?])
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+ fi
+ AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
+ fi
+ fi
+ fi
+ fi
+ fi
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ AC_MSG_CHECKING([for building with threads])
+ if test "${TCL_THREADS}" = 1; then
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
+ AC_MSG_RESULT([yes (default)])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ # TCL_THREADS sanity checking. See if our request for building with
+ # threads is the same as the way Tcl was built. If not, warn the user.
+ case ${TCL_DEFS} in
+ *THREADS=1*)
+ if test "${TCL_THREADS}" = "0"; then
+ AC_MSG_WARN([
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads.])
+ fi
+ ;;
+ *)
+ if test "${TCL_THREADS}" = "1"; then
+ AC_MSG_WARN([
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core.])
+ fi
+ ;;
+ esac
+ AC_SUBST(TCL_THREADS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SYMBOLS --
+#
+# Specify if debugging symbols should be used.
+# Memory (TCL_MEM_DEBUG) debugging can also be enabled.
+#
+# Arguments:
+# none
+#
+# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
+# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
+# Requires the following vars to be set in the Makefile:
+# CFLAGS_DEFAULT
+# LDFLAGS_DEFAULT
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-symbols
+#
+# Defines the following vars:
+# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
+# Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false
+# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
+# Sets to $(LDFLAGS_OPTIMIZE) if false
+# DBGX Formerly used as debug library extension;
+# always blank now.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SYMBOLS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_CONFIG_CFLAGS])
+ AC_MSG_CHECKING([for build with symbols])
+ AC_ARG_ENABLE(symbols,
+ AC_HELP_STRING([--enable-symbols],
+ [build with debugging symbols (default: off)]),
+ [tcl_ok=$enableval], [tcl_ok=no])
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ AC_MSG_RESULT([no])
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ AC_MSG_RESULT([yes (standard debugging)])
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+ AC_SUBST(CFLAGS_DEFAULT)
+ AC_SUBST(LDFLAGS_DEFAULT)
+ AC_SUBST(TCL_DBGX)
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ AC_MSG_RESULT([enabled symbols mem debugging])
+ else
+ AC_MSG_RESULT([enabled $tcl_ok debugging])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_LANGINFO --
+#
+# Allows use of modern nl_langinfo check for better l10n.
+# This is only relevant for Unix.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-langinfo=yes|no (default is yes)
+#
+# Defines the following vars:
+# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_LANGINFO], [
+ AC_ARG_ENABLE(langinfo,
+ AC_HELP_STRING([--enable-langinfo],
+ [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
+
+ HAVE_LANGINFO=0
+ if test "$langinfo_ok" = "yes"; then
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
+ fi
+ AC_MSG_CHECKING([whether to use nl_langinfo])
+ if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h, [
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
+ AC_MSG_RESULT([$tcl_cv_langinfo_h])
+ if test $tcl_cv_langinfo_h = yes; then
+ AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
+ fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_SYSTEM
+#
+# Determine what the system is (some things cannot be easily checked
+# on a feature-driven basis, alas). This can usually be done via the
+# "uname" command.
+#
+# Arguments:
+# none
+#
+# Results:
+# Defines the following var:
+#
+# system - System/platform/version identification code.
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_SYSTEM], [
+ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ AC_MSG_WARN([can't find uname command])
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+ ])
+ system=$tcl_cv_sys_version
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_CFLAGS
+#
+# Try to determine the proper flags to pass to the compiler
+# for building shared libraries and other such nonsense.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substitutes the following vars:
+#
+# DL_OBJS, DL_LIBS - removed for TEA, only needed by core.
+# LDFLAGS - Flags to pass to the compiler when linking object
+# files into an executable application binary such
+# as tclsh.
+# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile. Could
+# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
+# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile.
+# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
+# of a shared library (may request position-independent
+# code, among other things).
+# SHLIB_LD - Base command to use for combining object files
+# into a shared library.
+# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
+# creating shared libraries. This symbol typically
+# goes at the end of the "ld" commands that build
+# shared libraries. The value of the symbol defaults to
+# "${LIBS}" if all of the dependent libraries should
+# be specified when creating a shared library. If
+# dependent libraries should not be specified (as on
+# SunOS 4.x, where they cause the link to fail, or in
+# general if Tcl and Tk aren't themselves shared
+# libraries), then this symbol has an empty string
+# as its value.
+# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
+# extensions. An empty string means we don't know how
+# to use shared libraries on this platform.
+# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
+# in a static or shared library name, using the $PACKAGE_VERSION variable
+# to put the version in the right place. This is used
+# by platforms that need non-standard library names.
+# Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs
+# to have a version after the .so, and ${PACKAGE_VERSION}.a
+# on AIX, since a shared library needs to have
+# a .a extension whereas shared objects for loadable
+# extensions have a .so extension. Defaults to
+# ${PACKAGE_VERSION}${SHLIB_SUFFIX}.
+# CFLAGS_DEBUG -
+# Flags used when running the compiler in debug mode
+# CFLAGS_OPTIMIZE -
+# Flags used when running the compiler in optimize mode
+# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_CFLAGS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+
+ # Step 0.a: Enable 64 bit support?
+
+ AC_MSG_CHECKING([if 64bit support is requested])
+ AC_ARG_ENABLE(64bit,
+ AC_HELP_STRING([--enable-64bit],
+ [enable 64bit support (default: off)]),
+ [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT([$do64bit])
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
+ AC_ARG_ENABLE(64bit-vis,
+ AC_HELP_STRING([--enable-64bit-vis],
+ [enable 64bit Sparc VIS support (default: off)]),
+ [do64bitVIS=$enableval], [do64bitVIS=no])
+ AC_MSG_RESULT([$do64bitVIS])
+ # Force 64bit on with VIS
+ AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ AC_CACHE_CHECK([if compiler supports visibility "hidden"],
+ tcl_cv_cc_visibility_hidden, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ AC_TRY_LINK([
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
+ ])
+
+ # Step 0.d: Disable -rpath support?
+
+ AC_MSG_CHECKING([if rpath support is requested])
+ AC_ARG_ENABLE(rpath,
+ AC_HELP_STRING([--disable-rpath],
+ [disable rpath support (default: on)]),
+ [doRpath=$enableval], [doRpath=yes])
+ AC_MSG_RESULT([$doRpath])
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ AS_IF([test "${TEA_PLATFORM}" = windows], [
+ AC_MSG_CHECKING([if Windows/CE build is requested])
+ AC_ARG_ENABLE(wince,
+ AC_HELP_STRING([--enable-wince],
+ [enable Win/CE support (where applicable)]),
+ [doWince=$enableval], [doWince=no])
+ AC_MSG_RESULT([$doWince])
+ ])
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+ TEA_CONFIG_SYSTEM
+
+ # Require ranlib early so we can override it in special cases below.
+
+ AC_REQUIRE([AC_PROG_RANLIB])
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+ ], [
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+ ])
+ AC_CHECK_TOOL(AR, ar)
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION="1.0"])
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
+ AC_MSG_WARN([Ensure latest Platform SDK is installed])
+ do64bit="no"
+ else
+ AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
+ fi
+ if test "$GCC" = "yes" ; then
+ AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
+ fi
+ TEA_PATH_CELIB
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
+ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
+ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
+ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+ TEA_ADD_LIBS([bufferoverflowU.lib])
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+ AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
+ done
+ AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
+ AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+ AC_SUBST(CELIB_DIR)
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ AC_CHECK_TOOL(RC, windres)
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ AC_CACHE_CHECK(for cross-compile version of gcc,
+ ac_cv_cross,
+ AC_TRY_COMPILE([
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+ ], [],
+ ac_cv_cross=yes,
+ ac_cv_cross=no)
+ )
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
+ ;;
+ esac
+ AC_MSG_RESULT([Using $CC for compiling with threads])
+ ])
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+ ])
+ ])
+
+ AS_IF([test "`uname -m`" = ia64], [
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ AS_IF([test "$GCC" = yes], [
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ ], [
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+ ])
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ], [
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+ ], [
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+ ])
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ AS_IF([test "`uname -m`" = ia64], [
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+ ], [
+ SHLIB_SUFFIX=".sl"
+ ])
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ AS_IF([test "$tcl_ok" = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ ])
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ ])
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = "yes"], [
+ AS_IF([test "$GCC" = yes], [
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ;;
+ esac
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+ ])
+ ]) ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+ ], [
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+ ])
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported by gcc])
+ ], [
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+ ])
+ ])
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
+ AS_IF([test $do64bit = yes], [
+ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_m64 = yes], [
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+ ])
+ ])
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+ ])
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$[@]"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
+ AS_IF([test $do64bit = yes], [
+ case `arch` in
+ ppc)
+ AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
+ tcl_cv_cc_arch_ppc64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+ tcl_cv_cc_arch_ppc64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+ ]);;
+ i386)
+ AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
+ tcl_cv_cc_arch_x86_64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+ tcl_cv_cc_arch_x86_64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+ ]);;
+ *)
+ AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
+ esac
+ ], [
+ # Check for combined 32-bit and 64-bit fat build
+ AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
+ fat_32_64=yes])
+ ])
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_single_module = yes], [
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+ ])
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
+ LDFLAGS="$LDFLAGS -prebind"])
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
+ tcl_cv_ld_search_paths_first, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
+ tcl_cv_ld_search_paths_first=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ ])
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [__private_extern__],
+ [Compiler support for module scope symbols])
+ tcl_cv_cc_visibility_hidden=yes
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
+ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
+ tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [
+ AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ AC_TRY_LINK([#include <tk.h>], [Tk_InitStubs(NULL, "", 0);],
+ tcl_cv_lib_tk_64=yes, tcl_cv_lib_tk_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [
+ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done])
+ ])
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+ AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
+ [Should OS/390 do the right thing with sockets?])
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ AS_IF([test "$SHARED_BUILD" = 1], [
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ ], [
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ ])
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ AS_IF([test "${TCL_THREADS}" = 1], [
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ AS_IF([test "$GCC" = yes], [
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ ], [
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ])
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ ], [
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ ])
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[[0-6]])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ arch=`isainfo`
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ AS_IF([test "$GCC" = yes], [
+ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+ ])
+ ], [
+ do64bit_ok=yes
+ AS_IF([test "$do64bitVIS" = yes], [
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+ ], [
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+ ])
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+ ])
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
+ esac
+ ], [
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+ ])
+ ], [AC_MSG_WARN([64bit mode not supported for $arch])])])
+ ])
+
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "$do64bit_ok" = yes], [
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+ ])])
+ ])
+ ], [
+ case $system in
+ SunOS-5.[[1-9]][[0-9]]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ])
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_Bexport = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
+ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
+ ])
+
+dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
+dnl # until the end of configure, as configure's compile and link tests use
+dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
+dnl # preprocessing tests use only CPPFLAGS.
+ AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac])
+
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [extern],
+ [No Compiler support for module scope symbols])
+ ])
+
+ AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
+ AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ AC_CACHE_CHECK(for SEH support in compiler,
+ tcl_cv_seh,
+ AC_TRY_RUN([
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+ ],
+ tcl_cv_seh=yes,
+ tcl_cv_seh=no,
+ tcl_cv_seh=no)
+ )
+ if test "$tcl_cv_seh" = "no" ; then
+ AC_DEFINE(HAVE_NO_SEH, 1,
+ [Defined when mingw does not support SEH])
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
+ tcl_cv_eh_disposition,
+ AC_TRY_COMPILE([
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+ ],[
+ EXCEPTION_DISPOSITION x;
+ ],
+ tcl_cv_eh_disposition=yes,
+ tcl_cv_eh_disposition=no)
+ )
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+ AC_DEFINE(EXCEPTION_DISPOSITION, int,
+ [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ AC_CACHE_CHECK(for winnt.h that ignores VOID define,
+ tcl_cv_winnt_ignore_void,
+ AC_TRY_COMPILE([
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+ ], [
+ CHAR c;
+ SHORT s;
+ LONG l;
+ ],
+ tcl_cv_winnt_ignore_void=yes,
+ tcl_cv_winnt_ignore_void=no)
+ )
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+ AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
+ [Defined when cygwin/mingw ignores VOID define in winnt.h])
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_TRY_COMPILE([],
+ [
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ],
+ tcl_cv_cast_to_union=yes,
+ tcl_cv_cast_to_union=no)
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
+
+ AC_SUBST(CFLAGS_DEBUG)
+ AC_SUBST(CFLAGS_OPTIMIZE)
+ AC_SUBST(CFLAGS_WARNING)
+
+ AC_SUBST(STLIB_LD)
+ AC_SUBST(SHLIB_LD)
+
+ AC_SUBST(SHLIB_LD_LIBS)
+ AC_SUBST(SHLIB_CFLAGS)
+
+ AC_SUBST(LD_LIBRARY_PATH_VAR)
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+ TEA_TCL_EARLY_FLAGS
+ TEA_TCL_64BIT_FLAGS
+])
+
+#--------------------------------------------------------------------
+# TEA_SERIAL_PORT
+#
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
+# USE_TERMIOS
+# USE_TERMIO
+# USE_SGTTY
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_SERIAL_PORT], [
+ AC_CHECK_HEADERS(sys/modem.h)
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
+ AC_TRY_RUN([
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
+ termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
+ sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_MISSING_POSIX_HEADERS
+#
+# Supply substitutes for missing POSIX header files. Special
+# notes:
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod in some versions of SunOS
+# - some versions of string.h don't declare procedures such
+# as strstr
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# NO_DIRENT_H
+# NO_ERRNO_H
+# NO_VALUES_H
+# HAVE_LIMITS_H or NO_LIMITS_H
+# NO_STDLIB_H
+# NO_STRING_H
+# NO_SYS_WAIT_H
+# NO_DLFCN_H
+# HAVE_SYS_PARAM_H
+#
+# HAVE_STRING_H ?
+#
+# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+# CHECK on limits.h
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
+ AC_TRY_LINK([#include <sys/types.h>
+#include <dirent.h>], [
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
+
+ if test $tcl_cv_dirent_h = no; then
+ AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
+ fi
+
+ # TEA specific:
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
+ AC_CHECK_HEADER(limits.h,
+ [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
+ [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
+ fi
+ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
+ fi
+
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ AC_HAVE_HEADERS(sys/param.h)
+])
+
+#--------------------------------------------------------------------
+# TEA_PATH_X
+#
+# Locate the X11 header files and the X11 library archive. Try
+# the ac_path_x macro first, but if it doesn't find the X stuff
+# (e.g. because there's no xmkmf program) then check through
+# a list of possible directories. Under some conditions the
+# autoconf macro will return an include directory that contains
+# no include files, so double-check its result just to be safe.
+#
+# This should be called after TEA_CONFIG_CFLAGS as setting the
+# LIBS line can confuse some configure macro magic.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets the following vars:
+# XINCLUDES
+# XLIBSW
+# PKG_LIBS (appends to)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_X], [
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
+ TEA_PATH_UNIX_X
+ fi
+])
+
+AC_DEFUN([TEA_PATH_UNIX_X], [
+ AC_PATH_X
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
+ else
+ if test ! -r $x_includes/X11/Xlib.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ AC_MSG_CHECKING([for X11 header files])
+ found_xincludes="no"
+ AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Xlib.h; then
+ AC_MSG_RESULT([$i])
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test "$found_xincludes" = "no"; then
+ AC_MSG_RESULT([couldn't find any!])
+ fi
+
+ if test "$no_x" = yes; then
+ AC_MSG_CHECKING([for X11 libraries])
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
+ AC_MSG_RESULT([$i])
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_MSG_RESULT([could not find any! Using -lX11.])
+ XLIBSW=-lX11
+ fi
+ # TEA specific:
+ if test x"${XLIBSW}" != x ; then
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BLOCKING_STYLE
+#
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# HAVE_SYS_IOCTL_H
+# HAVE_SYS_FILIO_H
+# USE_FIONBIO
+# O_NONBLOCK
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BLOCKING_STYLE], [
+ AC_CHECK_HEADERS(sys/ioctl.h)
+ AC_CHECK_HEADERS(sys/filio.h)
+ TEA_CONFIG_SYSTEM
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
+ case $system in
+ OSF*)
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ *)
+ AC_MSG_RESULT([O_NONBLOCK])
+ ;;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_TIME_HANDLER
+#
+# Checks how the system deals with time.h, what time structures
+# are used on the system, and what fields the structures have.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# USE_DELTA_FOR_TZ
+# HAVE_TM_GMTOFF
+# HAVE_TM_TZADJ
+# HAVE_TIMEZONE_VAR
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TIME_HANDLER], [
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_HEADER_TIME
+ AC_STRUCT_TIMEZONE
+
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
+
+ AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
+ if test $tcl_cv_member_tm_tzadj = yes ; then
+ AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
+ fi
+
+ AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
+ AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
+ fi
+
+ #
+ # Its important to include time.h in this check, as some systems
+ # (like convex) have timezone functions, etc.
+ #
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern long timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
+ if test $tcl_cv_timezone_long = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ else
+ #
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
+ if test $tcl_cv_timezone_time = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BUGGY_STRTOD
+#
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" (provided by Tcl) that corrects the error.
+# Also, on Compaq's Tru64 Unix 5.0,
+# strtod(" ") returns 0.0 instead of a failure to convert.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Might defines some of the following vars:
+# strtod (=fixstrtod)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BUGGY_STRTOD], [
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
+ if test "$tcl_strtod" = 1; then
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
+ tcl_cv_strtod_buggy=buggy)])
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ AC_LIBOBJ([fixstrtod])
+ USE_COMPAT=1
+ AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_LINK_LIBS
+#
+# Search for the libraries needed to link the Tcl shell.
+# Things like the math library (-lm) and socket stuff (-lsocket vs.
+# -lnsl) are dealt with here.
+#
+# Arguments:
+# Requires the following vars to be set in the Makefile:
+# DL_LIBS (not in TEA, only needed in core)
+# LIBS
+# MATH_LIBS
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_LIBS
+# MATH_LIBS
+#
+# Might append to the following vars:
+# LIBS
+#
+# Might define the following vars:
+# HAVE_NET_ERRNO_H
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_LINK_LIBS], [
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
+ AC_CHECK_HEADER(net/errno.h, [
+ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
+ if test "$tcl_checkSocket" = 1; then
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
+ fi
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
+ [LIBS="$LIBS -lnsl"])])
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(MATH_LIBS)
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_EARLY_FLAGS
+#
+# Check for what flags are needed to be passed so the correct OS
+# features are available.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# _ISOC99_SOURCE
+# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_EARLY_FLAG],[
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
+ AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
+ tcl_flags="$tcl_flags $1"
+ fi
+])
+
+AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
+ AC_MSG_CHECKING([for required early compiler flags])
+ tcl_flags=""
+ TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
+ [char *p = (char *)open64;])
+ if test "x${tcl_flags}" = "x" ; then
+ AC_MSG_RESULT([none])
+ else
+ AC_MSG_RESULT([${tcl_flags}])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_64BIT_FLAGS
+#
+# Check for what is defined in the way of 64-bit features.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# TCL_WIDE_INT_IS_LONG
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_STAT64
+# HAVE_TYPE_OFF64_T
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
+ AC_MSG_CHECKING([for 64-bit integer type])
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ AC_TRY_COMPILE(,[switch (0) {
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
+ if test "${tcl_cv_type_64bit}" = none ; then
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
+ AC_MSG_RESULT([using long])
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ AC_MSG_RESULT([using Tcl header defaults])
+ else
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
+ [What type should be used to define wide integers?])
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
+
+ # Now check for auxiliary declarations
+ AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
+ fi
+
+ AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
+ fi
+
+ AC_CHECK_FUNCS(open64 lseek64)
+ AC_MSG_CHECKING([for off64_t])
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
+ dnl functions lseek64 and open64 are defined.
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+])
+
+##
+## Here ends the standard Tcl configuration bits and starts the
+## TEA specific functions
+##
+
+#------------------------------------------------------------------------
+# TEA_INIT --
+#
+# Init various Tcl Extension Architecture (TEA) variables.
+# This should be the first called TEA_* macro.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substs the following vars:
+# CYGPATH
+# EXEEXT
+# Defines only:
+# TEA_VERSION
+# TEA_INITED
+# TEA_PLATFORM (windows or unix)
+#
+# "cygpath" is used on windows to generate native path names for include
+# files. These variables should only be used with the compiler and linker
+# since they generate native path names.
+#
+# EXEEXT
+# Select the executable extension based on the host type. This
+# is a lightweight replacement for AC_EXEEXT that doesn't require
+# a compiler.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_INIT], [
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ AC_MSG_CHECKING([for correct TEA configuration])
+ if test x"${PACKAGE_NAME}" = x ; then
+ AC_MSG_ERROR([
+The PACKAGE_NAME variable must be defined by your TEA configure.in])
+ fi
+ if test x"$1" = x ; then
+ AC_MSG_ERROR([
+TEA version not specified.])
+ elif test "$1" != "${TEA_VERSION}" ; then
+ AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
+ else
+ AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}])
+
+ AC_SUBST(EXEEXT)
+ AC_SUBST(CYGPATH)
+
+ # This package name must be replaced statically for AC_SUBST to work
+ AC_SUBST(PKG_LIB_FILE)
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+ AC_SUBST(PKG_STUB_LIB_FILE)
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+ AC_SUBST(PKG_TCL_SOURCES)
+ AC_SUBST(PKG_HEADERS)
+ AC_SUBST(PKG_INCLUDES)
+ AC_SUBST(PKG_LIBS)
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_SOURCES
+# PKG_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ case $i in
+ [\$]*)
+ # allow $-var names
+ PKG_SOURCES="$PKG_SOURCES $i"
+ PKG_OBJECTS="$PKG_OBJECTS $i"
+ ;;
+ *)
+ # check for existence - allows for generic/win/unix VPATH
+ # To add more dirs here (like 'src'), you have to update VPATH
+ # in Makefile.in as well
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find source file '$i'])
+ fi
+ PKG_SOURCES="$PKG_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_OBJECTS="$PKG_OBJECTS $j"
+ ;;
+ esac
+ done
+ AC_SUBST(PKG_SOURCES)
+ AC_SUBST(PKG_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_STUB_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_STUB_SOURCES
+# PKG_STUB_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_STUB_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence - allows for generic/win/unix VPATH
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find stub source file '$i'])
+ fi
+ PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
+ done
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_TCL_SOURCES --
+#
+# Specify one or more Tcl source files. These should be platform
+# independent runtime files.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_TCL_SOURCES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_TCL_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
+ fi
+ PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
+ done
+ AC_SUBST(PKG_TCL_SOURCES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_HEADERS --
+#
+# Specify one or more source headers. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_HEADERS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_HEADERS], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
+ fi
+ PKG_HEADERS="$PKG_HEADERS $i"
+ done
+ AC_SUBST(PKG_HEADERS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_INCLUDES --
+#
+# Specify one or more include dirs. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_INCLUDES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_INCLUDES], [
+ vars="$@"
+ for i in $vars; do
+ PKG_INCLUDES="$PKG_INCLUDES $i"
+ done
+ AC_SUBST(PKG_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_LIBS --
+#
+# Specify one or more libraries. Users should check for
+# the right platform before adding to their list. For Windows,
+# libraries provided in "foo.lib" format will be converted to
+# "-lfoo" when using GCC (mingw).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_LIBS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_LIBS], [
+ vars="$@"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+ AC_SUBST(PKG_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CFLAGS --
+#
+# Specify one or more CFLAGS. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_CFLAGS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CFLAGS], [
+ PKG_CFLAGS="$PKG_CFLAGS $@"
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CLEANFILES --
+#
+# Specify one or more CLEANFILES.
+#
+# Arguments:
+# one or more file names to clean target
+#
+# Results:
+#
+# Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CLEANFILES], [
+ CLEANFILES="$CLEANFILES $@"
+])
+
+#------------------------------------------------------------------------
+# TEA_PREFIX --
+#
+# Handle the --prefix=... option by defaulting to what Tcl gave
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# If --prefix or --exec-prefix was not specified, $prefix and
+# $exec_prefix will be set to the values given to Tcl when it was
+# configured.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_PREFIX], [
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
+ prefix=${TCL_PREFIX}
+ else
+ AC_MSG_NOTICE([--prefix defaulting to /usr/local])
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
+ exec_prefix=$prefix
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER_CC --
+#
+# Do compiler checks the way we want. This is just a replacement
+# for AC_PROG_CC in TEA configure.in files to make them cleaner.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER_CC], [
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ AC_PROG_CC
+ AC_PROG_CPP
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+ AC_SUBST(INSTALL)
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ AC_PROG_MAKE_SET
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ AC_CHECK_TOOL(RANLIB, ranlib)
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+ AC_OBJEXT
+ AC_EXEEXT
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER --
+#
+# Do compiler checks that use the compiler. This must go after
+# TEA_SETUP_COMPILER_CC, which does the actual compiler check.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER], [
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+ AC_REQUIRE([TEA_SETUP_COMPILER_CC])
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ AC_CACHE_CHECK([if the compiler understands -pipe],
+ tcl_cv_cc_pipe, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ AC_C_BIGENDIAN
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ TEA_TCL_LINK_LIBS
+ TEA_MISSING_POSIX_HEADERS
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_MAKE_LIB --
+#
+# Generate a line that can be used to build a shared/unshared library
+# in a platform independent manner.
+#
+# Arguments:
+# none
+#
+# Requires:
+#
+# Results:
+#
+# Defines the following vars:
+# CFLAGS - Done late here to note disturb other AC macros
+# MAKE_LIB - Command to execute to build the Tcl library;
+# differs depending on whether or not Tcl is being
+# compiled as a shared library.
+# MAKE_SHARED_LIB Makefile rule for building a shared library
+# MAKE_STATIC_LIB Makefile rule for building a static library
+# MAKE_STUB_LIB Makefile rule for building a stub library
+# VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL
+# VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_MAKE_LIB], [
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
+ AC_EGREP_CPP([manifest needed], [
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+ ], [
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+ TEA_ADD_CLEANFILES([*.manifest])
+ ])
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+ AC_SUBST(MAKE_LIB)
+ AC_SUBST(MAKE_SHARED_LIB)
+ AC_SUBST(MAKE_STATIC_LIB)
+ AC_SUBST(MAKE_STUB_LIB)
+ AC_SUBST(RANLIB_STUB)
+ AC_SUBST(VC_MANIFEST_EMBED_DLL)
+ AC_SUBST(VC_MANIFEST_EMBED_EXE)
+])
+
+#------------------------------------------------------------------------
+# TEA_LIB_SPEC --
+#
+# Compute the name of an existing object library located in libdir
+# from the given base name and produce the appropriate linker flags.
+#
+# Arguments:
+# basename The base name of the library without version
+# numbers, extensions, or "lib" prefixes.
+# extra_dir Extra directory in which to search for the
+# library. This location is used first, then
+# $prefix/$exec-prefix, then some defaults.
+#
+# Requires:
+# TEA_INIT and TEA_PREFIX must be called first.
+#
+# Results:
+#
+# Defines the following vars:
+# ${basename}_LIB_NAME The computed library name.
+# ${basename}_LIB_SPEC The computed linker flags.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LIB_SPEC], [
+ AC_MSG_CHECKING([for $1 library])
+
+ # Look in exec-prefix for the library (defined by TEA_PREFIX).
+
+ tea_lib_name_dir="${exec_prefix}/lib"
+
+ # Or in a user-specified location.
+
+ if test x"$2" != x ; then
+ tea_extra_lib_dir=$2
+ else
+ tea_extra_lib_dir=NONE
+ fi
+
+ for i in \
+ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
+ if test -f "$i" ; then
+ tea_lib_name_dir=`dirname $i`
+ $1_LIB_NAME=`basename $i`
+ $1_LIB_PATH_NAME=$i
+ break
+ fi
+ done
+
+ if test "${TEA_PLATFORM}" = "windows"; then
+ $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
+ else
+ # Strip off the leading "lib" and trailing ".a" or ".so"
+
+ tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
+ $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
+ fi
+
+ if test "x${$1_LIB_NAME}" = x ; then
+ AC_MSG_ERROR([not found])
+ else
+ AC_MSG_RESULT([${$1_LIB_SPEC}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TCL_HEADERS --
+#
+# Locate the private Tcl include files
+#
+# Arguments:
+#
+# Requires:
+# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_TOP_DIR_NATIVE
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
+ # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh}
+ AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS])
+ AC_MSG_CHECKING([for Tcl private include files])
+
+ TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
+ TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
+
+ # Check to see if tcl<Plat>Port.h isn't already with the public headers
+ # Don't look for tclInt.h because that resides with tcl.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tclh}/tclWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tclh}/tclUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
+ else
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TCL_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -d "${TCL_BIN_DIR}/Headers" -a \
+ -d "${TCL_BIN_DIR}/PrivateHeaders"; then
+ TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"
+ else
+ TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TCL_INCLUDES}"
+ else
+ if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
+ fi
+ result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TCL_TOP_DIR_NATIVE)
+
+ AC_SUBST(TCL_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TCL_HEADERS --
+#
+# Locate the installed public Tcl header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tclinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
+ AC_MSG_CHECKING([for Tcl public headers])
+
+ AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tclh, [
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tclh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TCL_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TK_HEADERS --
+#
+# Locate the private Tk include files
+#
+# Arguments:
+#
+# Requires:
+# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
+ # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}
+ AC_REQUIRE([TEA_PUBLIC_TK_HEADERS])
+ AC_MSG_CHECKING([for Tk private include files])
+
+ TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
+ TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
+
+ # Check to see if tk<Plat>Port.h isn't already with the public headers
+ # Don't look for tkInt.h because that resides with tk.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tkh}/tkWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tkh}/tkUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
+ TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
+ else
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TK_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
+ # Detect and add ttk subdir
+ if test -d "${TK_SRC_DIR}/generic/ttk"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
+ fi
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -d "${TK_BIN_DIR}/Headers" -a \
+ -d "${TK_BIN_DIR}/PrivateHeaders"; then
+ TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
+ else
+ TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TK_INCLUDES}"
+ else
+ if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
+ fi
+ result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TK_TOP_DIR_NATIVE)
+ AC_SUBST(TK_XLIB_DIR_NATIVE)
+
+ AC_SUBST(TK_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TK_HEADERS --
+#
+# Locate the installed public Tk header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tkinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
+ AC_MSG_CHECKING([for Tk public headers])
+
+ AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tkh, [
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tkh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TK_INCLUDES)
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ AC_MSG_CHECKING([for X11 header files])
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+ AC_SUBST(TK_XINCLUDES)
+ fi
+ AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_CONFIG --
+#
+# Locate the ${1}Config.sh file and perform a sanity check on
+# the ${1} compile flags. These are used by packages like
+# [incr Tk] that load *Config.sh files from more than Tcl and Tk.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-$1=...
+#
+# Defines the following vars:
+# $1_BIN_DIR Full path to the directory containing
+# the $1Config.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CONFIG], [
+ #
+ # Ok, lets find the $1 configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-$1
+ #
+
+ if test x"${no_$1}" = x ; then
+ # we reset no_$1 in case something fails here
+ no_$1=true
+ AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
+ AC_MSG_CHECKING([for $1 configuration])
+ AC_CACHE_VAL(ac_cv_c_$1config,[
+
+ # First check to see if --with-$1 was specified.
+ if test x"${with_$1config}" != x ; then
+ case ${with_$1config} in
+ */$1Config.sh )
+ if test -f ${with_$1config}; then
+ AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
+ with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
+ fi;;
+ esac
+ if test -f "${with_$1config}/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
+ else
+ AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
+ fi
+ fi
+
+ # then check for a private $1 installation
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in \
+ ../$1 \
+ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../$1 \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../../$1 \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../$1 \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ if test -f "$i/unix/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_$1config}" = x ; then
+ $1_BIN_DIR="# no $1 configs found"
+ AC_MSG_WARN([Cannot find $1 configuration definitions])
+ exit 0
+ else
+ no_$1=
+ $1_BIN_DIR=${ac_cv_c_$1config}
+ AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG --
+#
+# Load the $1Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# $1_SRC_DIR
+# $1_LIB_FILE
+# $1_LIB_SPEC
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_CONFIG], [
+ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
+
+ if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${$1_BIN_DIR}/$1Config.sh"
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+
+ #
+ # If the $1_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable $1_LIB_SPEC will be set to the value
+ # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
+ # instead of $1_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f "${$1_BIN_DIR}/Makefile" ; then
+ AC_MSG_WARN([Found Makefile - using build library specs for $1])
+ $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
+ $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
+ $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
+ $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
+ $1_LIBRARY_PATH=${$1_LIBRARY_PATH}
+ fi
+
+ AC_SUBST($1_VERSION)
+ AC_SUBST($1_BIN_DIR)
+ AC_SUBST($1_SRC_DIR)
+
+ AC_SUBST($1_LIB_FILE)
+ AC_SUBST($1_LIB_SPEC)
+
+ AC_SUBST($1_STUB_LIB_FILE)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ # Allow the caller to prevent this auto-check by specifying any 2nd arg
+ AS_IF([test "x$2" = x], [
+ # Check both upper and lower-case variants
+ # If a dev wanted non-stubs libs, this function could take an option
+ # to not use _STUB in the paths below
+ AS_IF([test "x${$1_STUB_LIB_SPEC}" = x],
+ [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)],
+ [TEA_LOAD_CONFIG_LIB($1_STUB)])
+ ])
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG_LIB --
+#
+# Helper function to load correct library from another extension's
+# ${PACKAGE}Config.sh.
+#
+# Results:
+# Adds to LIBS the appropriate extension library
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_LOAD_CONFIG_LIB], [
+ AC_MSG_CHECKING([For $1 library for LIBS])
+ # This simplifies the use of stub libraries by automatically adding
+ # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
+ # but this is called before CONFIG_CFLAGS. More importantly, this adds
+ # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
+ if test "x${$1_LIB_SPEC}" != "x" ; then
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
+ TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"])
+ AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}])
+ else
+ TEA_ADD_LIBS([${$1_LIB_SPEC}])
+ AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}])
+ fi
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_EXPORT_CONFIG --
+#
+# Define the data to insert into the ${PACKAGE}Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1
+#
+# Results:
+# Substitutes the following vars:
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_EXPORT_CONFIG], [
+ #--------------------------------------------------------------------
+ # These are for $1Config.sh
+ #--------------------------------------------------------------------
+
+ # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
+ eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}"
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}"
+ else
+ eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ fi
+ $1_BUILD_LIB_SPEC="-L`pwd` ${$1_LIB_FLAG}"
+ $1_LIB_SPEC="-L${pkglibdir} ${$1_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_SPEC="-L`pwd` [$]{$1_STUB_LIB_FLAG}"
+ $1_STUB_LIB_SPEC="-L${pkglibdir} [$]{$1_STUB_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}"
+ $1_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}"
+
+ AC_SUBST($1_BUILD_LIB_SPEC)
+ AC_SUBST($1_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_PATH)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ AC_SUBST(MAJOR_VERSION)
+ AC_SUBST(MINOR_VERSION)
+ AC_SUBST(PATCHLEVEL)
+])
+
+
+#------------------------------------------------------------------------
+# TEA_PATH_CELIB --
+#
+# Locate Keuchel's celib emulation layer for targeting Win/CE
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-celib=...
+#
+# Defines the following vars:
+# CELIB_DIR Full path to the directory containing
+# the include and platform lib files
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CELIB], [
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+ AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
+ AC_MSG_CHECKING([for Windows/CE celib directory])
+ AC_CACHE_VAL(ac_cv_c_celibconfig,[
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ AC_MSG_ERROR([Cannot find celib support library directory])
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ AC_MSG_RESULT([found $CELIB_DIR])
+ fi
+ fi
+])
+
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/ds9/msgs/cs.msg b/ds9/msgs/cs.msg
new file mode 100644
index 0000000..9593451
--- /dev/null
+++ b/ds9/msgs/cs.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset cs {2D}
+::msgcat::mcset cs {3D}
+::msgcat::mcset cs {A postscript generation error has occurred} [encoding convertfrom iso8859-2 {Chyba pøi generování postscriptu}]
+::msgcat::mcset cs {AIP}
+::msgcat::mcset cs {Abort} [encoding convertfrom iso8859-2 {Pøeru¹it}]
+::msgcat::mcset cs {About SAOImage DS9} [encoding convertfrom iso8859-2 {O programu SAOImage DS9}]
+::msgcat::mcset cs {About} [encoding convertfrom iso8859-2 {O programu}]
+::msgcat::mcset cs {Acknowledgment} [encoding convertfrom iso8859-2 {Podìkování}]
+::msgcat::mcset cs {Add} [encoding convertfrom iso8859-2 {Pøidat}]
+::msgcat::mcset cs {Advanced} [encoding convertfrom iso8859-2 {Dal¹í nastavení}]
+::msgcat::mcset cs {Aligned}
+::msgcat::mcset cs {Align} [encoding convertfrom iso8859-2 {Zarovnat}]
+::msgcat::mcset cs {All Columns} [encoding convertfrom iso8859-2 {V¹echny sloupce}]
+::msgcat::mcset cs {All Rows} [encoding convertfrom iso8859-2 {V¹echny øádky}]
+::msgcat::mcset cs {All} [encoding convertfrom iso8859-2 {V¹e}]
+::msgcat::mcset cs {Always save files during Backup} [encoding convertfrom iso8859-2 {V¾dy ulo¾it soubory pøi zálohování}]
+::msgcat::mcset cs {Amplifier} [encoding convertfrom iso8859-2 {Zesilovaè}]
+::msgcat::mcset cs {An error has occurred during backup} [encoding convertfrom iso8859-2 {Chyba pøi poøizování zálohy}]
+::msgcat::mcset cs {An error has occurred during restore} [encoding convertfrom iso8859-2 {Chyba pøi obnovì zálohy}]
+::msgcat::mcset cs {An error has occurred invoking the Analysis task} [encoding convertfrom iso8859-2 {Chyba pøi spou¹tìní Analýzy}]
+::msgcat::mcset cs {An error has occurred while creating image.} [encoding convertfrom iso8859-2 {Chyba pøi vytváøení obrázku.}]
+::msgcat::mcset cs {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.} [encoding convertfrom iso8859-2 {Chyba pøi vytváøení obrázku. Prosím ujistìte se ¾e okno s DS9tkou je ve vrchním levém rohu výchozí obrazovky a ¾e je celé viditelné.}]
+::msgcat::mcset cs {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.} [encoding convertfrom iso8859-2 {Chyba pøi vytváøení obrázku. Prosím ujistìte se na obrazovce je zobrazené celé okno s obrázkem}]
+::msgcat::mcset cs {An error has occurred while printing} [encoding convertfrom iso8859-2 {Pøi tisku se vyskytla chyba}]
+::msgcat::mcset cs {An error has occurred while reading image.} [encoding convertfrom iso8859-2 {Chyba pøi ètení obrázku.}]
+::msgcat::mcset cs {An error has occurred while saving} [encoding convertfrom iso8859-2 {Chyba pøi ukládání souboru}]
+::msgcat::mcset cs {An error has occurred while updating VO server list}
+::msgcat::mcset cs {An error has occurred while writing image.}
+::msgcat::mcset cs {An internal error has been detected} [encoding convertfrom iso8859-2 {Byla detekována vnitøní chyba programu}]
+::msgcat::mcset cs {Analysis Command Log} [encoding convertfrom iso8859-2 {Poøizovat záznam analytických pøíkazù}]
+::msgcat::mcset cs {Analysis Commands} [encoding convertfrom iso8859-2 {Analytické pøíkazy}]
+::msgcat::mcset cs {Analysis File} [encoding convertfrom iso8859-2 {Analytický soubor}]
+::msgcat::mcset cs {Analysis Log} [encoding convertfrom iso8859-2 {Záznam èinnosti analytický pøíkazù}]
+::msgcat::mcset cs {Analysis} [encoding convertfrom iso8859-2 {Analýza}]
+::msgcat::mcset cs {Angle Complement} [encoding convertfrom iso8859-2 {Doplnìk úhlu}]
+::msgcat::mcset cs {Angles} [encoding convertfrom iso8859-2 {Úhly}]
+::msgcat::mcset cs {Angle} [encoding convertfrom iso8859-2 {Úhel}]
+::msgcat::mcset cs {Annuli} [encoding convertfrom iso8859-2 {Kruhù}]
+::msgcat::mcset cs {Annulus} [encoding convertfrom iso8859-2 {Kruh}]
+::msgcat::mcset cs {Apply} [encoding convertfrom iso8859-2 {Pou¾ít}]
+::msgcat::mcset cs {ArcMin} [encoding convertfrom iso8859-2 {úhlových minut}]
+::msgcat::mcset cs {ArcSec} [encoding convertfrom iso8859-2 {úhlových sekund}]
+::msgcat::mcset cs {Architecture} [encoding convertfrom iso8859-2 {Architektura}]
+::msgcat::mcset cs {Archives}
+::msgcat::mcset cs {Array}
+::msgcat::mcset cs {Arrow} [encoding convertfrom iso8859-2 {©ipka}]
+::msgcat::mcset cs {Astronomy} [encoding convertfrom iso8859-2 {Astronomie}]
+::msgcat::mcset cs {At Startup} [encoding convertfrom iso8859-2 {Pøi spu¹tìní}]
+::msgcat::mcset cs {At least 2 different catalogs are required}
+::msgcat::mcset cs {Auto Centroid} [encoding convertfrom iso8859-2 {Automatické centrování}]
+::msgcat::mcset cs {Auto Plot 2D} [encoding convertfrom iso8859-2 {Automatický 2D graf}]
+::msgcat::mcset cs {Auto Plot 3D} [encoding convertfrom iso8859-2 {Automatický 3D graf}]
+::msgcat::mcset cs {Auto Plot Statistics}
+::msgcat::mcset cs {Auto Plot} [encoding convertfrom iso8859-2 {Automatický graf}]
+::msgcat::mcset cs {Autoload FITS Regions} [encoding convertfrom iso8859-2 {Automaticky nahrát FITS oblasti}]
+::msgcat::mcset cs {Autoload} [encoding convertfrom iso8859-2 {Automatické nahrávání}]
+::msgcat::mcset cs {Automatic} [encoding convertfrom iso8859-2 {Automatické}]
+::msgcat::mcset cs {Average} [encoding convertfrom iso8859-2 {Prùmìr}]
+::msgcat::mcset cs {Axes Number}
+::msgcat::mcset cs {Axes Order}
+::msgcat::mcset cs {Axes Title}
+::msgcat::mcset cs {Axes} [encoding convertfrom iso8859-2 {Osy}]
+::msgcat::mcset cs {Axis Length} [encoding convertfrom iso8859-2 {Délka osy}]
+::msgcat::mcset cs {Axis Numbers} [encoding convertfrom iso8859-2 {Èíslování osy}]
+::msgcat::mcset cs {Axis Title}
+::msgcat::mcset cs {Axis} [encoding convertfrom iso8859-2 {Osy}]
+::msgcat::mcset cs {Azimuth} [encoding convertfrom iso8859-2 {Azimut}]
+::msgcat::mcset cs {Background Color} [encoding convertfrom iso8859-2 {Barva pozadí}]
+::msgcat::mcset cs {Background} [encoding convertfrom iso8859-2 {Pozadí}]
+::msgcat::mcset cs {Backup} [encoding convertfrom iso8859-2 {Záloha}]
+::msgcat::mcset cs {Back} [encoding convertfrom iso8859-2 {Zpìt}]
+::msgcat::mcset cs {Bar Plot Tool}
+::msgcat::mcset cs {Bias}
+::msgcat::mcset cs {Bin 3rd Column} [encoding convertfrom iso8859-2 {Binuj tøetí sloupec}]
+::msgcat::mcset cs {Bin Center} [encoding convertfrom iso8859-2 {Binuj støed}]
+::msgcat::mcset cs {Bin Columns} [encoding convertfrom iso8859-2 {Binuj sloupce}]
+::msgcat::mcset cs {Bin Filter} [encoding convertfrom iso8859-2 {Filtr binování}]
+::msgcat::mcset cs {Bin Fit}
+::msgcat::mcset cs {Bin In}
+::msgcat::mcset cs {Bin Out}
+::msgcat::mcset cs {Binning Parameters} [encoding convertfrom iso8859-2 {Parametry binování}]
+::msgcat::mcset cs {Bin}
+::msgcat::mcset cs {Black} [encoding convertfrom iso8859-2 {Èerná}]
+::msgcat::mcset cs {Blank/Inf/NaN Color} [encoding convertfrom iso8859-2 {Barva nedefinovaných pixelù}]
+::msgcat::mcset cs {Blink Frames} [encoding convertfrom iso8859-2 {Problikávej snímky}]
+::msgcat::mcset cs {Blink Interval} [encoding convertfrom iso8859-2 {Interval problikávání snímkù}]
+::msgcat::mcset cs {Blink} [encoding convertfrom iso8859-2 {Problikávat}]
+::msgcat::mcset cs {Block Fit}
+::msgcat::mcset cs {Block In} [encoding convertfrom iso8859-2 {Zmen¹it}]
+::msgcat::mcset cs {Block Out} [encoding convertfrom iso8859-2 {Zvìt¹it}]
+::msgcat::mcset cs {Block Parameters}
+::msgcat::mcset cs {Block}
+::msgcat::mcset cs {Blue} [encoding convertfrom iso8859-2 {Modrá}]
+::msgcat::mcset cs {Bold} [encoding convertfrom iso8859-2 {Tuènì}]
+::msgcat::mcset cs {Border} [encoding convertfrom iso8859-2 {Okraj}]
+::msgcat::mcset cs {Bottom}
+::msgcat::mcset cs {Box Annulus}
+::msgcat::mcset cs {Box Panda}
+::msgcat::mcset cs {BoxCircle}
+::msgcat::mcset cs {Boxcar}
+::msgcat::mcset cs {Box} [encoding convertfrom iso8859-2 {Obdélník}]
+::msgcat::mcset cs {Broadcast}
+::msgcat::mcset cs {Browser} [encoding convertfrom iso8859-2 {Prohlí¾eè}]
+::msgcat::mcset cs {Browse} [encoding convertfrom iso8859-2 {Prohlí¾et}]
+::msgcat::mcset cs {Buffer}
+::msgcat::mcset cs {Buttonbar}
+::msgcat::mcset cs {Buttons} [encoding convertfrom iso8859-2 {Tlaèítka}]
+::msgcat::mcset cs {Bytes}
+::msgcat::mcset cs {CMYK}
+::msgcat::mcset cs {Can Delete}
+::msgcat::mcset cs {Can Edit}
+::msgcat::mcset cs {Can Move}
+::msgcat::mcset cs {Can Rotate}
+::msgcat::mcset cs {Cancelled}
+::msgcat::mcset cs {Cancel} [encoding convertfrom iso8859-2 {Zru¹it}]
+::msgcat::mcset cs {Cap}
+::msgcat::mcset cs {Catalog Server} [encoding convertfrom iso8859-2 {Katalogový server}]
+::msgcat::mcset cs {Catalog Tool} [encoding convertfrom iso8859-2 {Katalogový nástroj}]
+::msgcat::mcset cs {Catalogs} [encoding convertfrom iso8859-2 {Katalogy}]
+::msgcat::mcset cs {Catalog} [encoding convertfrom iso8859-2 {Katalog}]
+::msgcat::mcset cs {Catrom}
+::msgcat::mcset cs {Cat}
+::msgcat::mcset cs {Center Image} [encoding convertfrom iso8859-2 {Vycentruj obrázek}]
+::msgcat::mcset cs {Center Non-modal Dialogs}
+::msgcat::mcset cs {Center} [encoding convertfrom iso8859-2 {Støed}]
+::msgcat::mcset cs {Centroid Parameters} [encoding convertfrom iso8859-2 {Parametry centroidu}]
+::msgcat::mcset cs {Centroid} [encoding convertfrom iso8859-2 {Vystøedit}]
+::msgcat::mcset cs {Circle} [encoding convertfrom iso8859-2 {Kru¾nice}]
+::msgcat::mcset cs {Clear All} [encoding convertfrom iso8859-2 {Vyma¾ v¹e}]
+::msgcat::mcset cs {Clear Analysis Commands} [encoding convertfrom iso8859-2 {Vyma¾ analytické pøíkazy}]
+::msgcat::mcset cs {Clear Cache}
+::msgcat::mcset cs {Clear Data}
+::msgcat::mcset cs {Clear External Analysis Commands?}
+::msgcat::mcset cs {Clear Filter} [encoding convertfrom iso8859-2 {Vynuluvoat filtr}]
+::msgcat::mcset cs {Clear Frame} [encoding convertfrom iso8859-2 {Vyèistit snímek}]
+::msgcat::mcset cs {Clear Preferences?} [encoding convertfrom iso8859-2 {Smazat nastavení?}]
+::msgcat::mcset cs {Clear Preferences} [encoding convertfrom iso8859-2 {Smazat nastavení}]
+::msgcat::mcset cs {Clear} [encoding convertfrom iso8859-2 {Vyèistit}]
+::msgcat::mcset cs {Click to Center} [encoding convertfrom iso8859-2 {Klinout na centrování}]
+::msgcat::mcset cs {Close} [encoding convertfrom iso8859-2 {Zavøít}]
+::msgcat::mcset cs {Colorbar Size} [encoding convertfrom iso8859-2 {Velikost colorbaru}]
+::msgcat::mcset cs {Colorbar} [encoding convertfrom iso8859-2 {©kálování barev}]
+::msgcat::mcset cs {Colormap Parameters}
+::msgcat::mcset cs {Colormap}
+::msgcat::mcset cs {Color} [encoding convertfrom iso8859-2 {Barva}]
+::msgcat::mcset cs {Columns} [encoding convertfrom iso8859-2 {Sloupce}]
+::msgcat::mcset cs {Column} [encoding convertfrom iso8859-2 {Sploupec}]
+::msgcat::mcset cs {Command not allowed}
+::msgcat::mcset cs {Command} [encoding convertfrom iso8859-2 {Pøíkaz}]
+::msgcat::mcset cs {Compass} [encoding convertfrom iso8859-2 {Kompas}]
+::msgcat::mcset cs {Composite Region} [encoding convertfrom iso8859-2 {Spojit oblasti}]
+::msgcat::mcset cs {Composite}
+::msgcat::mcset cs {Compression} [encoding convertfrom iso8859-2 {Komprese}]
+::msgcat::mcset cs {Configure} [encoding convertfrom iso8859-2 {Konfigurace}]
+::msgcat::mcset cs {Connect Directly}
+::msgcat::mcset cs {Connect SAMP}
+::msgcat::mcset cs {Connect Using Web Proxy}
+::msgcat::mcset cs {Connect} [encoding convertfrom iso8859-2 {Pøipoji}]
+::msgcat::mcset cs {Console}
+::msgcat::mcset cs {Contacting Image Server}
+::msgcat::mcset cs {Contour Parameters} [encoding convertfrom iso8859-2 {Parametry obrysu}]
+::msgcat::mcset cs {Contours} [encoding convertfrom iso8859-2 {Obrysy}]
+::msgcat::mcset cs {Contour} [encoding convertfrom iso8859-2 {Obrys}]
+::msgcat::mcset cs {Contrast} [encoding convertfrom iso8859-2 {Kontrast}]
+::msgcat::mcset cs {Convert to Polygons} [encoding convertfrom iso8859-2 {Zmìnit na obdélníky}]
+::msgcat::mcset cs {Coordinate Grid Parameters} [encoding convertfrom iso8859-2 {Nastavení møí¾ky}]
+::msgcat::mcset cs {Coordinate Grid} [encoding convertfrom iso8859-2 {Møí¾ka}]
+::msgcat::mcset cs {Coordinate System} [encoding convertfrom iso8859-2 {Systém koordinátù}]
+::msgcat::mcset cs {Coordinates} [encoding convertfrom iso8859-2 {Koordináty}]
+::msgcat::mcset cs {Coordinate} [encoding convertfrom iso8859-2 {Koordinát}]
+::msgcat::mcset cs {Copy Contours}
+::msgcat::mcset cs {Copy to Regions} [encoding convertfrom iso8859-2 {Kopíruj do oblastí}]
+::msgcat::mcset cs {Copy} [encoding convertfrom iso8859-2 {Kopíruj}]
+::msgcat::mcset cs {Create Movie} [encoding convertfrom iso8859-2 {Vytvoøit video}]
+::msgcat::mcset cs {Create New Frame on Download}
+::msgcat::mcset cs {Create} [encoding convertfrom iso8859-2 {Vytvoøit}]
+::msgcat::mcset cs {Crop Parameters} [encoding convertfrom iso8859-2 {Parametry oøezávání}]
+::msgcat::mcset cs {Crop} [encoding convertfrom iso8859-2 {Výøez}]
+::msgcat::mcset cs {Crosshair Parameters}
+::msgcat::mcset cs {Crosshair To} [encoding convertfrom iso8859-2 {Zamìøovaè na}]
+::msgcat::mcset cs {Crosshair} [encoding convertfrom iso8859-2 {Zamìøovaè}]
+::msgcat::mcset cs {Cross} [encoding convertfrom iso8859-2 {Køí¾}]
+::msgcat::mcset cs {Cubehelix}
+::msgcat::mcset cs {Cube} [encoding convertfrom iso8859-2 {Krychle}]
+::msgcat::mcset cs {Cubic}
+::msgcat::mcset cs {Current Frame} [encoding convertfrom iso8859-2 {Souèasný obrázek}]
+::msgcat::mcset cs {Current Range} [encoding convertfrom iso8859-2 {Souèasný rozsah}]
+::msgcat::mcset cs {Current} [encoding convertfrom iso8859-2 {Souèasný}]
+::msgcat::mcset cs {Cursor} [encoding convertfrom iso8859-2 {Kurzor}]
+::msgcat::mcset cs {Cut} [encoding convertfrom iso8859-2 {Vyøíznout}]
+::msgcat::mcset cs {Cyan} [encoding convertfrom iso8859-2 {Azurová}]
+::msgcat::mcset cs {DPI}
+::msgcat::mcset cs {DS9 has detected a newer version of a backup file and therefore will not process this file.} [encoding convertfrom iso8859-2 {Program na¹el novou verzi zálo¾ního souboru a tedy tento soubor nebude zpracován.}]
+::msgcat::mcset cs {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset cs {DS9 has detected an older backup file, do you wish to continue?} [encoding convertfrom iso8859-2 {DS9 detekovala starou verzi zálo¾ního souboru, chcete pokraèovat?}]
+::msgcat::mcset cs {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-2 {Starý konfiguraèní soubor, chcete ho zaktualizovat?}]
+::msgcat::mcset cs {DS9 will complete the initialization process} [encoding convertfrom iso8859-2 {DS9 dokonèí inticializaèní proces}]
+::msgcat::mcset cs {Dash}
+::msgcat::mcset cs {Data Format} [encoding convertfrom iso8859-2 {Formát dat}]
+::msgcat::mcset cs {Dataset Name}
+::msgcat::mcset cs {Dataset} [encoding convertfrom iso8859-2 {Soubor dat}]
+::msgcat::mcset cs {Data}
+::msgcat::mcset cs {Decrease} [encoding convertfrom iso8859-2 {Zmen¹it}]
+::msgcat::mcset cs {Default All Files} [encoding convertfrom iso8859-2 {Vychozí pro v¹echny soubory}]
+::msgcat::mcset cs {Default Format}
+::msgcat::mcset cs {Default Length}
+::msgcat::mcset cs {Default} [encoding convertfrom iso8859-2 {Výchozí}]
+::msgcat::mcset cs {Degrees} [encoding convertfrom iso8859-2 {Stupnì}]
+::msgcat::mcset cs {Delete All Frames?} [encoding convertfrom iso8859-2 {Smazat v¹echny snímky?}]
+::msgcat::mcset cs {Delete All Frames} [encoding convertfrom iso8859-2 {Smazat v¹echny snímky}]
+::msgcat::mcset cs {Delete All Groups?} [encoding convertfrom iso8859-2 {Smazat v¹echny skupiny?}]
+::msgcat::mcset cs {Delete All Groups} [encoding convertfrom iso8859-2 {Smazat v¹echny skupiny}]
+::msgcat::mcset cs {Delete All Regions?} [encoding convertfrom iso8859-2 {Smazat v¹echny oblasti?}]
+::msgcat::mcset cs {Delete All Regions} [encoding convertfrom iso8859-2 {Smazat v¹echny oblasti}]
+::msgcat::mcset cs {Delete All} [encoding convertfrom iso8859-2 {Smazat v¹e}]
+::msgcat::mcset cs {Delete Color Tags}
+::msgcat::mcset cs {Delete Frame} [encoding convertfrom iso8859-2 {Smazat snímek}]
+::msgcat::mcset cs {Delete Group} [encoding convertfrom iso8859-2 {Smazat skupiny}]
+::msgcat::mcset cs {Delete Selected Regions} [encoding convertfrom iso8859-2 {Smazat vybrané oblasti}]
+::msgcat::mcset cs {Delete} [encoding convertfrom iso8859-2 {Smazat}]
+::msgcat::mcset cs {Depth} [encoding convertfrom iso8859-2 {Hloubka}]
+::msgcat::mcset cs {Detector} [encoding convertfrom iso8859-2 {Detektor}]
+::msgcat::mcset cs {Dialog Box} [encoding convertfrom iso8859-2 {Dialogové okno}]
+::msgcat::mcset cs {Diamond} [encoding convertfrom iso8859-2 {Diamant}]
+::msgcat::mcset cs {Dimension} [encoding convertfrom iso8859-2 {Rozmìr}]
+::msgcat::mcset cs {Direction}
+::msgcat::mcset cs {Disconnect}
+::msgcat::mcset cs {Display Header}
+::msgcat::mcset cs {Display Size} [encoding convertfrom iso8859-2 {Velikost displeje}]
+::msgcat::mcset cs {Dissolve}
+::msgcat::mcset cs {Distance} [encoding convertfrom iso8859-2 {Vzdálenost}]
+::msgcat::mcset cs {Done}
+::msgcat::mcset cs {Download Colormap}
+::msgcat::mcset cs {Download VOTABLE format if available}
+::msgcat::mcset cs {Drag to Center}
+::msgcat::mcset cs {Duplicate Data}
+::msgcat::mcset cs {East} [encoding convertfrom iso8859-2 {Východ}]
+::msgcat::mcset cs {Ecliptic} [encoding convertfrom iso8859-2 {Ekliptikální}]
+::msgcat::mcset cs {Edit Group Name}
+::msgcat::mcset cs {Edit} [encoding convertfrom iso8859-2 {Úpravy}]
+::msgcat::mcset cs {Elevation}
+::msgcat::mcset cs {Ellipse Annulus}
+::msgcat::mcset cs {Ellipse Panda}
+::msgcat::mcset cs {Ellipse} [encoding convertfrom iso8859-2 {Elipsa}]
+::msgcat::mcset cs {Elliptical Annulus}
+::msgcat::mcset cs {Elliptical Panda}
+::msgcat::mcset cs {Enable Confirmation Dialogs}
+::msgcat::mcset cs {Enable} [encoding convertfrom iso8859-2 {Povolit}]
+::msgcat::mcset cs {End} [encoding convertfrom iso8859-2 {Ukonèit}]
+::msgcat::mcset cs {Enter Color} [encoding convertfrom iso8859-2 {Zadejte barvu}]
+::msgcat::mcset cs {Enter Font Size}
+::msgcat::mcset cs {Enter Group Name}
+::msgcat::mcset cs {Enter Search Expression}
+::msgcat::mcset cs {Enter URL}
+::msgcat::mcset cs {Entry}
+::msgcat::mcset cs {Equal Area}
+::msgcat::mcset cs {Equal Distance}
+::msgcat::mcset cs {Equal Spacing}
+::msgcat::mcset cs {Equal Value}
+::msgcat::mcset cs {Error code was returned}
+::msgcat::mcset cs {Error}
+::msgcat::mcset cs {Examine Frame}
+::msgcat::mcset cs {Examine} [encoding convertfrom iso8859-2 {Prozkoumat}]
+::msgcat::mcset cs {Exam}
+::msgcat::mcset cs {Exclude}
+::msgcat::mcset cs {Exit} [encoding convertfrom iso8859-2 {Ukonèi}]
+::msgcat::mcset cs {Export Array}
+::msgcat::mcset cs {Export} [encoding convertfrom iso8859-2 {Ulo¾it jako}]
+::msgcat::mcset cs {Extention}
+::msgcat::mcset cs {Exterior Axes}
+::msgcat::mcset cs {Exterior Numerics}
+::msgcat::mcset cs {FAQ}
+::msgcat::mcset cs {FK4}
+::msgcat::mcset cs {FK5}
+::msgcat::mcset cs {Factor} [encoding convertfrom iso8859-2 {Faktor}]
+::msgcat::mcset cs {File not Found or Unable to load FITS data MIME type} [encoding convertfrom iso8859-2 {Soubor nenalezen nebo není mo¾né nahrát daný FITS MIME typ}]
+::msgcat::mcset cs {Filename} [encoding convertfrom iso8859-2 {Název souboru}]
+::msgcat::mcset cs {File} [encoding convertfrom iso8859-2 {Soubor}]
+::msgcat::mcset cs {Fill}
+::msgcat::mcset cs {Filter} [encoding convertfrom iso8859-2 {Filtr}]
+::msgcat::mcset cs {Find Next} [encoding convertfrom iso8859-2 {Najít dal¹í}]
+::msgcat::mcset cs {Find} [encoding convertfrom iso8859-2 {Najít}]
+::msgcat::mcset cs {First Frame} [encoding convertfrom iso8859-2 {První snímek}]
+::msgcat::mcset cs {First} [encoding convertfrom iso8859-2 {První}]
+::msgcat::mcset cs {Fits}
+::msgcat::mcset cs {Fixed in Size}
+::msgcat::mcset cs {Flat}
+::msgcat::mcset cs {Flip}
+::msgcat::mcset cs {Font} [encoding convertfrom iso8859-2 {Znak}]
+::msgcat::mcset cs {For more information, use --help} [encoding convertfrom iso8859-2 {Pro více informací, pou¾ijte --help}]
+::msgcat::mcset cs {Format} [encoding convertfrom iso8859-2 {Formát}]
+::msgcat::mcset cs {Forward} [encoding convertfrom iso8859-2 {Vpøed}]
+::msgcat::mcset cs {Found} [encoding convertfrom iso8859-2 {Nalezeno}]
+::msgcat::mcset cs {Frame Information} [encoding convertfrom iso8859-2 {Informace o snímku}]
+::msgcat::mcset cs {Frame Parameters} [encoding convertfrom iso8859-2 {Parametry snímku}]
+::msgcat::mcset cs {Frames} [encoding convertfrom iso8859-2 {Snímky}]
+::msgcat::mcset cs {Frame} [encoding convertfrom iso8859-2 {Snímek}]
+::msgcat::mcset cs {From} [encoding convertfrom iso8859-2 {Od}]
+::msgcat::mcset cs {Front} [encoding convertfrom iso8859-2 {První}]
+::msgcat::mcset cs {Full Range} [encoding convertfrom iso8859-2 {Plný rozsah}]
+::msgcat::mcset cs {Function} [encoding convertfrom iso8859-2 {Funkce}]
+::msgcat::mcset cs {GUI Font} [encoding convertfrom iso8859-2 {Font GUI}]
+::msgcat::mcset cs {Galactic} [encoding convertfrom iso8859-2 {Galaktické}]
+::msgcat::mcset cs {Gap}
+::msgcat::mcset cs {Gaussian}
+::msgcat::mcset cs {General}
+::msgcat::mcset cs {Generate} [encoding convertfrom iso8859-2 {Vygeneruj}]
+::msgcat::mcset cs {Generating Regions}
+::msgcat::mcset cs {Get Information} [encoding convertfrom iso8859-2 {Získej informace}]
+::msgcat::mcset cs {Gist}
+::msgcat::mcset cs {Global Properties}
+::msgcat::mcset cs {Global}
+::msgcat::mcset cs {Goto Frame} [encoding convertfrom iso8859-2 {Bì¾ na snímek}]
+::msgcat::mcset cs {Graph Horz}
+::msgcat::mcset cs {Graph Vert}
+::msgcat::mcset cs {Graphics}
+::msgcat::mcset cs {Graphs} [encoding convertfrom iso8859-2 {Grafy}]
+::msgcat::mcset cs {Graph} [encoding convertfrom iso8859-2 {Graf}]
+::msgcat::mcset cs {Grayscale} [encoding convertfrom iso8859-2 {Stupnì ¹edi}]
+::msgcat::mcset cs {Green} [encoding convertfrom iso8859-2 {Zelená}]
+::msgcat::mcset cs {Grid Gap}
+::msgcat::mcset cs {Grid} [encoding convertfrom iso8859-2 {Møí¾ka}]
+::msgcat::mcset cs {Groove}
+::msgcat::mcset cs {Groups} [encoding convertfrom iso8859-2 {Skupiny}]
+::msgcat::mcset cs {HTTP}
+::msgcat::mcset cs {Header} [encoding convertfrom iso8859-2 {Hlavièka}]
+::msgcat::mcset cs {Height} [encoding convertfrom iso8859-2 {Vý¹ka}]
+::msgcat::mcset cs {Help Desk} [encoding convertfrom iso8859-2 {Podpora}]
+::msgcat::mcset cs {Help Me Choose}
+::msgcat::mcset cs {Help} [encoding convertfrom iso8859-2 {Nápovìda}]
+::msgcat::mcset cs {Hide All} [encoding convertfrom iso8859-2 {Skryj v¹echny}]
+::msgcat::mcset cs {Highlite}
+::msgcat::mcset cs {High} [encoding convertfrom iso8859-2 {Vysoký}]
+::msgcat::mcset cs {Histogram Equalization} [encoding convertfrom iso8859-2 {Vyrovnání histogramu}]
+::msgcat::mcset cs {Histogram}
+::msgcat::mcset cs {Horizontal Graph} [encoding convertfrom iso8859-2 {Horizontální graf}]
+::msgcat::mcset cs {Horizontal Layout} [encoding convertfrom iso8859-2 {Horizontální rozlo¾ení}]
+::msgcat::mcset cs {Horizontal}
+::msgcat::mcset cs {IAU Location Code}
+::msgcat::mcset cs {ICRS}
+::msgcat::mcset cs {Identification}
+::msgcat::mcset cs {If}
+::msgcat::mcset cs {Image Servers}
+::msgcat::mcset cs {Image} [encoding convertfrom iso8859-2 {Obrázek}]
+::msgcat::mcset cs {Import Array}
+::msgcat::mcset cs {Import}
+::msgcat::mcset cs {Include}
+::msgcat::mcset cs {Increase}
+::msgcat::mcset cs {Information Panel} [encoding convertfrom iso8859-2 {Informaèní panel}]
+::msgcat::mcset cs {Information} [encoding convertfrom iso8859-2 {Detaily}]
+::msgcat::mcset cs {Initialize XPA}
+::msgcat::mcset cs {Inner}
+::msgcat::mcset cs {Instrument FOV} [encoding convertfrom iso8859-2 {Zorné pole dalekohledù}]
+::msgcat::mcset cs {Interior Axes}
+::msgcat::mcset cs {Interior Numerics}
+::msgcat::mcset cs {Internal Parse Error}
+::msgcat::mcset cs {Interval}
+::msgcat::mcset cs {Invalid Column Name}
+::msgcat::mcset cs {Invalid formated multipart/mixed mime type message}
+::msgcat::mcset cs {Invert Colormap}
+::msgcat::mcset cs {Invert Selection} [encoding convertfrom iso8859-2 {Vybrat doplnìk}]
+::msgcat::mcset cs {Invert} [encoding convertfrom iso8859-2 {Pøeklopit}]
+::msgcat::mcset cs {Italic} [encoding convertfrom iso8859-2 {Kurzíva}]
+::msgcat::mcset cs {Items Found}
+::msgcat::mcset cs {Iteration}
+::msgcat::mcset cs {JPEG Quality Factor} [encoding convertfrom iso8859-2 {Kvalita JPEGu}]
+::msgcat::mcset cs {Keep-Alive}
+::msgcat::mcset cs {Kernel} [encoding convertfrom iso8859-2 {Kernel}]
+::msgcat::mcset cs {Keyboard Shortcuts} [encoding convertfrom iso8859-2 {Klávesnicové zkratky}]
+::msgcat::mcset cs {Keyboard} [encoding convertfrom iso8859-2 {Klávesnice}]
+::msgcat::mcset cs {Keyword}
+::msgcat::mcset cs {Labels} [encoding convertfrom iso8859-2 {Oznaèení}]
+::msgcat::mcset cs {Label} [encoding convertfrom iso8859-2 {Oznaèení}]
+::msgcat::mcset cs {Landscape} [encoding convertfrom iso8859-2 {Horizontálnì}]
+::msgcat::mcset cs {Language} [encoding convertfrom iso8859-2 {Jazyk}]
+::msgcat::mcset cs {Last Frame} [encoding convertfrom iso8859-2 {Poslední snímek}]
+::msgcat::mcset cs {Last} [encoding convertfrom iso8859-2 {Poslední}]
+::msgcat::mcset cs {Layout Horz}
+::msgcat::mcset cs {Layout Vert}
+::msgcat::mcset cs {Layout} [encoding convertfrom iso8859-2 {Rozvr¾ení}]
+::msgcat::mcset cs {Left} [encoding convertfrom iso8859-2 {Vlevo}]
+::msgcat::mcset cs {Legal}
+::msgcat::mcset cs {Legend Title}
+::msgcat::mcset cs {Legend}
+::msgcat::mcset cs {Length} [encoding convertfrom iso8859-2 {Délka}]
+::msgcat::mcset cs {Letter}
+::msgcat::mcset cs {Levels} [encoding convertfrom iso8859-2 {Úrovnì}]
+::msgcat::mcset cs {Level} [encoding convertfrom iso8859-2 {Úroveò}]
+::msgcat::mcset cs {Limits}
+::msgcat::mcset cs {Line Plot Tool}
+::msgcat::mcset cs {Linear} [encoding convertfrom iso8859-2 {Linární}]
+::msgcat::mcset cs {Line}
+::msgcat::mcset cs {List Data}
+::msgcat::mcset cs {List Regions} [encoding convertfrom iso8859-2 {Seznam oblastí}]
+::msgcat::mcset cs {List} [encoding convertfrom iso8859-2 {Seznam}]
+::msgcat::mcset cs {Load Analysis Commands} [encoding convertfrom iso8859-2 {Nahrát analytické pøíkazy}]
+::msgcat::mcset cs {Load Color Tags}
+::msgcat::mcset cs {Load Colormap}
+::msgcat::mcset cs {Load Configuration} [encoding convertfrom iso8859-2 {Nahraj konfiguraci}]
+::msgcat::mcset cs {Load Contour Levels}
+::msgcat::mcset cs {Load Contours}
+::msgcat::mcset cs {Load Contrast/Bias}
+::msgcat::mcset cs {Load Data}
+::msgcat::mcset cs {Load Mosaic}
+::msgcat::mcset cs {Load Regions} [encoding convertfrom iso8859-2 {Nahrát oblasti}]
+::msgcat::mcset cs {Load Template}
+::msgcat::mcset cs {Load into All Frames}
+::msgcat::mcset cs {Load into Current Frame}
+::msgcat::mcset cs {Loading Catalog}
+::msgcat::mcset cs {Loading}
+::msgcat::mcset cs {Load} [encoding convertfrom iso8859-2 {Nahrát}]
+::msgcat::mcset cs {Local}
+::msgcat::mcset cs {Lock Axes}
+::msgcat::mcset cs {Lock Bin}
+::msgcat::mcset cs {Lock Color}
+::msgcat::mcset cs {Lock Crop Amplifier}
+::msgcat::mcset cs {Lock Crop Detector}
+::msgcat::mcset cs {Lock Crop Image}
+::msgcat::mcset cs {Lock Crop None}
+::msgcat::mcset cs {Lock Crop Physical}
+::msgcat::mcset cs {Lock Crop WCS}
+::msgcat::mcset cs {Lock Crosshair Amplifier}
+::msgcat::mcset cs {Lock Crosshair Detector}
+::msgcat::mcset cs {Lock Crosshair Image}
+::msgcat::mcset cs {Lock Crosshair None}
+::msgcat::mcset cs {Lock Crosshair Physical}
+::msgcat::mcset cs {Lock Crosshair WCS}
+::msgcat::mcset cs {Lock Frame Amplifier}
+::msgcat::mcset cs {Lock Frame Detector}
+::msgcat::mcset cs {Lock Frame Image}
+::msgcat::mcset cs {Lock Frame None}
+::msgcat::mcset cs {Lock Frame Physical}
+::msgcat::mcset cs {Lock Frame WCS}
+::msgcat::mcset cs {Lock Limits}
+::msgcat::mcset cs {Lock Scale}
+::msgcat::mcset cs {Lock Slice Image}
+::msgcat::mcset cs {Lock Slice None}
+::msgcat::mcset cs {Lock Slice WCS}
+::msgcat::mcset cs {Lock Smooth}
+::msgcat::mcset cs {Lock} [encoding convertfrom iso8859-2 {Synchronizovat}]
+::msgcat::mcset cs {Log Exponent} [encoding convertfrom iso8859-2 {Numerus logaritmu}]
+::msgcat::mcset cs {Log} [encoding convertfrom iso8859-2 {Logaritmické}]
+::msgcat::mcset cs {Low High} [encoding convertfrom iso8859-2 {Nejmen¹í Nejvìt¹í}]
+::msgcat::mcset cs {Lower Left Back}
+::msgcat::mcset cs {Lower Left Front}
+::msgcat::mcset cs {Lower Right Back}
+::msgcat::mcset cs {Lower Right Front}
+::msgcat::mcset cs {Low}
+::msgcat::mcset cs {MIP}
+::msgcat::mcset cs {Magenta}
+::msgcat::mcset cs {Magnification}
+::msgcat::mcset cs {Magnifier} [encoding convertfrom iso8859-2 {Zvìt¹ovaè}]
+::msgcat::mcset cs {Major}
+::msgcat::mcset cs {Manual}
+::msgcat::mcset cs {Mask Parameters} [encoding convertfrom iso8859-2 {Nastavení masky}]
+::msgcat::mcset cs {Match Axes}
+::msgcat::mcset cs {Match Bin} [encoding convertfrom iso8859-2 {Zarovnat bin}]
+::msgcat::mcset cs {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset cs {Match Color} [encoding convertfrom iso8859-2 {Sladit barvu}]
+::msgcat::mcset cs {Match Crop Amplifier}
+::msgcat::mcset cs {Match Crop Detector}
+::msgcat::mcset cs {Match Crop Image}
+::msgcat::mcset cs {Match Crop Physical}
+::msgcat::mcset cs {Match Crop WCS}
+::msgcat::mcset cs {Match Crosshair Amplifier}
+::msgcat::mcset cs {Match Crosshair Detector}
+::msgcat::mcset cs {Match Crosshair Image}
+::msgcat::mcset cs {Match Crosshair Physical}
+::msgcat::mcset cs {Match Crosshair WCS}
+::msgcat::mcset cs {Match Frame Amplifier}
+::msgcat::mcset cs {Match Frame Detector}
+::msgcat::mcset cs {Match Frame Image}
+::msgcat::mcset cs {Match Frame Physical}
+::msgcat::mcset cs {Match Frame WCS}
+::msgcat::mcset cs {Match Limits}
+::msgcat::mcset cs {Match Scale} [encoding convertfrom iso8859-2 {Zarovnat ¹kálování}]
+::msgcat::mcset cs {Match Slice Image}
+::msgcat::mcset cs {Match Slice WCS}
+::msgcat::mcset cs {Match Smooth}
+::msgcat::mcset cs {Match} [encoding convertfrom iso8859-2 {Zarovnat}]
+::msgcat::mcset cs {Math Function}
+::msgcat::mcset cs {Matplotlib}
+::msgcat::mcset cs {Max Rows}
+::msgcat::mcset cs {Maximum}
+::msgcat::mcset cs {Max}
+::msgcat::mcset cs {Menus and Buttons}
+::msgcat::mcset cs {Menu} [encoding convertfrom iso8859-2 {Nabídka}]
+::msgcat::mcset cs {Message Log}
+::msgcat::mcset cs {Method}
+::msgcat::mcset cs {Min Max Parameters}
+::msgcat::mcset cs {Min Max} [encoding convertfrom iso8859-2 {Minimum Maximum}]
+::msgcat::mcset cs {Minimum}
+::msgcat::mcset cs {Minor}
+::msgcat::mcset cs {Minutes}
+::msgcat::mcset cs {Min}
+::msgcat::mcset cs {Mission}
+::msgcat::mcset cs {Mode}
+::msgcat::mcset cs {Mosaic IRAF Segment}
+::msgcat::mcset cs {Mosaic IRAF}
+::msgcat::mcset cs {Mosaic WCS Segment}
+::msgcat::mcset cs {Mosaic WCS}
+::msgcat::mcset cs {Mosaic WFPC2}
+::msgcat::mcset cs {Mosaic}
+::msgcat::mcset cs {Mouse Click Epsilon}
+::msgcat::mcset cs {Mouse Wheel Bin}
+::msgcat::mcset cs {Mouse Wheel Zoom}
+::msgcat::mcset cs {Mouse and Keyboard}
+::msgcat::mcset cs {Move Back}
+::msgcat::mcset cs {Move First}
+::msgcat::mcset cs {Move Forward}
+::msgcat::mcset cs {Move Frame} [encoding convertfrom iso8859-2 {Pøesunout snímek}]
+::msgcat::mcset cs {Move Last}
+::msgcat::mcset cs {Move to Back} [encoding convertfrom iso8859-2 {Pøesunout vzad}]
+::msgcat::mcset cs {Move to Front} [encoding convertfrom iso8859-2 {Pøesunout vpøed}]
+::msgcat::mcset cs {Movie}
+::msgcat::mcset cs {Multiple Extension Cube}
+::msgcat::mcset cs {Multiple Extension Frames}
+::msgcat::mcset cs {Multiple WCS} [encoding convertfrom iso8859-2 {Multi WCS}]
+::msgcat::mcset cs {NRRD}
+::msgcat::mcset cs {Name Resolution} [encoding convertfrom iso8859-2 {Vyhledání objektu}]
+::msgcat::mcset cs {Name Server}
+::msgcat::mcset cs {Name or Designation}
+::msgcat::mcset cs {Name} [encoding convertfrom iso8859-2 {Název}]
+::msgcat::mcset cs {Native Dialog}
+::msgcat::mcset cs {New Features} [encoding convertfrom iso8859-2 {Nové vlasnosti}]
+::msgcat::mcset cs {New Frame 3D} [encoding convertfrom iso8859-2 {Nový 3D snímek}]
+::msgcat::mcset cs {New Frame RGB} [encoding convertfrom iso8859-2 {Nový barevný RGB snímek}]
+::msgcat::mcset cs {New Frame each Time}
+::msgcat::mcset cs {New Frame} [encoding convertfrom iso8859-2 {Nový snímek}]
+::msgcat::mcset cs {New Group} [encoding convertfrom iso8859-2 {Nová skupina}]
+::msgcat::mcset cs {New} [encoding convertfrom iso8859-2 {Nový}]
+::msgcat::mcset cs {Next Frame} [encoding convertfrom iso8859-2 {Dal¹í snímek}]
+::msgcat::mcset cs {Next} [encoding convertfrom iso8859-2 {Dal¹í}]
+::msgcat::mcset cs {No Catalog specified}
+::msgcat::mcset cs {No Data Available}
+::msgcat::mcset cs {No Items Found}
+::msgcat::mcset cs {No current frame}
+::msgcat::mcset cs {Non-zero}
+::msgcat::mcset cs {None} [encoding convertfrom iso8859-2 {Nic}]
+::msgcat::mcset cs {Normal}
+::msgcat::mcset cs {North} [encoding convertfrom iso8859-2 {Sever}]
+::msgcat::mcset cs {Not Found}
+::msgcat::mcset cs {Not Supported}
+::msgcat::mcset cs {Number of Samples}
+::msgcat::mcset cs {Number of Threads}
+::msgcat::mcset cs {Number of Ticks}
+::msgcat::mcset cs {Number} [encoding convertfrom iso8859-2 {Èíslo}]
+::msgcat::mcset cs {Numerics}
+::msgcat::mcset cs {OK} [encoding convertfrom iso8859-2 {Budi¾}]
+::msgcat::mcset cs {Object} [encoding convertfrom iso8859-2 {Objekt}]
+::msgcat::mcset cs {Open File} [encoding convertfrom iso8859-2 {Otevøít soubor}]
+::msgcat::mcset cs {Open TCL Console} [encoding convertfrom iso8859-2 {Otevøít konzoly TCL}]
+::msgcat::mcset cs {Open URL} [encoding convertfrom iso8859-2 {Otevøít URL}]
+::msgcat::mcset cs {Open as}
+::msgcat::mcset cs {Open} [encoding convertfrom iso8859-2 {Otevøít}]
+::msgcat::mcset cs {Operator}
+::msgcat::mcset cs {Orientation}
+::msgcat::mcset cs {Origin}
+::msgcat::mcset cs {Oscillate}
+::msgcat::mcset cs {Other Color}
+::msgcat::mcset cs {Other Font Size}
+::msgcat::mcset cs {Other}
+::msgcat::mcset cs {Outer}
+::msgcat::mcset cs {Overlap}
+::msgcat::mcset cs {PS Page Setup}
+::msgcat::mcset cs {PS Print}
+::msgcat::mcset cs {Page Setup} [encoding convertfrom iso8859-2 {Vlastnosti tisku}]
+::msgcat::mcset cs {Page Source}
+::msgcat::mcset cs {Pan To}
+::msgcat::mcset cs {Pan Zoom Rotate Parameters} [encoding convertfrom iso8859-2 {Parametry prohlí¾ení a zvìt¹ení}]
+::msgcat::mcset cs {Pan Zoom}
+::msgcat::mcset cs {Pan then Zoom}
+::msgcat::mcset cs {Panda}
+::msgcat::mcset cs {Panner} [encoding convertfrom iso8859-2 {Náhled snímku}]
+::msgcat::mcset cs {Pan} [encoding convertfrom iso8859-2 {Posun}]
+::msgcat::mcset cs {Parameters}
+::msgcat::mcset cs {Password}
+::msgcat::mcset cs {Paste Contours}
+::msgcat::mcset cs {Paste} [encoding convertfrom iso8859-2 {Vlo¾it}]
+::msgcat::mcset cs {Physical} [encoding convertfrom iso8859-2 {Fyzické}]
+::msgcat::mcset cs {Pixel Distribution}
+::msgcat::mcset cs {Pixel Size}
+::msgcat::mcset cs {Pixel Table} [encoding convertfrom iso8859-2 {Pixel tabulka}]
+::msgcat::mcset cs {Pixels}
+::msgcat::mcset cs {Play}
+::msgcat::mcset cs {Please Select a Region}
+::msgcat::mcset cs {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset cs {Please specify width, height, and either name or (ra,dec)}
+::msgcat::mcset cs {Plot 2D}
+::msgcat::mcset cs {Plot 3D}
+::msgcat::mcset cs {Plot Title}
+::msgcat::mcset cs {Plotting Regions}
+::msgcat::mcset cs {Plot}
+::msgcat::mcset cs {Plus}
+::msgcat::mcset cs {Pointer} [encoding convertfrom iso8859-2 {Ukazatel}]
+::msgcat::mcset cs {Points}
+::msgcat::mcset cs {Point}
+::msgcat::mcset cs {Polygon}
+::msgcat::mcset cs {Portrait}
+::msgcat::mcset cs {Poster}
+::msgcat::mcset cs {Postscript Page Setup}
+::msgcat::mcset cs {Postscript Print}
+::msgcat::mcset cs {Postscript}
+::msgcat::mcset cs {Power} [encoding convertfrom iso8859-2 {Mocninové}]
+::msgcat::mcset cs {Preferences} [encoding convertfrom iso8859-2 {Nastavení}]
+::msgcat::mcset cs {Preserve During Load} [encoding convertfrom iso8859-2 {Zachovej pøi otevøení}]
+::msgcat::mcset cs {Previous Frame} [encoding convertfrom iso8859-2 {Pøede¹lí snímek}]
+::msgcat::mcset cs {Previous} [encoding convertfrom iso8859-2 {Pøedchozí}]
+::msgcat::mcset cs {Prev}
+::msgcat::mcset cs {Print Coordinates}
+::msgcat::mcset cs {Print To}
+::msgcat::mcset cs {Printer}
+::msgcat::mcset cs {Print} [encoding convertfrom iso8859-2 {Vytisknout}]
+::msgcat::mcset cs {Projection}
+::msgcat::mcset cs {Properties} [encoding convertfrom iso8859-2 {Vlastnosti}]
+::msgcat::mcset cs {Property}
+::msgcat::mcset cs {Proxy Host}
+::msgcat::mcset cs {Proxy Port}
+::msgcat::mcset cs {Publication}
+::msgcat::mcset cs {Quadratic}
+::msgcat::mcset cs {RGB Array}
+::msgcat::mcset cs {RGB Cube}
+::msgcat::mcset cs {RGB Image}
+::msgcat::mcset cs {RGB}
+::msgcat::mcset cs {Radial Profile}
+::msgcat::mcset cs {Radial}
+::msgcat::mcset cs {Radius}
+::msgcat::mcset cs {Raised}
+::msgcat::mcset cs {Range}
+::msgcat::mcset cs {Redo}
+::msgcat::mcset cs {Red}
+::msgcat::mcset cs {Reference Manual} [encoding convertfrom iso8859-2 {Seznam pøíkazù}]
+::msgcat::mcset cs {Reference}
+::msgcat::mcset cs {Refresh Frame} [encoding convertfrom iso8859-2 {Obnov snímek}]
+::msgcat::mcset cs {Refresh}
+::msgcat::mcset cs {Region Parameters} [encoding convertfrom iso8859-2 {Parametry oblastí}]
+::msgcat::mcset cs {Region} [encoding convertfrom iso8859-2 {Oblasti}]
+::msgcat::mcset cs {Release Notes} [encoding convertfrom iso8859-2 {Informace o vydání}]
+::msgcat::mcset cs {Release}
+::msgcat::mcset cs {Relief}
+::msgcat::mcset cs {Reload}
+::msgcat::mcset cs {Render}
+::msgcat::mcset cs {Repeat}
+::msgcat::mcset cs {Reset Colormap}
+::msgcat::mcset cs {Reset Frame} [encoding convertfrom iso8859-2 {Vynulovat nastavení snímku}]
+::msgcat::mcset cs {Reset}
+::msgcat::mcset cs {Restore} [encoding convertfrom iso8859-2 {Obnovit}]
+::msgcat::mcset cs {Retrieve}
+::msgcat::mcset cs {Return}
+::msgcat::mcset cs {Right}
+::msgcat::mcset cs {Roman}
+::msgcat::mcset cs {Rotate} {Rotovat}
+::msgcat::mcset cs {Rows}
+::msgcat::mcset cs {Row}
+::msgcat::mcset cs {Ruler}
+::msgcat::mcset cs {SAMP Image}
+::msgcat::mcset cs {SAMP Table}
+::msgcat::mcset cs {SAMP: already connected}
+::msgcat::mcset cs {SAMP: internal error}
+::msgcat::mcset cs {SAMP: not connected}
+::msgcat::mcset cs {SAMP: unable to locate HUB}
+::msgcat::mcset cs {SAMP}
+::msgcat::mcset cs {Sample Increment}
+::msgcat::mcset cs {Sample Parameters}
+::msgcat::mcset cs {Samples per Line}
+::msgcat::mcset cs {Sample}
+::msgcat::mcset cs {Save 3D Movie}
+::msgcat::mcset cs {Save Color Tags}
+::msgcat::mcset cs {Save Colormap}
+::msgcat::mcset cs {Save Configuration}
+::msgcat::mcset cs {Save Contour Levels}
+::msgcat::mcset cs {Save Contours}
+::msgcat::mcset cs {Save Contrast/Bias}
+::msgcat::mcset cs {Save Data}
+::msgcat::mcset cs {Save Image on Download}
+::msgcat::mcset cs {Save Image} [encoding convertfrom iso8859-2 {Ulo¾it snímek}]
+::msgcat::mcset cs {Save Regions} [encoding convertfrom iso8859-2 {Ulo¾it oblasti}]
+::msgcat::mcset cs {Save Template} [encoding convertfrom iso8859-2 {Ulo¾it ¹ablony}]
+::msgcat::mcset cs {Save as}
+::msgcat::mcset cs {Save} [encoding convertfrom iso8859-2 {Ulo¾it}]
+::msgcat::mcset cs {Scale Parameters} [encoding convertfrom iso8859-2 {Parametry ¹kálování}]
+::msgcat::mcset cs {Scale and Limits}
+::msgcat::mcset cs {Scale} [encoding convertfrom iso8859-2 {©kálování}]
+::msgcat::mcset cs {Scan}
+::msgcat::mcset cs {Scatter Plot Tool}
+::msgcat::mcset cs {Scope}
+::msgcat::mcset cs {Search for Catalogs}
+::msgcat::mcset cs {Searching for catalogs}
+::msgcat::mcset cs {Seconds}
+::msgcat::mcset cs {Segment}
+::msgcat::mcset cs {Select All} [encoding convertfrom iso8859-2 {Vybrat v¹echny}]
+::msgcat::mcset cs {Select Coordinate System }
+::msgcat::mcset cs {Select None} [encoding convertfrom iso8859-2 {Zru¹it výbìr}]
+::msgcat::mcset cs {Select}
+::msgcat::mcset cs {Send}
+::msgcat::mcset cs {Server}
+::msgcat::mcset cs {Sexagesimal} [encoding convertfrom iso8859-2 {©edesátkové}]
+::msgcat::mcset cs {Shape} [encoding convertfrom iso8859-2 {Tvar}]
+::msgcat::mcset cs {Show All} [encoding convertfrom iso8859-2 {Zobrazit v¹e}]
+::msgcat::mcset cs {Show Command}
+::msgcat::mcset cs {Show Compass}
+::msgcat::mcset cs {Show Text}
+::msgcat::mcset cs {Show/Hide Frames} [encoding convertfrom iso8859-2 {Zobrazit/skrýt snímky}]
+::msgcat::mcset cs {Show}
+::msgcat::mcset cs {Simple Cross}
+::msgcat::mcset cs {Simple Plus}
+::msgcat::mcset cs {Single Frame} [encoding convertfrom iso8859-2 {Jeden snímek}]
+::msgcat::mcset cs {Single} [encoding convertfrom iso8859-2 {jeden}]
+::msgcat::mcset cs {Sites}
+::msgcat::mcset cs {Size/Radius}
+::msgcat::mcset cs {Size}
+::msgcat::mcset cs {Skip First}
+::msgcat::mcset cs {Slice}
+::msgcat::mcset cs {Smooth Parameters} [encoding convertfrom iso8859-2 {Nastavení vyhlazení}]
+::msgcat::mcset cs {Smoothness}
+::msgcat::mcset cs {Smooth} [encoding convertfrom iso8859-2 {Vyhlazení}]
+::msgcat::mcset cs {Solid}
+::msgcat::mcset cs {Sorry, DS9 does not support}
+::msgcat::mcset cs {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset cs {Sort}
+::msgcat::mcset cs {Source TCL}
+::msgcat::mcset cs {Source}
+::msgcat::mcset cs {Space Equal Distance}
+::msgcat::mcset cs {Space Equal Value}
+::msgcat::mcset cs {Spacing}
+::msgcat::mcset cs {Sqrt}
+::msgcat::mcset cs {Square Root} [encoding convertfrom iso8859-2 {Odmocninové}]
+::msgcat::mcset cs {Squared}
+::msgcat::mcset cs {Square}
+::msgcat::mcset cs {Stacked}
+::msgcat::mcset cs {Starbase}
+::msgcat::mcset cs {Startup}
+::msgcat::mcset cs {Start}
+::msgcat::mcset cs {Statistics}
+::msgcat::mcset cs {Stats}
+::msgcat::mcset cs {Status}
+::msgcat::mcset cs {Step}
+::msgcat::mcset cs {Stop}
+::msgcat::mcset cs {Story of SAOImage DS9} [encoding convertfrom iso8859-2 {Pøíbìh SAOImage DS9}]
+::msgcat::mcset cs {Story}
+::msgcat::mcset cs {Sum}
+::msgcat::mcset cs {Sunken}
+::msgcat::mcset cs {Symbol Editor}
+::msgcat::mcset cs {Symbol}
+::msgcat::mcset cs {Tab-Separated-Value}
+::msgcat::mcset cs {Table}
+::msgcat::mcset cs {Tabloid}
+::msgcat::mcset cs {Tag Color}
+::msgcat::mcset cs {Task}
+::msgcat::mcset cs {Template} [encoding convertfrom iso8859-2 {©ablona}]
+::msgcat::mcset cs {Text Font}
+::msgcat::mcset cs {Text}
+::msgcat::mcset cs {Then}
+::msgcat::mcset cs {Thickness}
+::msgcat::mcset cs {This analysis task is already running. Do you wish to kill it?}
+::msgcat::mcset cs {This function is not available.}
+::msgcat::mcset cs {This function is not currently supported for this port.}
+::msgcat::mcset cs {Tickmarks}
+::msgcat::mcset cs {Tile Frames} [encoding convertfrom iso8859-2 {Snímky do dla¾dic}]
+::msgcat::mcset cs {Tile Parameters} [encoding convertfrom iso8859-2 {Parametry dla¾dic}]
+::msgcat::mcset cs {Tile} [encoding convertfrom iso8859-2 {Dla¾dice}]
+::msgcat::mcset cs {Times}
+::msgcat::mcset cs {Title}
+::msgcat::mcset cs {Tophat}
+::msgcat::mcset cs {Topographic}
+::msgcat::mcset cs {Top}
+::msgcat::mcset cs {To}
+::msgcat::mcset cs {Transparency}
+::msgcat::mcset cs {Triangle}
+::msgcat::mcset cs {Type}
+::msgcat::mcset cs {URL}
+::msgcat::mcset cs {Unable to connect directly: using Web Proxy}
+::msgcat::mcset cs {Unable to determine date of observation}
+::msgcat::mcset cs {Unable to determine time of observation}
+::msgcat::mcset cs {Unable to evaluate filter}
+::msgcat::mcset cs {Unable to find SIAP window}
+::msgcat::mcset cs {Unable to find URL column}
+::msgcat::mcset cs {Unable to find catalog window}
+::msgcat::mcset cs {Unable to find plot window}
+::msgcat::mcset cs {Unable to load RGB image into a non-rgb frame}
+::msgcat::mcset cs {Unable to load region file}
+::msgcat::mcset cs {Unable to load}
+::msgcat::mcset cs {Unable to locate URL}
+::msgcat::mcset cs {Unable to match target with XPA Mime request}
+::msgcat::mcset cs {Unable to open file}
+::msgcat::mcset cs {Unable to process Analysis file}
+::msgcat::mcset cs {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset cs {Undo} [encoding convertfrom iso8859-2 {Zpìt}]
+::msgcat::mcset cs {Unique}
+::msgcat::mcset cs {Unists}
+::msgcat::mcset cs {Units}
+::msgcat::mcset cs {Unknown Colormap}
+::msgcat::mcset cs {Unknown command}
+::msgcat::mcset cs {Update Filter}
+::msgcat::mcset cs {Update Group}
+::msgcat::mcset cs {Update from Current Crosshair}
+::msgcat::mcset cs {Update from Current Frame}
+::msgcat::mcset cs {Update}
+::msgcat::mcset cs {Upper Left Back}
+::msgcat::mcset cs {Upper Left Front}
+::msgcat::mcset cs {Upper Right Back}
+::msgcat::mcset cs {Upper Right Front}
+::msgcat::mcset cs {Use Authentication}
+::msgcat::mcset cs {Use Current Frame on Download}
+::msgcat::mcset cs {Use Internal Web Browser}
+::msgcat::mcset cs {Use Proxy}
+::msgcat::mcset cs {User Manual} [encoding convertfrom iso8859-2 {U¾ivatelský manuál}]
+::msgcat::mcset cs {Username}
+::msgcat::mcset cs {User} [encoding convertfrom iso8859-2 {U¾ivatelské}]
+::msgcat::mcset cs {Use} [encoding convertfrom iso8859-2 {Pou¾ívat}]
+::msgcat::mcset cs {VO Server}
+::msgcat::mcset cs {VO}
+::msgcat::mcset cs {Value} [encoding convertfrom iso8859-2 {Hodnota}]
+::msgcat::mcset cs {Vector}
+::msgcat::mcset cs {Vertical Graph} [encoding convertfrom iso8859-2 {Vertikální graf}]
+::msgcat::mcset cs {Vertical Layout} [encoding convertfrom iso8859-2 {Vertikální rozlo¾ení}]
+::msgcat::mcset cs {Vertical Text}
+::msgcat::mcset cs {Vertical}
+::msgcat::mcset cs {View} [encoding convertfrom iso8859-2 {Zobrazit}]
+::msgcat::mcset cs {Virtual Observatory} [encoding convertfrom iso8859-2 {Virtuální Observatoø}]
+::msgcat::mcset cs {WCS Parameters} [encoding convertfrom iso8859-2 {Detaily WCS}]
+::msgcat::mcset cs {WCS}
+::msgcat::mcset cs {Wavelength}
+::msgcat::mcset cs {Web Browser} [encoding convertfrom iso8859-2 {Prohlí¾eè}]
+::msgcat::mcset cs {White}
+::msgcat::mcset cs {Width} [encoding convertfrom iso8859-2 {Tlou¹»ka}]
+::msgcat::mcset cs {Window}
+::msgcat::mcset cs {Words matching title, description}
+::msgcat::mcset cs {X Axis Title}
+::msgcat::mcset cs {X Grid}
+::msgcat::mcset cs {XPA Information}
+::msgcat::mcset cs {XPA not initialized} [encoding convertfrom iso8859-2]
+::msgcat::mcset cs {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset cs {XPA}
+::msgcat::mcset cs {X}
+::msgcat::mcset cs {Y Axis Title}
+::msgcat::mcset cs {Y Grid}
+::msgcat::mcset cs {Yellow} [encoding convertfrom iso8859-2 {®lutá}]
+::msgcat::mcset cs {Y}
+::msgcat::mcset cs {Z Axis Scale}
+::msgcat::mcset cs {ZScale Parameters} [encoding convertfrom iso8859-2 {Parametry ZScale}]
+::msgcat::mcset cs {Zero} [encoding convertfrom iso8859-2 {Nula}]
+::msgcat::mcset cs {Zoom Fit}
+::msgcat::mcset cs {Zoom In} [encoding convertfrom iso8859-2 {Zvìt¹it}]
+::msgcat::mcset cs {Zoom Out} [encoding convertfrom iso8859-2 {Zmen¹it}]
+::msgcat::mcset cs {Zoom} [encoding convertfrom iso8859-2 {Zvìt¹ení}]
+::msgcat::mcset cs {and}
+::msgcat::mcset cs {blue} [encoding convertfrom iso8859-2 {modrá}]
+::msgcat::mcset cs {b}
+::msgcat::mcset cs {color} [encoding convertfrom iso8859-2 {barva}]
+::msgcat::mcset cs {cool} [encoding convertfrom iso8859-2 {chlad}]
+::msgcat::mcset cs {green} [encoding convertfrom iso8859-2 {zelená}]
+::msgcat::mcset cs {grey} [encoding convertfrom iso8859-2 {¹edá}]
+::msgcat::mcset cs {g}
+::msgcat::mcset cs {h5utils}
+::msgcat::mcset cs {heat} [encoding convertfrom iso8859-2 {horko}]
+::msgcat::mcset cs {not}
+::msgcat::mcset cs {only}
+::msgcat::mcset cs {or center of data}
+::msgcat::mcset cs {rainbow} [encoding convertfrom iso8859-2 {duha}]
+::msgcat::mcset cs {red} [encoding convertfrom iso8859-2 {èervená}]
+::msgcat::mcset cs {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom iso8859-2 {øádkù dat. Více jich mù¾e být k dispozici. Zkuste zmìnit povolené maximum}]
+::msgcat::mcset cs {r}
+::msgcat::mcset cs {staircase} [encoding convertfrom iso8859-2 {schodi¹tì}]
+::msgcat::mcset cs {standard}
+::msgcat::mcset cs {x}
+::msgcat::mcset cs {}
diff --git a/ds9/msgs/da.msg b/ds9/msgs/da.msg
new file mode 100644
index 0000000..bc16a44
--- /dev/null
+++ b/ds9/msgs/da.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset da {2D}
+::msgcat::mcset da {3D}
+::msgcat::mcset da {A postscript generation error has occurred} [encoding convertfrom iso8859-1 {En fejl er opstået under postscript generering}]
+::msgcat::mcset da {AIP}
+::msgcat::mcset da {Abort}
+::msgcat::mcset da {About SAOImage DS9} {Om SAOImage DS9}
+::msgcat::mcset da {About} {Om}
+::msgcat::mcset da {Acknowledgment} {Tak}
+::msgcat::mcset da {Add} [encoding convertfrom iso8859-1 {Tilføj}]
+::msgcat::mcset da {Advanced} {Avanceret}
+::msgcat::mcset da {Aligned}
+::msgcat::mcset da {Align} {Juster}
+::msgcat::mcset da {All Columns} {Alle søjler}
+::msgcat::mcset da {All Rows} [encoding convertfrom iso8859-1 {Alle rækker}]
+::msgcat::mcset da {All} {Alle}
+::msgcat::mcset da {Always save files during Backup}
+::msgcat::mcset da {Amplifier} [encoding convertfrom iso8859-1 {Forstærker}]
+::msgcat::mcset da {An error has occurred during backup}
+::msgcat::mcset da {An error has occurred during restore}
+::msgcat::mcset da {An error has occurred invoking the Analysis task} [encoding convertfrom iso8859-1 {Fejl opstået ved kald til analyse program}]
+::msgcat::mcset da {An error has occurred while creating image.}
+::msgcat::mcset da {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset da {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset da {An error has occurred while printing} [encoding convertfrom iso8859-1 {Fejl opstået under udskrivning}]
+::msgcat::mcset da {An error has occurred while reading image.}
+::msgcat::mcset da {An error has occurred while saving} [encoding convertfrom iso8859-1 {Fejl opstået under gemning}]
+::msgcat::mcset da {An error has occurred while updating VO server list}
+::msgcat::mcset da {An error has occurred while writing image.}
+::msgcat::mcset da {An internal error has been detected}
+::msgcat::mcset da {Analysis Command Log} {Analyse kommando logbog}
+::msgcat::mcset da {Analysis Commands} [encoding convertfrom iso8859-1 {Analyse muligheder}]
+::msgcat::mcset da {Analysis File}
+::msgcat::mcset da {Analysis Log}
+::msgcat::mcset da {Analysis} {Analyse}
+::msgcat::mcset da {Angle Complement} [encoding convertfrom iso8859-1 {Komplementærvinkel}]
+::msgcat::mcset da {Angles} {Vinkler}
+::msgcat::mcset da {Angle} {Vinkel}
+::msgcat::mcset da {Annuli} {Ringforme}
+::msgcat::mcset da {Annulus} {Ringform}
+::msgcat::mcset da {Apply} {Anvend}
+::msgcat::mcset da {ArcMin} {Bueminutter}
+::msgcat::mcset da {ArcSec} {Buesekunder}
+::msgcat::mcset da {Architecture} {Arkitektur}
+::msgcat::mcset da {Archives}
+::msgcat::mcset da {Array}
+::msgcat::mcset da {Arrow} {Pil}
+::msgcat::mcset da {Astronomy}
+::msgcat::mcset da {At Startup}
+::msgcat::mcset da {At least 2 different catalogs are required}
+::msgcat::mcset da {Auto Centroid} {Automatisk centroide}
+::msgcat::mcset da {Auto Plot 2D}
+::msgcat::mcset da {Auto Plot 3D}
+::msgcat::mcset da {Auto Plot Statistics}
+::msgcat::mcset da {Auto Plot}
+::msgcat::mcset da {Autoload FITS Regions} [encoding convertfrom iso8859-1 {Indlæs automatisk FITS regioner}]
+::msgcat::mcset da {Autoload}
+::msgcat::mcset da {Automatic} {Automatisk}
+::msgcat::mcset da {Average} [encoding convertfrom iso8859-1 {Middelværdi}]
+::msgcat::mcset da {Axes Number}
+::msgcat::mcset da {Axes Order}
+::msgcat::mcset da {Axes Title}
+::msgcat::mcset da {Axes} {Akser}
+::msgcat::mcset da {Axis Length} [encoding convertfrom iso8859-1 {Akse længde}]
+::msgcat::mcset da {Axis Numbers} {Akse tal}
+::msgcat::mcset da {Axis Title}
+::msgcat::mcset da {Axis} {Akser}
+::msgcat::mcset da {Azimuth}
+::msgcat::mcset da {Background Color} {Baggrunds farve}
+::msgcat::mcset da {Background} {Baggrund}
+::msgcat::mcset da {Backup}
+::msgcat::mcset da {Back} {Tilbage}
+::msgcat::mcset da {Bar Plot Tool}
+::msgcat::mcset da {Bias} {Bias}
+::msgcat::mcset da {Bin 3rd Column} [encoding convertfrom iso8859-1 {Bin 3dje søjle}]
+::msgcat::mcset da {Bin Center} {Bin center}
+::msgcat::mcset da {Bin Columns} [encoding convertfrom iso8859-1 {Bin søjler}]
+::msgcat::mcset da {Bin Filter} {Bin filter}
+::msgcat::mcset da {Bin Fit}
+::msgcat::mcset da {Bin In}
+::msgcat::mcset da {Bin Out}
+::msgcat::mcset da {Binning Parameters} {Parameter binning}
+::msgcat::mcset da {Bin} {Bin}
+::msgcat::mcset da {Black} {Sort}
+::msgcat::mcset da {Blank/Inf/NaN Color} {Blank/Inf/NaN farve}
+::msgcat::mcset da {Blink Frames} {Blink rammer}
+::msgcat::mcset da {Blink Interval} {Blinke interval}
+::msgcat::mcset da {Blink} {Blink}
+::msgcat::mcset da {Block Fit}
+::msgcat::mcset da {Block In} {Bin ind}
+::msgcat::mcset da {Block Out} {Bin ud}
+::msgcat::mcset da {Block Parameters}
+::msgcat::mcset da {Block} {Bin}
+::msgcat::mcset da {Blue} [encoding convertfrom iso8859-1 {Blå}]
+::msgcat::mcset da {Bold} {Fed}
+::msgcat::mcset da {Border} {Kant}
+::msgcat::mcset da {Bottom}
+::msgcat::mcset da {Box Annulus} {Kasseformet ringform}
+::msgcat::mcset da {Box Panda} {Kasseformet panda}
+::msgcat::mcset da {BoxCircle}
+::msgcat::mcset da {Boxcar} {Kvadratisk kernel}
+::msgcat::mcset da {Box} {Kasse}
+::msgcat::mcset da {Broadcast}
+::msgcat::mcset da {Browser}
+::msgcat::mcset da {Browse}
+::msgcat::mcset da {Buffer}
+::msgcat::mcset da {Buttonbar}
+::msgcat::mcset da {Buttons} {Knapper}
+::msgcat::mcset da {Bytes}
+::msgcat::mcset da {CMYK}
+::msgcat::mcset da {Can Delete} [encoding convertfrom iso8859-1 {Må slette}]
+::msgcat::mcset da {Can Edit} [encoding convertfrom iso8859-1 {Må redigere}]
+::msgcat::mcset da {Can Move} [encoding convertfrom iso8859-1 {Må flytte}]
+::msgcat::mcset da {Can Rotate} [encoding convertfrom iso8859-1 {Må rotere}]
+::msgcat::mcset da {Cancelled}
+::msgcat::mcset da {Cancel} {Slet}
+::msgcat::mcset da {Cap}
+::msgcat::mcset da {Catalog Server} {Katalog server}
+::msgcat::mcset da {Catalog Tool} {Katalog funktion}
+::msgcat::mcset da {Catalogs} {Kataloger}
+::msgcat::mcset da {Catalog} {Katalog}
+::msgcat::mcset da {Catrom}
+::msgcat::mcset da {Cat}
+::msgcat::mcset da {Center Image} {Centrer billedet}
+::msgcat::mcset da {Center Non-modal Dialogs}
+::msgcat::mcset da {Center} {Centrer}
+::msgcat::mcset da {Centroid Parameters}
+::msgcat::mcset da {Centroid} {Centroide}
+::msgcat::mcset da {Circle} {Cirkel}
+::msgcat::mcset da {Clear All} {Fjern alt}
+::msgcat::mcset da {Clear Analysis Commands} {Fjern analyse funktioner}
+::msgcat::mcset da {Clear Cache} [encoding convertfrom iso8859-1 {Tøm cache}]
+::msgcat::mcset da {Clear Data} {Fjern data}
+::msgcat::mcset da {Clear External Analysis Commands?} [encoding convertfrom iso8859-1 {Ryd ekstern analyse kommandoer?}]
+::msgcat::mcset da {Clear Filter} {Fjern filter}
+::msgcat::mcset da {Clear Frame} {Ryd ramme}
+::msgcat::mcset da {Clear Preferences?} {Nulstil foretrukne?}
+::msgcat::mcset da {Clear Preferences} {Nulstil foretrukne}
+::msgcat::mcset da {Clear} {Fjern}
+::msgcat::mcset da {Click to Center} {Klik for centrering}
+::msgcat::mcset da {Close} {Luk}
+::msgcat::mcset da {Colorbar Size}
+::msgcat::mcset da {Colorbar} {Farvekode}
+::msgcat::mcset da {Colormap Parameters} {Farvetabel parametre}
+::msgcat::mcset da {Colormap} {Farvetabel}
+::msgcat::mcset da {Color} {Farve}
+::msgcat::mcset da {Columns} [encoding convertfrom iso8859-1 {Søjler}]
+::msgcat::mcset da {Column} [encoding convertfrom iso8859-1 {Søjle}]
+::msgcat::mcset da {Command not allowed}
+::msgcat::mcset da {Command}
+::msgcat::mcset da {Compass} {Kompas}
+::msgcat::mcset da {Composite Region}
+::msgcat::mcset da {Composite} {Sammensat}
+::msgcat::mcset da {Compression} {Komprimer}
+::msgcat::mcset da {Configure} {Konfigurer}
+::msgcat::mcset da {Connect Directly} {Tilslut direkte}
+::msgcat::mcset da {Connect SAMP}
+::msgcat::mcset da {Connect Using Web Proxy} {Tilslut via web proxy}
+::msgcat::mcset da {Connect}
+::msgcat::mcset da {Console} {konsol}
+::msgcat::mcset da {Contacting Image Server}
+::msgcat::mcset da {Contour Parameters} {Kontur parametre}
+::msgcat::mcset da {Contours} {Konturer}
+::msgcat::mcset da {Contour} {Konturer}
+::msgcat::mcset da {Contrast} {Kontrast}
+::msgcat::mcset da {Convert to Polygons} {Omdan til poygoner}
+::msgcat::mcset da {Coordinate Grid Parameters} {Koordinatnetparametre}
+::msgcat::mcset da {Coordinate Grid} {Koordinatnet}
+::msgcat::mcset da {Coordinate System} {Koordinat system}
+::msgcat::mcset da {Coordinates} {Koordinater}
+::msgcat::mcset da {Coordinate} {Koordinat}
+::msgcat::mcset da {Copy Contours} {Kopier konturer}
+::msgcat::mcset da {Copy to Regions} {kopier til regioner}
+::msgcat::mcset da {Copy} {Kopier}
+::msgcat::mcset da {Create Movie}
+::msgcat::mcset da {Create New Frame on Download} {Dan en ny ramme under hentning}
+::msgcat::mcset da {Create}
+::msgcat::mcset da {Crop Parameters}
+::msgcat::mcset da {Crop}
+::msgcat::mcset da {Crosshair Parameters}
+::msgcat::mcset da {Crosshair To} [encoding convertfrom iso8859-1 {Trådkors til}]
+::msgcat::mcset da {Crosshair} [encoding convertfrom iso8859-1 {Trådkors}]
+::msgcat::mcset da {Cross} {Kryds}
+::msgcat::mcset da {Cubehelix}
+::msgcat::mcset da {Cube}
+::msgcat::mcset da {Cubic}
+::msgcat::mcset da {Current Frame} {Denne ramme}
+::msgcat::mcset da {Current Range} {Dette interval}
+::msgcat::mcset da {Current} {Denne}
+::msgcat::mcset da {Cursor}
+::msgcat::mcset da {Cut} [encoding convertfrom iso8859-1 {Beskær}]
+::msgcat::mcset da {Cyan} {Cyan}
+::msgcat::mcset da {DPI}
+::msgcat::mcset da {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset da {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset da {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset da {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-1 {DS9 har fundet en ældre fil med foretrukne indstillinger, ønsker du at opdatere?}]
+::msgcat::mcset da {DS9 will complete the initialization process} [encoding convertfrom iso8859-1 {DS9 vil fuldføre initialiserings processen}]
+::msgcat::mcset da {Dash} {streg}
+::msgcat::mcset da {Data Format} {Dataformat}
+::msgcat::mcset da {Dataset Name}
+::msgcat::mcset da {Dataset} [encoding convertfrom iso8859-1 {Datasæt}]
+::msgcat::mcset da {Data}
+::msgcat::mcset da {Decrease} {Aftag}
+::msgcat::mcset da {Default All Files}
+::msgcat::mcset da {Default Format}
+::msgcat::mcset da {Default Length}
+::msgcat::mcset da {Default} {Standard}
+::msgcat::mcset da {Degrees} {Grader}
+::msgcat::mcset da {Delete All Frames?} {Slet alle rammer?}
+::msgcat::mcset da {Delete All Frames} {Slet alle rammer}
+::msgcat::mcset da {Delete All Groups?} {Slet alle grupper?}
+::msgcat::mcset da {Delete All Groups} {Slet alle grupper}
+::msgcat::mcset da {Delete All Regions?} {Slet alle områder?}
+::msgcat::mcset da {Delete All Regions} {Slet alle områder}
+::msgcat::mcset da {Delete All} {Slet alt}
+::msgcat::mcset da {Delete Color Tags}
+::msgcat::mcset da {Delete Frame} {Slet denne ramme}
+::msgcat::mcset da {Delete Group} {Slet gruppe}
+::msgcat::mcset da {Delete Selected Regions} [encoding convertfrom iso8859-1 {Slet valgte områder}]
+::msgcat::mcset da {Delete} {Slet}
+::msgcat::mcset da {Depth} {Dybde}
+::msgcat::mcset da {Detector} {Detektor}
+::msgcat::mcset da {Dialog Box} {Dialog vindue}
+::msgcat::mcset da {Diamond} {Ruder}
+::msgcat::mcset da {Dimension} {Dimension}
+::msgcat::mcset da {Direction}
+::msgcat::mcset da {Disconnect}
+::msgcat::mcset da {Display Header}
+::msgcat::mcset da {Display Size} [encoding convertfrom iso8859-1 {Vis størrelse}]
+::msgcat::mcset da {Dissolve} [encoding convertfrom iso8859-1 {Opløs}]
+::msgcat::mcset da {Distance}
+::msgcat::mcset da {Done}
+::msgcat::mcset da {Download Colormap}
+::msgcat::mcset da {Download VOTABLE format if available}
+::msgcat::mcset da {Drag to Center} [encoding convertfrom iso8859-1 {Træk til center}]
+::msgcat::mcset da {Duplicate Data}
+::msgcat::mcset da {East} [encoding convertfrom iso8859-1 {Øst}]
+::msgcat::mcset da {Ecliptic} {Ekliptisk}
+::msgcat::mcset da {Edit Group Name} {Rediger gruppe navn}
+::msgcat::mcset da {Edit} {Rediger}
+::msgcat::mcset da {Elevation} {Stigning}
+::msgcat::mcset da {Ellipse Annulus}
+::msgcat::mcset da {Ellipse Panda} {Ellipse Panda}
+::msgcat::mcset da {Ellipse} {Ellipse}
+::msgcat::mcset da {Elliptical Annulus} {Elliptisk ringform}
+::msgcat::mcset da {Elliptical Panda} {Elliptisk pandaform}
+::msgcat::mcset da {Enable Confirmation Dialogs} [encoding convertfrom iso8859-1 {Aktiver bekræftelsesdialoger}]
+::msgcat::mcset da {Enable}
+::msgcat::mcset da {End} {Afslut}
+::msgcat::mcset da {Enter Color} {Angiv farve}
+::msgcat::mcset da {Enter Font Size}
+::msgcat::mcset da {Enter Group Name} {Indtast gruppenavn}
+::msgcat::mcset da {Enter Search Expression} [encoding convertfrom iso8859-1 {Angiv søgeudtryk}]
+::msgcat::mcset da {Enter URL}
+::msgcat::mcset da {Entry}
+::msgcat::mcset da {Equal Area} {Samme areal}
+::msgcat::mcset da {Equal Distance} {Samme afstand}
+::msgcat::mcset da {Equal Spacing}
+::msgcat::mcset da {Equal Value}
+::msgcat::mcset da {Error code was returned} {Fejlkode blev returneret}
+::msgcat::mcset da {Error} {Fejl}
+::msgcat::mcset da {Examine Frame} [encoding convertfrom iso8859-1 {Undersøg ramme}]
+::msgcat::mcset da {Examine} [encoding convertfrom iso8859-1 {Undersøg}]
+::msgcat::mcset da {Exam}
+::msgcat::mcset da {Exclude} {Udelad}
+::msgcat::mcset da {Exit} {Luk}
+::msgcat::mcset da {Export Array}
+::msgcat::mcset da {Export}
+::msgcat::mcset da {Extention}
+::msgcat::mcset da {Exterior Axes} {Udvendige akser}
+::msgcat::mcset da {Exterior Numerics} {Udvendige tal}
+::msgcat::mcset da {FAQ} [encoding convertfrom iso8859-1 {Ofte Stillede Spørgsmål}]
+::msgcat::mcset da {FK4}
+::msgcat::mcset da {FK5}
+::msgcat::mcset da {Factor}
+::msgcat::mcset da {File not Found or Unable to load FITS data MIME type} [encoding convertfrom iso8859-1 {Filen blev ikke fundet, eller det var ikke muligt at åbne FITS data MIME filtype}]
+::msgcat::mcset da {Filename} {Filnavn}
+::msgcat::mcset da {File} {Fil}
+::msgcat::mcset da {Fill}
+::msgcat::mcset da {Filter} {Filter}
+::msgcat::mcset da {Find Next} [encoding convertfrom iso8859-1 {Find næste}]
+::msgcat::mcset da {Find} {Find}
+::msgcat::mcset da {First Frame} [encoding convertfrom iso8859-1 {Første ramme}]
+::msgcat::mcset da {First} [encoding convertfrom iso8859-1 {Første}]
+::msgcat::mcset da {Fits}
+::msgcat::mcset da {Fixed in Size} [encoding convertfrom iso8859-1 {Fastlåst størrelse}]
+::msgcat::mcset da {Flat}
+::msgcat::mcset da {Flip}
+::msgcat::mcset da {Font} {Skrifttype}
+::msgcat::mcset da {For more information, use --help}
+::msgcat::mcset da {Format} {Format}
+::msgcat::mcset da {Forward} {Videre}
+::msgcat::mcset da {Found} {Fundet}
+::msgcat::mcset da {Frame Information} {Information for ramme}
+::msgcat::mcset da {Frame Parameters}
+::msgcat::mcset da {Frames}
+::msgcat::mcset da {Frame} {Ramme}
+::msgcat::mcset da {From}
+::msgcat::mcset da {Front} {Foran}
+::msgcat::mcset da {Full Range} {Hele intervallet}
+::msgcat::mcset da {Function} {Funktion}
+::msgcat::mcset da {GUI Font}
+::msgcat::mcset da {Galactic} {Galaktisk}
+::msgcat::mcset da {Gap}
+::msgcat::mcset da {Gaussian} {Gaussisk}
+::msgcat::mcset da {General} {Generel}
+::msgcat::mcset da {Generate} {Opret}
+::msgcat::mcset da {Generating Regions} [encoding convertfrom iso8859-1 {danner områder}]
+::msgcat::mcset da {Get Information} {Hent information}
+::msgcat::mcset da {Gist}
+::msgcat::mcset da {Global Properties}
+::msgcat::mcset da {Global} {Global}
+::msgcat::mcset da {Goto Frame} [encoding convertfrom iso8859-1 {Gå til ramme}]
+::msgcat::mcset da {Graph Horz} {vandret graf}
+::msgcat::mcset da {Graph Vert} {lodret graf}
+::msgcat::mcset da {Graphics} {Grafisk}
+::msgcat::mcset da {Graphs}
+::msgcat::mcset da {Graph} {graf}
+::msgcat::mcset da {Grayscale} [encoding convertfrom iso8859-1 {Gråskala}]
+::msgcat::mcset da {Green} [encoding convertfrom iso8859-1 {Grøn}]
+::msgcat::mcset da {Grid Gap} {Mellemrum i nettet}
+::msgcat::mcset da {Grid} {Net}
+::msgcat::mcset da {Groove}
+::msgcat::mcset da {Groups} {Gupper}
+::msgcat::mcset da {HTTP} {HTTP}
+::msgcat::mcset da {Header} {Hovede}
+::msgcat::mcset da {Height} [encoding convertfrom iso8859-1 {Højde}]
+::msgcat::mcset da {Help Desk} [encoding convertfrom iso8859-1 {Hjælp}]
+::msgcat::mcset da {Help Me Choose} [encoding convertfrom iso8859-1 {Hjælp mig at vælge}]
+::msgcat::mcset da {Help} [encoding convertfrom iso8859-1 {Hjælp}]
+::msgcat::mcset da {Hide All} {Gem alle}
+::msgcat::mcset da {Highlite}
+::msgcat::mcset da {High} [encoding convertfrom iso8859-1 {Høj}]
+::msgcat::mcset da {Histogram Equalization} {Histogram udligning}
+::msgcat::mcset da {Histogram} {Histogram}
+::msgcat::mcset da {Horizontal Graph} {Vandret graf}
+::msgcat::mcset da {Horizontal Layout} {Vandret layout}
+::msgcat::mcset da {Horizontal}
+::msgcat::mcset da {IAU Location Code}
+::msgcat::mcset da {ICRS}
+::msgcat::mcset da {Identification} {Identifikation}
+::msgcat::mcset da {If} {Hvis}
+::msgcat::mcset da {Image Servers}
+::msgcat::mcset da {Image} {Billed}
+::msgcat::mcset da {Import Array}
+::msgcat::mcset da {Import}
+::msgcat::mcset da {Include} {Inkluder}
+::msgcat::mcset da {Increase} [encoding convertfrom iso8859-1 {Forøg}]
+::msgcat::mcset da {Information Panel} {Informations panel}
+::msgcat::mcset da {Information} {Information}
+::msgcat::mcset da {Initialize XPA} {Initialiser XPA}
+::msgcat::mcset da {Inner} {Indre}
+::msgcat::mcset da {Instrument FOV} {Instrument FOV}
+::msgcat::mcset da {Interior Axes} {Indre akser}
+::msgcat::mcset da {Interior Numerics} {Indre tal}
+::msgcat::mcset da {Internal Parse Error}
+::msgcat::mcset da {Interval} {Interval}
+::msgcat::mcset da {Invalid Column Name}
+::msgcat::mcset da {Invalid formated multipart/mixed mime type message} {Forkert formatteret opdelt eller blandet mime type meddelelse}
+::msgcat::mcset da {Invert Colormap} {Vend farvetabel}
+::msgcat::mcset da {Invert Selection} {Inverter valg}
+::msgcat::mcset da {Invert} {Inverter}
+::msgcat::mcset da {Italic} {Kursiv}
+::msgcat::mcset da {Items Found} {Emner fundet}
+::msgcat::mcset da {Iteration}
+::msgcat::mcset da {JPEG Quality Factor} {JPEG kvalitetsfaktor}
+::msgcat::mcset da {Keep-Alive}
+::msgcat::mcset da {Kernel}
+::msgcat::mcset da {Keyboard Shortcuts} {Tastatur genveje}
+::msgcat::mcset da {Keyboard} {Tastatur}
+::msgcat::mcset da {Keyword}
+::msgcat::mcset da {Labels} {Etiketter}
+::msgcat::mcset da {Label} {Etikette}
+::msgcat::mcset da {Landscape} {Landskab}
+::msgcat::mcset da {Language} {Sprog}
+::msgcat::mcset da {Last Frame} {Sidste ramme}
+::msgcat::mcset da {Last} {Sidste}
+::msgcat::mcset da {Layout Horz}
+::msgcat::mcset da {Layout Vert}
+::msgcat::mcset da {Layout}
+::msgcat::mcset da {Left}
+::msgcat::mcset da {Legal}
+::msgcat::mcset da {Legend Title}
+::msgcat::mcset da {Legend}
+::msgcat::mcset da {Length} [encoding convertfrom iso8859-1 {Længde}]
+::msgcat::mcset da {Letter}
+::msgcat::mcset da {Levels} {Niveauer}
+::msgcat::mcset da {Level} {Niveau}
+::msgcat::mcset da {Limits} [encoding convertfrom iso8859-1 {Grænser}]
+::msgcat::mcset da {Line Plot Tool}
+::msgcat::mcset da {Linear} [encoding convertfrom iso8859-1 {Lineær}]
+::msgcat::mcset da {Line} {Linie}
+::msgcat::mcset da {List Data}
+::msgcat::mcset da {List Regions} [encoding convertfrom iso8859-1 {Vis områder}]
+::msgcat::mcset da {List} {Liste}
+::msgcat::mcset da {Load Analysis Commands} [encoding convertfrom iso8859-1 {Indlæs analyse funktioner}]
+::msgcat::mcset da {Load Color Tags}
+::msgcat::mcset da {Load Colormap} [encoding convertfrom iso8859-1 {Indlæs farvekort}]
+::msgcat::mcset da {Load Configuration} [encoding convertfrom iso8859-1 {Indlæs konfiguration}]
+::msgcat::mcset da {Load Contour Levels} [encoding convertfrom iso8859-1 {Indlæs konturniveauer}]
+::msgcat::mcset da {Load Contours} [encoding convertfrom iso8859-1 {indlæs konturer}]
+::msgcat::mcset da {Load Contrast/Bias} [encoding convertfrom iso8859-1 {Indlæs kontrast/bias}]
+::msgcat::mcset da {Load Data} [encoding convertfrom iso8859-1 {Indlæs data}]
+::msgcat::mcset da {Load Mosaic} [encoding convertfrom iso8859-1 {Indlæs mosaik}]
+::msgcat::mcset da {Load Regions} [encoding convertfrom iso8859-1 {Indlæs områder}]
+::msgcat::mcset da {Load Template} [encoding convertfrom iso8859-1 {Indlæs skabelon}]
+::msgcat::mcset da {Load into All Frames}
+::msgcat::mcset da {Load into Current Frame}
+::msgcat::mcset da {Loading Catalog}
+::msgcat::mcset da {Loading}
+::msgcat::mcset da {Load} [encoding convertfrom iso8859-1 {Indlæs}]
+::msgcat::mcset da {Local} {Lokal}
+::msgcat::mcset da {Lock Axes}
+::msgcat::mcset da {Lock Bin}
+::msgcat::mcset da {Lock Color}
+::msgcat::mcset da {Lock Crop Amplifier}
+::msgcat::mcset da {Lock Crop Detector}
+::msgcat::mcset da {Lock Crop Image}
+::msgcat::mcset da {Lock Crop None}
+::msgcat::mcset da {Lock Crop Physical}
+::msgcat::mcset da {Lock Crop WCS}
+::msgcat::mcset da {Lock Crosshair Amplifier}
+::msgcat::mcset da {Lock Crosshair Detector}
+::msgcat::mcset da {Lock Crosshair Image}
+::msgcat::mcset da {Lock Crosshair None}
+::msgcat::mcset da {Lock Crosshair Physical}
+::msgcat::mcset da {Lock Crosshair WCS}
+::msgcat::mcset da {Lock Frame Amplifier}
+::msgcat::mcset da {Lock Frame Detector}
+::msgcat::mcset da {Lock Frame Image}
+::msgcat::mcset da {Lock Frame None}
+::msgcat::mcset da {Lock Frame Physical}
+::msgcat::mcset da {Lock Frame WCS}
+::msgcat::mcset da {Lock Limits}
+::msgcat::mcset da {Lock Scale}
+::msgcat::mcset da {Lock Slice Image}
+::msgcat::mcset da {Lock Slice None}
+::msgcat::mcset da {Lock Slice WCS}
+::msgcat::mcset da {Lock Smooth}
+::msgcat::mcset da {Lock} [encoding convertfrom iso8859-1 {Lås}]
+::msgcat::mcset da {Log Exponent}
+::msgcat::mcset da {Log}
+::msgcat::mcset da {Low High} [encoding convertfrom iso8859-1 {Lav høj}]
+::msgcat::mcset da {Lower Left Back}
+::msgcat::mcset da {Lower Left Front}
+::msgcat::mcset da {Lower Right Back}
+::msgcat::mcset da {Lower Right Front}
+::msgcat::mcset da {Low} {lav}
+::msgcat::mcset da {MIP}
+::msgcat::mcset da {Magenta}
+::msgcat::mcset da {Magnification}
+::msgcat::mcset da {Magnifier} [encoding convertfrom iso8859-1 {Forstørrelse}]
+::msgcat::mcset da {Major}
+::msgcat::mcset da {Manual}
+::msgcat::mcset da {Mask Parameters} {Maske parametre}
+::msgcat::mcset da {Match Axes}
+::msgcat::mcset da {Match Bin}
+::msgcat::mcset da {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset da {Match Color}
+::msgcat::mcset da {Match Crop Amplifier}
+::msgcat::mcset da {Match Crop Detector}
+::msgcat::mcset da {Match Crop Image}
+::msgcat::mcset da {Match Crop Physical}
+::msgcat::mcset da {Match Crop WCS}
+::msgcat::mcset da {Match Crosshair Amplifier}
+::msgcat::mcset da {Match Crosshair Detector}
+::msgcat::mcset da {Match Crosshair Image}
+::msgcat::mcset da {Match Crosshair Physical}
+::msgcat::mcset da {Match Crosshair WCS}
+::msgcat::mcset da {Match Frame Amplifier}
+::msgcat::mcset da {Match Frame Detector}
+::msgcat::mcset da {Match Frame Image}
+::msgcat::mcset da {Match Frame Physical}
+::msgcat::mcset da {Match Frame WCS}
+::msgcat::mcset da {Match Limits}
+::msgcat::mcset da {Match Scale}
+::msgcat::mcset da {Match Slice Image}
+::msgcat::mcset da {Match Slice WCS}
+::msgcat::mcset da {Match Smooth}
+::msgcat::mcset da {Match}
+::msgcat::mcset da {Math Function} {Matematisk funktion}
+::msgcat::mcset da {Matplotlib}
+::msgcat::mcset da {Max Rows} {Maks antal rækker}
+::msgcat::mcset da {Maximum}
+::msgcat::mcset da {Max} {Maks}
+::msgcat::mcset da {Menus and Buttons}
+::msgcat::mcset da {Menu}
+::msgcat::mcset da {Message Log}
+::msgcat::mcset da {Method} {Metode}
+::msgcat::mcset da {Min Max Parameters}
+::msgcat::mcset da {Min Max} {Min Maks}
+::msgcat::mcset da {Minimum}
+::msgcat::mcset da {Minor}
+::msgcat::mcset da {Minutes}
+::msgcat::mcset da {Min}
+::msgcat::mcset da {Mission}
+::msgcat::mcset da {Mode}
+::msgcat::mcset da {Mosaic IRAF Segment}
+::msgcat::mcset da {Mosaic IRAF}
+::msgcat::mcset da {Mosaic WCS Segment}
+::msgcat::mcset da {Mosaic WCS}
+::msgcat::mcset da {Mosaic WFPC2}
+::msgcat::mcset da {Mosaic}
+::msgcat::mcset da {Mouse Click Epsilon}
+::msgcat::mcset da {Mouse Wheel Bin}
+::msgcat::mcset da {Mouse Wheel Zoom}
+::msgcat::mcset da {Mouse and Keyboard}
+::msgcat::mcset da {Move Back} {flyt tilbage}
+::msgcat::mcset da {Move First} {flyt forrest}
+::msgcat::mcset da {Move Forward} {flyt frem}
+::msgcat::mcset da {Move Frame}
+::msgcat::mcset da {Move Last} {flyt sidst}
+::msgcat::mcset da {Move to Back} {Bag}
+::msgcat::mcset da {Move to Front} {Foran}
+::msgcat::mcset da {Movie}
+::msgcat::mcset da {Multiple Extension Cube}
+::msgcat::mcset da {Multiple Extension Frames}
+::msgcat::mcset da {Multiple WCS} {Multipel WCS}
+::msgcat::mcset da {NRRD}
+::msgcat::mcset da {Name Resolution} [encoding convertfrom iso8859-1 {Navnesøgning}]
+::msgcat::mcset da {Name Server} {Navneserver}
+::msgcat::mcset da {Name or Designation} {navn eller beskrivelse}
+::msgcat::mcset da {Name}
+::msgcat::mcset da {Native Dialog} {Oprindelig dialog}
+::msgcat::mcset da {New Features} {Nye egenskaber}
+::msgcat::mcset da {New Frame 3D} {Ny ramme 3D}
+::msgcat::mcset da {New Frame RGB} {Ny ramme (RGB)}
+::msgcat::mcset da {New Frame each Time} {Ny ramme hver gang}
+::msgcat::mcset da {New Frame} {Ny ramme}
+::msgcat::mcset da {New Group} {Ny gruppe}
+::msgcat::mcset da {New} {Ny}
+::msgcat::mcset da {Next Frame} [encoding convertfrom iso8859-1 {Næste ramme}]
+::msgcat::mcset da {Next} [encoding convertfrom iso8859-1 {Næste}]
+::msgcat::mcset da {No Catalog specified} {Intet katalog er specificeret}
+::msgcat::mcset da {No Data Available}
+::msgcat::mcset da {No Items Found} {Ingen emner er fundet}
+::msgcat::mcset da {No current frame}
+::msgcat::mcset da {Non-zero} {ikke-nul}
+::msgcat::mcset da {None} [encoding convertfrom iso8859-1 {Ingen}]
+::msgcat::mcset da {Normal} {Normal}
+::msgcat::mcset da {North} {Nord}
+::msgcat::mcset da {Not Found}
+::msgcat::mcset da {Not Supported}
+::msgcat::mcset da {Number of Samples} {Antal}
+::msgcat::mcset da {Number of Threads}
+::msgcat::mcset da {Number of Ticks}
+::msgcat::mcset da {Number} {Antal}
+::msgcat::mcset da {Numerics} {Talværdier}
+::msgcat::mcset da {OK}
+::msgcat::mcset da {Object} {Objekt}
+::msgcat::mcset da {Open File} {Åben fil}
+::msgcat::mcset da {Open TCL Console} [encoding convertfrom iso8859-1 {Åben TCL konsol}]
+::msgcat::mcset da {Open URL} [encoding convertfrom iso8859-1 {Åben URL}]
+::msgcat::mcset da {Open as}
+::msgcat::mcset da {Open} [encoding convertfrom iso8859-1 {Åben}]
+::msgcat::mcset da {Operator}
+::msgcat::mcset da {Orientation} {Orientering}
+::msgcat::mcset da {Origin}
+::msgcat::mcset da {Oscillate}
+::msgcat::mcset da {Other Color}
+::msgcat::mcset da {Other Font Size}
+::msgcat::mcset da {Other} {Anden}
+::msgcat::mcset da {Outer} {Ydre}
+::msgcat::mcset da {Overlap}
+::msgcat::mcset da {PS Page Setup} {PS side opsætning}
+::msgcat::mcset da {PS Print} {PS udskrift}
+::msgcat::mcset da {Page Setup} [encoding convertfrom iso8859-1 {Side opsætning}]
+::msgcat::mcset da {Page Source} {Side kilde}
+::msgcat::mcset da {Pan To} {Flyt til}
+::msgcat::mcset da {Pan Zoom Rotate Parameters} [encoding convertfrom iso8859-1 {Flyt Zoom Rotér parametre}]
+::msgcat::mcset da {Pan Zoom} {Flyt Zoom}
+::msgcat::mcset da {Pan then Zoom} {Flyt og derefter zoom}
+::msgcat::mcset da {Panda}
+::msgcat::mcset da {Panner} {Oversigtskort}
+::msgcat::mcset da {Pan} {Flyt}
+::msgcat::mcset da {Parameters} {Parametre}
+::msgcat::mcset da {Password} {Kodeord}
+::msgcat::mcset da {Paste Contours} {Indsæt konturer}
+::msgcat::mcset da {Paste} [encoding convertfrom iso8859-1 {Sæt ind}]
+::msgcat::mcset da {Physical} {Fysisk}
+::msgcat::mcset da {Pixel Distribution} {Pixelfordeling}
+::msgcat::mcset da {Pixel Size} [encoding convertfrom iso8859-1 {Pixelstørrelse}]
+::msgcat::mcset da {Pixel Table} {Pixel tabel}
+::msgcat::mcset da {Pixels} {Pixler}
+::msgcat::mcset da {Play} {Afspil}
+::msgcat::mcset da {Please Select a Region}
+::msgcat::mcset da {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset da {Please specify width, height, and either name or (ra,dec)} [encoding convertfrom iso8859-1 {angiv venligst bredde, højde, og enten navn eller (ra,dec)}]
+::msgcat::mcset da {Plot 2D}
+::msgcat::mcset da {Plot 3D}
+::msgcat::mcset da {Plot Title} {Plot titel}
+::msgcat::mcset da {Plotting Regions} [encoding convertfrom iso8859-1 {Plotte områder}]
+::msgcat::mcset da {Plot}
+::msgcat::mcset da {Plus}
+::msgcat::mcset da {Pointer} {Pegepil}
+::msgcat::mcset da {Points} {Punkter}
+::msgcat::mcset da {Point} {Punkt}
+::msgcat::mcset da {Polygon} {Polygon}
+::msgcat::mcset da {Portrait} [encoding convertfrom iso8859-1 {Portræt}]
+::msgcat::mcset da {Poster} {Plakat}
+::msgcat::mcset da {Postscript Page Setup} [encoding convertfrom iso8859-1 {Postscript side opsætning}]
+::msgcat::mcset da {Postscript Print} {Postscript udskriv}
+::msgcat::mcset da {Postscript}
+::msgcat::mcset da {Power} {Potenslov}
+::msgcat::mcset da {Preferences} {Foretrukne}
+::msgcat::mcset da {Preserve During Load} [encoding convertfrom iso8859-1 {Bevar under indlæsning}]
+::msgcat::mcset da {Previous Frame} [encoding convertfrom iso8859-1 {Foregående ramme}]
+::msgcat::mcset da {Previous} [encoding convertfrom iso8859-1 {Foregående}]
+::msgcat::mcset da {Prev}
+::msgcat::mcset da {Print Coordinates} {Udskriv koordinater}
+::msgcat::mcset da {Print To} {Udskriv til}
+::msgcat::mcset da {Printer} {Printer}
+::msgcat::mcset da {Print} {Udskriv}
+::msgcat::mcset da {Projection} {Projektion}
+::msgcat::mcset da {Properties} {Egenskaber}
+::msgcat::mcset da {Property} {Egenskab}
+::msgcat::mcset da {Proxy Host}
+::msgcat::mcset da {Proxy Port}
+::msgcat::mcset da {Publication} {Publikation}
+::msgcat::mcset da {Quadratic} {Kvadratisk}
+::msgcat::mcset da {RGB Array}
+::msgcat::mcset da {RGB Cube}
+::msgcat::mcset da {RGB Image}
+::msgcat::mcset da {RGB}
+::msgcat::mcset da {Radial Profile}
+::msgcat::mcset da {Radial}
+::msgcat::mcset da {Radius}
+::msgcat::mcset da {Raised}
+::msgcat::mcset da {Range}
+::msgcat::mcset da {Redo} {Gentag sidste}
+::msgcat::mcset da {Red} [encoding convertfrom iso8859-1 {Rød}]
+::msgcat::mcset da {Reference Manual}
+::msgcat::mcset da {Reference}
+::msgcat::mcset da {Refresh Frame} {Opdater ramme}
+::msgcat::mcset da {Refresh} {Opdater}
+::msgcat::mcset da {Region Parameters}
+::msgcat::mcset da {Region} [encoding convertfrom iso8859-1 {Område}]
+::msgcat::mcset da {Release Notes} {Frigvelsesnoter}
+::msgcat::mcset da {Release} {Frigivelsesnoter}
+::msgcat::mcset da {Relief}
+::msgcat::mcset da {Reload} {Genhent}
+::msgcat::mcset da {Render}
+::msgcat::mcset da {Repeat}
+::msgcat::mcset da {Reset Colormap} {Nulstil farvetabel}
+::msgcat::mcset da {Reset Frame} {Nulstil ramme}
+::msgcat::mcset da {Reset} {Nulstil}
+::msgcat::mcset da {Restore}
+::msgcat::mcset da {Retrieve} {Hent}
+::msgcat::mcset da {Return}
+::msgcat::mcset da {Right}
+::msgcat::mcset da {Roman}
+::msgcat::mcset da {Rotate} {Roter}
+::msgcat::mcset da {Rows} [encoding convertfrom iso8859-1 {Rækker}]
+::msgcat::mcset da {Row}
+::msgcat::mcset da {Ruler} {Lineal}
+::msgcat::mcset da {SAMP Image}
+::msgcat::mcset da {SAMP Table}
+::msgcat::mcset da {SAMP: already connected}
+::msgcat::mcset da {SAMP: internal error}
+::msgcat::mcset da {SAMP: not connected}
+::msgcat::mcset da {SAMP: unable to locate HUB}
+::msgcat::mcset da {SAMP}
+::msgcat::mcset da {Sample Increment}
+::msgcat::mcset da {Sample Parameters}
+::msgcat::mcset da {Samples per Line} {Udvalg per linie}
+::msgcat::mcset da {Sample}
+::msgcat::mcset da {Save 3D Movie}
+::msgcat::mcset da {Save Color Tags}
+::msgcat::mcset da {Save Colormap} {gem farvekort}
+::msgcat::mcset da {Save Configuration} {Gem konfiguration}
+::msgcat::mcset da {Save Contour Levels} {Gem konturniveauer}
+::msgcat::mcset da {Save Contours} {Gem konturer}
+::msgcat::mcset da {Save Contrast/Bias} {Gem kontrast/bias}
+::msgcat::mcset da {Save Data} {Gem data}
+::msgcat::mcset da {Save Image on Download}
+::msgcat::mcset da {Save Image} {Gem billede}
+::msgcat::mcset da {Save Regions} [encoding convertfrom iso8859-1 {Gem områder}]
+::msgcat::mcset da {Save Template} {Gem skabelon}
+::msgcat::mcset da {Save as}
+::msgcat::mcset da {Save} {Gem}
+::msgcat::mcset da {Scale Parameters} {Skala parametre}
+::msgcat::mcset da {Scale and Limits}
+::msgcat::mcset da {Scale} {Skala}
+::msgcat::mcset da {Scan} {skan}
+::msgcat::mcset da {Scatter Plot Tool}
+::msgcat::mcset da {Scope} [encoding convertfrom iso8859-1 {Gældende}]
+::msgcat::mcset da {Search for Catalogs} [encoding convertfrom iso8859-1 {søg efter kataloger}]
+::msgcat::mcset da {Searching for catalogs} [encoding convertfrom iso8859-1 {søger efter kataloger}]
+::msgcat::mcset da {Seconds} {Sekunder}
+::msgcat::mcset da {Segment}
+::msgcat::mcset da {Select All} [encoding convertfrom iso8859-1 {Vælg alle}]
+::msgcat::mcset da {Select Coordinate System } [encoding convertfrom iso8859-1 {vælg koordinat system}]
+::msgcat::mcset da {Select None} [encoding convertfrom iso8859-1 {Vælg ingen}]
+::msgcat::mcset da {Select}
+::msgcat::mcset da {Send}
+::msgcat::mcset da {Server} {Server}
+::msgcat::mcset da {Sexagesimal}
+::msgcat::mcset da {Shape} {Form}
+::msgcat::mcset da {Show All} {Vis alle}
+::msgcat::mcset da {Show Command}
+::msgcat::mcset da {Show Compass}
+::msgcat::mcset da {Show Text} {Vis tekst}
+::msgcat::mcset da {Show/Hide Frames} {Vis/skjul rammer}
+::msgcat::mcset da {Show} {Vis}
+::msgcat::mcset da {Simple Cross}
+::msgcat::mcset da {Simple Plus}
+::msgcat::mcset da {Single Frame} {Enkel ramme}
+::msgcat::mcset da {Single} {Enkel}
+::msgcat::mcset da {Sites}
+::msgcat::mcset da {Size/Radius} [encoding convertfrom iso8859-1 {Størrelse/Radius}]
+::msgcat::mcset da {Size} {Størrelse}
+::msgcat::mcset da {Skip First} [encoding convertfrom iso8859-1 {Overspring første}]
+::msgcat::mcset da {Slice}
+::msgcat::mcset da {Smooth Parameters} {Udglatningsparametre}
+::msgcat::mcset da {Smoothness}
+::msgcat::mcset da {Smooth} {Udglat}
+::msgcat::mcset da {Solid}
+::msgcat::mcset da {Sorry, DS9 does not support} [encoding convertfrom iso8859-1 {DS9 understøtter ikke}]
+::msgcat::mcset da {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset da {Sort} {Sorter}
+::msgcat::mcset da {Source TCL} {Kilde TCL}
+::msgcat::mcset da {Source} {Kilde}
+::msgcat::mcset da {Space Equal Distance}
+::msgcat::mcset da {Space Equal Value}
+::msgcat::mcset da {Spacing} {Mellemrum}
+::msgcat::mcset da {Sqrt}
+::msgcat::mcset da {Square Root} {Kvadratrod}
+::msgcat::mcset da {Squared} {Kvadratisk}
+::msgcat::mcset da {Square}
+::msgcat::mcset da {Stacked}
+::msgcat::mcset da {Starbase}
+::msgcat::mcset da {Startup}
+::msgcat::mcset da {Start}
+::msgcat::mcset da {Statistics}
+::msgcat::mcset da {Stats}
+::msgcat::mcset da {Status}
+::msgcat::mcset da {Step} {Trin}
+::msgcat::mcset da {Stop}
+::msgcat::mcset da {Story of SAOImage DS9}
+::msgcat::mcset da {Story}
+::msgcat::mcset da {Sum}
+::msgcat::mcset da {Sunken}
+::msgcat::mcset da {Symbol Editor}
+::msgcat::mcset da {Symbol}
+::msgcat::mcset da {Tab-Separated-Value}
+::msgcat::mcset da {Table}
+::msgcat::mcset da {Tabloid}
+::msgcat::mcset da {Tag Color}
+::msgcat::mcset da {Task}
+::msgcat::mcset da {Template}
+::msgcat::mcset da {Text Font}
+::msgcat::mcset da {Text} {Tekst}
+::msgcat::mcset da {Then} [encoding convertfrom iso8859-1 {Så}]
+::msgcat::mcset da {Thickness} {Tykkelse}
+::msgcat::mcset da {This analysis task is already running. Do you wish to kill it?} {Denne analyseopgave kører allerede - skal den stoppes?}
+::msgcat::mcset da {This function is not available.}
+::msgcat::mcset da {This function is not currently supported for this port.}
+::msgcat::mcset da {Tickmarks} {Afmærkninger}
+::msgcat::mcset da {Tile Frames} {Mosaik rammer}
+::msgcat::mcset da {Tile Parameters} {Mosaik parametre}
+::msgcat::mcset da {Tile} {Mosaik}
+::msgcat::mcset da {Times}
+::msgcat::mcset da {Title} {Titel}
+::msgcat::mcset da {Tophat}
+::msgcat::mcset da {Topographic}
+::msgcat::mcset da {Top}
+::msgcat::mcset da {To} {Til}
+::msgcat::mcset da {Transparency}
+::msgcat::mcset da {Triangle}
+::msgcat::mcset da {Type}
+::msgcat::mcset da {URL}
+::msgcat::mcset da {Unable to connect directly: using Web Proxy}
+::msgcat::mcset da {Unable to determine date of observation}
+::msgcat::mcset da {Unable to determine time of observation}
+::msgcat::mcset da {Unable to evaluate filter} {kan ikke bestemme filter}
+::msgcat::mcset da {Unable to find SIAP window}
+::msgcat::mcset da {Unable to find URL column}
+::msgcat::mcset da {Unable to find catalog window} {Kan ikke finde katalog vinduet}
+::msgcat::mcset da {Unable to find plot window} {kan ikke finde plotte vinduet}
+::msgcat::mcset da {Unable to load RGB image into a non-rgb frame} {Kan ikke hente et RGB billede ind i en ikke-RGB ramme}
+::msgcat::mcset da {Unable to load region file}
+::msgcat::mcset da {Unable to load} {Kan ikke hente}
+::msgcat::mcset da {Unable to locate URL} {Kan ikke finde URL}
+::msgcat::mcset da {Unable to match target with XPA Mime request}
+::msgcat::mcset da {Unable to open file} [encoding convertfrom iso8859-1 {Kan ikke åbne fil}]
+::msgcat::mcset da {Unable to process Analysis file}
+::msgcat::mcset da {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset da {Undo} {Fortryd}
+::msgcat::mcset da {Unique}
+::msgcat::mcset da {Unists}
+::msgcat::mcset da {Units} {Enheder}
+::msgcat::mcset da {Unknown Colormap}
+::msgcat::mcset da {Unknown command}
+::msgcat::mcset da {Update Filter}
+::msgcat::mcset da {Update Group} {Opdater gruppe}
+::msgcat::mcset da {Update from Current Crosshair} [encoding convertfrom iso8859-1 {Opdater fra nuværende trådkors}]
+::msgcat::mcset da {Update from Current Frame} [encoding convertfrom iso8859-1 {Opdater fra nuværende ramme}]
+::msgcat::mcset da {Update} {Opdater}
+::msgcat::mcset da {Upper Left Back}
+::msgcat::mcset da {Upper Left Front}
+::msgcat::mcset da {Upper Right Back}
+::msgcat::mcset da {Upper Right Front}
+::msgcat::mcset da {Use Authentication} [encoding convertfrom iso8859-1 {Anvend bekræftelse}]
+::msgcat::mcset da {Use Current Frame on Download} {Brug nuværende ramme til download}
+::msgcat::mcset da {Use Internal Web Browser} {Brug intern web browser}
+::msgcat::mcset da {Use Proxy} {Anvend proxy}
+::msgcat::mcset da {User Manual}
+::msgcat::mcset da {Username} {Brugernavn}
+::msgcat::mcset da {User} {Brugerdefineret}
+::msgcat::mcset da {Use} {Anvend}
+::msgcat::mcset da {VO Server}
+::msgcat::mcset da {VO}
+::msgcat::mcset da {Value} [encoding convertfrom iso8859-1 {Værdi}]
+::msgcat::mcset da {Vector} {Vektor}
+::msgcat::mcset da {Vertical Graph} {Lodret graf}
+::msgcat::mcset da {Vertical Layout} {Lodret layoyt}
+::msgcat::mcset da {Vertical Text} {Lodret tekst}
+::msgcat::mcset da {Vertical}
+::msgcat::mcset da {View} {Vis}
+::msgcat::mcset da {Virtual Observatory} {Virtuelt Observatorium}
+::msgcat::mcset da {WCS Parameters}
+::msgcat::mcset da {WCS}
+::msgcat::mcset da {Wavelength} [encoding convertfrom iso8859-1 {Bølgelængde}]
+::msgcat::mcset da {Web Browser}
+::msgcat::mcset da {White} {Hvid}
+::msgcat::mcset da {Width} {Bredde}
+::msgcat::mcset da {Window}
+::msgcat::mcset da {Words matching title, description} {Ord tilpasset titel, beskrivelse }
+::msgcat::mcset da {X Axis Title}
+::msgcat::mcset da {X Grid}
+::msgcat::mcset da {XPA Information} {XPA information}
+::msgcat::mcset da {XPA not initialized} {XPA ikke startet}
+::msgcat::mcset da {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset da {XPA}
+::msgcat::mcset da {X}
+::msgcat::mcset da {Y Axis Title}
+::msgcat::mcset da {Y Grid}
+::msgcat::mcset da {Yellow} {Gul}
+::msgcat::mcset da {Y}
+::msgcat::mcset da {Z Axis Scale}
+::msgcat::mcset da {ZScale Parameters}
+::msgcat::mcset da {Zero} {Nul}
+::msgcat::mcset da {Zoom Fit}
+::msgcat::mcset da {Zoom In} {Zoom ind}
+::msgcat::mcset da {Zoom Out} {Zoom ud}
+::msgcat::mcset da {Zoom}
+::msgcat::mcset da {and}
+::msgcat::mcset da {blue}
+::msgcat::mcset da {b}
+::msgcat::mcset da {color}
+::msgcat::mcset da {cool}
+::msgcat::mcset da {green}
+::msgcat::mcset da {grey} [encoding convertfrom iso8859-1 {grå}]
+::msgcat::mcset da {g}
+::msgcat::mcset da {h5utils}
+::msgcat::mcset da {heat}
+::msgcat::mcset da {not}
+::msgcat::mcset da {only}
+::msgcat::mcset da {or center of data} {eller center for data}
+::msgcat::mcset da {rainbow} {regnbue}
+::msgcat::mcset da {red}
+::msgcat::mcset da {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom iso8859-1 {rækker af data er blevet hentet. Der kan være flere tilgængelige. Du bør måske ændre det maksimalt tilladte antal}]
+::msgcat::mcset da {r}
+::msgcat::mcset da {staircase} {trappe}
+::msgcat::mcset da {standard}
+::msgcat::mcset da {x}
+::msgcat::mcset da {}
diff --git a/ds9/msgs/de.msg b/ds9/msgs/de.msg
new file mode 100644
index 0000000..e8d8803
--- /dev/null
+++ b/ds9/msgs/de.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset de {2D}
+::msgcat::mcset de {3D}
+::msgcat::mcset de {A postscript generation error has occurred} {Beim Erstellen von Postscript ist ein Fehler aufgetreten}
+::msgcat::mcset de {AIP}
+::msgcat::mcset de {Abort}
+::msgcat::mcset de {About SAOImage DS9} [encoding convertfrom iso8859-1 {Über SAOImage DS9}]
+::msgcat::mcset de {About} [encoding convertfrom iso8859-1 {Über}]
+::msgcat::mcset de {Acknowledgment} {Danksagung}
+::msgcat::mcset de {Add} [encoding convertfrom iso8859-1 {Hinzufügen}]
+::msgcat::mcset de {Advanced} {Erweitert}
+::msgcat::mcset de {Aligned}
+::msgcat::mcset de {Align} {Ausrichten}
+::msgcat::mcset de {All Columns} {Alle spalten}
+::msgcat::mcset de {All Rows} {Alle zeilen}
+::msgcat::mcset de {All} {Alles}
+::msgcat::mcset de {Always save files during Backup}
+::msgcat::mcset de {Amplifier} [encoding convertfrom iso8859-1 {Verstärker}]
+::msgcat::mcset de {An error has occurred during backup}
+::msgcat::mcset de {An error has occurred during restore}
+::msgcat::mcset de {An error has occurred invoking the Analysis task} {Beim Aufrufen des Analysetasks ist ein Fehler aufgetreten}
+::msgcat::mcset de {An error has occurred while creating image.}
+::msgcat::mcset de {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset de {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset de {An error has occurred while printing} {Beim Drucken ist ein Fehler aufgetreten}
+::msgcat::mcset de {An error has occurred while reading image.}
+::msgcat::mcset de {An error has occurred while saving} {Beim Speichern ist ein Fehler aufgetreten}
+::msgcat::mcset de {An error has occurred while updating VO server list}
+::msgcat::mcset de {An error has occurred while writing image.}
+::msgcat::mcset de {An internal error has been detected}
+::msgcat::mcset de {Analysis Command Log} {Analysebefehlslog}
+::msgcat::mcset de {Analysis Commands}
+::msgcat::mcset de {Analysis File}
+::msgcat::mcset de {Analysis Log}
+::msgcat::mcset de {Analysis} {Analyse}
+::msgcat::mcset de {Angle Complement} {Komplementwinkel}
+::msgcat::mcset de {Angles} {Winkel}
+::msgcat::mcset de {Angle} {Winkel}
+::msgcat::mcset de {Annuli} {Kreisringe}
+::msgcat::mcset de {Annulus} {Kreisring}
+::msgcat::mcset de {Apply} {Anwenden}
+::msgcat::mcset de {ArcMin} {Bogenminute}
+::msgcat::mcset de {ArcSec} {Bogensekunde}
+::msgcat::mcset de {Architecture} {Architektur}
+::msgcat::mcset de {Archives}
+::msgcat::mcset de {Array}
+::msgcat::mcset de {Arrow} {Pfeil}
+::msgcat::mcset de {Astronomy}
+::msgcat::mcset de {At Startup}
+::msgcat::mcset de {At least 2 different catalogs are required}
+::msgcat::mcset de {Auto Centroid}
+::msgcat::mcset de {Auto Plot 2D}
+::msgcat::mcset de {Auto Plot 3D}
+::msgcat::mcset de {Auto Plot Statistics}
+::msgcat::mcset de {Auto Plot}
+::msgcat::mcset de {Autoload FITS Regions} {FITS-Regionen autom. laden}
+::msgcat::mcset de {Autoload}
+::msgcat::mcset de {Automatic} {Automatisch}
+::msgcat::mcset de {Average} {Mitteln}
+::msgcat::mcset de {Axes Number}
+::msgcat::mcset de {Axes Order}
+::msgcat::mcset de {Axes Title}
+::msgcat::mcset de {Axes} {Achsen}
+::msgcat::mcset de {Axis Length} [encoding convertfrom iso8859-1 {Achsenlänge}]
+::msgcat::mcset de {Axis Numbers} {Achsenziffern}
+::msgcat::mcset de {Axis Title}
+::msgcat::mcset de {Axis} {Achse}
+::msgcat::mcset de {Azimuth}
+::msgcat::mcset de {Background Color} {Hintergrundfarbe}
+::msgcat::mcset de {Background} {Hintergrund}
+::msgcat::mcset de {Backup}
+::msgcat::mcset de {Back} [encoding convertfrom iso8859-1 {Zurück}]
+::msgcat::mcset de {Bar Plot Tool}
+::msgcat::mcset de {Bias}
+::msgcat::mcset de {Bin 3rd Column} {Bin 3. Spalte}
+::msgcat::mcset de {Bin Center} {Bin Zentrum}
+::msgcat::mcset de {Bin Columns} {Bin Spalten}
+::msgcat::mcset de {Bin Filter}
+::msgcat::mcset de {Bin Fit}
+::msgcat::mcset de {Bin In}
+::msgcat::mcset de {Bin Out}
+::msgcat::mcset de {Binning Parameters} {Binparameter}
+::msgcat::mcset de {Bin}
+::msgcat::mcset de {Black} {Schwarz}
+::msgcat::mcset de {Blank/Inf/NaN Color} {Leer/Inf/Nan Farbe}
+::msgcat::mcset de {Blink Frames} {Blinkende rahmen}
+::msgcat::mcset de {Blink Interval} {Blinkinterval}
+::msgcat::mcset de {Blink} {Blinken}
+::msgcat::mcset de {Block Fit}
+::msgcat::mcset de {Block In} {Bin ein}
+::msgcat::mcset de {Block Out} {Bin aus}
+::msgcat::mcset de {Block Parameters}
+::msgcat::mcset de {Block} {Bin}
+::msgcat::mcset de {Blue} {Blau}
+::msgcat::mcset de {Bold} {Fett}
+::msgcat::mcset de {Border} {Begrenzung}
+::msgcat::mcset de {Bottom}
+::msgcat::mcset de {Box Annulus} {Viereck ring}
+::msgcat::mcset de {Box Panda} {Viereckiger panda}
+::msgcat::mcset de {BoxCircle}
+::msgcat::mcset de {Boxcar}
+::msgcat::mcset de {Box} {Viereck}
+::msgcat::mcset de {Broadcast}
+::msgcat::mcset de {Browser}
+::msgcat::mcset de {Browse} [encoding convertfrom iso8859-1 {Auswählen}]
+::msgcat::mcset de {Buffer} {Puffer}
+::msgcat::mcset de {Buttonbar}
+::msgcat::mcset de {Buttons} [encoding convertfrom iso8859-1 {Schaltflächen}]
+::msgcat::mcset de {Bytes}
+::msgcat::mcset de {CMYK}
+::msgcat::mcset de {Can Delete} {Kann löschen}
+::msgcat::mcset de {Can Edit} {Kann bearbeiten}
+::msgcat::mcset de {Can Move} {Kann bewegen}
+::msgcat::mcset de {Can Rotate} {Kann rotieren}
+::msgcat::mcset de {Cancelled}
+::msgcat::mcset de {Cancel} {Abbrechen}
+::msgcat::mcset de {Cap}
+::msgcat::mcset de {Catalog Server} {Katalogserver}
+::msgcat::mcset de {Catalog Tool} {Katalogwerkzeug}
+::msgcat::mcset de {Catalogs} {Kataloge}
+::msgcat::mcset de {Catalog} {Katalog}
+::msgcat::mcset de {Catrom}
+::msgcat::mcset de {Cat}
+::msgcat::mcset de {Center Image} {Bild zentrieren}
+::msgcat::mcset de {Center Non-modal Dialogs}
+::msgcat::mcset de {Center} {Mittelpunkt}
+::msgcat::mcset de {Centroid Parameters}
+::msgcat::mcset de {Centroid}
+::msgcat::mcset de {Circle} {Kreis}
+::msgcat::mcset de {Clear All} [encoding convertfrom iso8859-1 {Alle löschen}]
+::msgcat::mcset de {Clear Analysis Commands} [encoding convertfrom iso8859-1 {Analysebefehle löschen}]
+::msgcat::mcset de {Clear Cache} [encoding convertfrom iso8859-1 {Cache löschen}]
+::msgcat::mcset de {Clear Data} [encoding convertfrom iso8859-1 {Daten löschen}]
+::msgcat::mcset de {Clear External Analysis Commands?} [encoding convertfrom iso8859-1 {Externe Analysebefehle löschen?}]
+::msgcat::mcset de {Clear Filter} [encoding convertfrom iso8859-1 {Filter löschen}]
+::msgcat::mcset de {Clear Frame} {Rahmen freigeben}
+::msgcat::mcset de {Clear Preferences?} [encoding convertfrom iso8859-1 {Voreinstellungen löschen?}]
+::msgcat::mcset de {Clear Preferences} [encoding convertfrom iso8859-1 {Voreinstellungen löschen}]
+::msgcat::mcset de {Clear} [encoding convertfrom iso8859-1 {Löschen}]
+::msgcat::mcset de {Click to Center} {Klicken zum Zentrieren}
+::msgcat::mcset de {Close} [encoding convertfrom iso8859-1 {Schließen}]
+::msgcat::mcset de {Colorbar Size}
+::msgcat::mcset de {Colorbar} {Farbbalken}
+::msgcat::mcset de {Colormap Parameters} {Farbpalettenparameter}
+::msgcat::mcset de {Colormap}
+::msgcat::mcset de {Color} {Farbe}
+::msgcat::mcset de {Columns} {Spalten}
+::msgcat::mcset de {Column} {Spalte}
+::msgcat::mcset de {Command not allowed}
+::msgcat::mcset de {Command}
+::msgcat::mcset de {Compass} {Kompass}
+::msgcat::mcset de {Composite Region}
+::msgcat::mcset de {Composite}
+::msgcat::mcset de {Compression} {Kompression}
+::msgcat::mcset de {Configure} {Konfigurieren}
+::msgcat::mcset de {Connect Directly} {Direkt verbinden}
+::msgcat::mcset de {Connect SAMP}
+::msgcat::mcset de {Connect Using Web Proxy} [encoding convertfrom iso8859-1 {Für Verbindung Webproxy verwenden}]
+::msgcat::mcset de {Connect}
+::msgcat::mcset de {Console}
+::msgcat::mcset de {Contacting Image Server}
+::msgcat::mcset de {Contour Parameters} {Konturenparameter}
+::msgcat::mcset de {Contours} {Konturen}
+::msgcat::mcset de {Contour}
+::msgcat::mcset de {Contrast} {Kontrast}
+::msgcat::mcset de {Convert to Polygons} {Zu Polygonen konvertieren}
+::msgcat::mcset de {Coordinate Grid Parameters} {Koordinatennetzparameter}
+::msgcat::mcset de {Coordinate Grid} {Koordinatennetz}
+::msgcat::mcset de {Coordinate System} {Koordinatensystem}
+::msgcat::mcset de {Coordinates}
+::msgcat::mcset de {Coordinate} {Koordinaten}
+::msgcat::mcset de {Copy Contours} {Konturen kopieren}
+::msgcat::mcset de {Copy to Regions} {Zu Regionen kopieren}
+::msgcat::mcset de {Copy} {Kopieren}
+::msgcat::mcset de {Create Movie}
+::msgcat::mcset de {Create New Frame on Download} {Neuen rahmen bei Download}
+::msgcat::mcset de {Create}
+::msgcat::mcset de {Crop Parameters}
+::msgcat::mcset de {Crop}
+::msgcat::mcset de {Crosshair Parameters}
+::msgcat::mcset de {Crosshair To} {Fadenkreuz auf}
+::msgcat::mcset de {Crosshair} {Fadenkreuz}
+::msgcat::mcset de {Cross} {Kreuz}
+::msgcat::mcset de {Cubehelix}
+::msgcat::mcset de {Cube}
+::msgcat::mcset de {Cubic}
+::msgcat::mcset de {Current Frame} {Aktueller rahmen}
+::msgcat::mcset de {Current Range} {Aktueller bereich}
+::msgcat::mcset de {Current} {Aktuell}
+::msgcat::mcset de {Cursor} {Zeiger}
+::msgcat::mcset de {Cut} {Ausschneiden}
+::msgcat::mcset de {Cyan} {Zyan}
+::msgcat::mcset de {DPI}
+::msgcat::mcset de {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset de {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset de {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset de {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-1 {DS9 hat ein ältere Einstellungsdatei erkannt, möchten Sie aktualisieren?}]
+::msgcat::mcset de {DS9 will complete the initialization process} [encoding convertfrom iso8859-1 {DS9 wird den Initialisierungsprozeß vervollständigen}]
+::msgcat::mcset de {Dash} {Gestrichelt}
+::msgcat::mcset de {Data Format} {Datenformat}
+::msgcat::mcset de {Dataset Name}
+::msgcat::mcset de {Dataset} {Datensatz}
+::msgcat::mcset de {Data}
+::msgcat::mcset de {Decrease} {Absteigend}
+::msgcat::mcset de {Default All Files}
+::msgcat::mcset de {Default Format}
+::msgcat::mcset de {Default Length}
+::msgcat::mcset de {Default} {Standard}
+::msgcat::mcset de {Degrees} {Grad}
+::msgcat::mcset de {Delete All Frames?} [encoding convertfrom iso8859-1 {Alle rahmen löschen?}]
+::msgcat::mcset de {Delete All Frames} [encoding convertfrom iso8859-1 {Alle rahmen löschen}]
+::msgcat::mcset de {Delete All Groups?} [encoding convertfrom iso8859-1 {Alle Gruppen löschen?}]
+::msgcat::mcset de {Delete All Groups} [encoding convertfrom iso8859-1 {Alle Gruppen löschen}]
+::msgcat::mcset de {Delete All Regions?} [encoding convertfrom iso8859-1 {Alle Regionen löschen?}]
+::msgcat::mcset de {Delete All Regions} [encoding convertfrom iso8859-1 {Alle Regionen löschen}]
+::msgcat::mcset de {Delete All}
+::msgcat::mcset de {Delete Color Tags}
+::msgcat::mcset de {Delete Frame} [encoding convertfrom iso8859-1 {Rahmen löschen}]
+::msgcat::mcset de {Delete Group} [encoding convertfrom iso8859-1 {Gruppe löschen}]
+::msgcat::mcset de {Delete Selected Regions} [encoding convertfrom iso8859-1 {Ausgewählte Regionen löschen}]
+::msgcat::mcset de {Delete} [encoding convertfrom iso8859-1 {Löschen}]
+::msgcat::mcset de {Depth} {Tiefe}
+::msgcat::mcset de {Detector} {Detektor}
+::msgcat::mcset de {Dialog Box} {Dialogbox}
+::msgcat::mcset de {Diamond} {Raute}
+::msgcat::mcset de {Dimension}
+::msgcat::mcset de {Direction}
+::msgcat::mcset de {Disconnect}
+::msgcat::mcset de {Display Header}
+::msgcat::mcset de {Display Size} [encoding convertfrom iso8859-1 {Größe zeigen}]
+::msgcat::mcset de {Dissolve}
+::msgcat::mcset de {Distance}
+::msgcat::mcset de {Done}
+::msgcat::mcset de {Download Colormap}
+::msgcat::mcset de {Download VOTABLE format if available}
+::msgcat::mcset de {Drag to Center} {Ziehen zum zentrieren}
+::msgcat::mcset de {Duplicate Data}
+::msgcat::mcset de {East} {Osten}
+::msgcat::mcset de {Ecliptic} {Ekliptisch}
+::msgcat::mcset de {Edit Group Name} {Gruppenname bearbeiten}
+::msgcat::mcset de {Edit} {Bearbeiten}
+::msgcat::mcset de {Elevation}
+::msgcat::mcset de {Ellipse Annulus}
+::msgcat::mcset de {Ellipse Panda} {Ellipsen Panda}
+::msgcat::mcset de {Ellipse}
+::msgcat::mcset de {Elliptical Annulus} {Elliptischer Kreisring}
+::msgcat::mcset de {Elliptical Panda} {Elliptischer Panda}
+::msgcat::mcset de {Enable Confirmation Dialogs} [encoding convertfrom iso8859-1 {Bestätigungsdialoge einschalten}]
+::msgcat::mcset de {Enable}
+::msgcat::mcset de {End} {Ende}
+::msgcat::mcset de {Enter Color}
+::msgcat::mcset de {Enter Font Size}
+::msgcat::mcset de {Enter Group Name} {Gruppenname eingeben}
+::msgcat::mcset de {Enter Search Expression}
+::msgcat::mcset de {Enter URL}
+::msgcat::mcset de {Entry}
+::msgcat::mcset de {Equal Area} [encoding convertfrom iso8859-1 {Gleiche Fläche}]
+::msgcat::mcset de {Equal Distance} {Gleicher Abstand}
+::msgcat::mcset de {Equal Spacing}
+::msgcat::mcset de {Equal Value}
+::msgcat::mcset de {Error code was returned} [encoding convertfrom iso8859-1 {Fehlercode wurde zurückgegeben}]
+::msgcat::mcset de {Error} {Fehler}
+::msgcat::mcset de {Examine Frame} {Rahmen inspizieren}
+::msgcat::mcset de {Examine} {Inspizieren}
+::msgcat::mcset de {Exam}
+::msgcat::mcset de {Exclude} {Ausschliessen}
+::msgcat::mcset de {Exit} [encoding convertfrom iso8859-1 {Schließen}]
+::msgcat::mcset de {Export Array}
+::msgcat::mcset de {Export}
+::msgcat::mcset de {Extention}
+::msgcat::mcset de {Exterior Axes} [encoding convertfrom iso8859-1 {Äußere Achsen}]
+::msgcat::mcset de {Exterior Numerics} [encoding convertfrom iso8859-1 {Äußere Ziffern}]
+::msgcat::mcset de {FAQ}
+::msgcat::mcset de {FK4}
+::msgcat::mcset de {FK5}
+::msgcat::mcset de {Factor}
+::msgcat::mcset de {File not Found or Unable to load FITS data MIME type} [encoding convertfrom iso8859-1 {Datei nicht gefunden oder nicht möglich FITS-Daten MIME-Type zu laden}]
+::msgcat::mcset de {Filename} {Dateiname}
+::msgcat::mcset de {File} {Datei}
+::msgcat::mcset de {Fill}
+::msgcat::mcset de {Filter}
+::msgcat::mcset de {Find Next} [encoding convertfrom iso8859-1 {Nächsten finden}]
+::msgcat::mcset de {Find} {Suchen}
+::msgcat::mcset de {First Frame} {Erster rahmen}
+::msgcat::mcset de {First} {Erster}
+::msgcat::mcset de {Fits}
+::msgcat::mcset de {Fixed in Size} [encoding convertfrom iso8859-1 {Feste Größe}]
+::msgcat::mcset de {Flat}
+::msgcat::mcset de {Flip}
+::msgcat::mcset de {Font}
+::msgcat::mcset de {For more information, use --help}
+::msgcat::mcset de {Format}
+::msgcat::mcset de {Forward} [encoding convertfrom iso8859-1 {Vorwärts}]
+::msgcat::mcset de {Found} {Gefunden}
+::msgcat::mcset de {Frame Information} {Rahmeninformation}
+::msgcat::mcset de {Frame Parameters}
+::msgcat::mcset de {Frames}
+::msgcat::mcset de {Frame} {Rahmen}
+::msgcat::mcset de {From}
+::msgcat::mcset de {Front} {Vor}
+::msgcat::mcset de {Full Range} {Ganzer Bereich}
+::msgcat::mcset de {Function} {Funktion}
+::msgcat::mcset de {GUI Font}
+::msgcat::mcset de {Galactic} {Galaktisch}
+::msgcat::mcset de {Gap}
+::msgcat::mcset de {Gaussian} {Gauss}
+::msgcat::mcset de {General} {Allgemein}
+::msgcat::mcset de {Generate} {Herstellen}
+::msgcat::mcset de {Generating Regions} {Regionen erstellen}
+::msgcat::mcset de {Get Information} {Informationen}
+::msgcat::mcset de {Gist}
+::msgcat::mcset de {Global Properties}
+::msgcat::mcset de {Global}
+::msgcat::mcset de {Goto Frame}
+::msgcat::mcset de {Graph Horz}
+::msgcat::mcset de {Graph Vert}
+::msgcat::mcset de {Graphics} {Grafik}
+::msgcat::mcset de {Graphs}
+::msgcat::mcset de {Graph}
+::msgcat::mcset de {Grayscale} {Graustufen}
+::msgcat::mcset de {Green} [encoding convertfrom iso8859-1 {Grün}]
+::msgcat::mcset de {Grid Gap} {Gitterabstand}
+::msgcat::mcset de {Grid} {Gitter}
+::msgcat::mcset de {Groove}
+::msgcat::mcset de {Groups} {Gruppen}
+::msgcat::mcset de {HTTP}
+::msgcat::mcset de {Header} {Dateikopf}
+::msgcat::mcset de {Height} [encoding convertfrom iso8859-1 {Höhe}]
+::msgcat::mcset de {Help Desk} {Hilfestelle}
+::msgcat::mcset de {Help Me Choose} [encoding convertfrom iso8859-1 {Hilf mir auswählen}]
+::msgcat::mcset de {Help} {Hilfe}
+::msgcat::mcset de {Hide All} {Alle verstecken}
+::msgcat::mcset de {Highlite}
+::msgcat::mcset de {High} {Hoch}
+::msgcat::mcset de {Histogram Equalization} {Histogrammausgleich}
+::msgcat::mcset de {Histogram} {Histogramm}
+::msgcat::mcset de {Horizontal Graph} {Horizontaldarstellung}
+::msgcat::mcset de {Horizontal Layout} {Horizontales Layout}
+::msgcat::mcset de {Horizontal}
+::msgcat::mcset de {IAU Location Code}
+::msgcat::mcset de {ICRS}
+::msgcat::mcset de {Identification} {Kennzeichnung}
+::msgcat::mcset de {If} {Wenn}
+::msgcat::mcset de {Image Servers}
+::msgcat::mcset de {Image} {Bild}
+::msgcat::mcset de {Import Array}
+::msgcat::mcset de {Import}
+::msgcat::mcset de {Include} {Einschliessen}
+::msgcat::mcset de {Increase} {Aufsteigend}
+::msgcat::mcset de {Information Panel} {Informationsfeld}
+::msgcat::mcset de {Information} {Informations}
+::msgcat::mcset de {Initialize XPA} {XPA initialisieren}
+::msgcat::mcset de {Inner} {Innerer}
+::msgcat::mcset de {Instrument FOV} {Instrumentensichtfeld}
+::msgcat::mcset de {Interior Axes} {Innere Achsen}
+::msgcat::mcset de {Interior Numerics} {Innere Ziffern}
+::msgcat::mcset de {Internal Parse Error}
+::msgcat::mcset de {Interval} {Intervall}
+::msgcat::mcset de {Invalid Column Name}
+::msgcat::mcset de {Invalid formated multipart/mixed mime type message} [encoding convertfrom iso8859-1 {Ungültig formatierter multipart/mixed MIME-Type}]
+::msgcat::mcset de {Invert Colormap} {Farbpalette invertieren}
+::msgcat::mcset de {Invert Selection} {Auswahl umkehren}
+::msgcat::mcset de {Invert} {Invertieren}
+::msgcat::mcset de {Italic} {Kursiv}
+::msgcat::mcset de {Items Found}
+::msgcat::mcset de {Iteration}
+::msgcat::mcset de {JPEG Quality Factor} [encoding convertfrom iso8859-1 {JPEG Qualitätsfaktor}]
+::msgcat::mcset de {Keep-Alive}
+::msgcat::mcset de {Kernel}
+::msgcat::mcset de {Keyboard Shortcuts} {Tastatur-Shortcuts}
+::msgcat::mcset de {Keyboard} {Tastatur}
+::msgcat::mcset de {Keyword}
+::msgcat::mcset de {Labels} {Beschriftung}
+::msgcat::mcset de {Label}
+::msgcat::mcset de {Landscape} {Horizontal}
+::msgcat::mcset de {Language} {Sprache}
+::msgcat::mcset de {Last Frame} {Letzter rahmen}
+::msgcat::mcset de {Last} {Letzter}
+::msgcat::mcset de {Layout Horz}
+::msgcat::mcset de {Layout Vert}
+::msgcat::mcset de {Layout}
+::msgcat::mcset de {Left}
+::msgcat::mcset de {Legal}
+::msgcat::mcset de {Legend Title}
+::msgcat::mcset de {Legend}
+::msgcat::mcset de {Length} [encoding convertfrom iso8859-1 {Länge}]
+::msgcat::mcset de {Letter}
+::msgcat::mcset de {Levels} {Niveaus}
+::msgcat::mcset de {Level} {Niveau}
+::msgcat::mcset de {Limits} {Grenzen}
+::msgcat::mcset de {Line Plot Tool}
+::msgcat::mcset de {Linear}
+::msgcat::mcset de {Line} {Linie}
+::msgcat::mcset de {List Data}
+::msgcat::mcset de {List Regions} {Regionen auflisten}
+::msgcat::mcset de {List} {Auflisten}
+::msgcat::mcset de {Load Analysis Commands} {Analysebefehle laden}
+::msgcat::mcset de {Load Color Tags}
+::msgcat::mcset de {Load Colormap} {Farbpalette laden}
+::msgcat::mcset de {Load Configuration} {Konfiguration laden}
+::msgcat::mcset de {Load Contour Levels} {Kontourniveaus laden}
+::msgcat::mcset de {Load Contours} {Konturen laden}
+::msgcat::mcset de {Load Contrast/Bias} {Kontrast/Bias laden}
+::msgcat::mcset de {Load Data} {Daten laden}
+::msgcat::mcset de {Load Mosaic} {Mosaic laden}
+::msgcat::mcset de {Load Regions} {Regionen laden}
+::msgcat::mcset de {Load Template} {Vorlage laden}
+::msgcat::mcset de {Load into All Frames}
+::msgcat::mcset de {Load into Current Frame}
+::msgcat::mcset de {Loading Catalog}
+::msgcat::mcset de {Loading}
+::msgcat::mcset de {Load} {Laden}
+::msgcat::mcset de {Local} {Lokal}
+::msgcat::mcset de {Lock Axes}
+::msgcat::mcset de {Lock Bin}
+::msgcat::mcset de {Lock Color}
+::msgcat::mcset de {Lock Crop Amplifier}
+::msgcat::mcset de {Lock Crop Detector}
+::msgcat::mcset de {Lock Crop Image}
+::msgcat::mcset de {Lock Crop None}
+::msgcat::mcset de {Lock Crop Physical}
+::msgcat::mcset de {Lock Crop WCS}
+::msgcat::mcset de {Lock Crosshair Amplifier}
+::msgcat::mcset de {Lock Crosshair Detector}
+::msgcat::mcset de {Lock Crosshair Image}
+::msgcat::mcset de {Lock Crosshair None}
+::msgcat::mcset de {Lock Crosshair Physical}
+::msgcat::mcset de {Lock Crosshair WCS}
+::msgcat::mcset de {Lock Frame Amplifier}
+::msgcat::mcset de {Lock Frame Detector}
+::msgcat::mcset de {Lock Frame Image}
+::msgcat::mcset de {Lock Frame None}
+::msgcat::mcset de {Lock Frame Physical}
+::msgcat::mcset de {Lock Frame WCS}
+::msgcat::mcset de {Lock Limits}
+::msgcat::mcset de {Lock Scale}
+::msgcat::mcset de {Lock Slice Image}
+::msgcat::mcset de {Lock Slice None}
+::msgcat::mcset de {Lock Slice WCS}
+::msgcat::mcset de {Lock Smooth}
+::msgcat::mcset de {Lock} {Arretieren}
+::msgcat::mcset de {Log Exponent}
+::msgcat::mcset de {Log}
+::msgcat::mcset de {Low High} {Niedrig Hoch}
+::msgcat::mcset de {Lower Left Back}
+::msgcat::mcset de {Lower Left Front}
+::msgcat::mcset de {Lower Right Back}
+::msgcat::mcset de {Lower Right Front}
+::msgcat::mcset de {Low} {Niedrig}
+::msgcat::mcset de {MIP}
+::msgcat::mcset de {Magenta}
+::msgcat::mcset de {Magnification}
+::msgcat::mcset de {Magnifier} [encoding convertfrom iso8859-1 {Vergrößerungsglas}]
+::msgcat::mcset de {Major} [encoding convertfrom iso8859-1 {Groß}]
+::msgcat::mcset de {Manual} {Manuell}
+::msgcat::mcset de {Mask Parameters} {Maskenparameter}
+::msgcat::mcset de {Match Axes}
+::msgcat::mcset de {Match Bin}
+::msgcat::mcset de {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset de {Match Color}
+::msgcat::mcset de {Match Crop Amplifier}
+::msgcat::mcset de {Match Crop Detector}
+::msgcat::mcset de {Match Crop Image}
+::msgcat::mcset de {Match Crop Physical}
+::msgcat::mcset de {Match Crop WCS}
+::msgcat::mcset de {Match Crosshair Amplifier}
+::msgcat::mcset de {Match Crosshair Detector}
+::msgcat::mcset de {Match Crosshair Image}
+::msgcat::mcset de {Match Crosshair Physical}
+::msgcat::mcset de {Match Crosshair WCS}
+::msgcat::mcset de {Match Frame Amplifier}
+::msgcat::mcset de {Match Frame Detector}
+::msgcat::mcset de {Match Frame Image}
+::msgcat::mcset de {Match Frame Physical}
+::msgcat::mcset de {Match Frame WCS}
+::msgcat::mcset de {Match Limits}
+::msgcat::mcset de {Match Scale}
+::msgcat::mcset de {Match Slice Image}
+::msgcat::mcset de {Match Slice WCS}
+::msgcat::mcset de {Match Smooth}
+::msgcat::mcset de {Match}
+::msgcat::mcset de {Math Function} {Math. Funktion}
+::msgcat::mcset de {Matplotlib}
+::msgcat::mcset de {Max Rows} {Max. Reihen}
+::msgcat::mcset de {Maximum}
+::msgcat::mcset de {Max}
+::msgcat::mcset de {Menus and Buttons}
+::msgcat::mcset de {Menu}
+::msgcat::mcset de {Message Log}
+::msgcat::mcset de {Method} {Methode}
+::msgcat::mcset de {Min Max Parameters}
+::msgcat::mcset de {Min Max}
+::msgcat::mcset de {Minimum}
+::msgcat::mcset de {Minor} {Gering}
+::msgcat::mcset de {Minutes}
+::msgcat::mcset de {Min}
+::msgcat::mcset de {Mission}
+::msgcat::mcset de {Mode}
+::msgcat::mcset de {Mosaic IRAF Segment}
+::msgcat::mcset de {Mosaic IRAF}
+::msgcat::mcset de {Mosaic WCS Segment}
+::msgcat::mcset de {Mosaic WCS}
+::msgcat::mcset de {Mosaic WFPC2}
+::msgcat::mcset de {Mosaic}
+::msgcat::mcset de {Mouse Click Epsilon}
+::msgcat::mcset de {Mouse Wheel Bin}
+::msgcat::mcset de {Mouse Wheel Zoom}
+::msgcat::mcset de {Mouse and Keyboard}
+::msgcat::mcset de {Move Back}
+::msgcat::mcset de {Move First}
+::msgcat::mcset de {Move Forward}
+::msgcat::mcset de {Move Frame}
+::msgcat::mcset de {Move Last}
+::msgcat::mcset de {Move to Back} {Nach hinten}
+::msgcat::mcset de {Move to Front} {Nach vorne}
+::msgcat::mcset de {Movie}
+::msgcat::mcset de {Multiple Extension Cube}
+::msgcat::mcset de {Multiple Extension Frames}
+::msgcat::mcset de {Multiple WCS} {Mehrere WCS}
+::msgcat::mcset de {NRRD}
+::msgcat::mcset de {Name Resolution} {Namensbestimmung}
+::msgcat::mcset de {Name Server}
+::msgcat::mcset de {Name or Designation} {Name oder Bezeichnung}
+::msgcat::mcset de {Name}
+::msgcat::mcset de {Native Dialog} {Systemnativer Dialog}
+::msgcat::mcset de {New Features} {Neue Eigenschaften}
+::msgcat::mcset de {New Frame 3D}
+::msgcat::mcset de {New Frame RGB} {Neuer RGB rahmen}
+::msgcat::mcset de {New Frame each Time} {Neuer rahmen jedes Mal}
+::msgcat::mcset de {New Frame} {Neuer rahmen}
+::msgcat::mcset de {New Group} {Neue Gruppe}
+::msgcat::mcset de {New} {Neu}
+::msgcat::mcset de {Next Frame} [encoding convertfrom iso8859-1 {Nächster rahmen}]
+::msgcat::mcset de {Next} [encoding convertfrom iso8859-1 {Nächster}]
+::msgcat::mcset de {No Catalog specified} {Keine Katalog spezifiziert}
+::msgcat::mcset de {No Data Available}
+::msgcat::mcset de {No Items Found} {Keine Objekte gefunden}
+::msgcat::mcset de {No current frame}
+::msgcat::mcset de {Non-zero}
+::msgcat::mcset de {None} {Kein}
+::msgcat::mcset de {Normal}
+::msgcat::mcset de {North} {Norden}
+::msgcat::mcset de {Not Found}
+::msgcat::mcset de {Not Supported}
+::msgcat::mcset de {Number of Samples} {Anzahl der Stichproben}
+::msgcat::mcset de {Number of Threads}
+::msgcat::mcset de {Number of Ticks}
+::msgcat::mcset de {Number} {Zahl}
+::msgcat::mcset de {Numerics}
+::msgcat::mcset de {OK}
+::msgcat::mcset de {Object} {Objekt}
+::msgcat::mcset de {Open File} [encoding convertfrom iso8859-1 {Datei öffnen}]
+::msgcat::mcset de {Open TCL Console}
+::msgcat::mcset de {Open URL} [encoding convertfrom iso8859-1 {URL Öffnen}]
+::msgcat::mcset de {Open as}
+::msgcat::mcset de {Open} [encoding convertfrom iso8859-1 {Öffnen}]
+::msgcat::mcset de {Operator}
+::msgcat::mcset de {Orientation} {Orientierung}
+::msgcat::mcset de {Origin}
+::msgcat::mcset de {Oscillate}
+::msgcat::mcset de {Other Color}
+::msgcat::mcset de {Other Font Size}
+::msgcat::mcset de {Other} {Andere}
+::msgcat::mcset de {Outer} [encoding convertfrom iso8859-1 {Äußerer}]
+::msgcat::mcset de {Overlap}
+::msgcat::mcset de {PS Page Setup}
+::msgcat::mcset de {PS Print}
+::msgcat::mcset de {Page Setup} {Seitensetup}
+::msgcat::mcset de {Page Source} {Seitenquelle}
+::msgcat::mcset de {Pan To} {Ausrichten auf}
+::msgcat::mcset de {Pan Zoom Rotate Parameters} {Ausrichten zoomen rotieren}
+::msgcat::mcset de {Pan Zoom}
+::msgcat::mcset de {Pan then Zoom} {Ausrichten dann Zoomen}
+::msgcat::mcset de {Panda}
+::msgcat::mcset de {Panner} [encoding convertfrom iso8859-1 {Übersichtsfeld}]
+::msgcat::mcset de {Pan} {Ausrichtung}
+::msgcat::mcset de {Parameters} {Parameter}
+::msgcat::mcset de {Password} {Passwort}
+::msgcat::mcset de {Paste Contours} [encoding convertfrom iso8859-1 {Konturen einfügen}]
+::msgcat::mcset de {Paste} [encoding convertfrom iso8859-1 {Einfügen}]
+::msgcat::mcset de {Physical} {Physikalisch}
+::msgcat::mcset de {Pixel Distribution} {Pixelverteilung}
+::msgcat::mcset de {Pixel Size} [encoding convertfrom iso8859-1 {Pixelgröße}]
+::msgcat::mcset de {Pixel Table} {Pixeltabelle}
+::msgcat::mcset de {Pixels} {Pixel}
+::msgcat::mcset de {Play} {Abspielen}
+::msgcat::mcset de {Please Select a Region}
+::msgcat::mcset de {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset de {Please specify width, height, and either name or (ra,dec)} [encoding convertfrom iso8859-1 {Bitte Weite, Höhe und entweder Namen oder (RA,Dec) angeben}]
+::msgcat::mcset de {Plot 2D}
+::msgcat::mcset de {Plot 3D}
+::msgcat::mcset de {Plot Title} {Titel drucken}
+::msgcat::mcset de {Plotting Regions} {Regionen drucken}
+::msgcat::mcset de {Plot}
+::msgcat::mcset de {Plus}
+::msgcat::mcset de {Pointer} {Zeiger}
+::msgcat::mcset de {Points} {Punkte}
+::msgcat::mcset de {Point} {Punkt}
+::msgcat::mcset de {Polygon}
+::msgcat::mcset de {Portrait} {Vertikal}
+::msgcat::mcset de {Poster}
+::msgcat::mcset de {Postscript Page Setup}
+::msgcat::mcset de {Postscript Print}
+::msgcat::mcset de {Postscript}
+::msgcat::mcset de {Power} {Exp}
+::msgcat::mcset de {Preferences} {Einstellungen}
+::msgcat::mcset de {Preserve During Load} {Beim Laden beibehalten}
+::msgcat::mcset de {Previous Frame} {Vorheriger rahmen}
+::msgcat::mcset de {Previous} {Vorheriger}
+::msgcat::mcset de {Prev}
+::msgcat::mcset de {Print Coordinates} {Koordinaten drucken}
+::msgcat::mcset de {Print To} {Drucken}
+::msgcat::mcset de {Printer} {Drucker}
+::msgcat::mcset de {Print} {Drucken}
+::msgcat::mcset de {Projection} {Projektion}
+::msgcat::mcset de {Properties} {Eigenschaften}
+::msgcat::mcset de {Property} {Eigenschaften}
+::msgcat::mcset de {Proxy Host}
+::msgcat::mcset de {Proxy Port}
+::msgcat::mcset de {Publication} [encoding convertfrom iso8859-1 {Veröffentlichung}]
+::msgcat::mcset de {Quadratic} {Quadratisch}
+::msgcat::mcset de {RGB Array}
+::msgcat::mcset de {RGB Cube}
+::msgcat::mcset de {RGB Image}
+::msgcat::mcset de {RGB}
+::msgcat::mcset de {Radial Profile}
+::msgcat::mcset de {Radial}
+::msgcat::mcset de {Radius}
+::msgcat::mcset de {Raised}
+::msgcat::mcset de {Range}
+::msgcat::mcset de {Redo} {Wiederholen}
+::msgcat::mcset de {Red} {Rot}
+::msgcat::mcset de {Reference Manual} {Referenzhandbuch}
+::msgcat::mcset de {Reference} {Referenz}
+::msgcat::mcset de {Refresh Frame} {Rahmen erneuern}
+::msgcat::mcset de {Refresh}
+::msgcat::mcset de {Region Parameters}
+::msgcat::mcset de {Region}
+::msgcat::mcset de {Release Notes} {Versionshinweise}
+::msgcat::mcset de {Release} {Version}
+::msgcat::mcset de {Relief}
+::msgcat::mcset de {Reload} {Wieder laden}
+::msgcat::mcset de {Render}
+::msgcat::mcset de {Repeat}
+::msgcat::mcset de {Reset Colormap} [encoding convertfrom iso8859-1 {Farbpalette zurücksetzen}]
+::msgcat::mcset de {Reset Frame} [encoding convertfrom iso8859-1 {Rahmen zurücksetzen}]
+::msgcat::mcset de {Reset}
+::msgcat::mcset de {Restore}
+::msgcat::mcset de {Retrieve} {Suchen}
+::msgcat::mcset de {Return}
+::msgcat::mcset de {Right}
+::msgcat::mcset de {Roman}
+::msgcat::mcset de {Rotate} {Rotieren}
+::msgcat::mcset de {Rows} {Reihen}
+::msgcat::mcset de {Row}
+::msgcat::mcset de {Ruler} {Lineal}
+::msgcat::mcset de {SAMP Image}
+::msgcat::mcset de {SAMP Table}
+::msgcat::mcset de {SAMP: already connected}
+::msgcat::mcset de {SAMP: internal error}
+::msgcat::mcset de {SAMP: not connected}
+::msgcat::mcset de {SAMP: unable to locate HUB}
+::msgcat::mcset de {SAMP}
+::msgcat::mcset de {Sample Increment}
+::msgcat::mcset de {Sample Parameters}
+::msgcat::mcset de {Samples per Line} {Stichproben pro Linie}
+::msgcat::mcset de {Sample}
+::msgcat::mcset de {Save 3D Movie}
+::msgcat::mcset de {Save Color Tags}
+::msgcat::mcset de {Save Colormap} {Farbpalette speichern}
+::msgcat::mcset de {Save Configuration} {Konfiguration speichern}
+::msgcat::mcset de {Save Contour Levels} {Konturniveaus speichern}
+::msgcat::mcset de {Save Contours} {Konturen speichern}
+::msgcat::mcset de {Save Contrast/Bias} {Kontrast/Bias speichern}
+::msgcat::mcset de {Save Data} {Daten speichern}
+::msgcat::mcset de {Save Image on Download}
+::msgcat::mcset de {Save Image} {Bild speichern}
+::msgcat::mcset de {Save Regions} {Regionen speichern}
+::msgcat::mcset de {Save Template} {Vorlage speichern}
+::msgcat::mcset de {Save as}
+::msgcat::mcset de {Save} {Speichern}
+::msgcat::mcset de {Scale Parameters} {Skalierungsparameter}
+::msgcat::mcset de {Scale and Limits}
+::msgcat::mcset de {Scale} {Skalierung}
+::msgcat::mcset de {Scan} {Abtastung}
+::msgcat::mcset de {Scatter Plot Tool}
+::msgcat::mcset de {Scope} {Anwendungsbereich}
+::msgcat::mcset de {Search for Catalogs} {Nach Katalogen suchen}
+::msgcat::mcset de {Searching for catalogs} {Suche nach Katalogen}
+::msgcat::mcset de {Seconds} {Sekunden}
+::msgcat::mcset de {Segment}
+::msgcat::mcset de {Select All} [encoding convertfrom iso8859-1 {Alle auswählen}]
+::msgcat::mcset de {Select Coordinate System } [encoding convertfrom iso8859-1 {Koordinatensystem auswählen}]
+::msgcat::mcset de {Select None} [encoding convertfrom iso8859-1 {Nichts auswählen}]
+::msgcat::mcset de {Select}
+::msgcat::mcset de {Send}
+::msgcat::mcset de {Server}
+::msgcat::mcset de {Sexagesimal}
+::msgcat::mcset de {Shape} {Form}
+::msgcat::mcset de {Show All} {Alle zeigen}
+::msgcat::mcset de {Show Command}
+::msgcat::mcset de {Show Compass}
+::msgcat::mcset de {Show Text}
+::msgcat::mcset de {Show/Hide Frames} {Rahmen zeigen/verstecken}
+::msgcat::mcset de {Show}
+::msgcat::mcset de {Simple Cross}
+::msgcat::mcset de {Simple Plus}
+::msgcat::mcset de {Single Frame} {Einzelner rahmen}
+::msgcat::mcset de {Single} {Einzeln}
+::msgcat::mcset de {Sites}
+::msgcat::mcset de {Size/Radius} [encoding convertfrom iso8859-1 {Größe/Radius}]
+::msgcat::mcset de {Size} [encoding convertfrom iso8859-1 {Größe}]
+::msgcat::mcset de {Skip First} [encoding convertfrom iso8859-1 {Erste überspringen}]
+::msgcat::mcset de {Slice}
+::msgcat::mcset de {Smooth Parameters} [encoding convertfrom iso8859-1 {Glättungsparameter}]
+::msgcat::mcset de {Smoothness}
+::msgcat::mcset de {Smooth} [encoding convertfrom iso8859-1 {Glätten}]
+::msgcat::mcset de {Solid}
+::msgcat::mcset de {Sorry, DS9 does not support} [encoding convertfrom iso8859-1 {Sorry, DS9 unterstützt nicht}]
+::msgcat::mcset de {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset de {Sort} {Sortieren}
+::msgcat::mcset de {Source TCL}
+::msgcat::mcset de {Source} {Quelle}
+::msgcat::mcset de {Space Equal Distance}
+::msgcat::mcset de {Space Equal Value}
+::msgcat::mcset de {Spacing} {Intervall}
+::msgcat::mcset de {Sqrt}
+::msgcat::mcset de {Square Root} {Wurzel}
+::msgcat::mcset de {Squared} {Quadratisch}
+::msgcat::mcset de {Square}
+::msgcat::mcset de {Stacked}
+::msgcat::mcset de {Starbase}
+::msgcat::mcset de {Startup}
+::msgcat::mcset de {Start}
+::msgcat::mcset de {Statistics}
+::msgcat::mcset de {Stats}
+::msgcat::mcset de {Status}
+::msgcat::mcset de {Step} {Stufe}
+::msgcat::mcset de {Stop}
+::msgcat::mcset de {Story of SAOImage DS9}
+::msgcat::mcset de {Story}
+::msgcat::mcset de {Sum} {Summieren}
+::msgcat::mcset de {Sunken}
+::msgcat::mcset de {Symbol Editor}
+::msgcat::mcset de {Symbol}
+::msgcat::mcset de {Tab-Separated-Value}
+::msgcat::mcset de {Table}
+::msgcat::mcset de {Tabloid}
+::msgcat::mcset de {Tag Color}
+::msgcat::mcset de {Task}
+::msgcat::mcset de {Template}
+::msgcat::mcset de {Text Font}
+::msgcat::mcset de {Text}
+::msgcat::mcset de {Then} {dann}
+::msgcat::mcset de {Thickness} {Dicke}
+::msgcat::mcset de {This analysis task is already running. Do you wish to kill it?} [encoding convertfrom iso8859-1 {Diese Analyse läuft bereits. Soll sie beendet werden?}]
+::msgcat::mcset de {This function is not available.}
+::msgcat::mcset de {This function is not currently supported for this port.}
+::msgcat::mcset de {Tickmarks} {Achsenstriche}
+::msgcat::mcset de {Tile Frames} {Gekachelte rahmen}
+::msgcat::mcset de {Tile Parameters}
+::msgcat::mcset de {Tile} {Kacheln}
+::msgcat::mcset de {Times}
+::msgcat::mcset de {Title} {Titel}
+::msgcat::mcset de {Tophat}
+::msgcat::mcset de {Topographic}
+::msgcat::mcset de {Top}
+::msgcat::mcset de {To} {Nach}
+::msgcat::mcset de {Transparency}
+::msgcat::mcset de {Triangle}
+::msgcat::mcset de {Type} {Typ}
+::msgcat::mcset de {URL}
+::msgcat::mcset de {Unable to connect directly: using Web Proxy}
+::msgcat::mcset de {Unable to determine date of observation}
+::msgcat::mcset de {Unable to determine time of observation}
+::msgcat::mcset de {Unable to evaluate filter} [encoding convertfrom iso8859-1 {Nicht möglich Filter zu evaluieren}]
+::msgcat::mcset de {Unable to find SIAP window}
+::msgcat::mcset de {Unable to find URL column}
+::msgcat::mcset de {Unable to find catalog window} [encoding convertfrom iso8859-1 {Nicht möglich Katalogfenster zu finden}]
+::msgcat::mcset de {Unable to find plot window} [encoding convertfrom iso8859-1 {Nicht möglich Plotfenster zu finden}]
+::msgcat::mcset de {Unable to load RGB image into a non-rgb frame} [encoding convertfrom iso8859-1 {Nicht möglich RGB-Bild in nicht-RGB-rahmen zu laden}]
+::msgcat::mcset de {Unable to load region file}
+::msgcat::mcset de {Unable to load} [encoding convertfrom iso8859-1 {Nicht möglich zu laden}]
+::msgcat::mcset de {Unable to locate URL} [encoding convertfrom iso8859-1 {Nicht möglich URL zu finden}]
+::msgcat::mcset de {Unable to match target with XPA Mime request}
+::msgcat::mcset de {Unable to open file} [encoding convertfrom iso8859-1 {Nicht möglich Datei zu öffnen}]
+::msgcat::mcset de {Unable to process Analysis file}
+::msgcat::mcset de {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset de {Undo} [encoding convertfrom iso8859-1 {Rückgängig}]
+::msgcat::mcset de {Unique}
+::msgcat::mcset de {Unists}
+::msgcat::mcset de {Units} {Einheiten}
+::msgcat::mcset de {Unknown Colormap}
+::msgcat::mcset de {Unknown command}
+::msgcat::mcset de {Update Filter}
+::msgcat::mcset de {Update Group} {Gruppe aktualisieren}
+::msgcat::mcset de {Update from Current Crosshair} {Vom aktuellen Fadenkreuz aktualisieren}
+::msgcat::mcset de {Update from Current Frame} {Vom aktuellen rahmen aktualisieren}
+::msgcat::mcset de {Update} {Aktualisieren}
+::msgcat::mcset de {Upper Left Back}
+::msgcat::mcset de {Upper Left Front}
+::msgcat::mcset de {Upper Right Back}
+::msgcat::mcset de {Upper Right Front}
+::msgcat::mcset de {Use Authentication} {Authentifizierung verwenden}
+::msgcat::mcset de {Use Current Frame on Download} {Aktuellen rahmen bei Download verwenden}
+::msgcat::mcset de {Use Internal Web Browser} {Internen Webbrowser verwenden}
+::msgcat::mcset de {Use Proxy} {Proxy verwenden}
+::msgcat::mcset de {User Manual}
+::msgcat::mcset de {Username} {Login}
+::msgcat::mcset de {User} {Benutzer}
+::msgcat::mcset de {Use} {Benutze}
+::msgcat::mcset de {VO Server}
+::msgcat::mcset de {VO}
+::msgcat::mcset de {Value} {Wert}
+::msgcat::mcset de {Vector} {Vektor}
+::msgcat::mcset de {Vertical Graph} {Vertikaldarstellung}
+::msgcat::mcset de {Vertical Layout} {Vertikales layout}
+::msgcat::mcset de {Vertical Text} {Vertikaler text}
+::msgcat::mcset de {Vertical}
+::msgcat::mcset de {View} {Ansicht}
+::msgcat::mcset de {Virtual Observatory}
+::msgcat::mcset de {WCS Parameters}
+::msgcat::mcset de {WCS}
+::msgcat::mcset de {Wavelength} [encoding convertfrom iso8859-1 {Wellenlänge}]
+::msgcat::mcset de {Web Browser} {Webbrowser}
+::msgcat::mcset de {White} [encoding convertfrom iso8859-1 {Weiß}]
+::msgcat::mcset de {Width} {Breite}
+::msgcat::mcset de {Window}
+::msgcat::mcset de {Words matching title, description} {Worte im Titel, Bezeichnung}
+::msgcat::mcset de {X Axis Title}
+::msgcat::mcset de {X Grid}
+::msgcat::mcset de {XPA Information}
+::msgcat::mcset de {XPA not initialized} {XPA nicht initialisiert}
+::msgcat::mcset de {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset de {XPA}
+::msgcat::mcset de {X}
+::msgcat::mcset de {Y Axis Title}
+::msgcat::mcset de {Y Grid}
+::msgcat::mcset de {Yellow} {Gelb}
+::msgcat::mcset de {Y}
+::msgcat::mcset de {Z Axis Scale}
+::msgcat::mcset de {ZScale Parameters}
+::msgcat::mcset de {Zero}
+::msgcat::mcset de {Zoom Fit}
+::msgcat::mcset de {Zoom In} {Hineinzoomen}
+::msgcat::mcset de {Zoom Out} {Herauszoomen}
+::msgcat::mcset de {Zoom}
+::msgcat::mcset de {and}
+::msgcat::mcset de {blue}
+::msgcat::mcset de {b}
+::msgcat::mcset de {color}
+::msgcat::mcset de {cool}
+::msgcat::mcset de {green}
+::msgcat::mcset de {grey}
+::msgcat::mcset de {g}
+::msgcat::mcset de {h5utils}
+::msgcat::mcset de {heat}
+::msgcat::mcset de {not}
+::msgcat::mcset de {only}
+::msgcat::mcset de {or center of data} {oder Zentrum der Daten}
+::msgcat::mcset de {rainbow}
+::msgcat::mcset de {red}
+::msgcat::mcset de {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom iso8859-1 {Datenreihen wurden heruntergeladen. Mehr sind vielleicht verfügbar. Sie können die maximale Anzahl anpassen.}]
+::msgcat::mcset de {r}
+::msgcat::mcset de {staircase}
+::msgcat::mcset de {standard}
+::msgcat::mcset de {x}
+::msgcat::mcset de {}
diff --git a/ds9/msgs/es.msg b/ds9/msgs/es.msg
new file mode 100644
index 0000000..d9fd8b7
--- /dev/null
+++ b/ds9/msgs/es.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset es {2D}
+::msgcat::mcset es {3D}
+::msgcat::mcset es {A postscript generation error has occurred} [encoding convertfrom iso8859-1 {Un error ha ocurrido en la generación del fichero postscript}]
+::msgcat::mcset es {AIP}
+::msgcat::mcset es {Abort}
+::msgcat::mcset es {About SAOImage DS9} {Acerca de SAOImage DS9}
+::msgcat::mcset es {About} {Acerca de}
+::msgcat::mcset es {Acknowledgment} {Reconocimientos}
+::msgcat::mcset es {Add} {Agregar}
+::msgcat::mcset es {Advanced} {Avanzado}
+::msgcat::mcset es {Aligned}
+::msgcat::mcset es {Align} {Alinear}
+::msgcat::mcset es {All Columns} {Todas las columnas}
+::msgcat::mcset es {All Rows} {Todas las filas}
+::msgcat::mcset es {All} {Todas}
+::msgcat::mcset es {Always save files during Backup}
+::msgcat::mcset es {Amplifier} {Amplificador}
+::msgcat::mcset es {An error has occurred during backup}
+::msgcat::mcset es {An error has occurred during restore}
+::msgcat::mcset es {An error has occurred invoking the Analysis task} [encoding convertfrom iso8859-1 {Un error ha ocurrido mientras se invocaba la tarea de análisis}]
+::msgcat::mcset es {An error has occurred while creating image.}
+::msgcat::mcset es {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset es {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset es {An error has occurred while printing} {Un error ha ocurrido al imprimir}
+::msgcat::mcset es {An error has occurred while reading image.}
+::msgcat::mcset es {An error has occurred while saving} {Un error ha ocurrido al guardar}
+::msgcat::mcset es {An error has occurred while updating VO server list}
+::msgcat::mcset es {An error has occurred while writing image.}
+::msgcat::mcset es {An internal error has been detected}
+::msgcat::mcset es {Analysis Command Log} [encoding convertfrom iso8859-1 {Log de instrucciones de análisis}]
+::msgcat::mcset es {Analysis Commands} [encoding convertfrom iso8859-1 {Comandos de análisis}]
+::msgcat::mcset es {Analysis File}
+::msgcat::mcset es {Analysis Log}
+::msgcat::mcset es {Analysis} [encoding convertfrom iso8859-1 {Análisis}]
+::msgcat::mcset es {Angle Complement} [encoding convertfrom iso8859-1 {Ángulo complementario}]
+::msgcat::mcset es {Angles} [encoding convertfrom iso8859-1 {Ángulos}]
+::msgcat::mcset es {Angle} [encoding convertfrom iso8859-1 {Ángulo}]
+::msgcat::mcset es {Annuli} [encoding convertfrom iso8859-1 {Ánulos}]
+::msgcat::mcset es {Annulus} {Corona}
+::msgcat::mcset es {Apply} {Aplicar}
+::msgcat::mcset es {ArcMin} {MinArc}
+::msgcat::mcset es {ArcSec} {SegArc}
+::msgcat::mcset es {Architecture} {Arquitectura}
+::msgcat::mcset es {Archives}
+::msgcat::mcset es {Array}
+::msgcat::mcset es {Arrow} {Flecha}
+::msgcat::mcset es {Astronomy}
+::msgcat::mcset es {At Startup}
+::msgcat::mcset es {At least 2 different catalogs are required}
+::msgcat::mcset es {Auto Centroid} {Auto Centroide}
+::msgcat::mcset es {Auto Plot 2D}
+::msgcat::mcset es {Auto Plot 3D}
+::msgcat::mcset es {Auto Plot Statistics}
+::msgcat::mcset es {Auto Plot}
+::msgcat::mcset es {Autoload FITS Regions} {Autocargar regiones FITS}
+::msgcat::mcset es {Autoload}
+::msgcat::mcset es {Automatic} [encoding convertfrom iso8859-1 {Automático}]
+::msgcat::mcset es {Average} {Promedio}
+::msgcat::mcset es {Axes Number}
+::msgcat::mcset es {Axes Order}
+::msgcat::mcset es {Axes Title}
+::msgcat::mcset es {Axes} {Ejes}
+::msgcat::mcset es {Axis Length} {Longitud del eje}
+::msgcat::mcset es {Axis Numbers} [encoding convertfrom iso8859-1 {Números de los ejes}]
+::msgcat::mcset es {Axis Title}
+::msgcat::mcset es {Axis} {Eje}
+::msgcat::mcset es {Azimuth}
+::msgcat::mcset es {Background Color} {Color de fondo}
+::msgcat::mcset es {Background} {Fondo}
+::msgcat::mcset es {Backup}
+::msgcat::mcset es {Back} [encoding convertfrom iso8859-1 {Para atrás}]
+::msgcat::mcset es {Bar Plot Tool}
+::msgcat::mcset es {Bias}
+::msgcat::mcset es {Bin 3rd Column} {Bin tercera columna}
+::msgcat::mcset es {Bin Center} {Centro del bin}
+::msgcat::mcset es {Bin Columns} {Columnas del bin}
+::msgcat::mcset es {Bin Filter} {Filtro del bin}
+::msgcat::mcset es {Bin Fit}
+::msgcat::mcset es {Bin In}
+::msgcat::mcset es {Bin Out}
+::msgcat::mcset es {Binning Parameters} [encoding convertfrom iso8859-1 {Parámetros de resolución}]
+::msgcat::mcset es {Bin}
+::msgcat::mcset es {Black} {Negro}
+::msgcat::mcset es {Blank/Inf/NaN Color} {Color en blanco/Inf/NaN}
+::msgcat::mcset es {Blink Frames} {Parpadear Marcos}
+::msgcat::mcset es {Blink Interval} {Intervalo de parpadeo}
+::msgcat::mcset es {Blink} {Parpadear}
+::msgcat::mcset es {Block Fit}
+::msgcat::mcset es {Block In} {Bin a}
+::msgcat::mcset es {Block Out} {Bin de}
+::msgcat::mcset es {Block Parameters}
+::msgcat::mcset es {Block} {Bin}
+::msgcat::mcset es {Blue} {Azul}
+::msgcat::mcset es {Bold} {Negrilla}
+::msgcat::mcset es {Border} {Borde}
+::msgcat::mcset es {Bottom}
+::msgcat::mcset es {Box Annulus} {Caja con caja inscrita}
+::msgcat::mcset es {Box Panda} {Caja con caja inscrita segmetada}
+::msgcat::mcset es {BoxCircle}
+::msgcat::mcset es {Boxcar}
+::msgcat::mcset es {Box} {Casilla}
+::msgcat::mcset es {Broadcast}
+::msgcat::mcset es {Browser}
+::msgcat::mcset es {Browse}
+::msgcat::mcset es {Buffer}
+::msgcat::mcset es {Buttonbar}
+::msgcat::mcset es {Buttons} {Teclas}
+::msgcat::mcset es {Bytes}
+::msgcat::mcset es {CMYK}
+::msgcat::mcset es {Can Delete} {Puede suprimir}
+::msgcat::mcset es {Can Edit} {Puede editar}
+::msgcat::mcset es {Can Move} {Puede mover}
+::msgcat::mcset es {Can Rotate} {Puede rotar}
+::msgcat::mcset es {Cancelled}
+::msgcat::mcset es {Cancel} {Cancelar}
+::msgcat::mcset es {Cap}
+::msgcat::mcset es {Catalog Server} [encoding convertfrom iso8859-1 {Servidor de catálogo}]
+::msgcat::mcset es {Catalog Tool} [encoding convertfrom iso8859-1 {Herramienta de catálogo}]
+::msgcat::mcset es {Catalogs} [encoding convertfrom iso8859-1 {Catálogos}]
+::msgcat::mcset es {Catalog} [encoding convertfrom iso8859-1 {Catálogo}]
+::msgcat::mcset es {Catrom}
+::msgcat::mcset es {Cat}
+::msgcat::mcset es {Center Image} {Centrar imagen}
+::msgcat::mcset es {Center Non-modal Dialogs}
+::msgcat::mcset es {Center} {Centrar}
+::msgcat::mcset es {Centroid Parameters} [encoding convertfrom iso8859-1 {Párametros del centroide}]
+::msgcat::mcset es {Centroid} {Centroide}
+::msgcat::mcset es {Circle} [encoding convertfrom iso8859-1 {Círculo}]
+::msgcat::mcset es {Clear All} {Despejar todos}
+::msgcat::mcset es {Clear Analysis Commands} {Borrar las instrucciones de análisis}
+::msgcat::mcset es {Clear Cache} {Limpiar cache}
+::msgcat::mcset es {Clear Data} {Limpiar de datos}
+::msgcat::mcset es {Clear External Analysis Commands?} [encoding convertfrom iso8859-1 {¿Borrar las instrucciones externas de análisis?}]
+::msgcat::mcset es {Clear Filter} {Borrar filtro}
+::msgcat::mcset es {Clear Frame} {Despejar marco}
+::msgcat::mcset es {Clear Preferences?} [encoding convertfrom iso8859-1 {¿Limpiar las preferencias?}]
+::msgcat::mcset es {Clear Preferences} {Limpiar las preferencias}
+::msgcat::mcset es {Clear} {Vaciar}
+::msgcat::mcset es {Click to Center} {Clic para centrar}
+::msgcat::mcset es {Close} {Cerrar}
+::msgcat::mcset es {Colorbar Size}
+::msgcat::mcset es {Colorbar} {Barra de colores}
+::msgcat::mcset es {Colormap Parameters} [encoding convertfrom iso8859-1 {Parámetros del mapa de colores}]
+::msgcat::mcset es {Colormap} {Mapa de colores}
+::msgcat::mcset es {Color}
+::msgcat::mcset es {Columns} {Columnas}
+::msgcat::mcset es {Column} {Columna}
+::msgcat::mcset es {Command not allowed}
+::msgcat::mcset es {Command}
+::msgcat::mcset es {Compass} [encoding convertfrom iso8859-1 {Compás}]
+::msgcat::mcset es {Composite Region}
+::msgcat::mcset es {Composite} {Compuesto}
+::msgcat::mcset es {Compression} [encoding convertfrom iso8859-1 {Compresión}]
+::msgcat::mcset es {Configure} {Configurar}
+::msgcat::mcset es {Connect Directly} {Conecta directamente}
+::msgcat::mcset es {Connect SAMP}
+::msgcat::mcset es {Connect Using Web Proxy} {Conecta, usa Web Proxy}
+::msgcat::mcset es {Connect}
+::msgcat::mcset es {Console}
+::msgcat::mcset es {Contacting Image Server}
+::msgcat::mcset es {Contour Parameters} [encoding convertfrom iso8859-1 {Parámetros de contorno}]
+::msgcat::mcset es {Contours} {Contornos}
+::msgcat::mcset es {Contour}
+::msgcat::mcset es {Contrast} {Contraste}
+::msgcat::mcset es {Convert to Polygons} [encoding convertfrom iso8859-1 {Convertir a polígonos}]
+::msgcat::mcset es {Coordinate Grid Parameters} [encoding convertfrom iso8859-1 {Parámetros de la cuadrícula de coordenadas}]
+::msgcat::mcset es {Coordinate Grid} [encoding convertfrom iso8859-1 {Cuadrícula de coordenadas}]
+::msgcat::mcset es {Coordinate System} {Sistema de coordenadas}
+::msgcat::mcset es {Coordinates} {Coordenadas}
+::msgcat::mcset es {Coordinate} {Coordenada}
+::msgcat::mcset es {Copy Contours} {Copiar contornos}
+::msgcat::mcset es {Copy to Regions} {Copiar a regiones}
+::msgcat::mcset es {Copy} {Copiar}
+::msgcat::mcset es {Create Movie}
+::msgcat::mcset es {Create New Frame on Download} {Crear un nuevo marco al transferir}
+::msgcat::mcset es {Create}
+::msgcat::mcset es {Crop Parameters}
+::msgcat::mcset es {Crop}
+::msgcat::mcset es {Crosshair Parameters}
+::msgcat::mcset es {Crosshair To} {Localizar con punto de mira}
+::msgcat::mcset es {Crosshair} {Punto de mira}
+::msgcat::mcset es {Cross} {Cruz}
+::msgcat::mcset es {Cubehelix}
+::msgcat::mcset es {Cube}
+::msgcat::mcset es {Cubic}
+::msgcat::mcset es {Current Frame} {Marco actual}
+::msgcat::mcset es {Current Range} {Rango actual}
+::msgcat::mcset es {Current} {Actual}
+::msgcat::mcset es {Cursor}
+::msgcat::mcset es {Cut} {Corte}
+::msgcat::mcset es {Cyan} {Cian}
+::msgcat::mcset es {DPI}
+::msgcat::mcset es {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset es {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset es {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset es {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-1 {DS9 ha detectado un fichero de preferencias más antiguo, ¿Desea actualizarlo?}]
+::msgcat::mcset es {DS9 will complete the initialization process} [encoding convertfrom iso8859-1 {DS9 completará el proceso de inicialización}]
+::msgcat::mcset es {Dash} [encoding convertfrom iso8859-1 {Guión}]
+::msgcat::mcset es {Data Format} {Formato de los datos}
+::msgcat::mcset es {Dataset Name}
+::msgcat::mcset es {Dataset} {Conjunto de datos}
+::msgcat::mcset es {Data}
+::msgcat::mcset es {Decrease} [encoding convertfrom iso8859-1 {Disminución}]
+::msgcat::mcset es {Default All Files}
+::msgcat::mcset es {Default Format}
+::msgcat::mcset es {Default Length}
+::msgcat::mcset es {Default} {Por defecto}
+::msgcat::mcset es {Degrees} {Grados}
+::msgcat::mcset es {Delete All Frames?} [encoding convertfrom iso8859-1 {¿Borrar todos los marcos?}]
+::msgcat::mcset es {Delete All Frames} {Borrar todos los marcos}
+::msgcat::mcset es {Delete All Groups?} [encoding convertfrom iso8859-1 {¿Borrar todos los grupos?}]
+::msgcat::mcset es {Delete All Groups} {Borrar todos los grupos}
+::msgcat::mcset es {Delete All Regions?} [encoding convertfrom iso8859-1 {¿Borrar todas las regiones?}]
+::msgcat::mcset es {Delete All Regions} {Borrar todas las regiones}
+::msgcat::mcset es {Delete All}
+::msgcat::mcset es {Delete Color Tags}
+::msgcat::mcset es {Delete Frame} {Borrar marco}
+::msgcat::mcset es {Delete Group} {Borrar grupo}
+::msgcat::mcset es {Delete Selected Regions} {Borrar regiones seleccionadas}
+::msgcat::mcset es {Delete} {Borrar}
+::msgcat::mcset es {Depth} {Profundidad}
+::msgcat::mcset es {Detector}
+::msgcat::mcset es {Dialog Box} [encoding convertfrom iso8859-1 {Caja de diálogo}]
+::msgcat::mcset es {Diamond} {Diamante}
+::msgcat::mcset es {Dimension} [encoding convertfrom iso8859-1 {Dimensión}]
+::msgcat::mcset es {Direction}
+::msgcat::mcset es {Disconnect}
+::msgcat::mcset es {Display Header}
+::msgcat::mcset es {Display Size} [encoding convertfrom iso8859-1 {Mostrar el tamaño}]
+::msgcat::mcset es {Dissolve} {Disolver}
+::msgcat::mcset es {Distance}
+::msgcat::mcset es {Done}
+::msgcat::mcset es {Download Colormap}
+::msgcat::mcset es {Download VOTABLE format if available}
+::msgcat::mcset es {Drag to Center} {Arrastrar para centrar}
+::msgcat::mcset es {Duplicate Data}
+::msgcat::mcset es {East} {Este}
+::msgcat::mcset es {Ecliptic} [encoding convertfrom iso8859-1 {Eclíptica}]
+::msgcat::mcset es {Edit Group Name} {Editar el nombre del grupo}
+::msgcat::mcset es {Edit} {Editar}
+::msgcat::mcset es {Elevation} [encoding convertfrom iso8859-1 {Elevación}]
+::msgcat::mcset es {Ellipse Annulus}
+::msgcat::mcset es {Ellipse Panda} {Elipse con elipse inscrita segmentada}
+::msgcat::mcset es {Ellipse} {Elipse}
+::msgcat::mcset es {Elliptical Annulus} {Elipse con elipse inscrita}
+::msgcat::mcset es {Elliptical Panda} [encoding convertfrom iso8859-1 {Elipse con elipse inscrita segmentada}]
+::msgcat::mcset es {Enable Confirmation Dialogs} [encoding convertfrom iso8859-1 {Habilitar los diálogos de confirmación}]
+::msgcat::mcset es {Enable}
+::msgcat::mcset es {End}
+::msgcat::mcset es {Enter Color} {Entrar color}
+::msgcat::mcset es {Enter Font Size}
+::msgcat::mcset es {Enter Group Name} {Entrar nombre de grupo}
+::msgcat::mcset es {Enter Search Expression} [encoding convertfrom iso8859-1 {Entrar expresión de búsqueda}]
+::msgcat::mcset es {Enter URL}
+::msgcat::mcset es {Entry} {Entrada}
+::msgcat::mcset es {Equal Area} {Misma área}
+::msgcat::mcset es {Equal Distance} {Misma distancia}
+::msgcat::mcset es {Equal Spacing}
+::msgcat::mcset es {Equal Value}
+::msgcat::mcset es {Error code was returned} [encoding convertfrom iso8859-1 {Error de código fue regresado}]
+::msgcat::mcset es {Error}
+::msgcat::mcset es {Examine Frame} {Examinar marco}
+::msgcat::mcset es {Examine} {Examinar}
+::msgcat::mcset es {Exam}
+::msgcat::mcset es {Exclude} {Excluir}
+::msgcat::mcset es {Exit} {Salir}
+::msgcat::mcset es {Export Array}
+::msgcat::mcset es {Export}
+::msgcat::mcset es {Extention}
+::msgcat::mcset es {Exterior Axes} {Ejes exteriores}
+::msgcat::mcset es {Exterior Numerics} {Numeración exterior}
+::msgcat::mcset es {FAQ}
+::msgcat::mcset es {FK4}
+::msgcat::mcset es {FK5}
+::msgcat::mcset es {Factor}
+::msgcat::mcset es {File not Found or Unable to load FITS data MIME type} {Fichero no hallado o incapaz de cargar datos FITS de tipo MIME}
+::msgcat::mcset es {Filename} {Nombre del fichero}
+::msgcat::mcset es {File} {Fichero}
+::msgcat::mcset es {Fill}
+::msgcat::mcset es {Filter} {Filtro}
+::msgcat::mcset es {Find Next} {Hallar la siguiente}
+::msgcat::mcset es {Find} {Hallar}
+::msgcat::mcset es {First Frame} {Primer Marco}
+::msgcat::mcset es {First} {Primer}
+::msgcat::mcset es {Fits}
+::msgcat::mcset es {Fixed in Size} [encoding convertfrom iso8859-1 {Fijado en tamaño}]
+::msgcat::mcset es {Flat}
+::msgcat::mcset es {Flip}
+::msgcat::mcset es {Font} {Fuente}
+::msgcat::mcset es {For more information, use --help}
+::msgcat::mcset es {Format} {Formato}
+::msgcat::mcset es {Forward} {Hacia adelante}
+::msgcat::mcset es {Found} {Hallado}
+::msgcat::mcset es {Frame Information} [encoding convertfrom iso8859-1 {Información del marco}]
+::msgcat::mcset es {Frame Parameters}
+::msgcat::mcset es {Frames}
+::msgcat::mcset es {Frame} {Marco}
+::msgcat::mcset es {From}
+::msgcat::mcset es {Front} {Al frente}
+::msgcat::mcset es {Full Range} {Rango completo}
+::msgcat::mcset es {Function} [encoding convertfrom iso8859-1 {Función}]
+::msgcat::mcset es {GUI Font}
+::msgcat::mcset es {Galactic} [encoding convertfrom iso8859-1 {Galáctico}]
+::msgcat::mcset es {Gap}
+::msgcat::mcset es {Gaussian} {Gausiana}
+::msgcat::mcset es {General}
+::msgcat::mcset es {Generate} {Generar}
+::msgcat::mcset es {Generating Regions} {Generando regiones}
+::msgcat::mcset es {Get Information} [encoding convertfrom iso8859-1 {Obtener información}]
+::msgcat::mcset es {Gist}
+::msgcat::mcset es {Global Properties}
+::msgcat::mcset es {Global}
+::msgcat::mcset es {Goto Frame}
+::msgcat::mcset es {Graph Horz}
+::msgcat::mcset es {Graph Vert}
+::msgcat::mcset es {Graphics} [encoding convertfrom iso8859-1 {Gráficos}]
+::msgcat::mcset es {Graphs}
+::msgcat::mcset es {Graph} [encoding convertfrom iso8859-1 {Gráfica}]
+::msgcat::mcset es {Grayscale} {Escala de grises}
+::msgcat::mcset es {Green} {Verde}
+::msgcat::mcset es {Grid Gap} [encoding convertfrom iso8859-1 {Espaciado de la cuadrícula}]
+::msgcat::mcset es {Grid} [encoding convertfrom iso8859-1 {Cuadrícula}]
+::msgcat::mcset es {Groove}
+::msgcat::mcset es {Groups} {Grupos}
+::msgcat::mcset es {HTTP}
+::msgcat::mcset es {Header} {Cabecera}
+::msgcat::mcset es {Height} {Altura}
+::msgcat::mcset es {Help Desk} {Mesa de ayuda}
+::msgcat::mcset es {Help Me Choose} {Ayudame a escoger}
+::msgcat::mcset es {Help} {Ayuda}
+::msgcat::mcset es {Hide All} {Ocultar todos}
+::msgcat::mcset es {Highlite}
+::msgcat::mcset es {High} {Alto}
+::msgcat::mcset es {Histogram Equalization} [encoding convertfrom iso8859-1 {Ecualización de histograma}]
+::msgcat::mcset es {Histogram} {Histograma}
+::msgcat::mcset es {Horizontal Graph} [encoding convertfrom iso8859-1 {Gráfica horizontal}]
+::msgcat::mcset es {Horizontal Layout} [encoding convertfrom iso8859-1 {Distribución horizontal}]
+::msgcat::mcset es {Horizontal}
+::msgcat::mcset es {IAU Location Code}
+::msgcat::mcset es {ICRS}
+::msgcat::mcset es {Identification} {Identificación}
+::msgcat::mcset es {If} {Si}
+::msgcat::mcset es {Image Servers}
+::msgcat::mcset es {Image} {Imagen}
+::msgcat::mcset es {Import Array}
+::msgcat::mcset es {Import}
+::msgcat::mcset es {Include} {Incluir}
+::msgcat::mcset es {Increase} {Aumento}
+::msgcat::mcset es {Information Panel} [encoding convertfrom iso8859-1 {Panel de información}]
+::msgcat::mcset es {Information} [encoding convertfrom iso8859-1 {Información}]
+::msgcat::mcset es {Initialize XPA} {Inicializar XPA}
+::msgcat::mcset es {Inner} {Interior}
+::msgcat::mcset es {Instrument FOV} {Campo visual del instrumento}
+::msgcat::mcset es {Interior Axes} {Ejes interiores}
+::msgcat::mcset es {Interior Numerics} [encoding convertfrom iso8859-1 {Numeración interior}]
+::msgcat::mcset es {Internal Parse Error}
+::msgcat::mcset es {Interval} {Intervalo}
+::msgcat::mcset es {Invalid Column Name}
+::msgcat::mcset es {Invalid formated multipart/mixed mime type message}
+::msgcat::mcset es {Invert Colormap} {Invertir mapa de colores}
+::msgcat::mcset es {Invert Selection} [encoding convertfrom iso8859-1 {Invertir selección}]
+::msgcat::mcset es {Invert} {Invertir}
+::msgcat::mcset es {Italic} [encoding convertfrom iso8859-1 {Itálica}]
+::msgcat::mcset es {Items Found} [encoding convertfrom iso8859-1 {Artículos hallados}]
+::msgcat::mcset es {Iteration} [encoding convertfrom iso8859-1 {Iteración}]
+::msgcat::mcset es {JPEG Quality Factor} {Factor de calidad JPEG}
+::msgcat::mcset es {Keep-Alive}
+::msgcat::mcset es {Kernel}
+::msgcat::mcset es {Keyboard Shortcuts} {Atajos con el teclado}
+::msgcat::mcset es {Keyboard} {Teclado}
+::msgcat::mcset es {Keyword}
+::msgcat::mcset es {Labels} {Etiquetas}
+::msgcat::mcset es {Label} {Etiqueta}
+::msgcat::mcset es {Landscape} {Apaisado}
+::msgcat::mcset es {Language} {Idioma}
+::msgcat::mcset es {Last Frame} [encoding convertfrom iso8859-1 {Último marco}]
+::msgcat::mcset es {Last} [encoding convertfrom iso8859-1 {Último}]
+::msgcat::mcset es {Layout Horz}
+::msgcat::mcset es {Layout Vert}
+::msgcat::mcset es {Layout}
+::msgcat::mcset es {Left}
+::msgcat::mcset es {Legal}
+::msgcat::mcset es {Legend Title}
+::msgcat::mcset es {Legend}
+::msgcat::mcset es {Length} {Longitud}
+::msgcat::mcset es {Letter}
+::msgcat::mcset es {Levels} {Niveles}
+::msgcat::mcset es {Level} {Nivel}
+::msgcat::mcset es {Limits} [encoding convertfrom iso8859-1 {Límites}]
+::msgcat::mcset es {Line Plot Tool}
+::msgcat::mcset es {Linear} {Lineal}
+::msgcat::mcset es {Line} [encoding convertfrom iso8859-1 {Línea}]
+::msgcat::mcset es {List Data}
+::msgcat::mcset es {List Regions} {Listar regiones}
+::msgcat::mcset es {List} {Listar}
+::msgcat::mcset es {Load Analysis Commands} [encoding convertfrom iso8859-1 {Cargar las instrucciones de análisis}]
+::msgcat::mcset es {Load Color Tags}
+::msgcat::mcset es {Load Colormap} {Cargar mapa de colores}
+::msgcat::mcset es {Load Configuration} [encoding convertfrom iso8859-1 {Cargar configuración}]
+::msgcat::mcset es {Load Contour Levels} {Cargar niveles de contorno}
+::msgcat::mcset es {Load Contours} {Cargar contornos}
+::msgcat::mcset es {Load Contrast/Bias} {Cargar contraste/Bias}
+::msgcat::mcset es {Load Data} {Cargar datos}
+::msgcat::mcset es {Load Mosaic} {Cargar mosaico}
+::msgcat::mcset es {Load Regions} {Cargar regiones}
+::msgcat::mcset es {Load Template} {Cargar modelo}
+::msgcat::mcset es {Load into All Frames}
+::msgcat::mcset es {Load into Current Frame}
+::msgcat::mcset es {Loading Catalog}
+::msgcat::mcset es {Loading}
+::msgcat::mcset es {Load} {Cargar}
+::msgcat::mcset es {Local}
+::msgcat::mcset es {Lock Axes}
+::msgcat::mcset es {Lock Bin}
+::msgcat::mcset es {Lock Color}
+::msgcat::mcset es {Lock Crop Amplifier}
+::msgcat::mcset es {Lock Crop Detector}
+::msgcat::mcset es {Lock Crop Image}
+::msgcat::mcset es {Lock Crop None}
+::msgcat::mcset es {Lock Crop Physical}
+::msgcat::mcset es {Lock Crop WCS}
+::msgcat::mcset es {Lock Crosshair Amplifier}
+::msgcat::mcset es {Lock Crosshair Detector}
+::msgcat::mcset es {Lock Crosshair Image}
+::msgcat::mcset es {Lock Crosshair None}
+::msgcat::mcset es {Lock Crosshair Physical}
+::msgcat::mcset es {Lock Crosshair WCS}
+::msgcat::mcset es {Lock Frame Amplifier}
+::msgcat::mcset es {Lock Frame Detector}
+::msgcat::mcset es {Lock Frame Image}
+::msgcat::mcset es {Lock Frame None}
+::msgcat::mcset es {Lock Frame Physical}
+::msgcat::mcset es {Lock Frame WCS}
+::msgcat::mcset es {Lock Limits}
+::msgcat::mcset es {Lock Scale}
+::msgcat::mcset es {Lock Slice Image}
+::msgcat::mcset es {Lock Slice None}
+::msgcat::mcset es {Lock Slice WCS}
+::msgcat::mcset es {Lock Smooth}
+::msgcat::mcset es {Lock} {Bloquear}
+::msgcat::mcset es {Log Exponent}
+::msgcat::mcset es {Log}
+::msgcat::mcset es {Low High} {Bajo Alto}
+::msgcat::mcset es {Lower Left Back}
+::msgcat::mcset es {Lower Left Front}
+::msgcat::mcset es {Lower Right Back}
+::msgcat::mcset es {Lower Right Front}
+::msgcat::mcset es {Low} {Bajo}
+::msgcat::mcset es {MIP}
+::msgcat::mcset es {Magenta}
+::msgcat::mcset es {Magnification}
+::msgcat::mcset es {Magnifier} {Ventanilla magnificadora}
+::msgcat::mcset es {Major} {Mayor}
+::msgcat::mcset es {Manual}
+::msgcat::mcset es {Mask Parameters} [encoding convertfrom iso8859-1 {Parámetros de mascara}]
+::msgcat::mcset es {Match Axes}
+::msgcat::mcset es {Match Bin}
+::msgcat::mcset es {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset es {Match Color}
+::msgcat::mcset es {Match Crop Amplifier}
+::msgcat::mcset es {Match Crop Detector}
+::msgcat::mcset es {Match Crop Image}
+::msgcat::mcset es {Match Crop Physical}
+::msgcat::mcset es {Match Crop WCS}
+::msgcat::mcset es {Match Crosshair Amplifier}
+::msgcat::mcset es {Match Crosshair Detector}
+::msgcat::mcset es {Match Crosshair Image}
+::msgcat::mcset es {Match Crosshair Physical}
+::msgcat::mcset es {Match Crosshair WCS}
+::msgcat::mcset es {Match Frame Amplifier}
+::msgcat::mcset es {Match Frame Detector}
+::msgcat::mcset es {Match Frame Image}
+::msgcat::mcset es {Match Frame Physical}
+::msgcat::mcset es {Match Frame WCS}
+::msgcat::mcset es {Match Limits}
+::msgcat::mcset es {Match Scale}
+::msgcat::mcset es {Match Slice Image}
+::msgcat::mcset es {Match Slice WCS}
+::msgcat::mcset es {Match Smooth}
+::msgcat::mcset es {Match}
+::msgcat::mcset es {Math Function} [encoding convertfrom iso8859-1 {Función matemática}]
+::msgcat::mcset es {Matplotlib}
+::msgcat::mcset es {Max Rows} [encoding convertfrom iso8859-1 {Máx filas}]
+::msgcat::mcset es {Maximum}
+::msgcat::mcset es {Max} [encoding convertfrom iso8859-1 {Máx}]
+::msgcat::mcset es {Menus and Buttons}
+::msgcat::mcset es {Menu}
+::msgcat::mcset es {Message Log}
+::msgcat::mcset es {Method} [encoding convertfrom iso8859-1 {Método}]
+::msgcat::mcset es {Min Max Parameters}
+::msgcat::mcset es {Min Max} [encoding convertfrom iso8859-1 {Mín Máx}]
+::msgcat::mcset es {Minimum}
+::msgcat::mcset es {Minor} {Menor}
+::msgcat::mcset es {Minutes}
+::msgcat::mcset es {Min} [encoding convertfrom iso8859-1 {Mín}]
+::msgcat::mcset es {Mission} [encoding convertfrom iso8859-1 {Misión}]
+::msgcat::mcset es {Mode}
+::msgcat::mcset es {Mosaic IRAF Segment}
+::msgcat::mcset es {Mosaic IRAF}
+::msgcat::mcset es {Mosaic WCS Segment}
+::msgcat::mcset es {Mosaic WCS}
+::msgcat::mcset es {Mosaic WFPC2}
+::msgcat::mcset es {Mosaic}
+::msgcat::mcset es {Mouse Click Epsilon}
+::msgcat::mcset es {Mouse Wheel Bin}
+::msgcat::mcset es {Mouse Wheel Zoom}
+::msgcat::mcset es {Mouse and Keyboard}
+::msgcat::mcset es {Move Back} [encoding convertfrom iso8859-1 {Mover atrás}]
+::msgcat::mcset es {Move First} {Mover al primero}
+::msgcat::mcset es {Move Forward} {Mover adelante}
+::msgcat::mcset es {Move Frame}
+::msgcat::mcset es {Move Last} [encoding convertfrom iso8859-1 {Mover al Último}]
+::msgcat::mcset es {Move to Back} [encoding convertfrom iso8859-1 {Poner detrás}]
+::msgcat::mcset es {Move to Front} {Poner delante}
+::msgcat::mcset es {Movie}
+::msgcat::mcset es {Multiple Extension Cube}
+::msgcat::mcset es {Multiple Extension Frames}
+::msgcat::mcset es {Multiple WCS} [encoding convertfrom iso8859-1 {Múltiple WCS}]
+::msgcat::mcset es {NRRD}
+::msgcat::mcset es {Name Resolution} [encoding convertfrom iso8859-1 {Conversión a coordenadas}]
+::msgcat::mcset es {Name Server} {Nombre del servidor}
+::msgcat::mcset es {Name or Designation} [encoding convertfrom iso8859-1 {Nombre o designación}]
+::msgcat::mcset es {Name}
+::msgcat::mcset es {Native Dialog} [encoding convertfrom iso8859-1 {Diálogo nativo}]
+::msgcat::mcset es {New Features} [encoding convertfrom iso8859-1 {Nuevas características}]
+::msgcat::mcset es {New Frame 3D} {Nuevo Marco 3D}
+::msgcat::mcset es {New Frame RGB} {Nuevo marco RGB}
+::msgcat::mcset es {New Frame each Time} {Nuevo marco cada vez}
+::msgcat::mcset es {New Frame} {Nuevo marco}
+::msgcat::mcset es {New Group} {Nuevo grupo}
+::msgcat::mcset es {New} {Nuevo}
+::msgcat::mcset es {Next Frame} {Siguiente Marco}
+::msgcat::mcset es {Next} {Siguiente}
+::msgcat::mcset es {No Catalog specified} [encoding convertfrom iso8859-1 {No se ha especificado el catálogo}]
+::msgcat::mcset es {No Data Available}
+::msgcat::mcset es {No Items Found} [encoding convertfrom iso8859-1 {Artículos no encontrados}]
+::msgcat::mcset es {No current frame}
+::msgcat::mcset es {Non-zero} {No nulo}
+::msgcat::mcset es {None} {Nada}
+::msgcat::mcset es {Normal}
+::msgcat::mcset es {North} {Norte}
+::msgcat::mcset es {Not Found}
+::msgcat::mcset es {Not Supported}
+::msgcat::mcset es {Number of Samples} [encoding convertfrom iso8859-1 {Número de muestreos}]
+::msgcat::mcset es {Number of Threads}
+::msgcat::mcset es {Number of Ticks}
+::msgcat::mcset es {Number} [encoding convertfrom iso8859-1 {Número}]
+::msgcat::mcset es {Numerics} [encoding convertfrom iso8859-1 {Numeración}]
+::msgcat::mcset es {OK} {Vale}
+::msgcat::mcset es {Object} {Objeto}
+::msgcat::mcset es {Open File} {Abrir fichero}
+::msgcat::mcset es {Open TCL Console} {Abrir consola TCL}
+::msgcat::mcset es {Open URL} {Abrir URL}
+::msgcat::mcset es {Open as}
+::msgcat::mcset es {Open} {Abrir}
+::msgcat::mcset es {Operator} {Operador}
+::msgcat::mcset es {Orientation} [encoding convertfrom iso8859-1 {Orientación}]
+::msgcat::mcset es {Origin}
+::msgcat::mcset es {Oscillate}
+::msgcat::mcset es {Other Color}
+::msgcat::mcset es {Other Font Size}
+::msgcat::mcset es {Other} {Otro}
+::msgcat::mcset es {Outer} {Exterior}
+::msgcat::mcset es {Overlap}
+::msgcat::mcset es {PS Page Setup} [encoding convertfrom iso8859-1 {Setup para Página PS}]
+::msgcat::mcset es {PS Print} {Imprimir PS}
+::msgcat::mcset es {Page Setup} [encoding convertfrom iso8859-1 {Formato de página}]
+::msgcat::mcset es {Page Source} [encoding convertfrom iso8859-1 {Fuente HTML de la página}]
+::msgcat::mcset es {Pan To} {Trasladar a}
+::msgcat::mcset es {Pan Zoom Rotate Parameters} [encoding convertfrom iso8859-1 {Parámetros de traslación, Zoom y rotación}]
+::msgcat::mcset es {Pan Zoom}
+::msgcat::mcset es {Pan then Zoom} [encoding convertfrom iso8859-1 {Trasladar y después Zoom}]
+::msgcat::mcset es {Panda} {Corona segmentada}
+::msgcat::mcset es {Panner} [encoding convertfrom iso8859-1 {Ventanilla panorámica}]
+::msgcat::mcset es {Pan} {Trasladar}
+::msgcat::mcset es {Parameters} [encoding convertfrom iso8859-1 {Parámetros}]
+::msgcat::mcset es {Password} [encoding convertfrom iso8859-1 {Contraseña}]
+::msgcat::mcset es {Paste Contours} {Pegar contornos}
+::msgcat::mcset es {Paste} {Pegar}
+::msgcat::mcset es {Physical} [encoding convertfrom iso8859-1 {Física}]
+::msgcat::mcset es {Pixel Distribution} [encoding convertfrom iso8859-1 {Distribución por píxeles}]
+::msgcat::mcset es {Pixel Size} [encoding convertfrom iso8859-1 {Tamaño del píxel}]
+::msgcat::mcset es {Pixel Table} [encoding convertfrom iso8859-1 {Tabla en píxeles}]
+::msgcat::mcset es {Pixels} [encoding convertfrom iso8859-1 {Píxeles}]
+::msgcat::mcset es {Play}
+::msgcat::mcset es {Please Select a Region}
+::msgcat::mcset es {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset es {Please specify width, height, and either name or (ra,dec)} {Por farvor, especifique el ancho, altura, y nombre o (A.R.,Dec.)}
+::msgcat::mcset es {Plot 2D}
+::msgcat::mcset es {Plot 3D}
+::msgcat::mcset es {Plot Title} [encoding convertfrom iso8859-1 {Título de la gráfica}]
+::msgcat::mcset es {Plotting Regions} {Dibujando regiones}
+::msgcat::mcset es {Plot}
+::msgcat::mcset es {Plus} [encoding convertfrom iso8859-1 {Más}]
+::msgcat::mcset es {Pointer} {Indicador}
+::msgcat::mcset es {Points} [encoding convertfrom iso8859-1 {Posición}]
+::msgcat::mcset es {Point} [encoding convertfrom iso8859-1 {Posición}]
+::msgcat::mcset es {Polygon} [encoding convertfrom iso8859-1 {Polígono}]
+::msgcat::mcset es {Portrait}
+::msgcat::mcset es {Poster} [encoding convertfrom iso8859-1 {Póster}]
+::msgcat::mcset es {Postscript Page Setup} [encoding convertfrom iso8859-1 {Setup para Página Postscript}]
+::msgcat::mcset es {Postscript Print} {Imprimir Postscript}
+::msgcat::mcset es {Postscript}
+::msgcat::mcset es {Power} {Potencia}
+::msgcat::mcset es {Preferences} {Preferencias}
+::msgcat::mcset es {Preserve During Load} {Conservar mientras se carga}
+::msgcat::mcset es {Previous Frame} {Marco Previo}
+::msgcat::mcset es {Previous} {Previo}
+::msgcat::mcset es {Prev}
+::msgcat::mcset es {Print Coordinates} {Imprimir coordenadas}
+::msgcat::mcset es {Print To} {Imprimir en}
+::msgcat::mcset es {Printer} {Impresora}
+::msgcat::mcset es {Print} {Imprimir}
+::msgcat::mcset es {Projection} [encoding convertfrom iso8859-1 {Proyección}]
+::msgcat::mcset es {Properties} {Propiedades}
+::msgcat::mcset es {Property} {Propiedad}
+::msgcat::mcset es {Proxy Host}
+::msgcat::mcset es {Proxy Port}
+::msgcat::mcset es {Publication} [encoding convertfrom iso8859-1 {Publicación}]
+::msgcat::mcset es {Quadratic} [encoding convertfrom iso8859-1 {Cuadrático}]
+::msgcat::mcset es {RGB Array}
+::msgcat::mcset es {RGB Cube}
+::msgcat::mcset es {RGB Image}
+::msgcat::mcset es {RGB}
+::msgcat::mcset es {Radial Profile}
+::msgcat::mcset es {Radial}
+::msgcat::mcset es {Radius} {Radio}
+::msgcat::mcset es {Raised}
+::msgcat::mcset es {Range}
+::msgcat::mcset es {Redo} {Rehacer}
+::msgcat::mcset es {Red} {Rojo}
+::msgcat::mcset es {Reference Manual} {Manual de referencia}
+::msgcat::mcset es {Reference} {Manual}
+::msgcat::mcset es {Refresh Frame} {Refrescar marco}
+::msgcat::mcset es {Refresh} {Refrescar}
+::msgcat::mcset es {Region Parameters}
+::msgcat::mcset es {Region} [encoding convertfrom iso8859-1 {Región}]
+::msgcat::mcset es {Release Notes} [encoding convertfrom iso8859-1 {Notas de esta versión}]
+::msgcat::mcset es {Release} [encoding convertfrom iso8859-1 {Versión}]
+::msgcat::mcset es {Relief}
+::msgcat::mcset es {Reload} {Recargar}
+::msgcat::mcset es {Render}
+::msgcat::mcset es {Repeat}
+::msgcat::mcset es {Reset Colormap} {Restaurar el mapa de colores}
+::msgcat::mcset es {Reset Frame} {Restaurar Marco}
+::msgcat::mcset es {Reset}
+::msgcat::mcset es {Restore}
+::msgcat::mcset es {Retrieve} {Localizar y leer}
+::msgcat::mcset es {Return}
+::msgcat::mcset es {Right}
+::msgcat::mcset es {Roman}
+::msgcat::mcset es {Rotate} {Rotar}
+::msgcat::mcset es {Rows} {Filas}
+::msgcat::mcset es {Row}
+::msgcat::mcset es {Ruler} {Regla}
+::msgcat::mcset es {SAMP Image}
+::msgcat::mcset es {SAMP Table}
+::msgcat::mcset es {SAMP: already connected}
+::msgcat::mcset es {SAMP: internal error}
+::msgcat::mcset es {SAMP: not connected}
+::msgcat::mcset es {SAMP: unable to locate HUB}
+::msgcat::mcset es {SAMP}
+::msgcat::mcset es {Sample Increment}
+::msgcat::mcset es {Sample Parameters}
+::msgcat::mcset es {Samples per Line} [encoding convertfrom iso8859-1 {Muestreos por línea}]
+::msgcat::mcset es {Sample}
+::msgcat::mcset es {Save 3D Movie}
+::msgcat::mcset es {Save Color Tags}
+::msgcat::mcset es {Save Colormap} {Guardar mapa de colores}
+::msgcat::mcset es {Save Configuration} [encoding convertfrom iso8859-1 {Guardar configuración}]
+::msgcat::mcset es {Save Contour Levels} {Guardar niveles de contorno}
+::msgcat::mcset es {Save Contours} {Guardar contornos}
+::msgcat::mcset es {Save Contrast/Bias} {Guardar contraste/Bias}
+::msgcat::mcset es {Save Data} {Guardar datos}
+::msgcat::mcset es {Save Image on Download}
+::msgcat::mcset es {Save Image} {Guardar imagen}
+::msgcat::mcset es {Save Regions} {Guardar regiones}
+::msgcat::mcset es {Save Template} {Guardar modelo}
+::msgcat::mcset es {Save as}
+::msgcat::mcset es {Save} {Guardar}
+::msgcat::mcset es {Scale Parameters} [encoding convertfrom iso8859-1 {Párametros de escala}]
+::msgcat::mcset es {Scale and Limits}
+::msgcat::mcset es {Scale} {Escala}
+::msgcat::mcset es {Scan} {Escanear}
+::msgcat::mcset es {Scatter Plot Tool}
+::msgcat::mcset es {Scope} {Alcance}
+::msgcat::mcset es {Search for Catalogs} [encoding convertfrom iso8859-1 {Buscar por catálogos}]
+::msgcat::mcset es {Searching for catalogs} [encoding convertfrom iso8859-1 {Buscando por catálogos}]
+::msgcat::mcset es {Seconds} {Segundos}
+::msgcat::mcset es {Segment}
+::msgcat::mcset es {Select All} {Seleccionar todos}
+::msgcat::mcset es {Select Coordinate System } {Seleccionar el sistema de coordenadas}
+::msgcat::mcset es {Select None} {Seleccionar nada}
+::msgcat::mcset es {Select}
+::msgcat::mcset es {Send}
+::msgcat::mcset es {Server} {Servidor}
+::msgcat::mcset es {Sexagesimal}
+::msgcat::mcset es {Shape} {Forma}
+::msgcat::mcset es {Show All} {Mostrarlos todos}
+::msgcat::mcset es {Show Command}
+::msgcat::mcset es {Show Compass}
+::msgcat::mcset es {Show Text} {Mostrar Texto}
+::msgcat::mcset es {Show/Hide Frames} {Mostar/ocultar marcos}
+::msgcat::mcset es {Show} {Mostrar}
+::msgcat::mcset es {Simple Cross}
+::msgcat::mcset es {Simple Plus}
+::msgcat::mcset es {Single Frame} [encoding convertfrom iso8859-1 {Un único marco}]
+::msgcat::mcset es {Single} [encoding convertfrom iso8859-1 {Único}]
+::msgcat::mcset es {Sites}
+::msgcat::mcset es {Size/Radius} [encoding convertfrom iso8859-1 {Tamaño/Radio}]
+::msgcat::mcset es {Size} [encoding convertfrom iso8859-1 {Tamaño}]
+::msgcat::mcset es {Skip First} {Omitir primeros}
+::msgcat::mcset es {Slice}
+::msgcat::mcset es {Smooth Parameters} [encoding convertfrom iso8859-1 {Parámetros de suavizado}]
+::msgcat::mcset es {Smoothness}
+::msgcat::mcset es {Smooth} {Suavizar}
+::msgcat::mcset es {Solid}
+::msgcat::mcset es {Sorry, DS9 does not support} {Lo siento, DS9 no admite}
+::msgcat::mcset es {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset es {Sort} {Clasificar}
+::msgcat::mcset es {Source TCL} [encoding convertfrom iso8859-1 {Leer código TCL}]
+::msgcat::mcset es {Source} {Fuente}
+::msgcat::mcset es {Space Equal Distance}
+::msgcat::mcset es {Space Equal Value}
+::msgcat::mcset es {Spacing} {Espaciado}
+::msgcat::mcset es {Sqrt}
+::msgcat::mcset es {Square Root} [encoding convertfrom iso8859-1 {Raíz cuadrada}]
+::msgcat::mcset es {Squared} {Al cuadrado}
+::msgcat::mcset es {Square}
+::msgcat::mcset es {Stacked}
+::msgcat::mcset es {Starbase}
+::msgcat::mcset es {Startup}
+::msgcat::mcset es {Start} {Empezar}
+::msgcat::mcset es {Statistics}
+::msgcat::mcset es {Stats}
+::msgcat::mcset es {Status} {Estado}
+::msgcat::mcset es {Step} {Escalonado}
+::msgcat::mcset es {Stop} {Parar}
+::msgcat::mcset es {Story of SAOImage DS9}
+::msgcat::mcset es {Story}
+::msgcat::mcset es {Sum} {Suma}
+::msgcat::mcset es {Sunken}
+::msgcat::mcset es {Symbol Editor} [encoding convertfrom iso8859-1 {Editor de símbolos}]
+::msgcat::mcset es {Symbol} [encoding convertfrom iso8859-1 {Símbolo}]
+::msgcat::mcset es {Tab-Separated-Value}
+::msgcat::mcset es {Table}
+::msgcat::mcset es {Tabloid}
+::msgcat::mcset es {Tag Color}
+::msgcat::mcset es {Task}
+::msgcat::mcset es {Template}
+::msgcat::mcset es {Text Font}
+::msgcat::mcset es {Text} {Texto}
+::msgcat::mcset es {Then} {Entonces}
+::msgcat::mcset es {Thickness} {Grosor}
+::msgcat::mcset es {This analysis task is already running. Do you wish to kill it?} [encoding convertfrom iso8859-1 {Esta tarea para el análisis ya está siendo ejecutada. ¿Desea interrumpirla?}]
+::msgcat::mcset es {This function is not available.}
+::msgcat::mcset es {This function is not currently supported for this port.}
+::msgcat::mcset es {Tickmarks} {Marcas}
+::msgcat::mcset es {Tile Frames} {Alicatar los marcos}
+::msgcat::mcset es {Tile Parameters} [encoding convertfrom iso8859-1 {Parámetros de alicatado}]
+::msgcat::mcset es {Tile} {Tejar}
+::msgcat::mcset es {Times}
+::msgcat::mcset es {Title} [encoding convertfrom iso8859-1 {Título}]
+::msgcat::mcset es {Tophat}
+::msgcat::mcset es {Topographic}
+::msgcat::mcset es {Top}
+::msgcat::mcset es {To} {A}
+::msgcat::mcset es {Transparency}
+::msgcat::mcset es {Triangle}
+::msgcat::mcset es {Type} {Clase}
+::msgcat::mcset es {URL}
+::msgcat::mcset es {Unable to connect directly: using Web Proxy}
+::msgcat::mcset es {Unable to determine date of observation}
+::msgcat::mcset es {Unable to determine time of observation}
+::msgcat::mcset es {Unable to evaluate filter} {Incapaz de evaluar el filtro}
+::msgcat::mcset es {Unable to find SIAP window}
+::msgcat::mcset es {Unable to find URL column}
+::msgcat::mcset es {Unable to find catalog window} [encoding convertfrom iso8859-1 {Incapaz de hallar la ventana de catálogo}]
+::msgcat::mcset es {Unable to find plot window} [encoding convertfrom iso8859-1 {Incapaz de hallar la ventana gráfica}]
+::msgcat::mcset es {Unable to load RGB image into a non-rgb frame} {Incapaz de cargar imagen RGB en un marco no RGB}
+::msgcat::mcset es {Unable to load region file}
+::msgcat::mcset es {Unable to load} {Incapaz de cargar}
+::msgcat::mcset es {Unable to locate URL} {Incapaz de localizar URL}
+::msgcat::mcset es {Unable to match target with XPA Mime request}
+::msgcat::mcset es {Unable to open file} {Incapaz de abrir fichero}
+::msgcat::mcset es {Unable to process Analysis file}
+::msgcat::mcset es {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset es {Undo} {Deshacer}
+::msgcat::mcset es {Unique}
+::msgcat::mcset es {Unists}
+::msgcat::mcset es {Units} {Unidades}
+::msgcat::mcset es {Unknown Colormap}
+::msgcat::mcset es {Unknown command}
+::msgcat::mcset es {Update Filter}
+::msgcat::mcset es {Update Group} {Actualizar grupo}
+::msgcat::mcset es {Update from Current Crosshair} {Actualizar a partir del punto de mira actual}
+::msgcat::mcset es {Update from Current Frame} {Actualizar a partir del marco actual}
+::msgcat::mcset es {Update} {Actualizar}
+::msgcat::mcset es {Upper Left Back}
+::msgcat::mcset es {Upper Left Front}
+::msgcat::mcset es {Upper Right Back}
+::msgcat::mcset es {Upper Right Front}
+::msgcat::mcset es {Use Authentication} [encoding convertfrom iso8859-1 {Usa autenticación}]
+::msgcat::mcset es {Use Current Frame on Download} {Usar marco actual al transferir}
+::msgcat::mcset es {Use Internal Web Browser} {Usar Web Browser interno}
+::msgcat::mcset es {Use Proxy} {Usar Proxy}
+::msgcat::mcset es {User Manual}
+::msgcat::mcset es {Username} {Nombre de usuario}
+::msgcat::mcset es {User} {Usuario}
+::msgcat::mcset es {Use} {Usa}
+::msgcat::mcset es {VO Server}
+::msgcat::mcset es {VO}
+::msgcat::mcset es {Value} {Valor}
+::msgcat::mcset es {Vector}
+::msgcat::mcset es {Vertical Graph} [encoding convertfrom iso8859-1 {Gráfica vertical}]
+::msgcat::mcset es {Vertical Layout} [encoding convertfrom iso8859-1 {Distribución vertical}]
+::msgcat::mcset es {Vertical Text} {Texto vertical}
+::msgcat::mcset es {Vertical}
+::msgcat::mcset es {View} {Ver}
+::msgcat::mcset es {Virtual Observatory} {Observatorio Virtual}
+::msgcat::mcset es {WCS Parameters}
+::msgcat::mcset es {WCS}
+::msgcat::mcset es {Wavelength} {Longitud de onda}
+::msgcat::mcset es {Web Browser}
+::msgcat::mcset es {White} {Blanco}
+::msgcat::mcset es {Width} {Ancho}
+::msgcat::mcset es {Window}
+::msgcat::mcset es {Words matching title, description} [encoding convertfrom iso8859-1 {Palabras que coincidan con el título, descripción}]
+::msgcat::mcset es {X Axis Title}
+::msgcat::mcset es {X Grid}
+::msgcat::mcset es {XPA Information} [encoding convertfrom iso8859-1 {Información XPA}]
+::msgcat::mcset es {XPA not initialized} {XPA no inicializado}
+::msgcat::mcset es {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset es {XPA}
+::msgcat::mcset es {X}
+::msgcat::mcset es {Y Axis Title}
+::msgcat::mcset es {Y Grid}
+::msgcat::mcset es {Yellow} {Amarillo}
+::msgcat::mcset es {Y}
+::msgcat::mcset es {Z Axis Scale}
+::msgcat::mcset es {ZScale Parameters} [encoding convertfrom iso8859-1 {Parámetros de la escala Z}]
+::msgcat::mcset es {Zero}
+::msgcat::mcset es {Zoom Fit}
+::msgcat::mcset es {Zoom In} {Aumentar}
+::msgcat::mcset es {Zoom Out} {Reducir}
+::msgcat::mcset es {Zoom} {Zoom}
+::msgcat::mcset es {and}
+::msgcat::mcset es {blue}
+::msgcat::mcset es {b}
+::msgcat::mcset es {color}
+::msgcat::mcset es {cool}
+::msgcat::mcset es {green}
+::msgcat::mcset es {grey} {gris}
+::msgcat::mcset es {g}
+::msgcat::mcset es {h5utils}
+::msgcat::mcset es {heat}
+::msgcat::mcset es {not}
+::msgcat::mcset es {only}
+::msgcat::mcset es {or center of data} {o centro de los datos}
+::msgcat::mcset es {rainbow}
+::msgcat::mcset es {red}
+::msgcat::mcset es {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom iso8859-1 {Filas de datos transferidas. Puede que haya más disponibles. Quizá quiera ajustar el máximo permitido.}]
+::msgcat::mcset es {r}
+::msgcat::mcset es {staircase}
+::msgcat::mcset es {standard} [encoding convertfrom iso8859-1 {estándar}]
+::msgcat::mcset es {x}
+::msgcat::mcset es {}
diff --git a/ds9/msgs/fr.msg b/ds9/msgs/fr.msg
new file mode 100644
index 0000000..913f98c
--- /dev/null
+++ b/ds9/msgs/fr.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset fr {2D}
+::msgcat::mcset fr {3D}
+::msgcat::mcset fr {A postscript generation error has occurred} [encoding convertfrom iso8859-1 {Une erreur de génération de postscript s'est produite}]
+::msgcat::mcset fr {AIP}
+::msgcat::mcset fr {Abort}
+::msgcat::mcset fr {About SAOImage DS9} [encoding convertfrom iso8859-1 {À propos de SAOImage DS9}]
+::msgcat::mcset fr {About} [encoding convertfrom iso8859-1 {À propos de}]
+::msgcat::mcset fr {Acknowledgment} {Remerciement}
+::msgcat::mcset fr {Add} {Ajouter}
+::msgcat::mcset fr {Advanced} [encoding convertfrom iso8859-1 {Avancé}]
+::msgcat::mcset fr {Aligned}
+::msgcat::mcset fr {Align} {Aligner}
+::msgcat::mcset fr {All Columns} {Toutes les colonnes}
+::msgcat::mcset fr {All Rows} [encoding convertfrom iso8859-1 {Toutes les rangées}]
+::msgcat::mcset fr {All} {Tous}
+::msgcat::mcset fr {Always save files during Backup}
+::msgcat::mcset fr {Amplifier} {Amplificateur}
+::msgcat::mcset fr {An error has occurred during backup}
+::msgcat::mcset fr {An error has occurred during restore}
+::msgcat::mcset fr {An error has occurred invoking the Analysis task} [encoding convertfrom iso8859-1 {Une erreur s'est produite en invoquant la tâche d'analyse}]
+::msgcat::mcset fr {An error has occurred while creating image.}
+::msgcat::mcset fr {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset fr {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset fr {An error has occurred while printing} {Une erreur s'est produite pendant l'impression}
+::msgcat::mcset fr {An error has occurred while reading image.}
+::msgcat::mcset fr {An error has occurred while saving} {Une erreur s'est produite pendant la sauvegarde}
+::msgcat::mcset fr {An error has occurred while updating VO server list}
+::msgcat::mcset fr {An error has occurred while writing image.}
+::msgcat::mcset fr {An internal error has been detected}
+::msgcat::mcset fr {Analysis Command Log} {Enregistrement des commandes d'analyse}
+::msgcat::mcset fr {Analysis Commands}
+::msgcat::mcset fr {Analysis File}
+::msgcat::mcset fr {Analysis Log}
+::msgcat::mcset fr {Analysis} {Analyse}
+::msgcat::mcset fr {Angle Complement} [encoding convertfrom iso8859-1 {Complément d'angle}]
+::msgcat::mcset fr {Angles} {Angles}
+::msgcat::mcset fr {Angle} {Angle}
+::msgcat::mcset fr {Annuli} {Anneaux}
+::msgcat::mcset fr {Annulus} {Anneau}
+::msgcat::mcset fr {Apply} {Appliquer}
+::msgcat::mcset fr {ArcMin}
+::msgcat::mcset fr {ArcSec}
+::msgcat::mcset fr {Architecture}
+::msgcat::mcset fr {Archives}
+::msgcat::mcset fr {Array}
+::msgcat::mcset fr {Arrow} [encoding convertfrom iso8859-1 {Flèche}]
+::msgcat::mcset fr {Astronomy}
+::msgcat::mcset fr {At Startup}
+::msgcat::mcset fr {At least 2 different catalogs are required}
+::msgcat::mcset fr {Auto Centroid}
+::msgcat::mcset fr {Auto Plot 2D}
+::msgcat::mcset fr {Auto Plot 3D}
+::msgcat::mcset fr {Auto Plot Statistics}
+::msgcat::mcset fr {Auto Plot}
+::msgcat::mcset fr {Autoload FITS Regions} [encoding convertfrom iso8859-1 {Autochargement des régions FITS}]
+::msgcat::mcset fr {Autoload}
+::msgcat::mcset fr {Automatic} {Automatique}
+::msgcat::mcset fr {Average} {Moyenne}
+::msgcat::mcset fr {Axes Number}
+::msgcat::mcset fr {Axes Order}
+::msgcat::mcset fr {Axes Title}
+::msgcat::mcset fr {Axes}
+::msgcat::mcset fr {Axis Length} {Longueur de l'axe}
+::msgcat::mcset fr {Axis Numbers} [encoding convertfrom iso8859-1 {Échelle de l'axe}]
+::msgcat::mcset fr {Axis Title}
+::msgcat::mcset fr {Axis} {Axe}
+::msgcat::mcset fr {Azimuth}
+::msgcat::mcset fr {Background Color} {Couleur de fond}
+::msgcat::mcset fr {Background} {Fond}
+::msgcat::mcset fr {Backup}
+::msgcat::mcset fr {Back} {Retour}
+::msgcat::mcset fr {Bar Plot Tool}
+::msgcat::mcset fr {Bias} {Biais}
+::msgcat::mcset fr {Bin 3rd Column} [encoding convertfrom iso8859-1 {3ème colonne de bin}]
+::msgcat::mcset fr {Bin Center} {Centre de bin}
+::msgcat::mcset fr {Bin Columns} {Colonnes de bin}
+::msgcat::mcset fr {Bin Filter} {Filtre de bin}
+::msgcat::mcset fr {Bin Fit}
+::msgcat::mcset fr {Bin In}
+::msgcat::mcset fr {Bin Out}
+::msgcat::mcset fr {Binning Parameters} [encoding convertfrom iso8859-1 {Paramètres de bin}]
+::msgcat::mcset fr {Bin}
+::msgcat::mcset fr {Black} {Noir}
+::msgcat::mcset fr {Blank/Inf/NaN Color} {Blanc/Inf/NaN Couleur}
+::msgcat::mcset fr {Blink Frames} [encoding convertfrom iso8859-1 {Clignotement des fenêtres}]
+::msgcat::mcset fr {Blink Interval} {Intervalle de clignotement}
+::msgcat::mcset fr {Blink} {Clignotement}
+::msgcat::mcset fr {Block Fit}
+::msgcat::mcset fr {Block In} [encoding convertfrom iso8859-1 {Bin à}]
+::msgcat::mcset fr {Block Out} {Bin de}
+::msgcat::mcset fr {Block Parameters}
+::msgcat::mcset fr {Block} {Bin}
+::msgcat::mcset fr {Blue} {Bleu}
+::msgcat::mcset fr {Bold} {Gras}
+::msgcat::mcset fr {Border} {Bordure}
+::msgcat::mcset fr {Bottom}
+::msgcat::mcset fr {Box Annulus} [encoding convertfrom iso8859-1 {Anneau de boîte}]
+::msgcat::mcset fr {Box Panda}
+::msgcat::mcset fr {BoxCircle}
+::msgcat::mcset fr {Boxcar}
+::msgcat::mcset fr {Box} [encoding convertfrom iso8859-1 {Boîte}]
+::msgcat::mcset fr {Broadcast}
+::msgcat::mcset fr {Browser}
+::msgcat::mcset fr {Browse} {Parcourir}
+::msgcat::mcset fr {Buffer} {Tampon}
+::msgcat::mcset fr {Buttonbar}
+::msgcat::mcset fr {Buttons} {Boutons}
+::msgcat::mcset fr {Bytes} {Octets}
+::msgcat::mcset fr {CMYK}
+::msgcat::mcset fr {Can Delete} {Peut effacer}
+::msgcat::mcset fr {Can Edit} [encoding convertfrom iso8859-1 {Peut éditer}]
+::msgcat::mcset fr {Can Move} [encoding convertfrom iso8859-1 {Peut déplacer}]
+::msgcat::mcset fr {Can Rotate} {Peut tourner}
+::msgcat::mcset fr {Cancelled}
+::msgcat::mcset fr {Cancel} {Annuler}
+::msgcat::mcset fr {Cap}
+::msgcat::mcset fr {Catalog Server} {Serveur de catalogue}
+::msgcat::mcset fr {Catalog Tool} {Outil de catalogue}
+::msgcat::mcset fr {Catalogs} {Catalogues}
+::msgcat::mcset fr {Catalog} {Catalogue}
+::msgcat::mcset fr {Catrom}
+::msgcat::mcset fr {Cat}
+::msgcat::mcset fr {Center Image} {Centrer l'image}
+::msgcat::mcset fr {Center Non-modal Dialogs}
+::msgcat::mcset fr {Center} {Centrer}
+::msgcat::mcset fr {Centroid Parameters}
+::msgcat::mcset fr {Centroid}
+::msgcat::mcset fr {Circle} {Cercle}
+::msgcat::mcset fr {Clear All} {Tout effacer}
+::msgcat::mcset fr {Clear Analysis Commands} {Effacer les commandes d'analyse}
+::msgcat::mcset fr {Clear Cache} {Effacer le cache}
+::msgcat::mcset fr {Clear Data} [encoding convertfrom iso8859-1 {Effacer les données}]
+::msgcat::mcset fr {Clear External Analysis Commands?} {Effacer les commandes d'analyse externes ?}
+::msgcat::mcset fr {Clear Filter} {Effacer le filtre}
+::msgcat::mcset fr {Clear Frame} [encoding convertfrom iso8859-1 {Effacer la fenêtre}]
+::msgcat::mcset fr {Clear Preferences?} [encoding convertfrom iso8859-1 {Effacer les préférences ?}]
+::msgcat::mcset fr {Clear Preferences} [encoding convertfrom iso8859-1 {Effacer les préférences}]
+::msgcat::mcset fr {Clear} {Effacer}
+::msgcat::mcset fr {Click to Center} {Cliquer pour centrer}
+::msgcat::mcset fr {Close} {Fermer}
+::msgcat::mcset fr {Colorbar Size}
+::msgcat::mcset fr {Colorbar} {Barre de couleurs}
+::msgcat::mcset fr {Colormap Parameters} [encoding convertfrom iso8859-1 {Paramètres de carte de couleurs}]
+::msgcat::mcset fr {Colormap} {Carte de couleurs}
+::msgcat::mcset fr {Color} {Couleur}
+::msgcat::mcset fr {Columns} {Colonnes}
+::msgcat::mcset fr {Column} {Colonne}
+::msgcat::mcset fr {Command not allowed}
+::msgcat::mcset fr {Command}
+::msgcat::mcset fr {Compass} {Boussole}
+::msgcat::mcset fr {Composite Region}
+::msgcat::mcset fr {Composite}
+::msgcat::mcset fr {Compression}
+::msgcat::mcset fr {Configure} {Configurer}
+::msgcat::mcset fr {Connect Directly} {Connexion directe}
+::msgcat::mcset fr {Connect SAMP}
+::msgcat::mcset fr {Connect Using Web Proxy} {Connexion par proxy web}
+::msgcat::mcset fr {Connect}
+::msgcat::mcset fr {Console}
+::msgcat::mcset fr {Contacting Image Server}
+::msgcat::mcset fr {Contour Parameters} [encoding convertfrom iso8859-1 {Paramètres de contour}]
+::msgcat::mcset fr {Contours}
+::msgcat::mcset fr {Contour}
+::msgcat::mcset fr {Contrast} {Contraste}
+::msgcat::mcset fr {Convert to Polygons} {Convertir en polygones}
+::msgcat::mcset fr {Coordinate Grid Parameters} [encoding convertfrom iso8859-1 {Paramètres de grille de coordonnées}]
+::msgcat::mcset fr {Coordinate Grid} [encoding convertfrom iso8859-1 {Grille de coordonnées}]
+::msgcat::mcset fr {Coordinate System} [encoding convertfrom iso8859-1 {Système de coordonnées}]
+::msgcat::mcset fr {Coordinates}
+::msgcat::mcset fr {Coordinate} [encoding convertfrom iso8859-1 {Coordonnée}]
+::msgcat::mcset fr {Copy Contours} {Copier les contours}
+::msgcat::mcset fr {Copy to Regions} [encoding convertfrom iso8859-1 {Copier vers Régions}]
+::msgcat::mcset fr {Copy} {Copier}
+::msgcat::mcset fr {Create Movie}
+::msgcat::mcset fr {Create New Frame on Download} [encoding convertfrom iso8859-1 {Créer une nouvelle fenêtre au téléchargement}]
+::msgcat::mcset fr {Create}
+::msgcat::mcset fr {Crop Parameters}
+::msgcat::mcset fr {Crop}
+::msgcat::mcset fr {Crosshair Parameters}
+::msgcat::mcset fr {Crosshair To} [encoding convertfrom iso8859-1 {Réticule vers}]
+::msgcat::mcset fr {Crosshair} [encoding convertfrom iso8859-1 {Réticule}]
+::msgcat::mcset fr {Cross} {Croisement}
+::msgcat::mcset fr {Cubehelix}
+::msgcat::mcset fr {Cube}
+::msgcat::mcset fr {Cubic}
+::msgcat::mcset fr {Current Frame} {Fenêtre courante}
+::msgcat::mcset fr {Current Range} {Intervalle courant}
+::msgcat::mcset fr {Current} {Courant}
+::msgcat::mcset fr {Cursor} {Curseur}
+::msgcat::mcset fr {Cut} {Couper}
+::msgcat::mcset fr {Cyan}
+::msgcat::mcset fr {DPI}
+::msgcat::mcset fr {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset fr {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset fr {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset fr {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-1 {DS9 a détecté une vielle version du fichier de préférences, voulez vous la mettre à jour ?}]
+::msgcat::mcset fr {DS9 will complete the initialization process} {DS9 va terminer le processus d'initialisation}
+::msgcat::mcset fr {Dash} {Tiret}
+::msgcat::mcset fr {Data Format} [encoding convertfrom iso8859-1 {Format de données}]
+::msgcat::mcset fr {Dataset Name}
+::msgcat::mcset fr {Dataset} [encoding convertfrom iso8859-1 {Ensemble de données}]
+::msgcat::mcset fr {Data}
+::msgcat::mcset fr {Decrease} {Diminuer}
+::msgcat::mcset fr {Default All Files}
+::msgcat::mcset fr {Default Format}
+::msgcat::mcset fr {Default Length}
+::msgcat::mcset fr {Default} {Defaut}
+::msgcat::mcset fr {Degrees} [encoding convertfrom iso8859-1 {Degrés}]
+::msgcat::mcset fr {Delete All Frames?} [encoding convertfrom iso8859-1 {Supprimer toutes les fenêtres ?}]
+::msgcat::mcset fr {Delete All Frames} [encoding convertfrom iso8859-1 {Supprimer toutes les fenêtres}]
+::msgcat::mcset fr {Delete All Groups?} {Supprimer tous les groupes ?}
+::msgcat::mcset fr {Delete All Groups} {Supprimer tous les groupes}
+::msgcat::mcset fr {Delete All Regions?} [encoding convertfrom iso8859-1 {Supprimer toutes les régions ?}]
+::msgcat::mcset fr {Delete All Regions} [encoding convertfrom iso8859-1 {Supprimer toutes les régions}]
+::msgcat::mcset fr {Delete All}
+::msgcat::mcset fr {Delete Color Tags}
+::msgcat::mcset fr {Delete Frame} [encoding convertfrom iso8859-1 {Supprimer la fenêtre}]
+::msgcat::mcset fr {Delete Group} {Supprimer le groupe}
+::msgcat::mcset fr {Delete Selected Regions} [encoding convertfrom iso8859-1 {Supprimer les régions séléctionnées}]
+::msgcat::mcset fr {Delete} {Supprimer}
+::msgcat::mcset fr {Depth} {Profondeur}
+::msgcat::mcset fr {Detector} {Detecteur}
+::msgcat::mcset fr {Dialog Box} [encoding convertfrom iso8859-1 {Boîte de dialogue}]
+::msgcat::mcset fr {Diamond} {Losange}
+::msgcat::mcset fr {Dimension} {Dimention}
+::msgcat::mcset fr {Direction}
+::msgcat::mcset fr {Disconnect}
+::msgcat::mcset fr {Display Header}
+::msgcat::mcset fr {Display Size} {Afficher la taille}
+::msgcat::mcset fr {Dissolve}
+::msgcat::mcset fr {Distance}
+::msgcat::mcset fr {Done}
+::msgcat::mcset fr {Download Colormap}
+::msgcat::mcset fr {Download VOTABLE format if available}
+::msgcat::mcset fr {Drag to Center} {Glisser au centre}
+::msgcat::mcset fr {Duplicate Data}
+::msgcat::mcset fr {East} {Est}
+::msgcat::mcset fr {Ecliptic} {Ecliptiques}
+::msgcat::mcset fr {Edit Group Name} {Editer le nom du groupe}
+::msgcat::mcset fr {Edit} [encoding convertfrom iso8859-1 {Édition}]
+::msgcat::mcset fr {Elevation}
+::msgcat::mcset fr {Ellipse Annulus}
+::msgcat::mcset fr {Ellipse Panda} {Ellipse Panda}
+::msgcat::mcset fr {Ellipse} {Ellipse}
+::msgcat::mcset fr {Elliptical Annulus} {Anneau elliptique}
+::msgcat::mcset fr {Elliptical Panda} {Panda elliptique}
+::msgcat::mcset fr {Enable Confirmation Dialogs} {Utiliser les dialogues de confirmation}
+::msgcat::mcset fr {Enable}
+::msgcat::mcset fr {End} {Fin}
+::msgcat::mcset fr {Enter Color}
+::msgcat::mcset fr {Enter Font Size}
+::msgcat::mcset fr {Enter Group Name} {Entrer le nom du groupe}
+::msgcat::mcset fr {Enter Search Expression}
+::msgcat::mcset fr {Enter URL}
+::msgcat::mcset fr {Entry}
+::msgcat::mcset fr {Equal Area} {Egale surface}
+::msgcat::mcset fr {Equal Distance} {Egale distance}
+::msgcat::mcset fr {Equal Spacing}
+::msgcat::mcset fr {Equal Value}
+::msgcat::mcset fr {Error code was returned} [encoding convertfrom iso8859-1 {Un code d'erreur a été renvoyé}]
+::msgcat::mcset fr {Error} {Erreur}
+::msgcat::mcset fr {Examine Frame} [encoding convertfrom iso8859-1 {Examiner la fenêtre}]
+::msgcat::mcset fr {Examine} {Examiner}
+::msgcat::mcset fr {Exam}
+::msgcat::mcset fr {Exclude} {Exclure}
+::msgcat::mcset fr {Exit} {Sortie}
+::msgcat::mcset fr {Export Array}
+::msgcat::mcset fr {Export}
+::msgcat::mcset fr {Extention}
+::msgcat::mcset fr {Exterior Axes} {Axes exterieurs}
+::msgcat::mcset fr {Exterior Numerics} {Chiffres exterieurs}
+::msgcat::mcset fr {FAQ} {Foire-Aux-Questions}
+::msgcat::mcset fr {FK4}
+::msgcat::mcset fr {FK5}
+::msgcat::mcset fr {Factor}
+::msgcat::mcset fr {File not Found or Unable to load FITS data MIME type} [encoding convertfrom iso8859-1 {Fichier non trouvé, ou impossible d'utiliser le type MIME des données FITS}]
+::msgcat::mcset fr {Filename} {NomDuFichier}
+::msgcat::mcset fr {File} {Fichier}
+::msgcat::mcset fr {Fill}
+::msgcat::mcset fr {Filter} {Filtre}
+::msgcat::mcset fr {Find Next} {Trouver le suivant}
+::msgcat::mcset fr {Find} {Trouver}
+::msgcat::mcset fr {First Frame} [encoding convertfrom iso8859-1 {Première fenêtre}]
+::msgcat::mcset fr {First} {Premier}
+::msgcat::mcset fr {Fits}
+::msgcat::mcset fr {Fixed in Size} [encoding convertfrom iso8859-1 {Taille fixée}]
+::msgcat::mcset fr {Flat}
+::msgcat::mcset fr {Flip}
+::msgcat::mcset fr {Font} {Police}
+::msgcat::mcset fr {For more information, use --help}
+::msgcat::mcset fr {Format}
+::msgcat::mcset fr {Forward} {En avant}
+::msgcat::mcset fr {Found} {Trouvé}
+::msgcat::mcset fr {Frame Information} [encoding convertfrom iso8859-1 {Information de la fenêtre }]
+::msgcat::mcset fr {Frame Parameters}
+::msgcat::mcset fr {Frames}
+::msgcat::mcset fr {Frame} [encoding convertfrom iso8859-1 {Fenêtre}]
+::msgcat::mcset fr {From}
+::msgcat::mcset fr {Front} {Avant}
+::msgcat::mcset fr {Full Range}
+::msgcat::mcset fr {Function} {Fonction}
+::msgcat::mcset fr {GUI Font}
+::msgcat::mcset fr {Galactic} {Galactiques}
+::msgcat::mcset fr {Gap}
+::msgcat::mcset fr {Gaussian} {Gaussien}
+::msgcat::mcset fr {General} [encoding convertfrom iso8859-1 {Général}]
+::msgcat::mcset fr {Generate} [encoding convertfrom iso8859-1 {Générer}]
+::msgcat::mcset fr {Generating Regions} [encoding convertfrom iso8859-1 {Création des régions}]
+::msgcat::mcset fr {Get Information} [encoding convertfrom iso8859-1 {Récuperer l'information}]
+::msgcat::mcset fr {Gist}
+::msgcat::mcset fr {Global Properties}
+::msgcat::mcset fr {Global} {Global}
+::msgcat::mcset fr {Goto Frame} [encoding convertfrom iso8859-1 {Aller à la fenêtre}]
+::msgcat::mcset fr {Graph Horz}
+::msgcat::mcset fr {Graph Vert}
+::msgcat::mcset fr {Graphics} {Graphiques}
+::msgcat::mcset fr {Graphs}
+::msgcat::mcset fr {Graph} {Graph}
+::msgcat::mcset fr {Grayscale} {Niveaux de gris}
+::msgcat::mcset fr {Green} {Vert}
+::msgcat::mcset fr {Grid Gap} {Espacement de la grille}
+::msgcat::mcset fr {Grid} {Grille}
+::msgcat::mcset fr {Groove}
+::msgcat::mcset fr {Groups} {Groupes}
+::msgcat::mcset fr {HTTP}
+::msgcat::mcset fr {Header} [encoding convertfrom iso8859-1 {Entête}]
+::msgcat::mcset fr {Height} {Hauteur}
+::msgcat::mcset fr {Help Desk} {Contacts}
+::msgcat::mcset fr {Help Me Choose} {Aider moi}
+::msgcat::mcset fr {Help} {Aide}
+::msgcat::mcset fr {Hide All} {Cacher tous}
+::msgcat::mcset fr {Highlite}
+::msgcat::mcset fr {High} {Haut}
+::msgcat::mcset fr {Histogram Equalization} {Egalisation via Histogramme}
+::msgcat::mcset fr {Histogram} {Histogramme}
+::msgcat::mcset fr {Horizontal Graph} {Graphique Horizontal}
+::msgcat::mcset fr {Horizontal Layout} {Mise en page Horizontale}
+::msgcat::mcset fr {Horizontal}
+::msgcat::mcset fr {IAU Location Code}
+::msgcat::mcset fr {ICRS}
+::msgcat::mcset fr {Identification}
+::msgcat::mcset fr {If} {Si}
+::msgcat::mcset fr {Image Servers}
+::msgcat::mcset fr {Image}
+::msgcat::mcset fr {Import Array}
+::msgcat::mcset fr {Import}
+::msgcat::mcset fr {Include} {Inclure}
+::msgcat::mcset fr {Increase} {Augmenter}
+::msgcat::mcset fr {Information Panel} {Panneau de reseignement}
+::msgcat::mcset fr {Information} {Reseignement}
+::msgcat::mcset fr {Initialize XPA} {Initialiser XPA}
+::msgcat::mcset fr {Inner} [encoding convertfrom iso8859-1 {Intérieur}]
+::msgcat::mcset fr {Instrument FOV} {Profondeur de champ de l'instrument}
+::msgcat::mcset fr {Interior Axes} [encoding convertfrom iso8859-1 {Axes intérieur}]
+::msgcat::mcset fr {Interior Numerics} [encoding convertfrom iso8859-1 {Chiffres intérieur}]
+::msgcat::mcset fr {Internal Parse Error}
+::msgcat::mcset fr {Interval} {Intervalle}
+::msgcat::mcset fr {Invalid Column Name}
+::msgcat::mcset fr {Invalid formated multipart/mixed mime type message} {Message invalide de genre mixte/multipart}
+::msgcat::mcset fr {Invert Colormap} {Plan de couleur inverti}
+::msgcat::mcset fr {Invert Selection} {Selection inverti}
+::msgcat::mcset fr {Invert} {Invertir}
+::msgcat::mcset fr {Italic} {Italique}
+::msgcat::mcset fr {Items Found} [encoding convertfrom iso8859-1 {Articles trouvés}]
+::msgcat::mcset fr {Iteration}
+::msgcat::mcset fr {JPEG Quality Factor} [encoding convertfrom iso8859-1 {Le facteur de qualité JPEG}]
+::msgcat::mcset fr {Keep-Alive}
+::msgcat::mcset fr {Kernel}
+::msgcat::mcset fr {Keyboard Shortcuts} {Raccourcis du clavier}
+::msgcat::mcset fr {Keyboard} {Clavier}
+::msgcat::mcset fr {Keyword}
+::msgcat::mcset fr {Labels} {Étiquettes}
+::msgcat::mcset fr {Label} {Étiquette}
+::msgcat::mcset fr {Landscape} {Paysage}
+::msgcat::mcset fr {Language} {Langue}
+::msgcat::mcset fr {Last Frame} [encoding convertfrom iso8859-1 {Dernière fenêtre}]
+::msgcat::mcset fr {Last} {Dernier}
+::msgcat::mcset fr {Layout Horz}
+::msgcat::mcset fr {Layout Vert}
+::msgcat::mcset fr {Layout}
+::msgcat::mcset fr {Left}
+::msgcat::mcset fr {Legal} {Legale}
+::msgcat::mcset fr {Legend Title}
+::msgcat::mcset fr {Legend}
+::msgcat::mcset fr {Length} {Longeur}
+::msgcat::mcset fr {Letter} {Lettre}
+::msgcat::mcset fr {Levels} {Niveaux}
+::msgcat::mcset fr {Level} {Niveau}
+::msgcat::mcset fr {Limits} {Limites}
+::msgcat::mcset fr {Line Plot Tool}
+::msgcat::mcset fr {Linear} [encoding convertfrom iso8859-1 {Linéaire}]
+::msgcat::mcset fr {Line} {Ligne}
+::msgcat::mcset fr {List Data}
+::msgcat::mcset fr {List Regions} [encoding convertfrom iso8859-1 {Énumérer les régions}]
+::msgcat::mcset fr {List} [encoding convertfrom iso8859-1 {Énumérer}]
+::msgcat::mcset fr {Load Analysis Commands} {Charger le commandes d'analyse}
+::msgcat::mcset fr {Load Color Tags}
+::msgcat::mcset fr {Load Colormap} {Charger le plan de couleur}
+::msgcat::mcset fr {Load Configuration} {Charger la configuration}
+::msgcat::mcset fr {Load Contour Levels} {Charger les niveaux de contour}
+::msgcat::mcset fr {Load Contours} {Charger les contours}
+::msgcat::mcset fr {Load Contrast/Bias} {Charger le contraste/inclination}
+::msgcat::mcset fr {Load Data} [encoding convertfrom iso8859-1 {Charger les données}]
+::msgcat::mcset fr {Load Mosaic} [encoding convertfrom iso8859-1 {Charger le mosaïque}]
+::msgcat::mcset fr {Load Regions} [encoding convertfrom iso8859-1 {Charger les régions}]
+::msgcat::mcset fr {Load Template} {Charger le patron}
+::msgcat::mcset fr {Load into All Frames}
+::msgcat::mcset fr {Load into Current Frame}
+::msgcat::mcset fr {Loading Catalog}
+::msgcat::mcset fr {Loading}
+::msgcat::mcset fr {Load} {Charger}
+::msgcat::mcset fr {Local} {Locale}
+::msgcat::mcset fr {Lock Axes}
+::msgcat::mcset fr {Lock Bin}
+::msgcat::mcset fr {Lock Color}
+::msgcat::mcset fr {Lock Crop Amplifier}
+::msgcat::mcset fr {Lock Crop Detector}
+::msgcat::mcset fr {Lock Crop Image}
+::msgcat::mcset fr {Lock Crop None}
+::msgcat::mcset fr {Lock Crop Physical}
+::msgcat::mcset fr {Lock Crop WCS}
+::msgcat::mcset fr {Lock Crosshair Amplifier}
+::msgcat::mcset fr {Lock Crosshair Detector}
+::msgcat::mcset fr {Lock Crosshair Image}
+::msgcat::mcset fr {Lock Crosshair None}
+::msgcat::mcset fr {Lock Crosshair Physical}
+::msgcat::mcset fr {Lock Crosshair WCS}
+::msgcat::mcset fr {Lock Frame Amplifier}
+::msgcat::mcset fr {Lock Frame Detector}
+::msgcat::mcset fr {Lock Frame Image}
+::msgcat::mcset fr {Lock Frame None}
+::msgcat::mcset fr {Lock Frame Physical}
+::msgcat::mcset fr {Lock Frame WCS}
+::msgcat::mcset fr {Lock Limits}
+::msgcat::mcset fr {Lock Scale}
+::msgcat::mcset fr {Lock Slice Image}
+::msgcat::mcset fr {Lock Slice None}
+::msgcat::mcset fr {Lock Slice WCS}
+::msgcat::mcset fr {Lock Smooth}
+::msgcat::mcset fr {Lock} {Verrouiller}
+::msgcat::mcset fr {Log Exponent}
+::msgcat::mcset fr {Log}
+::msgcat::mcset fr {Low High} {Haut bas}
+::msgcat::mcset fr {Lower Left Back}
+::msgcat::mcset fr {Lower Left Front}
+::msgcat::mcset fr {Lower Right Back}
+::msgcat::mcset fr {Lower Right Front}
+::msgcat::mcset fr {Low} {Bas}
+::msgcat::mcset fr {MIP}
+::msgcat::mcset fr {Magenta}
+::msgcat::mcset fr {Magnification}
+::msgcat::mcset fr {Magnifier} {Magnificateur}
+::msgcat::mcset fr {Major} {Majeure}
+::msgcat::mcset fr {Manual}
+::msgcat::mcset fr {Mask Parameters} [encoding convertfrom iso8859-1 {Paramètres de masque}]
+::msgcat::mcset fr {Match Axes}
+::msgcat::mcset fr {Match Bin}
+::msgcat::mcset fr {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset fr {Match Color}
+::msgcat::mcset fr {Match Crop Amplifier}
+::msgcat::mcset fr {Match Crop Detector}
+::msgcat::mcset fr {Match Crop Image}
+::msgcat::mcset fr {Match Crop Physical}
+::msgcat::mcset fr {Match Crop WCS}
+::msgcat::mcset fr {Match Crosshair Amplifier}
+::msgcat::mcset fr {Match Crosshair Detector}
+::msgcat::mcset fr {Match Crosshair Image}
+::msgcat::mcset fr {Match Crosshair Physical}
+::msgcat::mcset fr {Match Crosshair WCS}
+::msgcat::mcset fr {Match Frame Amplifier}
+::msgcat::mcset fr {Match Frame Detector}
+::msgcat::mcset fr {Match Frame Image}
+::msgcat::mcset fr {Match Frame Physical}
+::msgcat::mcset fr {Match Frame WCS}
+::msgcat::mcset fr {Match Limits}
+::msgcat::mcset fr {Match Scale}
+::msgcat::mcset fr {Match Slice Image}
+::msgcat::mcset fr {Match Slice WCS}
+::msgcat::mcset fr {Match Smooth}
+::msgcat::mcset fr {Match}
+::msgcat::mcset fr {Math Function} {Fonction mathématique}
+::msgcat::mcset fr {Matplotlib}
+::msgcat::mcset fr {Max Rows} [encoding convertfrom iso8859-1 {Maximum de rangées}]
+::msgcat::mcset fr {Maximum}
+::msgcat::mcset fr {Max} {Maximum}
+::msgcat::mcset fr {Menus and Buttons}
+::msgcat::mcset fr {Menu}
+::msgcat::mcset fr {Message Log}
+::msgcat::mcset fr {Method} [encoding convertfrom iso8859-1 {Méthode}]
+::msgcat::mcset fr {Min Max Parameters}
+::msgcat::mcset fr {Min Max}
+::msgcat::mcset fr {Minimum}
+::msgcat::mcset fr {Minor} {Mineure}
+::msgcat::mcset fr {Minutes}
+::msgcat::mcset fr {Min} {Minimum}
+::msgcat::mcset fr {Mission}
+::msgcat::mcset fr {Mode}
+::msgcat::mcset fr {Mosaic IRAF Segment}
+::msgcat::mcset fr {Mosaic IRAF}
+::msgcat::mcset fr {Mosaic WCS Segment}
+::msgcat::mcset fr {Mosaic WCS}
+::msgcat::mcset fr {Mosaic WFPC2}
+::msgcat::mcset fr {Mosaic}
+::msgcat::mcset fr {Mouse Click Epsilon}
+::msgcat::mcset fr {Mouse Wheel Bin}
+::msgcat::mcset fr {Mouse Wheel Zoom}
+::msgcat::mcset fr {Mouse and Keyboard}
+::msgcat::mcset fr {Move Back}
+::msgcat::mcset fr {Move First}
+::msgcat::mcset fr {Move Forward}
+::msgcat::mcset fr {Move Frame}
+::msgcat::mcset fr {Move Last}
+::msgcat::mcset fr {Move to Back} [encoding convertfrom iso8859-1 {Bouger vers arrière}]
+::msgcat::mcset fr {Move to Front} {Bouger vers le devant}
+::msgcat::mcset fr {Movie}
+::msgcat::mcset fr {Multiple Extension Cube}
+::msgcat::mcset fr {Multiple Extension Frames}
+::msgcat::mcset fr {Multiple WCS}
+::msgcat::mcset fr {NRRD}
+::msgcat::mcset fr {Name Resolution} [encoding convertfrom iso8859-1 {Nom de la résolution}]
+::msgcat::mcset fr {Name Server} {Nom du Serveur}
+::msgcat::mcset fr {Name or Designation} [encoding convertfrom iso8859-1 {Nom ou Désignation}]
+::msgcat::mcset fr {Name}
+::msgcat::mcset fr {Native Dialog}
+::msgcat::mcset fr {New Features} {Nouvelles options}
+::msgcat::mcset fr {New Frame 3D}
+::msgcat::mcset fr {New Frame RGB} [encoding convertfrom iso8859-1 {Nouvelle fenêtre RGB}]
+::msgcat::mcset fr {New Frame each Time} [encoding convertfrom iso8859-1 {Nouvelle fenêtre à chaque fois}]
+::msgcat::mcset fr {New Frame} [encoding convertfrom iso8859-1 {Nouvelle fenêtre}]
+::msgcat::mcset fr {New Group} {Nouveau groupe}
+::msgcat::mcset fr {New} {Nouveau}
+::msgcat::mcset fr {Next Frame} [encoding convertfrom iso8859-1 {Fenêtre suivante}]
+::msgcat::mcset fr {Next} {Suivant}
+::msgcat::mcset fr {No Catalog specified} [encoding convertfrom iso8859-1 {Pas de Catalogue spécifié}]
+::msgcat::mcset fr {No Data Available}
+::msgcat::mcset fr {No Items Found} [encoding convertfrom iso8859-1 {Pas trouvé}]
+::msgcat::mcset fr {No current frame}
+::msgcat::mcset fr {Non-zero}
+::msgcat::mcset fr {None} {Rien}
+::msgcat::mcset fr {Normal}
+::msgcat::mcset fr {North} {Nord}
+::msgcat::mcset fr {Not Found}
+::msgcat::mcset fr {Not Supported}
+::msgcat::mcset fr {Number of Samples} [encoding convertfrom iso8859-1 {Nombre d'échantillons}]
+::msgcat::mcset fr {Number of Threads}
+::msgcat::mcset fr {Number of Ticks}
+::msgcat::mcset fr {Number} {Nombre}
+::msgcat::mcset fr {Numerics} {Chiffres}
+::msgcat::mcset fr {OK}
+::msgcat::mcset fr {Object} {Objet}
+::msgcat::mcset fr {Open File} {Ouvrir fichier}
+::msgcat::mcset fr {Open TCL Console}
+::msgcat::mcset fr {Open URL} {Ouvrir un URL}
+::msgcat::mcset fr {Open as}
+::msgcat::mcset fr {Open} {Ouvrir}
+::msgcat::mcset fr {Operator} {Operateur}
+::msgcat::mcset fr {Orientation}
+::msgcat::mcset fr {Origin}
+::msgcat::mcset fr {Oscillate}
+::msgcat::mcset fr {Other Color}
+::msgcat::mcset fr {Other Font Size}
+::msgcat::mcset fr {Other} {Autre}
+::msgcat::mcset fr {Outer} {Externe}
+::msgcat::mcset fr {Overlap}
+::msgcat::mcset fr {PS Page Setup}
+::msgcat::mcset fr {PS Print}
+::msgcat::mcset fr {Page Setup} {Configurer la Page}
+::msgcat::mcset fr {Page Source} {Source de la Page}
+::msgcat::mcset fr {Pan To}
+::msgcat::mcset fr {Pan Zoom Rotate Parameters}
+::msgcat::mcset fr {Pan Zoom}
+::msgcat::mcset fr {Pan then Zoom}
+::msgcat::mcset fr {Panda}
+::msgcat::mcset fr {Panner}
+::msgcat::mcset fr {Pan}
+::msgcat::mcset fr {Parameters} [encoding convertfrom iso8859-1 {Paramètres}]
+::msgcat::mcset fr {Password} {Mot de passe}
+::msgcat::mcset fr {Paste Contours} {Coller les contours}
+::msgcat::mcset fr {Paste} {Coller}
+::msgcat::mcset fr {Physical} {Physique}
+::msgcat::mcset fr {Pixel Distribution} {Distribution des pixels}
+::msgcat::mcset fr {Pixel Size} {Taille des pixels}
+::msgcat::mcset fr {Pixel Table} {Table des pixels}
+::msgcat::mcset fr {Pixels}
+::msgcat::mcset fr {Play} {Jouer}
+::msgcat::mcset fr {Please Select a Region}
+::msgcat::mcset fr {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset fr {Please specify width, height, and either name or (ra,dec)} {Specifiez largeur, longeur, et autre noms possibles ou (ra,dec)}
+::msgcat::mcset fr {Plot 2D}
+::msgcat::mcset fr {Plot 3D}
+::msgcat::mcset fr {Plot Title} {Ecrire le titre}
+::msgcat::mcset fr {Plotting Regions} [encoding convertfrom iso8859-1 {Tracer les régions}]
+::msgcat::mcset fr {Plot} {Dessiner}
+::msgcat::mcset fr {Plus}
+::msgcat::mcset fr {Pointer} {Pointeur}
+::msgcat::mcset fr {Points}
+::msgcat::mcset fr {Point}
+::msgcat::mcset fr {Polygon} {Polygone}
+::msgcat::mcset fr {Portrait}
+::msgcat::mcset fr {Poster}
+::msgcat::mcset fr {Postscript Page Setup}
+::msgcat::mcset fr {Postscript Print}
+::msgcat::mcset fr {Postscript}
+::msgcat::mcset fr {Power} {Puissance}
+::msgcat::mcset fr {Preferences} [encoding convertfrom iso8859-1 {Préférences}]
+::msgcat::mcset fr {Preserve During Load} [encoding convertfrom iso8859-1 {Préserver pendant le chargement}]
+::msgcat::mcset fr {Previous Frame} [encoding convertfrom iso8859-1 {Fenêtre précédente}]
+::msgcat::mcset fr {Previous} [encoding convertfrom iso8859-1 {Précédent}]
+::msgcat::mcset fr {Prev}
+::msgcat::mcset fr {Print Coordinates} {Imprimer les coordonnees}
+::msgcat::mcset fr {Print To} {Imprimer dans}
+::msgcat::mcset fr {Printer} {L'imprimante}
+::msgcat::mcset fr {Print} {Imprimer}
+::msgcat::mcset fr {Projection}
+::msgcat::mcset fr {Properties} [encoding convertfrom iso8859-1 {Propriétés}]
+::msgcat::mcset fr {Property} [encoding convertfrom iso8859-1 {Propriété}]
+::msgcat::mcset fr {Proxy Host}
+::msgcat::mcset fr {Proxy Port}
+::msgcat::mcset fr {Publication}
+::msgcat::mcset fr {Quadratic}
+::msgcat::mcset fr {RGB Array}
+::msgcat::mcset fr {RGB Cube}
+::msgcat::mcset fr {RGB Image}
+::msgcat::mcset fr {RGB}
+::msgcat::mcset fr {Radial Profile}
+::msgcat::mcset fr {Radial}
+::msgcat::mcset fr {Radius}
+::msgcat::mcset fr {Raised}
+::msgcat::mcset fr {Range}
+::msgcat::mcset fr {Redo} {Refaire}
+::msgcat::mcset fr {Red}
+::msgcat::mcset fr {Reference Manual}
+::msgcat::mcset fr {Reference}
+::msgcat::mcset fr {Refresh Frame}
+::msgcat::mcset fr {Refresh}
+::msgcat::mcset fr {Region Parameters}
+::msgcat::mcset fr {Region} [encoding convertfrom iso8859-1 {Région}]
+::msgcat::mcset fr {Release Notes}
+::msgcat::mcset fr {Release}
+::msgcat::mcset fr {Relief}
+::msgcat::mcset fr {Reload}
+::msgcat::mcset fr {Render}
+::msgcat::mcset fr {Repeat}
+::msgcat::mcset fr {Reset Colormap}
+::msgcat::mcset fr {Reset Frame}
+::msgcat::mcset fr {Reset}
+::msgcat::mcset fr {Restore}
+::msgcat::mcset fr {Retrieve}
+::msgcat::mcset fr {Return}
+::msgcat::mcset fr {Right}
+::msgcat::mcset fr {Roman}
+::msgcat::mcset fr {Rotate}
+::msgcat::mcset fr {Rows}
+::msgcat::mcset fr {Row}
+::msgcat::mcset fr {Ruler}
+::msgcat::mcset fr {SAMP Image}
+::msgcat::mcset fr {SAMP Table}
+::msgcat::mcset fr {SAMP: already connected}
+::msgcat::mcset fr {SAMP: internal error}
+::msgcat::mcset fr {SAMP: not connected}
+::msgcat::mcset fr {SAMP: unable to locate HUB}
+::msgcat::mcset fr {SAMP}
+::msgcat::mcset fr {Sample Increment}
+::msgcat::mcset fr {Sample Parameters}
+::msgcat::mcset fr {Samples per Line}
+::msgcat::mcset fr {Sample}
+::msgcat::mcset fr {Save 3D Movie}
+::msgcat::mcset fr {Save Color Tags}
+::msgcat::mcset fr {Save Colormap}
+::msgcat::mcset fr {Save Configuration}
+::msgcat::mcset fr {Save Contour Levels}
+::msgcat::mcset fr {Save Contours}
+::msgcat::mcset fr {Save Contrast/Bias}
+::msgcat::mcset fr {Save Data}
+::msgcat::mcset fr {Save Image on Download}
+::msgcat::mcset fr {Save Image}
+::msgcat::mcset fr {Save Regions}
+::msgcat::mcset fr {Save Template}
+::msgcat::mcset fr {Save as}
+::msgcat::mcset fr {Save} {Enregistrer}
+::msgcat::mcset fr {Scale Parameters}
+::msgcat::mcset fr {Scale and Limits}
+::msgcat::mcset fr {Scale}
+::msgcat::mcset fr {Scan}
+::msgcat::mcset fr {Scatter Plot Tool}
+::msgcat::mcset fr {Scope}
+::msgcat::mcset fr {Search for Catalogs}
+::msgcat::mcset fr {Searching for catalogs}
+::msgcat::mcset fr {Seconds}
+::msgcat::mcset fr {Segment}
+::msgcat::mcset fr {Select All}
+::msgcat::mcset fr {Select Coordinate System }
+::msgcat::mcset fr {Select None}
+::msgcat::mcset fr {Select}
+::msgcat::mcset fr {Send}
+::msgcat::mcset fr {Server}
+::msgcat::mcset fr {Sexagesimal}
+::msgcat::mcset fr {Shape}
+::msgcat::mcset fr {Show All} {Montrer tous}
+::msgcat::mcset fr {Show Command}
+::msgcat::mcset fr {Show Compass}
+::msgcat::mcset fr {Show Text}
+::msgcat::mcset fr {Show/Hide Frames} [encoding convertfrom iso8859-1 {Montrer/Cacher les fenêtres}]
+::msgcat::mcset fr {Show}
+::msgcat::mcset fr {Simple Cross}
+::msgcat::mcset fr {Simple Plus}
+::msgcat::mcset fr {Single Frame}
+::msgcat::mcset fr {Single}
+::msgcat::mcset fr {Sites}
+::msgcat::mcset fr {Size/Radius}
+::msgcat::mcset fr {Size}
+::msgcat::mcset fr {Skip First}
+::msgcat::mcset fr {Slice}
+::msgcat::mcset fr {Smooth Parameters}
+::msgcat::mcset fr {Smoothness}
+::msgcat::mcset fr {Smooth}
+::msgcat::mcset fr {Solid}
+::msgcat::mcset fr {Sorry, DS9 does not support}
+::msgcat::mcset fr {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset fr {Sort}
+::msgcat::mcset fr {Source TCL}
+::msgcat::mcset fr {Source}
+::msgcat::mcset fr {Space Equal Distance}
+::msgcat::mcset fr {Space Equal Value}
+::msgcat::mcset fr {Spacing}
+::msgcat::mcset fr {Sqrt}
+::msgcat::mcset fr {Square Root}
+::msgcat::mcset fr {Squared}
+::msgcat::mcset fr {Square}
+::msgcat::mcset fr {Stacked}
+::msgcat::mcset fr {Starbase}
+::msgcat::mcset fr {Startup}
+::msgcat::mcset fr {Start}
+::msgcat::mcset fr {Statistics}
+::msgcat::mcset fr {Stats}
+::msgcat::mcset fr {Status}
+::msgcat::mcset fr {Step}
+::msgcat::mcset fr {Stop}
+::msgcat::mcset fr {Story of SAOImage DS9}
+::msgcat::mcset fr {Story}
+::msgcat::mcset fr {Sum}
+::msgcat::mcset fr {Sunken}
+::msgcat::mcset fr {Symbol Editor}
+::msgcat::mcset fr {Symbol}
+::msgcat::mcset fr {Tab-Separated-Value}
+::msgcat::mcset fr {Table}
+::msgcat::mcset fr {Tabloid}
+::msgcat::mcset fr {Tag Color}
+::msgcat::mcset fr {Task}
+::msgcat::mcset fr {Template}
+::msgcat::mcset fr {Text Font}
+::msgcat::mcset fr {Text} {Texte}
+::msgcat::mcset fr {Then}
+::msgcat::mcset fr {Thickness}
+::msgcat::mcset fr {This analysis task is already running. Do you wish to kill it?}
+::msgcat::mcset fr {This function is not available.}
+::msgcat::mcset fr {This function is not currently supported for this port.}
+::msgcat::mcset fr {Tickmarks}
+::msgcat::mcset fr {Tile Frames}
+::msgcat::mcset fr {Tile Parameters}
+::msgcat::mcset fr {Tile}
+::msgcat::mcset fr {Times}
+::msgcat::mcset fr {Title}
+::msgcat::mcset fr {Tophat}
+::msgcat::mcset fr {Topographic}
+::msgcat::mcset fr {Top}
+::msgcat::mcset fr {To}
+::msgcat::mcset fr {Transparency}
+::msgcat::mcset fr {Triangle}
+::msgcat::mcset fr {Type}
+::msgcat::mcset fr {URL}
+::msgcat::mcset fr {Unable to connect directly: using Web Proxy}
+::msgcat::mcset fr {Unable to determine date of observation}
+::msgcat::mcset fr {Unable to determine time of observation}
+::msgcat::mcset fr {Unable to evaluate filter}
+::msgcat::mcset fr {Unable to find SIAP window}
+::msgcat::mcset fr {Unable to find URL column}
+::msgcat::mcset fr {Unable to find catalog window}
+::msgcat::mcset fr {Unable to find plot window}
+::msgcat::mcset fr {Unable to load RGB image into a non-rgb frame}
+::msgcat::mcset fr {Unable to load region file}
+::msgcat::mcset fr {Unable to load}
+::msgcat::mcset fr {Unable to locate URL}
+::msgcat::mcset fr {Unable to match target with XPA Mime request}
+::msgcat::mcset fr {Unable to open file}
+::msgcat::mcset fr {Unable to process Analysis file}
+::msgcat::mcset fr {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset fr {Undo} [encoding convertfrom iso8859-1 {Défaire}]
+::msgcat::mcset fr {Unique}
+::msgcat::mcset fr {Unists}
+::msgcat::mcset fr {Units}
+::msgcat::mcset fr {Unknown Colormap}
+::msgcat::mcset fr {Unknown command}
+::msgcat::mcset fr {Update Filter}
+::msgcat::mcset fr {Update Group}
+::msgcat::mcset fr {Update from Current Crosshair}
+::msgcat::mcset fr {Update from Current Frame}
+::msgcat::mcset fr {Update}
+::msgcat::mcset fr {Upper Left Back}
+::msgcat::mcset fr {Upper Left Front}
+::msgcat::mcset fr {Upper Right Back}
+::msgcat::mcset fr {Upper Right Front}
+::msgcat::mcset fr {Use Authentication}
+::msgcat::mcset fr {Use Current Frame on Download}
+::msgcat::mcset fr {Use Internal Web Browser}
+::msgcat::mcset fr {Use Proxy}
+::msgcat::mcset fr {User Manual}
+::msgcat::mcset fr {Username}
+::msgcat::mcset fr {User}
+::msgcat::mcset fr {Use}
+::msgcat::mcset fr {VO Server}
+::msgcat::mcset fr {VO}
+::msgcat::mcset fr {Value}
+::msgcat::mcset fr {Vector}
+::msgcat::mcset fr {Vertical Graph}
+::msgcat::mcset fr {Vertical Layout}
+::msgcat::mcset fr {Vertical Text}
+::msgcat::mcset fr {Vertical}
+::msgcat::mcset fr {View} {Affichage}
+::msgcat::mcset fr {Virtual Observatory}
+::msgcat::mcset fr {WCS Parameters}
+::msgcat::mcset fr {WCS}
+::msgcat::mcset fr {Wavelength}
+::msgcat::mcset fr {Web Browser}
+::msgcat::mcset fr {White}
+::msgcat::mcset fr {Width}
+::msgcat::mcset fr {Window}
+::msgcat::mcset fr {Words matching title, description}
+::msgcat::mcset fr {X Axis Title}
+::msgcat::mcset fr {X Grid}
+::msgcat::mcset fr {XPA Information}
+::msgcat::mcset fr {XPA not initialized}
+::msgcat::mcset fr {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset fr {XPA}
+::msgcat::mcset fr {X}
+::msgcat::mcset fr {Y Axis Title}
+::msgcat::mcset fr {Y Grid}
+::msgcat::mcset fr {Yellow}
+::msgcat::mcset fr {Y}
+::msgcat::mcset fr {Z Axis Scale}
+::msgcat::mcset fr {ZScale Parameters}
+::msgcat::mcset fr {Zero}
+::msgcat::mcset fr {Zoom Fit}
+::msgcat::mcset fr {Zoom In}
+::msgcat::mcset fr {Zoom Out}
+::msgcat::mcset fr {Zoom}
+::msgcat::mcset fr {and}
+::msgcat::mcset fr {blue}
+::msgcat::mcset fr {b}
+::msgcat::mcset fr {color}
+::msgcat::mcset fr {cool}
+::msgcat::mcset fr {green}
+::msgcat::mcset fr {grey}
+::msgcat::mcset fr {g}
+::msgcat::mcset fr {h5utils}
+::msgcat::mcset fr {heat}
+::msgcat::mcset fr {not}
+::msgcat::mcset fr {only}
+::msgcat::mcset fr {or center of data}
+::msgcat::mcset fr {rainbow}
+::msgcat::mcset fr {red}
+::msgcat::mcset fr {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed}
+::msgcat::mcset fr {r}
+::msgcat::mcset fr {staircase}
+::msgcat::mcset fr {standard}
+::msgcat::mcset fr {x}
+::msgcat::mcset fr {}
diff --git a/ds9/msgs/ja.msg b/ds9/msgs/ja.msg
new file mode 100644
index 0000000..2eba962
--- /dev/null
+++ b/ds9/msgs/ja.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset ja {2D}
+::msgcat::mcset ja {3D} [encoding convertfrom euc-jp "\x33\xbc\xa1\xb8\xb5"]
+::msgcat::mcset ja {A postscript generation error has occurred} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xb9\xa5\xc8\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xba\xee\xc0\xae\xa4\xcb\xbc\xba\xc7\xd4\xa4\xb7\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {AIP}
+::msgcat::mcset ja {Abort}
+::msgcat::mcset ja {About SAOImage DS9} [encoding convertfrom euc-jp "\x53\x41\x4f\x49\x6d\x61\x67\x65\x20\x44\x53\x39\x20\xa4\xcb\xa4\xc4\xa4\xa4\xa4\xc6"]
+::msgcat::mcset ja {About} [encoding convertfrom euc-jp "\x44\x53\x39\x20\xa4\xcb\xa4\xc4\xa4\xa4\xa4\xc6"]
+::msgcat::mcset ja {Acknowledgment} [encoding convertfrom euc-jp "\xbc\xd5\xbc\xad"]
+::msgcat::mcset ja {Add} [encoding convertfrom euc-jp "\xc4\xc9\xb2\xc3"]
+::msgcat::mcset ja {Advanced} [encoding convertfrom euc-jp "\xb9\xe2\xc5\xd9\xa4\xca\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Aligned}
+::msgcat::mcset ja {Align} [encoding convertfrom euc-jp "\xc0\xb0\xce\xf3"]
+::msgcat::mcset ja {All Columns} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xce\xf3"]
+::msgcat::mcset ja {All Rows} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xb9\xd4"]
+::msgcat::mcset ja {All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6"]
+::msgcat::mcset ja {Always save files during Backup}
+::msgcat::mcset ja {Amplifier} [encoding convertfrom euc-jp "\xc1\xfd\xc9\xfd\xb4\xef\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {An error has occurred during backup}
+::msgcat::mcset ja {An error has occurred during restore}
+::msgcat::mcset ja {An error has occurred invoking the Analysis task} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf\xa5\xbf\xa5\xb9\xa5\xaf\xa4\xce\xb5\xaf\xc6\xb0\xa4\xcb\xbc\xba\xc7\xd4\xa4\xb7\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {An error has occurred while creating image.}
+::msgcat::mcset ja {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset ja {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset ja {An error has occurred while printing} [encoding convertfrom euc-jp "\xb0\xf5\xba\xfe\xa4\xcb\xbc\xba\xc7\xd4\xa4\xb7\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {An error has occurred while reading image.}
+::msgcat::mcset ja {An error has occurred while saving} [encoding convertfrom euc-jp "\xca\xdd\xc2\xb8\xa4\xcb\xbc\xba\xc7\xd4\xa4\xb7\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {An error has occurred while updating VO server list}
+::msgcat::mcset ja {An error has occurred while writing image.}
+::msgcat::mcset ja {An internal error has been detected}
+::msgcat::mcset ja {Analysis Command Log} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9\xa4\xce\xb5\xad\xcf\xbf"]
+::msgcat::mcset ja {Analysis Commands} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9"]
+::msgcat::mcset ja {Analysis File}
+::msgcat::mcset ja {Analysis Log}
+::msgcat::mcset ja {Analysis} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf"]
+::msgcat::mcset ja {Angle Complement} [encoding convertfrom euc-jp "\xca\xe4\xb3\xd1"]
+::msgcat::mcset ja {Angles} [encoding convertfrom euc-jp "\xb3\xd1\xc5\xd9"]
+::msgcat::mcset ja {Angle} [encoding convertfrom euc-jp "\xb3\xd1\xc5\xd9"]
+::msgcat::mcset ja {Annuli} [encoding convertfrom euc-jp "\xc3\xe6\xc8\xb4\xa4\xad\xb1\xdf"]
+::msgcat::mcset ja {Annulus} [encoding convertfrom euc-jp "\xc3\xe6\xc8\xb4\xa4\xad\xb1\xdf"]
+::msgcat::mcset ja {Apply} [encoding convertfrom euc-jp "\xc5\xac\xcd\xd1"]
+::msgcat::mcset ja {ArcMin} [encoding convertfrom euc-jp "\xca\xac"]
+::msgcat::mcset ja {ArcSec} [encoding convertfrom euc-jp "\xc9\xc3"]
+::msgcat::mcset ja {Architecture} [encoding convertfrom euc-jp "\xa5\xa2\xa1\xbc\xa5\xad\xa5\xc6\xa5\xaf\xa5\xc1\xa5\xe3"]
+::msgcat::mcset ja {Archives}
+::msgcat::mcset ja {Array}
+::msgcat::mcset ja {Arrow} [encoding convertfrom euc-jp "\xcc\xf0\xb0\xf5"]
+::msgcat::mcset ja {Astronomy} [encoding convertfrom euc-jp "\xc5\xb7\xca\xb8\xb3\xd8"]
+::msgcat::mcset ja {At Startup}
+::msgcat::mcset ja {At least 2 different catalogs are required}
+::msgcat::mcset ja {Auto Centroid} [encoding convertfrom euc-jp "\xbc\xab\xc6\xb0\xc3\xe6\xbf\xb4\xb9\xe7\xa4\xef\xa4\xbb"]
+::msgcat::mcset ja {Auto Plot 2D}
+::msgcat::mcset ja {Auto Plot 3D}
+::msgcat::mcset ja {Auto Plot Statistics}
+::msgcat::mcset ja {Auto Plot}
+::msgcat::mcset ja {Autoload FITS Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xce\xbc\xab\xc6\xb0\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Autoload}
+::msgcat::mcset ja {Automatic} [encoding convertfrom euc-jp "\xbc\xab\xc6\xb0"]
+::msgcat::mcset ja {Average} [encoding convertfrom euc-jp "\xca\xbf\xb6\xd1"]
+::msgcat::mcset ja {Axes Number}
+::msgcat::mcset ja {Axes Order}
+::msgcat::mcset ja {Axes Title}
+::msgcat::mcset ja {Axes} [encoding convertfrom euc-jp "\xbc\xb4"]
+::msgcat::mcset ja {Axis Length} [encoding convertfrom euc-jp "\xbc\xb4\xa4\xce\xc4\xb9\xa4\xb5"]
+::msgcat::mcset ja {Axis Numbers} [encoding convertfrom euc-jp "\xbc\xb4\xa4\xce\xbf\xf4\xc3\xcd"]
+::msgcat::mcset ja {Axis Title}
+::msgcat::mcset ja {Axis} [encoding convertfrom euc-jp "\xbc\xb4"]
+::msgcat::mcset ja {Azimuth} [encoding convertfrom euc-jp "\xca\xfd\xb0\xcc\xb3\xd1"]
+::msgcat::mcset ja {Background Color} [encoding convertfrom euc-jp "\xc7\xd8\xb7\xca\xbf\xa7"]
+::msgcat::mcset ja {Background} [encoding convertfrom euc-jp "\xa5\xd0\xa5\xc3\xa5\xaf\xa5\xb0\xa5\xe9\xa5\xa6\xa5\xf3\xa5\xc9\xce\xce\xb0\xe8"]
+::msgcat::mcset ja {Backup}
+::msgcat::mcset ja {Back} [encoding convertfrom euc-jp "\xc1\xb0"]
+::msgcat::mcset ja {Bar Plot Tool}
+::msgcat::mcset ja {Bias} [encoding convertfrom euc-jp "\xa5\xd0\xa5\xa4\xa5\xa2\xa5\xb9"]
+::msgcat::mcset ja {Bin 3rd Column} [encoding convertfrom euc-jp "\xc2\xe8\xa3\xb3\xa4\xce\xce\xf3\xa4\xf2\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1"]
+::msgcat::mcset ja {Bin Center} [encoding convertfrom euc-jp "\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1\xa4\xce\xc3\xe6\xbf\xb4"]
+::msgcat::mcset ja {Bin Columns} [encoding convertfrom euc-jp "\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1\xa4\xb9\xa4\xeb\xce\xf3"]
+::msgcat::mcset ja {Bin Filter} [encoding convertfrom euc-jp "\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1\xa4\xce\xb9\xca\xa4\xea\xb9\xfe\xa4\xdf\xbe\xf2\xb7\xef"]
+::msgcat::mcset ja {Bin Fit}
+::msgcat::mcset ja {Bin In}
+::msgcat::mcset ja {Bin Out}
+::msgcat::mcset ja {Binning Parameters} [encoding convertfrom euc-jp "\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Bin} [encoding convertfrom euc-jp "\xa5\xd3\xa5\xf3\xa4\xde\xa4\xc8\xa4\xe1"]
+::msgcat::mcset ja {Black} [encoding convertfrom euc-jp "\xb9\xf5\xbf\xa7"]
+::msgcat::mcset ja {Blank/Inf/NaN Color} [encoding convertfrom euc-jp "\xcc\xa4\xc4\xea\xb5\xc1\xc3\xcd\x28\x42\x6c\x61\x6e\x6b\x2f\x49\x6e\x66\x2f\x4e\x61\x4e\x29\xa4\xce\xbf\xa7"]
+::msgcat::mcset ja {Blink Frames} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xa5\xd6\xa5\xea\xa5\xf3\xa5\xaf"]
+::msgcat::mcset ja {Blink Interval} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xea\xa5\xf3\xa5\xaf\xa4\xce\xb4\xd6\xb3\xd6"]
+::msgcat::mcset ja {Blink} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xea\xa5\xf3\xa5\xaf"]
+::msgcat::mcset ja {Block Fit}
+::msgcat::mcset ja {Block In} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xed\xa5\xc3\xa5\xaf\xa4\xf2\xba\xd9\xa4\xab\xa4\xaf"]
+::msgcat::mcset ja {Block Out} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xed\xa5\xc3\xa5\xaf\xa4\xf2\xb9\xd3\xa4\xaf"]
+::msgcat::mcset ja {Block Parameters}
+::msgcat::mcset ja {Block} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xed\xa5\xc3\xa5\xaf"]
+::msgcat::mcset ja {Blue} [encoding convertfrom euc-jp "\xc0\xc4\xbf\xa7"]
+::msgcat::mcset ja {Bold} [encoding convertfrom euc-jp "\xc2\xc0\xbb\xfa"]
+::msgcat::mcset ja {Border} [encoding convertfrom euc-jp "\xcf\xc8\xc0\xfe"]
+::msgcat::mcset ja {Bottom}
+::msgcat::mcset ja {Box Annulus} [encoding convertfrom euc-jp "\xc3\xe6\xc8\xb4\xa4\xad\xbb\xcd\xb3\xd1\xb7\xc1"]
+::msgcat::mcset ja {Box Panda} [encoding convertfrom euc-jp "\xc9\xf4\xca\xac\xbb\xcd\xb3\xd1\xb7\xc1"]
+::msgcat::mcset ja {BoxCircle}
+::msgcat::mcset ja {Boxcar} [encoding convertfrom euc-jp "\xa5\xdc\xa5\xc3\xa5\xaf\xa5\xb9\xa5\xab\xa1\xbc"]
+::msgcat::mcset ja {Box} [encoding convertfrom euc-jp "\xbb\xcd\xb3\xd1\xb7\xc1"]
+::msgcat::mcset ja {Broadcast}
+::msgcat::mcset ja {Browser}
+::msgcat::mcset ja {Browse} [encoding convertfrom euc-jp "\xbb\xb2\xbe\xc8"]
+::msgcat::mcset ja {Buffer} [encoding convertfrom euc-jp "\xa5\xd0\xa5\xc3\xa5\xd5\xa5\xa1"]
+::msgcat::mcset ja {Buttonbar} [encoding convertfrom euc-jp "\xa5\xdc\xa5\xbf\xa5\xf3\xa5\xd0\xa1\xbc"]
+::msgcat::mcset ja {Buttons} [encoding convertfrom euc-jp "\xa5\xdc\xa5\xbf\xa5\xf3"]
+::msgcat::mcset ja {Bytes} [encoding convertfrom euc-jp "\xa5\xd0\xa5\xa4\xa5\xc8"]
+::msgcat::mcset ja {CMYK} [encoding convertfrom euc-jp "\x43\x4d\x59\x4b\xbf\xa7"]
+::msgcat::mcset ja {Can Delete} [encoding convertfrom euc-jp "\xba\xef\xbd\xfc\xb2\xc4"]
+::msgcat::mcset ja {Can Edit} [encoding convertfrom euc-jp "\xca\xd4\xbd\xb8\xb2\xc4"]
+::msgcat::mcset ja {Can Move} [encoding convertfrom euc-jp "\xb0\xdc\xc6\xb0\xb2\xc4"]
+::msgcat::mcset ja {Can Rotate} [encoding convertfrom euc-jp "\xb2\xf3\xc5\xbe\xb2\xc4"]
+::msgcat::mcset ja {Cancelled}
+::msgcat::mcset ja {Cancel} [encoding convertfrom euc-jp "\xbc\xe8\xa4\xea\xbe\xc3\xa4\xb7"]
+::msgcat::mcset ja {Cap}
+::msgcat::mcset ja {Catalog Server} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xb8\xa1\xba\xf7\xa5\xb5\xa1\xbc\xa5\xd0\xa1\xbc"]
+::msgcat::mcset ja {Catalog Tool} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa5\xc4\xa1\xbc\xa5\xeb"]
+::msgcat::mcset ja {Catalogs} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0"]
+::msgcat::mcset ja {Catalog} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0"]
+::msgcat::mcset ja {Catrom}
+::msgcat::mcset ja {Cat}
+::msgcat::mcset ja {Center Image} [encoding convertfrom euc-jp "\xa5\xa4\xa5\xe1\xa1\xbc\xa5\xb8\xa4\xf2\xc3\xe6\xbf\xb4\xa4\xcb"]
+::msgcat::mcset ja {Center Non-modal Dialogs}
+::msgcat::mcset ja {Center} [encoding convertfrom euc-jp "\xc3\xe6\xbf\xb4"]
+::msgcat::mcset ja {Centroid Parameters} [encoding convertfrom euc-jp "\xc3\xe6\xbf\xb4\xb9\xe7\xa4\xef\xa4\xbb\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Centroid}
+::msgcat::mcset ja {Circle} [encoding convertfrom euc-jp "\xb1\xdf"]
+::msgcat::mcset ja {Clear All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear Analysis Commands} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear Cache} [encoding convertfrom euc-jp "\xa5\xad\xa5\xe3\xa5\xc3\xa5\xb7\xa5\xe5\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear Data} [encoding convertfrom euc-jp "\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear External Analysis Commands?} [encoding convertfrom euc-jp "\xb3\xb0\xc9\xf4\xb2\xf2\xc0\xcf\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9\xa4\xf2\xbe\xc3\xb5\xee\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {Clear Filter} [encoding convertfrom euc-jp "\xb9\xca\xa4\xea\xb9\xfe\xa4\xdf\xbe\xf2\xb7\xef\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear Preferences?} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea\xa4\xf2\xbe\xc3\xb5\xee\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {Clear Preferences} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Clear} [encoding convertfrom euc-jp "\xa5\xaf\xa5\xea\xa5\xa2"]
+::msgcat::mcset ja {Click to Center} [encoding convertfrom euc-jp "\xa5\xaf\xa5\xea\xa5\xc3\xa5\xaf\xb0\xcc\xc3\xd6\xa4\xf2\xc3\xe6\xbf\xb4"]
+::msgcat::mcset ja {Close} [encoding convertfrom euc-jp "\xca\xc4\xa4\xb8\xa4\xeb"]
+::msgcat::mcset ja {Colorbar Size}
+::msgcat::mcset ja {Colorbar} [encoding convertfrom euc-jp "\xc7\xdb\xbf\xa7\xcb\xc0"]
+::msgcat::mcset ja {Colormap Parameters} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Colormap} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4"]
+::msgcat::mcset ja {Color} [encoding convertfrom euc-jp "\xbf\xa7"]
+::msgcat::mcset ja {Columns} [encoding convertfrom euc-jp "\xce\xf3"]
+::msgcat::mcset ja {Column} [encoding convertfrom euc-jp "\xce\xf3"]
+::msgcat::mcset ja {Command not allowed}
+::msgcat::mcset ja {Command} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9"]
+::msgcat::mcset ja {Compass} [encoding convertfrom euc-jp "\xca\xfd\xb0\xcc\xbc\xa7\xc0\xd0"]
+::msgcat::mcset ja {Composite Region} [encoding convertfrom euc-jp "\xca\xa3\xb9\xe7\xce\xce\xb0\xe8"]
+::msgcat::mcset ja {Composite}
+::msgcat::mcset ja {Compression} [encoding convertfrom euc-jp "\xb0\xb5\xbd\xcc"]
+::msgcat::mcset ja {Configure} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Connect Directly} [encoding convertfrom euc-jp "\xc4\xbe\xc0\xdc\xc0\xdc\xc2\xb3"]
+::msgcat::mcset ja {Connect SAMP}
+::msgcat::mcset ja {Connect Using Web Proxy} [encoding convertfrom euc-jp "\x57\x65\x62\x20\xa5\xd7\xa5\xed\xa5\xad\xa5\xb7\xa4\xf2\xb2\xf0\xa4\xb7\xa4\xc6\xc0\xdc\xc2\xb3"]
+::msgcat::mcset ja {Connect} [encoding convertfrom euc-jp "\xc0\xdc\xc2\xb3"]
+::msgcat::mcset ja {Console}
+::msgcat::mcset ja {Contacting Image Server}
+::msgcat::mcset ja {Contour Parameters} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Contours} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2"]
+::msgcat::mcset ja {Contour}
+::msgcat::mcset ja {Contrast} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xe9\xa5\xb9\xa5\xc8"]
+::msgcat::mcset ja {Convert to Polygons} [encoding convertfrom euc-jp "\xc2\xbf\xb3\xd1\xb7\xc1\xa4\xcb\xca\xd1\xb4\xb9"]
+::msgcat::mcset ja {Coordinate Grid Parameters} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8\xa5\xb0\xa5\xea\xa5\xc3\xa5\xc9\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Coordinate Grid} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8\xa5\xb0\xa5\xea\xa5\xc3\xa5\xc9"]
+::msgcat::mcset ja {Coordinate System} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8\xb7\xcf"]
+::msgcat::mcset ja {Coordinates} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Coordinate} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Copy Contours} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa4\xf2\xa5\xb3\xa5\xd4\xa1\xbc"]
+::msgcat::mcset ja {Copy to Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xcb\xa5\xb3\xa5\xd4\xa1\xbc"]
+::msgcat::mcset ja {Copy} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xd4\xa1\xbc"]
+::msgcat::mcset ja {Create Movie}
+::msgcat::mcset ja {Create New Frame on Download} [encoding convertfrom euc-jp "\xa5\xc0\xa5\xa6\xa5\xf3\xa5\xed\xa1\xbc\xa5\xc9\xbb\xfe\xa4\xcb\xbf\xb7\xa4\xb7\xa4\xa4\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xba\xee\xc0\xae"]
+::msgcat::mcset ja {Create} [encoding convertfrom euc-jp "\xba\xee\xc0\xae"]
+::msgcat::mcset ja {Crop Parameters}
+::msgcat::mcset ja {Crop}
+::msgcat::mcset ja {Crosshair Parameters}
+::msgcat::mcset ja {Crosshair To} [encoding convertfrom euc-jp "\xa4\xbd\xa4\xb3\xa4\xcb\xbd\xbd\xbb\xfa\xc0\xfe"]
+::msgcat::mcset ja {Crosshair} [encoding convertfrom euc-jp "\xbd\xbd\xbb\xfa\xa5\xab\xa1\xbc\xa5\xbd\xa5\xeb"]
+::msgcat::mcset ja {Cross} [encoding convertfrom euc-jp "\xbd\xbd\xbb\xfa"]
+::msgcat::mcset ja {Cubehelix}
+::msgcat::mcset ja {Cube}
+::msgcat::mcset ja {Cubic}
+::msgcat::mcset ja {Current Frame} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xc3\xe6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Current Range} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xc3\xe6\xa4\xce\xc8\xcf\xb0\xcf"]
+::msgcat::mcset ja {Current} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xc3\xe6"]
+::msgcat::mcset ja {Cursor} [encoding convertfrom euc-jp "\xa5\xab\xa1\xbc\xa5\xbd\xa5\xeb"]
+::msgcat::mcset ja {Cut} [encoding convertfrom euc-jp "\xc0\xda\xa4\xea\xbc\xe8\xa4\xea"]
+::msgcat::mcset ja {Cyan} [encoding convertfrom euc-jp "\xbf\xe5\xbf\xa7"]
+::msgcat::mcset ja {DPI}
+::msgcat::mcset ja {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset ja {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset ja {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset ja {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom euc-jp "\xb8\xc5\xa4\xa4\xa5\xd0\xa1\xbc\xa5\xb8\xa5\xe7\xa5\xf3\xa4\xce\xc0\xdf\xc4\xea\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3\xb9\xb9\xbf\xb7\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {DS9 will complete the initialization process} [encoding convertfrom euc-jp "\xbd\xe9\xb4\xfc\xb2\xbd\xa4\xf2\xb4\xb0\xce\xbb\xa4\xb7\xa4\xde\xa4\xb9\xa1\xa3"]
+::msgcat::mcset ja {Dash} [encoding convertfrom euc-jp "\xc7\xcb\xc0\xfe"]
+::msgcat::mcset ja {Data Format} [encoding convertfrom euc-jp "\xa5\xc7\xa1\xbc\xa5\xbf\xb7\xc1\xbc\xb0"]
+::msgcat::mcset ja {Dataset Name}
+::msgcat::mcset ja {Dataset} [encoding convertfrom euc-jp "\xa5\xc7\xa1\xbc\xa5\xbf\xa5\xbb\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Data}
+::msgcat::mcset ja {Decrease} [encoding convertfrom euc-jp "\xb9\xdf\xbd\xe7"]
+::msgcat::mcset ja {Default All Files}
+::msgcat::mcset ja {Default Format}
+::msgcat::mcset ja {Default Length}
+::msgcat::mcset ja {Default} [encoding convertfrom euc-jp "\xc9\xb8\xbd\xe0"]
+::msgcat::mcset ja {Degrees} [encoding convertfrom euc-jp "\xc5\xd9"]
+::msgcat::mcset ja {Delete All Frames?} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbe\xc3\xb5\xee\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {Delete All Frames} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete All Groups?} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xa4\xf2\xbe\xc3\xb5\xee\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {Delete All Groups} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete All Regions?} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xce\xce\xb0\xe8\xa4\xf2\xbe\xc3\xb5\xee\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {Delete All Regions} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xce\xce\xb0\xe8\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete Color Tags}
+::msgcat::mcset ja {Delete Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete Group} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xa4\xf2\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Delete Selected Regions} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xa4\xb7\xa4\xbf\xce\xce\xb0\xe8\xa4\xf2\xba\xef\xbd\xfc"]
+::msgcat::mcset ja {Delete} [encoding convertfrom euc-jp "\xbe\xc3\xb5\xee"]
+::msgcat::mcset ja {Depth} [encoding convertfrom euc-jp "\xbf\xbc\xa4\xb5"]
+::msgcat::mcset ja {Detector} [encoding convertfrom euc-jp "\xb8\xa1\xbd\xd0\xb4\xef\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Dialog Box} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xc3\xa5\xd7\xa5\xa2\xa5\xc3\xa5\xd7\xa5\xe1\xa5\xcb\xa5\xe5\xa1\xbc"]
+::msgcat::mcset ja {Diamond} [encoding convertfrom euc-jp "\xc9\xa9\xb7\xc1"]
+::msgcat::mcset ja {Dimension} [encoding convertfrom euc-jp "\xbc\xa1\xb8\xb5"]
+::msgcat::mcset ja {Direction}
+::msgcat::mcset ja {Disconnect} [encoding convertfrom euc-jp "\xc0\xdc\xc2\xb3\xbd\xaa\xce\xbb"]
+::msgcat::mcset ja {Display Header}
+::msgcat::mcset ja {Display Size} [encoding convertfrom euc-jp "\xa5\xb5\xa5\xa4\xa5\xba\xa4\xf2\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Dissolve} [encoding convertfrom euc-jp "\xca\xac\xb2\xf2"]
+::msgcat::mcset ja {Distance}
+::msgcat::mcset ja {Done}
+::msgcat::mcset ja {Download Colormap}
+::msgcat::mcset ja {Download VOTABLE format if available} [encoding convertfrom euc-jp "\x56\x4f\x54\x41\x42\x4c\x45\x20\xb7\xc1\xbc\xb0\xa4\xac\xa4\xa2\xa4\xec\xa4\xd0\xa5\xc0\xa5\xa6\xa5\xf3\xa5\xed\xa1\xbc\xa5\xc9"]
+::msgcat::mcset ja {Drag to Center} [encoding convertfrom euc-jp "\xc3\xe6\xbf\xb4\xa4\xcb\xa5\xc9\xa5\xe9\xa5\xc3\xa5\xb0"]
+::msgcat::mcset ja {Duplicate Data}
+::msgcat::mcset ja {East} [encoding convertfrom euc-jp "\xc5\xec"]
+::msgcat::mcset ja {Ecliptic} [encoding convertfrom euc-jp "\xb2\xab\xc6\xbb\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Edit Group Name} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xcc\xbe\xa4\xf2\xca\xd1\xb9\xb9"]
+::msgcat::mcset ja {Edit} [encoding convertfrom euc-jp "\xca\xd4\xbd\xb8"]
+::msgcat::mcset ja {Elevation} [encoding convertfrom euc-jp "\xb9\xe2\xc5\xd9"]
+::msgcat::mcset ja {Ellipse Annulus}
+::msgcat::mcset ja {Ellipse Panda} [encoding convertfrom euc-jp "\xc9\xf4\xca\xac\xc2\xca\xb1\xdf"]
+::msgcat::mcset ja {Ellipse} [encoding convertfrom euc-jp "\xc2\xca\xb1\xdf"]
+::msgcat::mcset ja {Elliptical Annulus} [encoding convertfrom euc-jp "\xc3\xe6\xc8\xb4\xa4\xad\xc2\xca\xb1\xdf"]
+::msgcat::mcset ja {Elliptical Panda} [encoding convertfrom euc-jp "\xc3\xe6\xc8\xb4\xa4\xad\xc9\xf4\xca\xac\xc2\xca\xb1\xdf"]
+::msgcat::mcset ja {Enable Confirmation Dialogs} [encoding convertfrom euc-jp "\xb3\xce\xc7\xa7\xa5\xe1\xa5\xc3\xa5\xbb\xa1\xbc\xa5\xb8\xa4\xf2\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Enable}
+::msgcat::mcset ja {End} [encoding convertfrom euc-jp "\xbd\xaa\xce\xbb"]
+::msgcat::mcset ja {Enter Color} [encoding convertfrom euc-jp "\xbf\xa7\xa4\xf2\xc6\xfe\xce\xcf"]
+::msgcat::mcset ja {Enter Font Size}
+::msgcat::mcset ja {Enter Group Name} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xcc\xbe\xa4\xf2\xc6\xfe\xce\xcf"]
+::msgcat::mcset ja {Enter Search Expression} [encoding convertfrom euc-jp "\xb8\xa1\xba\xf7\xbe\xf2\xb7\xef\xa4\xf2\xc6\xfe\xce\xcf"]
+::msgcat::mcset ja {Enter URL}
+::msgcat::mcset ja {Entry}
+::msgcat::mcset ja {Equal Area} [encoding convertfrom euc-jp "\xc5\xf9\xcc\xcc\xc0\xd1"]
+::msgcat::mcset ja {Equal Distance} [encoding convertfrom euc-jp "\xc5\xf9\xb5\xf7\xce\xa5"]
+::msgcat::mcset ja {Equal Spacing}
+::msgcat::mcset ja {Equal Value}
+::msgcat::mcset ja {Error code was returned} [encoding convertfrom euc-jp "\xa5\xa8\xa5\xe9\xa1\xbc\xa5\xb3\xa1\xbc\xa5\xc9\xa4\xac\xca\xd6\xa4\xb5\xa4\xec\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {Error} [encoding convertfrom euc-jp "\xa5\xa8\xa5\xe9\xa1\xbc"]
+::msgcat::mcset ja {Examine Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbe\xdc\xba\xd9\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Examine} [encoding convertfrom euc-jp "\xbe\xdc\xba\xd9\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Exam}
+::msgcat::mcset ja {Exclude} [encoding convertfrom euc-jp "\xb3\xb0\xc2\xa6"]
+::msgcat::mcset ja {Exit} [encoding convertfrom euc-jp "\xbd\xaa\xce\xbb"]
+::msgcat::mcset ja {Export Array}
+::msgcat::mcset ja {Export}
+::msgcat::mcset ja {Extention}
+::msgcat::mcset ja {Exterior Axes} [encoding convertfrom euc-jp "\xbc\xb4\xa4\xf2\xb3\xb0\xc2\xa6\xa4\xcb"]
+::msgcat::mcset ja {Exterior Numerics} [encoding convertfrom euc-jp "\xbf\xf4\xc3\xcd\xa4\xf2\xb3\xb0\xc2\xa6\xa4\xcb"]
+::msgcat::mcset ja {FAQ} [encoding convertfrom euc-jp "\xa4\xe8\xa4\xaf\xa4\xa2\xa4\xeb\xbc\xc1\xcc\xe4\xa4\xc8\xc5\xfa\xa4\xa8"]
+::msgcat::mcset ja {FK4}
+::msgcat::mcset ja {FK5}
+::msgcat::mcset ja {Factor}
+::msgcat::mcset ja {File not Found or Unable to load FITS data MIME type} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3\xa4\xde\xa4\xbf\xa4\xcf\xa1\xa2\x46\x49\x54\x53\x20\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xac\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Filename} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xcc\xbe"]
+::msgcat::mcset ja {File} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb"]
+::msgcat::mcset ja {Fill}
+::msgcat::mcset ja {Filter} [encoding convertfrom euc-jp "\xb9\xca\xa4\xea\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Find Next} [encoding convertfrom euc-jp "\xbc\xa1\xa4\xf2\xb8\xa1\xba\xf7"]
+::msgcat::mcset ja {Find} [encoding convertfrom euc-jp "\xb8\xa1\xba\xf7"]
+::msgcat::mcset ja {First Frame} [encoding convertfrom euc-jp "\xba\xc7\xbd\xe9\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {First} [encoding convertfrom euc-jp "\xba\xc7\xbd\xe9"]
+::msgcat::mcset ja {Fits}
+::msgcat::mcset ja {Fixed in Size} [encoding convertfrom euc-jp "\xa5\xb5\xa5\xa4\xa5\xba\xb8\xc7\xc4\xea"]
+::msgcat::mcset ja {Flat}
+::msgcat::mcset ja {Flip}
+::msgcat::mcset ja {Font} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa9\xa5\xf3\xa5\xc8"]
+::msgcat::mcset ja {For more information, use --help} [encoding convertfrom euc-jp "\xbe\xdc\xa4\xb7\xa4\xaf\xa4\xcf\x20\x2d\x2d\x68\x65\x6c\x70\x20\xa5\xaa\xa5\xd7\xa5\xb7\xa5\xe7\xa5\xf3\xa4\xc7\xa1\xa3"]
+::msgcat::mcset ja {Format} [encoding convertfrom euc-jp "\xb7\xc1\xbc\xb0"]
+::msgcat::mcset ja {Forward} [encoding convertfrom euc-jp "\xbc\xa1"]
+::msgcat::mcset ja {Found}
+::msgcat::mcset ja {Frame Information} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xce\xbe\xf0\xca\xf3"]
+::msgcat::mcset ja {Frame Parameters} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Frames}
+::msgcat::mcset ja {Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {From}
+::msgcat::mcset ja {Front} [encoding convertfrom euc-jp "\xc1\xb4\xcc\xcc"]
+::msgcat::mcset ja {Full Range} [encoding convertfrom euc-jp "\xc1\xb4\xc8\xcf\xb0\xcf"]
+::msgcat::mcset ja {Function} [encoding convertfrom euc-jp "\xb4\xd8\xbf\xf4"]
+::msgcat::mcset ja {GUI Font}
+::msgcat::mcset ja {Galactic} [encoding convertfrom euc-jp "\xb6\xe4\xb2\xcf\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Gap}
+::msgcat::mcset ja {Gaussian} [encoding convertfrom euc-jp "\xa5\xac\xa5\xa6\xa5\xb7\xa5\xa2\xa5\xf3"]
+::msgcat::mcset ja {General} [encoding convertfrom euc-jp "\xb0\xec\xc8\xcc"]
+::msgcat::mcset ja {Generate} [encoding convertfrom euc-jp "\xc0\xb8\xc0\xae"]
+::msgcat::mcset ja {Generating Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xf2\xba\xee\xc0\xae\xc3\xe6"]
+::msgcat::mcset ja {Get Information} [encoding convertfrom euc-jp "\xbe\xf0\xca\xf3\xa4\xf2\xbc\xe8\xc6\xc0"]
+::msgcat::mcset ja {Gist}
+::msgcat::mcset ja {Global Properties} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xed\xa1\xbc\xa5\xd0\xa5\xeb\xa5\xd7\xa5\xed\xa5\xd1\xa5\xc6\xa5\xa3"]
+::msgcat::mcset ja {Global} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xed\xa1\xbc\xa5\xd0\xa5\xeb"]
+::msgcat::mcset ja {Goto Frame} [encoding convertfrom euc-jp "\xbb\xd8\xc4\xea\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Graph Horz} [encoding convertfrom euc-jp "\xb2\xa3\xc3\xc7\xcc\xcc\xbf\xde"]
+::msgcat::mcset ja {Graph Vert} [encoding convertfrom euc-jp "\xbd\xc4\xc3\xc7\xcc\xcc\xbf\xde"]
+::msgcat::mcset ja {Graphics}
+::msgcat::mcset ja {Graphs}
+::msgcat::mcset ja {Graph} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xe9\xa5\xd5"]
+::msgcat::mcset ja {Grayscale} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xec\xa1\xbc\xa5\xb9\xa5\xb1\xa1\xbc\xa5\xeb"]
+::msgcat::mcset ja {Green} [encoding convertfrom euc-jp "\xce\xd0\xbf\xa7"]
+::msgcat::mcset ja {Grid Gap} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xea\xa5\xc3\xa5\xc9\xa4\xce\xb4\xd6\xb3\xd6"]
+::msgcat::mcset ja {Grid} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xea\xa5\xc3\xa5\xc9"]
+::msgcat::mcset ja {Groove}
+::msgcat::mcset ja {Groups} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7"]
+::msgcat::mcset ja {HTTP} [encoding convertfrom euc-jp "\x48\x54\x54\x50"]
+::msgcat::mcset ja {Header} [encoding convertfrom euc-jp "\xa5\xd8\xa5\xc3\xa5\xc0"]
+::msgcat::mcset ja {Height} [encoding convertfrom euc-jp "\xb9\xe2\xa4\xb5"]
+::msgcat::mcset ja {Help Desk} [encoding convertfrom euc-jp "\xa5\xd8\xa5\xeb\xa5\xd7\xa5\xc7\xa5\xb9\xa5\xaf"]
+::msgcat::mcset ja {Help Me Choose} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xa4\xce\xa5\xd2\xa5\xf3\xa5\xc8"]
+::msgcat::mcset ja {Help} [encoding convertfrom euc-jp "\xa5\xd8\xa5\xeb\xa5\xd7"]
+::msgcat::mcset ja {Hide All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xc8\xf3\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Highlite}
+::msgcat::mcset ja {High} [encoding convertfrom euc-jp "\xbe\xe5\xb8\xc2"]
+::msgcat::mcset ja {Histogram Equalization} [encoding convertfrom euc-jp "\xa5\xd2\xa5\xb9\xa5\xc8\xa5\xb0\xa5\xe9\xa5\xe0\xc5\xf9\xca\xac\xc9\xdb"]
+::msgcat::mcset ja {Histogram} [encoding convertfrom euc-jp "\xa5\xd2\xa5\xb9\xa5\xc8\xa5\xb0\xa5\xe9\xa5\xe0"]
+::msgcat::mcset ja {Horizontal Graph} [encoding convertfrom euc-jp "\xb2\xa3\xc3\xc7\xcc\xcc"]
+::msgcat::mcset ja {Horizontal Layout} [encoding convertfrom euc-jp "\xb2\xe8\xc1\xfc\xa4\xce\xbe\xe5\xa4\xcb\xc7\xdb\xc3\xd6"]
+::msgcat::mcset ja {Horizontal}
+::msgcat::mcset ja {IAU Location Code}
+::msgcat::mcset ja {ICRS} [encoding convertfrom euc-jp "\xb9\xf1\xba\xdd\xc5\xb7\xca\xb8\xbd\xe0\xb5\xf2\xb7\xcf"]
+::msgcat::mcset ja {Identification} [encoding convertfrom euc-jp "\xc6\xb1\xc4\xea"]
+::msgcat::mcset ja {If} [encoding convertfrom euc-jp "\xa4\xe2\xa4\xb7"]
+::msgcat::mcset ja {Image Servers}
+::msgcat::mcset ja {Image} [encoding convertfrom euc-jp "\xcf\xc0\xcd\xfd\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Import Array}
+::msgcat::mcset ja {Import}
+::msgcat::mcset ja {Include} [encoding convertfrom euc-jp "\xc6\xe2\xc2\xa6"]
+::msgcat::mcset ja {Increase} [encoding convertfrom euc-jp "\xbe\xba\xbd\xe7"]
+::msgcat::mcset ja {Information Panel} [encoding convertfrom euc-jp "\xbe\xf0\xca\xf3\xa5\xd1\xa5\xcd\xa5\xeb"]
+::msgcat::mcset ja {Information} [encoding convertfrom euc-jp "\xbe\xf0\xca\xf3"]
+::msgcat::mcset ja {Initialize XPA} [encoding convertfrom euc-jp "\x58\x50\x41\x20\xa4\xf2\xbd\xe9\xb4\xfc\xb2\xbd"]
+::msgcat::mcset ja {Inner} [encoding convertfrom euc-jp "\xc6\xe2\xb7\xc2"]
+::msgcat::mcset ja {Instrument FOV} [encoding convertfrom euc-jp "\xb8\xa1\xbd\xd0\xb4\xef\xa4\xce\xbb\xeb\xcc\xee"]
+::msgcat::mcset ja {Interior Axes} [encoding convertfrom euc-jp "\xbc\xb4\xa4\xf2\xc6\xe2\xc2\xa6\xa4\xcb"]
+::msgcat::mcset ja {Interior Numerics} [encoding convertfrom euc-jp "\xbf\xf4\xc3\xcd\xa4\xf2\xc6\xe2\xc2\xa6\xa4\xcb"]
+::msgcat::mcset ja {Internal Parse Error} [encoding convertfrom euc-jp "\xc6\xe2\xc9\xf4\xb2\xf2\xbc\xe1\xa5\xa8\xa5\xe9\xa1\xbc"]
+::msgcat::mcset ja {Interval} [encoding convertfrom euc-jp "\xb4\xd6\xb3\xd6"]
+::msgcat::mcset ja {Invalid Column Name}
+::msgcat::mcset ja {Invalid formated multipart/mixed mime type message}
+::msgcat::mcset ja {Invert Colormap} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4\xa4\xf2\xc8\xbf\xc5\xbe"]
+::msgcat::mcset ja {Invert Selection} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xa4\xf2\xc8\xbf\xc5\xbe"]
+::msgcat::mcset ja {Invert} [encoding convertfrom euc-jp "\xc8\xbf\xc5\xbe"]
+::msgcat::mcset ja {Italic} [encoding convertfrom euc-jp "\xa5\xa4\xa5\xbf\xa5\xea\xa5\xc3\xa5\xaf"]
+::msgcat::mcset ja {Items Found}
+::msgcat::mcset ja {Iteration} [encoding convertfrom euc-jp "\xb7\xab\xa4\xea\xca\xd6\xa4\xb7"]
+::msgcat::mcset ja {JPEG Quality Factor} [encoding convertfrom euc-jp "\x4a\x50\x45\x47\xa4\xce\xc9\xca\xbc\xc1"]
+::msgcat::mcset ja {Keep-Alive}
+::msgcat::mcset ja {Kernel}
+::msgcat::mcset ja {Keyboard Shortcuts} [encoding convertfrom euc-jp "\xa5\xb7\xa5\xe7\xa1\xbc\xa5\xc8\xa5\xab\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Keyboard} [encoding convertfrom euc-jp "\xa5\xad\xa1\xbc\xa5\xdc\xa1\xbc\xa5\xc9"]
+::msgcat::mcset ja {Keyword}
+::msgcat::mcset ja {Labels} [encoding convertfrom euc-jp "\xa5\xe9\xa5\xd9\xa5\xeb"]
+::msgcat::mcset ja {Label} [encoding convertfrom euc-jp "\xa5\xe9\xa5\xd9\xa5\xeb"]
+::msgcat::mcset ja {Landscape} [encoding convertfrom euc-jp "\xb2\xa3\xc4\xb9"]
+::msgcat::mcset ja {Language} [encoding convertfrom euc-jp "\xb8\xc0\xb8\xec"]
+::msgcat::mcset ja {Last Frame} [encoding convertfrom euc-jp "\xba\xc7\xb8\xe5\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Last} [encoding convertfrom euc-jp "\xba\xc7\xb8\xe5"]
+::msgcat::mcset ja {Layout Horz} [encoding convertfrom euc-jp "\xb2\xa3\xc7\xdb\xc3\xd6"]
+::msgcat::mcset ja {Layout Vert} [encoding convertfrom euc-jp "\xbd\xc4\xc7\xdb\xc3\xd6"]
+::msgcat::mcset ja {Layout}
+::msgcat::mcset ja {Left}
+::msgcat::mcset ja {Legal} [encoding convertfrom euc-jp "\xa5\xea\xa1\xbc\xa5\xac\xa5\xeb"]
+::msgcat::mcset ja {Legend Title}
+::msgcat::mcset ja {Legend}
+::msgcat::mcset ja {Length} [encoding convertfrom euc-jp "\xc4\xb9\xa4\xb5"]
+::msgcat::mcset ja {Letter} [encoding convertfrom euc-jp "\xa5\xec\xa5\xbf\xa1\xbc"]
+::msgcat::mcset ja {Levels} [encoding convertfrom euc-jp "\xa5\xec\xa5\xd9\xa5\xeb"]
+::msgcat::mcset ja {Level} [encoding convertfrom euc-jp "\xa5\xec\xa5\xd9\xa5\xeb"]
+::msgcat::mcset ja {Limits} [encoding convertfrom euc-jp "\xbe\xe5\xb2\xbc\xb8\xc2"]
+::msgcat::mcset ja {Line Plot Tool}
+::msgcat::mcset ja {Linear} [encoding convertfrom euc-jp "\xc0\xfe\xb7\xc1"]
+::msgcat::mcset ja {Line} [encoding convertfrom euc-jp "\xc0\xfe"]
+::msgcat::mcset ja {List Data}
+::msgcat::mcset ja {List Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xf2\xce\xf3\xb5\xf3"]
+::msgcat::mcset ja {List} [encoding convertfrom euc-jp "\xce\xf3\xb5\xf3"]
+::msgcat::mcset ja {Load Analysis Commands} [encoding convertfrom euc-jp "\xb2\xf2\xc0\xcf\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Color Tags}
+::msgcat::mcset ja {Load Colormap} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Configuration} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Contour Levels} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa5\xec\xa5\xd9\xa5\xeb\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Contours} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Contrast/Bias} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xe9\xa5\xb9\xa5\xc8\xa1\xa6\xa5\xd0\xa5\xa4\xa5\xa2\xa5\xb9\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Data} [encoding convertfrom euc-jp "\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Mosaic} [encoding convertfrom euc-jp "\xa5\xe2\xa5\xb6\xa5\xa4\xa5\xaf\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load Template} [encoding convertfrom euc-jp "\xbf\xf7\xb7\xc1\xa4\xce\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load into All Frames} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xcb\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Load into Current Frame} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xc3\xe6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xcb\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Loading Catalog} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa4\xf2\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf\xc3\xe6"]
+::msgcat::mcset ja {Loading} [encoding convertfrom euc-jp "\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf\xc3\xe6"]
+::msgcat::mcset ja {Load} [encoding convertfrom euc-jp "\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Local} [encoding convertfrom euc-jp "\xa5\xed\xa1\xbc\xa5\xab\xa5\xeb"]
+::msgcat::mcset ja {Lock Axes}
+::msgcat::mcset ja {Lock Bin}
+::msgcat::mcset ja {Lock Color}
+::msgcat::mcset ja {Lock Crop Amplifier}
+::msgcat::mcset ja {Lock Crop Detector}
+::msgcat::mcset ja {Lock Crop Image}
+::msgcat::mcset ja {Lock Crop None}
+::msgcat::mcset ja {Lock Crop Physical}
+::msgcat::mcset ja {Lock Crop WCS}
+::msgcat::mcset ja {Lock Crosshair Amplifier}
+::msgcat::mcset ja {Lock Crosshair Detector}
+::msgcat::mcset ja {Lock Crosshair Image}
+::msgcat::mcset ja {Lock Crosshair None}
+::msgcat::mcset ja {Lock Crosshair Physical}
+::msgcat::mcset ja {Lock Crosshair WCS}
+::msgcat::mcset ja {Lock Frame Amplifier}
+::msgcat::mcset ja {Lock Frame Detector}
+::msgcat::mcset ja {Lock Frame Image}
+::msgcat::mcset ja {Lock Frame None}
+::msgcat::mcset ja {Lock Frame Physical}
+::msgcat::mcset ja {Lock Frame WCS}
+::msgcat::mcset ja {Lock Limits}
+::msgcat::mcset ja {Lock Scale}
+::msgcat::mcset ja {Lock Slice Image}
+::msgcat::mcset ja {Lock Slice None}
+::msgcat::mcset ja {Lock Slice WCS}
+::msgcat::mcset ja {Lock Smooth}
+::msgcat::mcset ja {Lock} [encoding convertfrom euc-jp "\xb8\xc7\xc4\xea"]
+::msgcat::mcset ja {Log Exponent}
+::msgcat::mcset ja {Log} [encoding convertfrom euc-jp "\xc2\xd0\xbf\xf4"]
+::msgcat::mcset ja {Low High} [encoding convertfrom euc-jp "\xbe\xe5\xb8\xc2\xa1\xa6\xb2\xbc\xb8\xc2"]
+::msgcat::mcset ja {Lower Left Back}
+::msgcat::mcset ja {Lower Left Front}
+::msgcat::mcset ja {Lower Right Back}
+::msgcat::mcset ja {Lower Right Front}
+::msgcat::mcset ja {Low} [encoding convertfrom euc-jp "\xb2\xbc\xb8\xc2"]
+::msgcat::mcset ja {MIP}
+::msgcat::mcset ja {Magenta} [encoding convertfrom euc-jp "\xc5\xed\xbf\xa7"]
+::msgcat::mcset ja {Magnification}
+::msgcat::mcset ja {Magnifier} [encoding convertfrom euc-jp "\xb3\xc8\xc2\xe7\xbf\xde"]
+::msgcat::mcset ja {Major} [encoding convertfrom euc-jp "\xc4\xb9\xbc\xb4"]
+::msgcat::mcset ja {Manual} [encoding convertfrom euc-jp "\xbc\xea\xc6\xb0"]
+::msgcat::mcset ja {Mask Parameters} [encoding convertfrom euc-jp "\xa5\xde\xa5\xb9\xa5\xaf\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Match Axes}
+::msgcat::mcset ja {Match Bin}
+::msgcat::mcset ja {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset ja {Match Color}
+::msgcat::mcset ja {Match Crop Amplifier}
+::msgcat::mcset ja {Match Crop Detector}
+::msgcat::mcset ja {Match Crop Image}
+::msgcat::mcset ja {Match Crop Physical}
+::msgcat::mcset ja {Match Crop WCS}
+::msgcat::mcset ja {Match Crosshair Amplifier}
+::msgcat::mcset ja {Match Crosshair Detector}
+::msgcat::mcset ja {Match Crosshair Image}
+::msgcat::mcset ja {Match Crosshair Physical}
+::msgcat::mcset ja {Match Crosshair WCS}
+::msgcat::mcset ja {Match Frame Amplifier}
+::msgcat::mcset ja {Match Frame Detector}
+::msgcat::mcset ja {Match Frame Image}
+::msgcat::mcset ja {Match Frame Physical}
+::msgcat::mcset ja {Match Frame WCS}
+::msgcat::mcset ja {Match Limits}
+::msgcat::mcset ja {Match Scale}
+::msgcat::mcset ja {Match Slice Image}
+::msgcat::mcset ja {Match Slice WCS}
+::msgcat::mcset ja {Match Smooth}
+::msgcat::mcset ja {Match}
+::msgcat::mcset ja {Math Function} [encoding convertfrom euc-jp "\xb4\xd8\xbf\xf4"]
+::msgcat::mcset ja {Matplotlib}
+::msgcat::mcset ja {Max Rows} [encoding convertfrom euc-jp "\xba\xc7\xc2\xe7\xb9\xd4\xbf\xf4"]
+::msgcat::mcset ja {Maximum}
+::msgcat::mcset ja {Max} [encoding convertfrom euc-jp "\xba\xc7\xc2\xe7"]
+::msgcat::mcset ja {Menus and Buttons}
+::msgcat::mcset ja {Menu} [encoding convertfrom euc-jp "\xa5\xe1\xa5\xcb\xa5\xe5\xa1\xbc"]
+::msgcat::mcset ja {Message Log} [encoding convertfrom euc-jp "\xa5\xe1\xa5\xc3\xa5\xbb\xa1\xbc\xa5\xb8\xa4\xce\xb5\xad\xcf\xbf"]
+::msgcat::mcset ja {Method} [encoding convertfrom euc-jp "\xb7\xd7\xbb\xbb\xcb\xa1"]
+::msgcat::mcset ja {Min Max Parameters}
+::msgcat::mcset ja {Min Max} [encoding convertfrom euc-jp "\xba\xc7\xc2\xe7\xa1\xa6\xba\xc7\xbe\xae"]
+::msgcat::mcset ja {Minimum}
+::msgcat::mcset ja {Minor} [encoding convertfrom euc-jp "\xc3\xbb\xbc\xb4"]
+::msgcat::mcset ja {Minutes}
+::msgcat::mcset ja {Min} [encoding convertfrom euc-jp "\xba\xc7\xbe\xae"]
+::msgcat::mcset ja {Mission} [encoding convertfrom euc-jp "\xa5\xdf\xa5\xc3\xa5\xb7\xa5\xe7\xa5\xf3"]
+::msgcat::mcset ja {Mode}
+::msgcat::mcset ja {Mosaic IRAF Segment}
+::msgcat::mcset ja {Mosaic IRAF}
+::msgcat::mcset ja {Mosaic WCS Segment}
+::msgcat::mcset ja {Mosaic WCS}
+::msgcat::mcset ja {Mosaic WFPC2}
+::msgcat::mcset ja {Mosaic}
+::msgcat::mcset ja {Mouse Click Epsilon}
+::msgcat::mcset ja {Mouse Wheel Bin}
+::msgcat::mcset ja {Mouse Wheel Zoom}
+::msgcat::mcset ja {Mouse and Keyboard}
+::msgcat::mcset ja {Move Back} [encoding convertfrom euc-jp "\xc1\xb0\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move First} [encoding convertfrom euc-jp "\xba\xc7\xbd\xe9\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move Forward} [encoding convertfrom euc-jp "\xbc\xa1\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move Last} [encoding convertfrom euc-jp "\xba\xc7\xb8\xe5\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move to Back} [encoding convertfrom euc-jp "\xc7\xd8\xcc\xcc\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Move to Front} [encoding convertfrom euc-jp "\xc1\xb0\xcc\xcc\xa4\xcb\xb0\xdc\xc6\xb0"]
+::msgcat::mcset ja {Movie}
+::msgcat::mcset ja {Multiple Extension Cube}
+::msgcat::mcset ja {Multiple Extension Frames}
+::msgcat::mcset ja {Multiple WCS} [encoding convertfrom euc-jp "\xca\xa3\xbf\xf4\x57\x43\x53"]
+::msgcat::mcset ja {NRRD}
+::msgcat::mcset ja {Name Resolution} [encoding convertfrom euc-jp "\xcc\xbe\xc1\xb0\xa4\xc7\xb8\xa1\xba\xf7"]
+::msgcat::mcset ja {Name Server} [encoding convertfrom euc-jp "\xc5\xb7\xc2\xce\xcc\xbe\xb8\xa1\xba\xf7\xa5\xb5\xa1\xbc\xa5\xd0\xa1\xbc"]
+::msgcat::mcset ja {Name or Designation} [encoding convertfrom euc-jp "\xc5\xb7\xc2\xce\xcc\xbe"]
+::msgcat::mcset ja {Name}
+::msgcat::mcset ja {Native Dialog}
+::msgcat::mcset ja {New Features} [encoding convertfrom euc-jp "\xbf\xb7\xa4\xb7\xa4\xa4\xb5\xa1\xc7\xbd"]
+::msgcat::mcset ja {New Frame 3D} [encoding convertfrom euc-jp "\xbf\xb7\xa4\xb7\xa4\xa4\x33\x44\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {New Frame RGB} [encoding convertfrom euc-jp "\xbf\xb7\xa4\xb7\xa4\xa4\x52\x47\x42\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {New Frame each Time} [encoding convertfrom euc-jp "\xcb\xe8\xb2\xf3\xbf\xb7\xa4\xb7\xa4\xa4\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xba\xee\xc0\xae"]
+::msgcat::mcset ja {New Frame} [encoding convertfrom euc-jp "\xbf\xb7\xa4\xb7\xa4\xa4\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {New Group} [encoding convertfrom euc-jp "\xbf\xb7\xa4\xb7\xa4\xa4\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7"]
+::msgcat::mcset ja {New} [encoding convertfrom euc-jp "\xbf\xb7\xb5\xac"]
+::msgcat::mcset ja {Next Frame} [encoding convertfrom euc-jp "\xbc\xa1\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Next} [encoding convertfrom euc-jp "\xbf\xca\xa4\xe0"]
+::msgcat::mcset ja {No Catalog specified} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa4\xac\xbb\xd8\xc4\xea\xa4\xb5\xa4\xec\xa4\xc6\xa4\xa4\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {No Data Available}
+::msgcat::mcset ja {No Items Found} [encoding convertfrom euc-jp "\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3\xa4\xc7\xa4\xb7\xa4\xbf\xa1\xa3"]
+::msgcat::mcset ja {No current frame}
+::msgcat::mcset ja {Non-zero} [encoding convertfrom euc-jp "\xc8\xf3\xce\xed\xc3\xcd"]
+::msgcat::mcset ja {None} [encoding convertfrom euc-jp "\xa4\xca\xa4\xb7"]
+::msgcat::mcset ja {Normal} [encoding convertfrom euc-jp "\xc9\xb8\xbd\xe0"]
+::msgcat::mcset ja {North} [encoding convertfrom euc-jp "\xcb\xcc"]
+::msgcat::mcset ja {Not Found}
+::msgcat::mcset ja {Not Supported}
+::msgcat::mcset ja {Number of Samples} [encoding convertfrom euc-jp "\xa5\xb5\xa5\xf3\xa5\xd7\xa5\xeb\xa4\xce\xbf\xf4"]
+::msgcat::mcset ja {Number of Threads}
+::msgcat::mcset ja {Number of Ticks}
+::msgcat::mcset ja {Number} [encoding convertfrom euc-jp "\xc8\xd6\xb9\xe6"]
+::msgcat::mcset ja {Numerics} [encoding convertfrom euc-jp "\xbf\xf4\xc3\xcd"]
+::msgcat::mcset ja {OK} [encoding convertfrom euc-jp "\xce\xbb\xb2\xf2"]
+::msgcat::mcset ja {Object} [encoding convertfrom euc-jp "\xc5\xb7\xc2\xce\xcc\xbe"]
+::msgcat::mcset ja {Open File} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xf2\xb3\xab\xa4\xaf"]
+::msgcat::mcset ja {Open TCL Console} [encoding convertfrom euc-jp "\x54\x43\x4c\x20\xa5\xb3\xa5\xf3\xa5\xbd\xa1\xbc\xa5\xeb\xa4\xf2\xb3\xab\xa4\xaf"]
+::msgcat::mcset ja {Open URL} [encoding convertfrom euc-jp "\x55\x52\x4c\x20\xa4\xf2\xb3\xab\xa4\xaf"]
+::msgcat::mcset ja {Open as}
+::msgcat::mcset ja {Open} [encoding convertfrom euc-jp "\xb3\xab\xa4\xaf"]
+::msgcat::mcset ja {Operator} [encoding convertfrom euc-jp "\xb1\xe9\xbb\xbb\xbb\xd2"]
+::msgcat::mcset ja {Orientation} [encoding convertfrom euc-jp "\xca\xfd\xb8\xfe"]
+::msgcat::mcset ja {Origin}
+::msgcat::mcset ja {Oscillate}
+::msgcat::mcset ja {Other Color}
+::msgcat::mcset ja {Other Font Size}
+::msgcat::mcset ja {Other} [encoding convertfrom euc-jp "\xa4\xbd\xa4\xce\xc2\xbe"]
+::msgcat::mcset ja {Outer} [encoding convertfrom euc-jp "\xb3\xb0\xb7\xc2"]
+::msgcat::mcset ja {Overlap}
+::msgcat::mcset ja {PS Page Setup} [encoding convertfrom euc-jp "\x50\x53\xa5\xda\xa1\xbc\xa5\xb8\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {PS Print} [encoding convertfrom euc-jp "\x50\x53\xb0\xf5\xba\xfe"]
+::msgcat::mcset ja {Page Setup} [encoding convertfrom euc-jp "\xa5\xda\xa1\xbc\xa5\xb8\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Page Source} [encoding convertfrom euc-jp "\xa5\xda\xa1\xbc\xa5\xb8\xa4\xce\xa5\xbd\xa1\xbc\xa5\xb9"]
+::msgcat::mcset ja {Pan To} [encoding convertfrom euc-jp "\xa4\xbd\xa4\xb3\xa4\xcb\xa5\xd1\xa5\xf3"]
+::msgcat::mcset ja {Pan Zoom Rotate Parameters} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xf3\xa1\xa6\xa5\xba\xa1\xbc\xa5\xe0\xa1\xa6\xb2\xf3\xc5\xbe\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Pan Zoom} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xf3\xa1\xa6\xa5\xba\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Pan then Zoom} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xf3\xa4\xce\xa4\xc1\xa5\xba\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Panda} [encoding convertfrom euc-jp "\xc9\xf4\xca\xac\xb1\xdf"]
+::msgcat::mcset ja {Panner} [encoding convertfrom euc-jp "\xc1\xb4\xc2\xce\xbf\xde"]
+::msgcat::mcset ja {Pan} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xf3"]
+::msgcat::mcset ja {Parameters} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xe9\xa5\xe1\xa1\xbc\xa5\xbf"]
+::msgcat::mcset ja {Password} [encoding convertfrom euc-jp "\xa5\xd1\xa5\xb9\xa5\xef\xa1\xbc\xa5\xc9"]
+::msgcat::mcset ja {Paste Contours} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa4\xf2\xc5\xbd\xa4\xea\xc9\xd5\xa4\xb1"]
+::msgcat::mcset ja {Paste} [encoding convertfrom euc-jp "\xc5\xbd\xa4\xea\xc9\xd5\xa4\xb1"]
+::msgcat::mcset ja {Physical} [encoding convertfrom euc-jp "\xca\xaa\xcd\xfd\xba\xc2\xc9\xb8"]
+::msgcat::mcset ja {Pixel Distribution} [encoding convertfrom euc-jp "\xa5\xd4\xa5\xaf\xa5\xbb\xa5\xeb\xc9\xd1\xc5\xd9\xca\xac\xc9\xdb"]
+::msgcat::mcset ja {Pixel Size} [encoding convertfrom euc-jp "\xa5\xd4\xa5\xaf\xa5\xbb\xa5\xeb\xa5\xb5\xa5\xa4\xa5\xba"]
+::msgcat::mcset ja {Pixel Table} [encoding convertfrom euc-jp "\xa5\xd4\xa5\xaf\xa5\xbb\xa5\xeb\xc9\xbd"]
+::msgcat::mcset ja {Pixels} [encoding convertfrom euc-jp "\xa5\xd4\xa5\xaf\xa5\xbb\xa5\xeb"]
+::msgcat::mcset ja {Play} [encoding convertfrom euc-jp "\xba\xc6\xc0\xb8"]
+::msgcat::mcset ja {Please Select a Region} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xf2\xbb\xd8\xc4\xea\xa4\xb7\xa4\xc6\xa4\xaf\xa4\xc0\xa4\xb5\xa4\xa4\xa1\xa3"]
+::msgcat::mcset ja {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset ja {Please specify width, height, and either name or (ra,dec)} [encoding convertfrom euc-jp "\xc9\xfd\xa1\xa2\xb9\xe2\xa4\xb5\xa1\xa2\xcc\xbe\xc1\xb0\xa4\xe2\xa4\xb7\xa4\xaf\xa4\xcf\x20\x28\x72\x61\x2c\x64\x65\x63\x29\x20\xa4\xf2\xbb\xd8\xc4\xea\xa4\xb7\xa4\xc6\xa4\xaf\xa4\xc0\xa4\xb5\xa4\xa4\xa1\xa3"]
+::msgcat::mcset ja {Plot 2D}
+::msgcat::mcset ja {Plot 3D}
+::msgcat::mcset ja {Plot Title} [encoding convertfrom euc-jp "\xa5\xbf\xa5\xa4\xa5\xc8\xa5\xeb\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Plotting Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xf2\xa5\xd7\xa5\xed\xa5\xc3\xa5\xc8\xa4\xb7\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9"]
+::msgcat::mcset ja {Plot} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xed\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Plus} [encoding convertfrom euc-jp "\xa1\xdc"]
+::msgcat::mcset ja {Pointer} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xa4\xa5\xf3\xa5\xbf"]
+::msgcat::mcset ja {Points} [encoding convertfrom euc-jp "\xc5\xc0"]
+::msgcat::mcset ja {Point} [encoding convertfrom euc-jp "\xc5\xc0"]
+::msgcat::mcset ja {Polygon} [encoding convertfrom euc-jp "\xc2\xbf\xb3\xd1\xb7\xc1"]
+::msgcat::mcset ja {Portrait} [encoding convertfrom euc-jp "\xbd\xc4\xc4\xb9"]
+::msgcat::mcset ja {Poster} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xb9\xa5\xbf\xa1\xbc"]
+::msgcat::mcset ja {Postscript Page Setup} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xb9\xa5\xc8\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8\xa5\xda\xa1\xbc\xa5\xb8\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Postscript Print} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xb9\xa5\xc8\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8\xb0\xf5\xba\xfe"]
+::msgcat::mcset ja {Postscript} [encoding convertfrom euc-jp "\xa5\xdd\xa5\xb9\xa5\xc8\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8"]
+::msgcat::mcset ja {Power} [encoding convertfrom euc-jp "\xd1\xd1\xbe\xe8"]
+::msgcat::mcset ja {Preferences} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Preserve During Load} [encoding convertfrom euc-jp "\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf\xc3\xe6\xa4\xcb\xca\xdd\xbb\xfd"]
+::msgcat::mcset ja {Previous Frame} [encoding convertfrom euc-jp "\xc1\xb0\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Previous} [encoding convertfrom euc-jp "\xcc\xe1\xa4\xeb"]
+::msgcat::mcset ja {Prev}
+::msgcat::mcset ja {Print Coordinates} [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8\xa4\xf2\xb0\xf5\xba\xfe"]
+::msgcat::mcset ja {Print To} [encoding convertfrom euc-jp "\xbd\xd0\xce\xcf\xc0\xe8"]
+::msgcat::mcset ja {Printer} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xea\xa5\xf3\xa5\xbf"]
+::msgcat::mcset ja {Print} [encoding convertfrom euc-jp "\xb0\xf5\xba\xfe"]
+::msgcat::mcset ja {Projection} [encoding convertfrom euc-jp "\xc0\xda\xc3\xc7\xcc\xcc"]
+::msgcat::mcset ja {Properties} [encoding convertfrom euc-jp "\xc2\xb0\xc0\xad"]
+::msgcat::mcset ja {Property} [encoding convertfrom euc-jp "\xc2\xb0\xc0\xad"]
+::msgcat::mcset ja {Proxy Host} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xed\xa5\xad\xa5\xb7\xa5\xb5\xa1\xbc\xa5\xd0\xa1\xbc"]
+::msgcat::mcset ja {Proxy Port} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xed\xa5\xad\xa5\xb7\xa5\xdd\xa1\xbc\xa5\xc8"]
+::msgcat::mcset ja {Publication} [encoding convertfrom euc-jp "\xcf\xc0\xca\xb8"]
+::msgcat::mcset ja {Quadratic}
+::msgcat::mcset ja {RGB Array}
+::msgcat::mcset ja {RGB Cube}
+::msgcat::mcset ja {RGB Image}
+::msgcat::mcset ja {RGB} [encoding convertfrom euc-jp "\x52\x47\x42\xbf\xa7"]
+::msgcat::mcset ja {Radial Profile}
+::msgcat::mcset ja {Radial}
+::msgcat::mcset ja {Radius} [encoding convertfrom euc-jp "\xc8\xbe\xb7\xc2"]
+::msgcat::mcset ja {Raised}
+::msgcat::mcset ja {Range}
+::msgcat::mcset ja {Redo} [encoding convertfrom euc-jp "\xa4\xe2\xa4\xa6\xb0\xec\xc5\xd9"]
+::msgcat::mcset ja {Red} [encoding convertfrom euc-jp "\xc0\xd6\xbf\xa7"]
+::msgcat::mcset ja {Reference Manual} [encoding convertfrom euc-jp "\xa5\xea\xa5\xd5\xa5\xa1\xa5\xec\xa5\xf3\xa5\xb9\xa5\xde\xa5\xcb\xa5\xe5\xa5\xa2\xa5\xeb"]
+::msgcat::mcset ja {Reference} [encoding convertfrom euc-jp "\xa5\xea\xa5\xd5\xa5\xa1\xa5\xec\xa5\xf3\xa5\xb9"]
+::msgcat::mcset ja {Refresh Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xba\xc6\xc9\xc1\xb2\xe8"]
+::msgcat::mcset ja {Refresh} [encoding convertfrom euc-jp "\xba\xc6\xc9\xc1\xb2\xe8"]
+::msgcat::mcset ja {Region Parameters} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Region} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8"]
+::msgcat::mcset ja {Release Notes} [encoding convertfrom euc-jp "\xa5\xea\xa5\xea\xa1\xbc\xa5\xb9\xa5\xce\xa1\xbc\xa5\xc8"]
+::msgcat::mcset ja {Release} [encoding convertfrom euc-jp "\xa5\xea\xa5\xea\xa1\xbc\xa5\xb9"]
+::msgcat::mcset ja {Relief}
+::msgcat::mcset ja {Reload} [encoding convertfrom euc-jp "\xba\xc6\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xdf"]
+::msgcat::mcset ja {Render}
+::msgcat::mcset ja {Repeat}
+::msgcat::mcset ja {Reset Colormap} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4\xa4\xf2\xa5\xea\xa5\xbb\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Reset Frame} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xa5\xea\xa5\xbb\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Reset} [encoding convertfrom euc-jp "\xa5\xea\xa5\xbb\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Restore}
+::msgcat::mcset ja {Retrieve} [encoding convertfrom euc-jp "\xb8\xa1\xba\xf7"]
+::msgcat::mcset ja {Return}
+::msgcat::mcset ja {Right}
+::msgcat::mcset ja {Roman}
+::msgcat::mcset ja {Rotate} [encoding convertfrom euc-jp "\xb2\xf3\xc5\xbe"]
+::msgcat::mcset ja {Rows} [encoding convertfrom euc-jp "\xb9\xd4"]
+::msgcat::mcset ja {Row}
+::msgcat::mcset ja {Ruler} [encoding convertfrom euc-jp "\xa4\xe2\xa4\xce\xa4\xb5\xa4\xb7"]
+::msgcat::mcset ja {SAMP Image}
+::msgcat::mcset ja {SAMP Table}
+::msgcat::mcset ja {SAMP: already connected} [encoding convertfrom euc-jp "\x53\x41\x4d\x50\x3a\x20\xc0\xdc\xc2\xb3\xa4\xba\xa4\xdf"]
+::msgcat::mcset ja {SAMP: internal error} [encoding convertfrom euc-jp "\x53\x41\x4d\x50\x3a\x20\xc6\xe2\xc9\xf4\xa5\xa8\xa5\xe9\xa1\xbc"]
+::msgcat::mcset ja {SAMP: not connected} [encoding convertfrom euc-jp "\x53\x41\x4d\x50\x3a\x20\xcc\xa4\xc0\xdc\xc2\xb3"]
+::msgcat::mcset ja {SAMP: unable to locate HUB} [encoding convertfrom euc-jp "\x53\x41\x4d\x50\x3a\x20\x48\x55\x42\x20\xa4\xf2\xb8\xab\xa4\xc4\xa4\xb1\xa4\xe9\xa4\xec\xa4\xde\xa4\xbb\xa4\xf3"]
+::msgcat::mcset ja {SAMP} [encoding convertfrom euc-jp "\x53\x41\x4d\x50"]
+::msgcat::mcset ja {Sample Increment}
+::msgcat::mcset ja {Sample Parameters}
+::msgcat::mcset ja {Samples per Line} [encoding convertfrom euc-jp "\xa3\xb1\xb9\xd4\xa4\xa2\xa4\xbf\xa4\xea\xa4\xce\xa5\xb5\xa5\xf3\xa5\xd7\xa5\xeb"]
+::msgcat::mcset ja {Sample}
+::msgcat::mcset ja {Save 3D Movie}
+::msgcat::mcset ja {Save Color Tags}
+::msgcat::mcset ja {Save Colormap} [encoding convertfrom euc-jp "\xbf\xa7\xc4\xb4\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Configuration} [encoding convertfrom euc-jp "\xc0\xdf\xc4\xea\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Contour Levels} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa5\xec\xa5\xd9\xa5\xeb\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Contours} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xa2\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Contrast/Bias} [encoding convertfrom euc-jp "\xa5\xb3\xa5\xf3\xa5\xc8\xa5\xe9\xa5\xb9\xa5\xc8\xa1\xa6\xa5\xd0\xa5\xa4\xa5\xa2\xa5\xb9\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Data} [encoding convertfrom euc-jp "\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Image on Download}
+::msgcat::mcset ja {Save Image} [encoding convertfrom euc-jp "\xa5\xa4\xa5\xe1\xa1\xbc\xa5\xb8\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Regions} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save Template} [encoding convertfrom euc-jp "\xbf\xf7\xb7\xc1\xa4\xf2\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Save as}
+::msgcat::mcset ja {Save} [encoding convertfrom euc-jp "\xca\xdd\xc2\xb8"]
+::msgcat::mcset ja {Scale Parameters} [encoding convertfrom euc-jp "\xa5\xb9\xa5\xb1\xa1\xbc\xa5\xeb\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Scale and Limits}
+::msgcat::mcset ja {Scale} [encoding convertfrom euc-jp "\xa5\xb9\xa5\xb1\xa1\xbc\xa5\xeb"]
+::msgcat::mcset ja {Scan} [encoding convertfrom euc-jp "\xa5\xb9\xa5\xad\xa5\xe3\xa5\xf3"]
+::msgcat::mcset ja {Scatter Plot Tool}
+::msgcat::mcset ja {Scope} [encoding convertfrom euc-jp "\xa5\xb9\xa5\xb3\xa1\xbc\xa5\xd7"]
+::msgcat::mcset ja {Search for Catalogs} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa4\xf2\xb8\xa1\xba\xf7"]
+::msgcat::mcset ja {Searching for catalogs} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa4\xf2\xb8\xa1\xba\xf7\xc3\xe6"]
+::msgcat::mcset ja {Seconds} [encoding convertfrom euc-jp "\xc9\xc3"]
+::msgcat::mcset ja {Segment}
+::msgcat::mcset ja {Select All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xc1\xaa\xc2\xf2"]
+::msgcat::mcset ja {Select Coordinate System } [encoding convertfrom euc-jp "\xba\xc2\xc9\xb8\xb7\xcf\xa4\xf2\xc1\xaa\xc2\xf2"]
+::msgcat::mcset ja {Select None} [encoding convertfrom euc-jp "\xc1\xaa\xc2\xf2\xa4\xf2\xb2\xf2\xbd\xfc"]
+::msgcat::mcset ja {Select}
+::msgcat::mcset ja {Send} [encoding convertfrom euc-jp "\xc1\xf7\xbf\xae"]
+::msgcat::mcset ja {Server} [encoding convertfrom euc-jp "\xa5\xb5\xa1\xbc\xa5\xd0\xa1\xbc"]
+::msgcat::mcset ja {Sexagesimal} [encoding convertfrom euc-jp "\xbb\xfe\xca\xac\xc9\xc3"]
+::msgcat::mcset ja {Shape} [encoding convertfrom euc-jp "\xb7\xc1"]
+::msgcat::mcset ja {Show All} [encoding convertfrom euc-jp "\xc1\xb4\xa4\xc6\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Show Command}
+::msgcat::mcset ja {Show Compass}
+::msgcat::mcset ja {Show Text} [encoding convertfrom euc-jp "\xca\xb8\xbb\xfa\xa4\xf2\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Show/Hide Frames} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xce\xc9\xbd\xbc\xa8\x2f\xc8\xf3\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Show} [encoding convertfrom euc-jp "\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Simple Cross}
+::msgcat::mcset ja {Simple Plus}
+::msgcat::mcset ja {Single Frame} [encoding convertfrom euc-jp "\xc3\xb1\xb0\xec\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {Single} [encoding convertfrom euc-jp "\xc3\xb1\xb0\xec"]
+::msgcat::mcset ja {Sites}
+::msgcat::mcset ja {Size/Radius} [encoding convertfrom euc-jp "\xc2\xe7\xa4\xad\xa4\xb5\x2f\xc8\xbe\xb7\xc2"]
+::msgcat::mcset ja {Size} [encoding convertfrom euc-jp "\xc2\xe7\xa4\xad\xa4\xb5"]
+::msgcat::mcset ja {Skip First}
+::msgcat::mcset ja {Slice}
+::msgcat::mcset ja {Smooth Parameters} [encoding convertfrom euc-jp "\xca\xbf\xb3\xea\xb2\xbd\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Smoothness}
+::msgcat::mcset ja {Smooth} [encoding convertfrom euc-jp "\xca\xbf\xb3\xea\xb2\xbd"]
+::msgcat::mcset ja {Solid}
+::msgcat::mcset ja {Sorry, DS9 does not support} [encoding convertfrom euc-jp "\x44\x53\x39\x20\xa4\xc7\xa5\xb5\xa5\xdd\xa1\xbc\xa5\xc8\xa4\xb5\xa4\xec\xa4\xc6\xa4\xa4\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset ja {Sort} [encoding convertfrom euc-jp "\xca\xc2\xa4\xd9\xc2\xd8\xa4\xa8"]
+::msgcat::mcset ja {Source TCL} [encoding convertfrom euc-jp "\x54\x43\x4c\x20\xa4\xf2\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe0"]
+::msgcat::mcset ja {Source} [encoding convertfrom euc-jp "\xa5\xbd\xa1\xbc\xa5\xb9\xce\xce\xb0\xe8"]
+::msgcat::mcset ja {Space Equal Distance}
+::msgcat::mcset ja {Space Equal Value}
+::msgcat::mcset ja {Spacing}
+::msgcat::mcset ja {Sqrt}
+::msgcat::mcset ja {Square Root} [encoding convertfrom euc-jp "\xca\xbf\xca\xfd\xba\xac"]
+::msgcat::mcset ja {Squared} [encoding convertfrom euc-jp "\xca\xbf\xca\xfd"]
+::msgcat::mcset ja {Square}
+::msgcat::mcset ja {Stacked}
+::msgcat::mcset ja {Starbase}
+::msgcat::mcset ja {Startup}
+::msgcat::mcset ja {Start} [encoding convertfrom euc-jp "\xb3\xab\xbb\xcf"]
+::msgcat::mcset ja {Statistics}
+::msgcat::mcset ja {Stats}
+::msgcat::mcset ja {Status} [encoding convertfrom euc-jp "\xbe\xf5\xc2\xd6"]
+::msgcat::mcset ja {Step} [encoding convertfrom euc-jp "\xa5\xb9\xa5\xc6\xa5\xc3\xa5\xd7"]
+::msgcat::mcset ja {Stop} [encoding convertfrom euc-jp "\xbd\xaa\xce\xbb"]
+::msgcat::mcset ja {Story of SAOImage DS9}
+::msgcat::mcset ja {Story}
+::msgcat::mcset ja {Sum} [encoding convertfrom euc-jp "\xb9\xe7\xb7\xd7"]
+::msgcat::mcset ja {Sunken}
+::msgcat::mcset ja {Symbol Editor} [encoding convertfrom euc-jp "\xb5\xad\xb9\xe6\xa4\xce\xca\xd4\xbd\xb8"]
+::msgcat::mcset ja {Symbol} [encoding convertfrom euc-jp "\xb5\xad\xb9\xe6"]
+::msgcat::mcset ja {Tab-Separated-Value} [encoding convertfrom euc-jp "\xa5\xbf\xa5\xd6\xca\xac\xb3\xe4\xb5\xad\xcb\xa1"]
+::msgcat::mcset ja {Table}
+::msgcat::mcset ja {Tabloid} [encoding convertfrom euc-jp "\xa5\xbf\xa5\xd6\xa5\xed\xa5\xa4\xa5\xc9"]
+::msgcat::mcset ja {Tag Color}
+::msgcat::mcset ja {Task}
+::msgcat::mcset ja {Template} [encoding convertfrom euc-jp "\xbf\xf7\xb7\xc1"]
+::msgcat::mcset ja {Text Font}
+::msgcat::mcset ja {Text} [encoding convertfrom euc-jp "\xca\xb8\xbb\xfa"]
+::msgcat::mcset ja {Then} [encoding convertfrom euc-jp "\xa4\xca\xa4\xe9"]
+::msgcat::mcset ja {Thickness} [encoding convertfrom euc-jp "\xc2\xc0\xa4\xb5"]
+::msgcat::mcset ja {This analysis task is already running. Do you wish to kill it?} [encoding convertfrom euc-jp "\xa4\xb3\xa4\xce\xb2\xf2\xc0\xcf\xa5\xbf\xa5\xb9\xa5\xaf\xa4\xcf\xa4\xb9\xa4\xc7\xa4\xcb\xbc\xc2\xb9\xd4\xc3\xe6\xa4\xc7\xa4\xb9\xa1\xa3\xc3\xe6\xc3\xc7\xa4\xb7\xa4\xde\xa4\xb9\xa4\xab\x3f"]
+::msgcat::mcset ja {This function is not available.}
+::msgcat::mcset ja {This function is not currently supported for this port.}
+::msgcat::mcset ja {Tickmarks} [encoding convertfrom euc-jp "\xcc\xdc\xc0\xb9\xa4\xea"]
+::msgcat::mcset ja {Tile Frames} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xca\xc2\xa4\xd9\xa4\xeb"]
+::msgcat::mcset ja {Tile Parameters} [encoding convertfrom euc-jp "\xca\xc2\xa4\xd9\xca\xfd\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Tile} [encoding convertfrom euc-jp "\xca\xc2\xa4\xd9\xa4\xc6\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Times}
+::msgcat::mcset ja {Title} [encoding convertfrom euc-jp "\xa5\xbf\xa5\xa4\xa5\xc8\xa5\xeb"]
+::msgcat::mcset ja {Tophat} [encoding convertfrom euc-jp "\xa5\xc8\xa5\xc3\xa5\xd7\xa5\xcf\xa5\xc3\xa5\xc8"]
+::msgcat::mcset ja {Topographic}
+::msgcat::mcset ja {Top}
+::msgcat::mcset ja {To}
+::msgcat::mcset ja {Transparency} [encoding convertfrom euc-jp "\xc6\xa9\xcc\xc0"]
+::msgcat::mcset ja {Triangle}
+::msgcat::mcset ja {Type} [encoding convertfrom euc-jp "\xbc\xef\xce\xe0"]
+::msgcat::mcset ja {URL}
+::msgcat::mcset ja {Unable to connect directly: using Web Proxy}
+::msgcat::mcset ja {Unable to determine date of observation}
+::msgcat::mcset ja {Unable to determine time of observation}
+::msgcat::mcset ja {Unable to evaluate filter} [encoding convertfrom euc-jp "\xb9\xca\xa4\xea\xb9\xfe\xa4\xdf\xbe\xf2\xb7\xef\xa4\xac\xc9\xbe\xb2\xc1\xa4\xc7\xa4\xad\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to find SIAP window}
+::msgcat::mcset ja {Unable to find URL column}
+::msgcat::mcset ja {Unable to find catalog window} [encoding convertfrom euc-jp "\xa5\xab\xa5\xbf\xa5\xed\xa5\xb0\xa5\xa6\xa5\xa3\xa5\xf3\xa5\xc9\xa5\xa6\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to find plot window} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xed\xa5\xc3\xa5\xc8\xa5\xa6\xa5\xa3\xa5\xf3\xa5\xc9\xa5\xa6\xa4\xac\xb8\xab\xa4\xc4\xa4\xab\xa4\xea\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to load RGB image into a non-rgb frame} [encoding convertfrom euc-jp "\x52\x42\x47\xa5\xa4\xa5\xe1\xa1\xbc\xa5\xb8\xa4\xf2\xc8\xf3\x52\x47\x42\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xcb\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to load region file} [encoding convertfrom euc-jp "\xce\xce\xb0\xe8\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xf2\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to load} [encoding convertfrom euc-jp "\xc6\xc9\xa4\xdf\xb9\xfe\xa4\xe1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to locate URL} [encoding convertfrom euc-jp "\x55\x52\x4c\xa4\xf2\xc6\xc3\xc4\xea\xa4\xc7\xa4\xad\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to match target with XPA Mime request}
+::msgcat::mcset ja {Unable to open file} [encoding convertfrom euc-jp "\xa5\xd5\xa5\xa1\xa5\xa4\xa5\xeb\xa4\xf2\xb3\xab\xa4\xb1\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {Unable to process Analysis file}
+::msgcat::mcset ja {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset ja {Undo} [encoding convertfrom euc-jp "\xa4\xe4\xa4\xea\xc4\xbe\xa4\xb7"]
+::msgcat::mcset ja {Unique}
+::msgcat::mcset ja {Unists}
+::msgcat::mcset ja {Units} [encoding convertfrom euc-jp "\xc3\xb1\xb0\xcc"]
+::msgcat::mcset ja {Unknown Colormap} [encoding convertfrom euc-jp "\xa5\xb5\xa5\xdd\xa1\xbc\xa5\xc8\xa4\xb5\xa4\xec\xa4\xca\xa4\xa4\xc7\xdb\xbf\xa7"]
+::msgcat::mcset ja {Unknown command} [encoding convertfrom euc-jp "\xa5\xb5\xa5\xdd\xa1\xbc\xa5\xc8\xa4\xb5\xa4\xec\xa4\xca\xa4\xa4\xa5\xb3\xa5\xde\xa5\xf3\xa5\xc9"]
+::msgcat::mcset ja {Update Filter} [encoding convertfrom euc-jp "\xb8\xa1\xba\xf7\xbe\xf2\xb7\xef\xa4\xf2\xb9\xb9\xbf\xb7"]
+::msgcat::mcset ja {Update Group} [encoding convertfrom euc-jp "\xa5\xb0\xa5\xeb\xa1\xbc\xa5\xd7\xa4\xf2\xb9\xb9\xbf\xb7"]
+::msgcat::mcset ja {Update from Current Crosshair} [encoding convertfrom euc-jp "\xb8\xbd\xba\xdf\xa4\xce\xbd\xbd\xbb\xfa\xa5\xab\xa1\xbc\xa5\xbd\xa5\xeb\xb0\xcc\xc3\xd6\xa4\xab\xa4\xe9\xb9\xb9\xbf\xb7"]
+::msgcat::mcset ja {Update from Current Frame} [encoding convertfrom euc-jp "\xb8\xbd\xba\xdf\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xab\xa4\xe9\xb9\xb9\xbf\xb7"]
+::msgcat::mcset ja {Update} [encoding convertfrom euc-jp "\xb9\xb9\xbf\xb7"]
+::msgcat::mcset ja {Upper Left Back}
+::msgcat::mcset ja {Upper Left Front}
+::msgcat::mcset ja {Upper Right Back}
+::msgcat::mcset ja {Upper Right Front}
+::msgcat::mcset ja {Use Authentication} [encoding convertfrom euc-jp "\xc7\xa7\xbe\xda\xa4\xf2\xbb\xc8\xcd\xd1"]
+::msgcat::mcset ja {Use Current Frame on Download} [encoding convertfrom euc-jp "\xa5\xc0\xa5\xa6\xa5\xf3\xa5\xed\xa1\xbc\xa5\xc9\xbb\xfe\xa4\xcb\xc1\xaa\xc2\xf2\xc3\xe6\xa4\xce\xa5\xd5\xa5\xec\xa1\xbc\xa5\xe0\xa4\xf2\xbb\xc8\xcd\xd1"]
+::msgcat::mcset ja {Use Internal Web Browser} [encoding convertfrom euc-jp "\xc6\xe2\xc9\xf4\xa5\xd6\xa5\xe9\xa5\xa6\xa5\xb6\xa4\xf2\xbb\xc8\xcd\xd1"]
+::msgcat::mcset ja {Use Proxy} [encoding convertfrom euc-jp "\xa5\xd7\xa5\xed\xa5\xad\xa5\xb7\xa4\xf2\xbb\xc8\xcd\xd1"]
+::msgcat::mcset ja {User Manual} [encoding convertfrom euc-jp "\xa5\xe6\xa1\xbc\xa5\xb6\xa1\xbc\xa5\xde\xa5\xcb\xa5\xe5\xa5\xa2\xa5\xeb"]
+::msgcat::mcset ja {Username} [encoding convertfrom euc-jp "\xa5\xe6\xa1\xbc\xa5\xb6\xa1\xbc\xcc\xbe"]
+::msgcat::mcset ja {User} [encoding convertfrom euc-jp "\xa5\xe6\xa1\xbc\xa5\xb6\xa1\xbc"]
+::msgcat::mcset ja {Use} [encoding convertfrom euc-jp "\xbb\xc8\xcd\xd1"]
+::msgcat::mcset ja {VO Server}
+::msgcat::mcset ja {VO} [encoding convertfrom euc-jp "\xb2\xbe\xc1\xdb\xc5\xb7\xca\xb8\xc2\xe6"]
+::msgcat::mcset ja {Value} [encoding convertfrom euc-jp "\xc3\xcd"]
+::msgcat::mcset ja {Vector} [encoding convertfrom euc-jp "\xa5\xd9\xa5\xaf\xa5\xc8\xa5\xeb"]
+::msgcat::mcset ja {Vertical Graph} [encoding convertfrom euc-jp "\xbd\xc4\xc3\xc7\xcc\xcc"]
+::msgcat::mcset ja {Vertical Layout} [encoding convertfrom euc-jp "\xb2\xe8\xcc\xcc\xa4\xce\xba\xb8\xa4\xcb\xc7\xdb\xc3\xd6"]
+::msgcat::mcset ja {Vertical Text}
+::msgcat::mcset ja {Vertical}
+::msgcat::mcset ja {View} [encoding convertfrom euc-jp "\xc9\xbd\xbc\xa8"]
+::msgcat::mcset ja {Virtual Observatory} [encoding convertfrom euc-jp "\xb2\xbe\xc1\xdb\xc5\xb7\xca\xb8\xc2\xe6"]
+::msgcat::mcset ja {WCS Parameters}
+::msgcat::mcset ja {WCS}
+::msgcat::mcset ja {Wavelength} [encoding convertfrom euc-jp "\xc7\xc8\xc4\xb9"]
+::msgcat::mcset ja {Web Browser} [encoding convertfrom euc-jp "\xa5\xd6\xa5\xe9\xa5\xa6\xa5\xb6"]
+::msgcat::mcset ja {White} [encoding convertfrom euc-jp "\xc7\xf2\xbf\xa7"]
+::msgcat::mcset ja {Width} [encoding convertfrom euc-jp "\xc9\xfd"]
+::msgcat::mcset ja {Window}
+::msgcat::mcset ja {Words matching title, description}
+::msgcat::mcset ja {X Axis Title}
+::msgcat::mcset ja {X Grid}
+::msgcat::mcset ja {XPA Information} [encoding convertfrom euc-jp "\x58\x50\x41\xa4\xce\xbe\xf0\xca\xf3"]
+::msgcat::mcset ja {XPA not initialized} [encoding convertfrom euc-jp "\x58\x50\x41\x20\xa4\xac\xbd\xe9\xb4\xfc\xb2\xbd\xa4\xb5\xa4\xec\xa4\xc6\xa4\xa4\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3"]
+::msgcat::mcset ja {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset ja {XPA} [encoding convertfrom euc-jp "\x58\x50\x41"]
+::msgcat::mcset ja {X}
+::msgcat::mcset ja {Y Axis Title}
+::msgcat::mcset ja {Y Grid}
+::msgcat::mcset ja {Yellow} [encoding convertfrom euc-jp "\xb2\xab\xbf\xa7"]
+::msgcat::mcset ja {Y}
+::msgcat::mcset ja {Z Axis Scale}
+::msgcat::mcset ja {ZScale Parameters} [encoding convertfrom euc-jp "\x5a\xa5\xb9\xa5\xb1\xa1\xbc\xa5\xeb\xa4\xce\xc0\xdf\xc4\xea"]
+::msgcat::mcset ja {Zero} [encoding convertfrom euc-jp "\xce\xed"]
+::msgcat::mcset ja {Zoom Fit}
+::msgcat::mcset ja {Zoom In} [encoding convertfrom euc-jp "\xb3\xc8\xc2\xe7"]
+::msgcat::mcset ja {Zoom Out} [encoding convertfrom euc-jp "\xbd\xcc\xbe\xae"]
+::msgcat::mcset ja {Zoom} [encoding convertfrom euc-jp "\xa5\xba\xa1\xbc\xa5\xe0"]
+::msgcat::mcset ja {and}
+::msgcat::mcset ja {blue}
+::msgcat::mcset ja {b}
+::msgcat::mcset ja {color}
+::msgcat::mcset ja {cool}
+::msgcat::mcset ja {green}
+::msgcat::mcset ja {grey}
+::msgcat::mcset ja {g}
+::msgcat::mcset ja {h5utils}
+::msgcat::mcset ja {heat}
+::msgcat::mcset ja {not}
+::msgcat::mcset ja {only}
+::msgcat::mcset ja {or center of data} [encoding convertfrom euc-jp "\xa4\xe2\xa4\xb7\xa4\xaf\xa4\xcf\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xce\xc3\xe6\xbf\xb4"]
+::msgcat::mcset ja {rainbow}
+::msgcat::mcset ja {red}
+::msgcat::mcset ja {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom euc-jp "\xb9\xd4\xa4\xce\xa5\xc7\xa1\xbc\xa5\xbf\xa4\xac\xa5\xc0\xa5\xa6\xa5\xf3\xa5\xed\xa1\xbc\xa5\xc9\xa4\xb5\xa4\xec\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3\xa4\xb5\xa4\xe9\xa4\xcb\xa5\xc0\xa5\xa6\xa5\xf3\xa5\xed\xa1\xbc\xa5\xc9\xa4\xb9\xa4\xeb\xbe\xec\xb9\xe7\xa4\xcf\xa1\xa2\xba\xc7\xc2\xe7\xb9\xd4\xbf\xf4\xa4\xf2\xc0\xdf\xc4\xea\xa4\xb7\xa4\xca\xa4\xaa\xa4\xb7\xa4\xc6\xa4\xaf\xa4\xc0\xa4\xb5\xa4\xa4\xa1\xa3"]
+::msgcat::mcset ja {r}
+::msgcat::mcset ja {staircase}
+::msgcat::mcset ja {standard}
+::msgcat::mcset ja {x}
+::msgcat::mcset ja {}
diff --git a/ds9/msgs/pt.msg b/ds9/msgs/pt.msg
new file mode 100644
index 0000000..e6cc193
--- /dev/null
+++ b/ds9/msgs/pt.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset pt {2D}
+::msgcat::mcset pt {3D}
+::msgcat::mcset pt {A postscript generation error has occurred} {Um erro ocorreu ao gerar o postscript}
+::msgcat::mcset pt {AIP}
+::msgcat::mcset pt {Abort}
+::msgcat::mcset pt {About SAOImage DS9} {Sobre o SAOImage DS9}
+::msgcat::mcset pt {About} {Sobre}
+::msgcat::mcset pt {Acknowledgment} [encoding convertfrom iso8859-1 {Créditos}]
+::msgcat::mcset pt {Add} {Adicionar}
+::msgcat::mcset pt {Advanced} [encoding convertfrom iso8859-1 {Avançado}]
+::msgcat::mcset pt {Aligned}
+::msgcat::mcset pt {Align} {Alinhar}
+::msgcat::mcset pt {All Columns} {Todas as colunas}
+::msgcat::mcset pt {All Rows} {Todas as linhas}
+::msgcat::mcset pt {All} {Tudo}
+::msgcat::mcset pt {Always save files during Backup}
+::msgcat::mcset pt {Amplifier} {Aplificador}
+::msgcat::mcset pt {An error has occurred during backup}
+::msgcat::mcset pt {An error has occurred during restore}
+::msgcat::mcset pt {An error has occurred invoking the Analysis task} [encoding convertfrom iso8859-1 {Um erro ocorreu ao chamar a tarefa de Análise}]
+::msgcat::mcset pt {An error has occurred while creating image.}
+::msgcat::mcset pt {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset pt {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset pt {An error has occurred while printing} {Um erro ocorreu ao imprimir}
+::msgcat::mcset pt {An error has occurred while reading image.}
+::msgcat::mcset pt {An error has occurred while saving} {Um erro ocorreu ao salvar}
+::msgcat::mcset pt {An error has occurred while updating VO server list}
+::msgcat::mcset pt {An error has occurred while writing image.}
+::msgcat::mcset pt {An internal error has been detected}
+::msgcat::mcset pt {Analysis Command Log} [encoding convertfrom iso8859-1 {Registro de Comandos de Análise}]
+::msgcat::mcset pt {Analysis Commands}
+::msgcat::mcset pt {Analysis File}
+::msgcat::mcset pt {Analysis Log}
+::msgcat::mcset pt {Analysis} [encoding convertfrom iso8859-1 {Análise}]
+::msgcat::mcset pt {Angle Complement} [encoding convertfrom iso8859-1 {Complemento do ângulo}]
+::msgcat::mcset pt {Angles} [encoding convertfrom iso8859-1 {Ângulos}]
+::msgcat::mcset pt {Angle} [encoding convertfrom iso8859-1 {Ângulo}]
+::msgcat::mcset pt {Annuli} {Annuli}
+::msgcat::mcset pt {Annulus} {Annulus}
+::msgcat::mcset pt {Apply} {Aplicar}
+::msgcat::mcset pt {ArcMin}
+::msgcat::mcset pt {ArcSec}
+::msgcat::mcset pt {Architecture} {Arquitetura}
+::msgcat::mcset pt {Archives}
+::msgcat::mcset pt {Array}
+::msgcat::mcset pt {Arrow} {Seta}
+::msgcat::mcset pt {Astronomy}
+::msgcat::mcset pt {At Startup}
+::msgcat::mcset pt {At least 2 different catalogs are required}
+::msgcat::mcset pt {Auto Centroid}
+::msgcat::mcset pt {Auto Plot 2D}
+::msgcat::mcset pt {Auto Plot 3D}
+::msgcat::mcset pt {Auto Plot Statistics}
+::msgcat::mcset pt {Auto Plot}
+::msgcat::mcset pt {Autoload FITS Regions} [encoding convertfrom iso8859-1 {Auto-carregar regiões FITS}]
+::msgcat::mcset pt {Autoload}
+::msgcat::mcset pt {Automatic} [encoding convertfrom iso8859-1 {Automático}]
+::msgcat::mcset pt {Average} [encoding convertfrom iso8859-1 {Média}]
+::msgcat::mcset pt {Axes Number}
+::msgcat::mcset pt {Axes Order}
+::msgcat::mcset pt {Axes Title}
+::msgcat::mcset pt {Axes} {Eixos}
+::msgcat::mcset pt {Axis Length} {Tamanho do eixo}
+::msgcat::mcset pt {Axis Numbers} [encoding convertfrom iso8859-1 {Numeração do eixo}]
+::msgcat::mcset pt {Axis Title}
+::msgcat::mcset pt {Axis} {Eixo}
+::msgcat::mcset pt {Azimuth}
+::msgcat::mcset pt {Background Color} {Cor de fundo}
+::msgcat::mcset pt {Background} {Fundo}
+::msgcat::mcset pt {Backup}
+::msgcat::mcset pt {Back} {Anterior}
+::msgcat::mcset pt {Bar Plot Tool}
+::msgcat::mcset pt {Bias}
+::msgcat::mcset pt {Bin 3rd Column} {Bin terceira coluna}
+::msgcat::mcset pt {Bin Center} {Centro do Bin}
+::msgcat::mcset pt {Bin Columns} {Binar colunas}
+::msgcat::mcset pt {Bin Filter} {Filtro do Bin}
+::msgcat::mcset pt {Bin Fit}
+::msgcat::mcset pt {Bin In}
+::msgcat::mcset pt {Bin Out}
+::msgcat::mcset pt {Binning Parameters} [encoding convertfrom iso8859-1 {Parâmetros de Binning}]
+::msgcat::mcset pt {Bin}
+::msgcat::mcset pt {Black} {Preto}
+::msgcat::mcset pt {Blank/Inf/NaN Color} {Cor Preto/Inf/NaN}
+::msgcat::mcset pt {Blink Frames} {Blinkar quadros}
+::msgcat::mcset pt {Blink Interval} {Intervalo de Blink}
+::msgcat::mcset pt {Blink}
+::msgcat::mcset pt {Block Fit}
+::msgcat::mcset pt {Block In} {Bin em}
+::msgcat::mcset pt {Block Out} {Bin partir}
+::msgcat::mcset pt {Block Parameters}
+::msgcat::mcset pt {Block} {Bin}
+::msgcat::mcset pt {Blue} {Azul}
+::msgcat::mcset pt {Bold} {Negrito}
+::msgcat::mcset pt {Border} {Borda}
+::msgcat::mcset pt {Bottom}
+::msgcat::mcset pt {Box Annulus} {Annulus da Caixa}
+::msgcat::mcset pt {Box Panda} {Panda Caixa}
+::msgcat::mcset pt {BoxCircle}
+::msgcat::mcset pt {Boxcar}
+::msgcat::mcset pt {Box} {Caixa}
+::msgcat::mcset pt {Broadcast}
+::msgcat::mcset pt {Browser}
+::msgcat::mcset pt {Browse} {Navegar}
+::msgcat::mcset pt {Buffer}
+::msgcat::mcset pt {Buttonbar}
+::msgcat::mcset pt {Buttons} {Botoes}
+::msgcat::mcset pt {Bytes}
+::msgcat::mcset pt {CMYK}
+::msgcat::mcset pt {Can Delete} {Pode Apagar}
+::msgcat::mcset pt {Can Edit} {Pode Editar}
+::msgcat::mcset pt {Can Move} {Pode Mover}
+::msgcat::mcset pt {Can Rotate} {Pode Rodar}
+::msgcat::mcset pt {Cancelled}
+::msgcat::mcset pt {Cancel} {Cancelar}
+::msgcat::mcset pt {Cap}
+::msgcat::mcset pt {Catalog Server} [encoding convertfrom iso8859-1 {Servidor do Catálogo}]
+::msgcat::mcset pt {Catalog Tool} [encoding convertfrom iso8859-1 {Ferramenta de Catálogos}]
+::msgcat::mcset pt {Catalogs} [encoding convertfrom iso8859-1 {Catálogos}]
+::msgcat::mcset pt {Catalog} [encoding convertfrom iso8859-1 {Catálogo}]
+::msgcat::mcset pt {Catrom}
+::msgcat::mcset pt {Cat}
+::msgcat::mcset pt {Center Image} {Centralizar Imagem}
+::msgcat::mcset pt {Center Non-modal Dialogs}
+::msgcat::mcset pt {Center} {Centro}
+::msgcat::mcset pt {Centroid Parameters}
+::msgcat::mcset pt {Centroid}
+::msgcat::mcset pt {Circle} {Circulo}
+::msgcat::mcset pt {Clear All} {Limpar tudo}
+::msgcat::mcset pt {Clear Analysis Commands} [encoding convertfrom iso8859-1 {Limpar Comandos de Análise}]
+::msgcat::mcset pt {Clear Cache} {Limpar cache}
+::msgcat::mcset pt {Clear Data} {Limpar dados}
+::msgcat::mcset pt {Clear External Analysis Commands?} {Limpar Comandos de Análise Externos?}
+::msgcat::mcset pt {Clear Filter} {Limpar Filtro}
+::msgcat::mcset pt {Clear Frame} {Limpar Frame}
+::msgcat::mcset pt {Clear Preferences?} [encoding convertfrom iso8859-1 {Limpar preferências?}]
+::msgcat::mcset pt {Clear Preferences} [encoding convertfrom iso8859-1 {Limpar preferências}]
+::msgcat::mcset pt {Clear} {Limpar}
+::msgcat::mcset pt {Click to Center} {Clique para centralizar}
+::msgcat::mcset pt {Close} {Fechar}
+::msgcat::mcset pt {Colorbar Size}
+::msgcat::mcset pt {Colorbar} {Barra de Cores}
+::msgcat::mcset pt {Colormap Parameters} [encoding convertfrom iso8859-1 {Parâmetros do Mapa de Cores}]
+::msgcat::mcset pt {Colormap} {Mapa de Cores}
+::msgcat::mcset pt {Color} {Cor}
+::msgcat::mcset pt {Columns} {Colunas}
+::msgcat::mcset pt {Column} {Coluna}
+::msgcat::mcset pt {Command not allowed}
+::msgcat::mcset pt {Command}
+::msgcat::mcset pt {Compass} {Compasso}
+::msgcat::mcset pt {Composite Region}
+::msgcat::mcset pt {Composite}
+::msgcat::mcset pt {Compression} [encoding convertfrom iso8859-1 {Compressão}]
+::msgcat::mcset pt {Configure} {Configurar}
+::msgcat::mcset pt {Connect Directly} {Conectar diretamente}
+::msgcat::mcset pt {Connect SAMP}
+::msgcat::mcset pt {Connect Using Web Proxy} {Connectar usando Proxy Web}
+::msgcat::mcset pt {Connect}
+::msgcat::mcset pt {Console}
+::msgcat::mcset pt {Contacting Image Server}
+::msgcat::mcset pt {Contour Parameters} [encoding convertfrom iso8859-1 {Parâmetros de contorno}]
+::msgcat::mcset pt {Contours} {Contornos}
+::msgcat::mcset pt {Contour}
+::msgcat::mcset pt {Contrast} {Contraste}
+::msgcat::mcset pt {Convert to Polygons} [encoding convertfrom iso8859-1 {Converter para polígonos}]
+::msgcat::mcset pt {Coordinate Grid Parameters} [encoding convertfrom iso8859-1 {Parâmetros do Grid de Coordenadas}]
+::msgcat::mcset pt {Coordinate Grid} {Grid de Coordenadas}
+::msgcat::mcset pt {Coordinate System} {Sistema de Coordenadas}
+::msgcat::mcset pt {Coordinates}
+::msgcat::mcset pt {Coordinate} {Coordenada}
+::msgcat::mcset pt {Copy Contours} {Copiar Contornos}
+::msgcat::mcset pt {Copy to Regions} [encoding convertfrom iso8859-1 {Copiar para Regiões}]
+::msgcat::mcset pt {Copy} {Copiar}
+::msgcat::mcset pt {Create Movie}
+::msgcat::mcset pt {Create New Frame on Download} {Criar novo Frame ao carregar}
+::msgcat::mcset pt {Create}
+::msgcat::mcset pt {Crop Parameters}
+::msgcat::mcset pt {Crop}
+::msgcat::mcset pt {Crosshair Parameters}
+::msgcat::mcset pt {Crosshair To} {Cruz para}
+::msgcat::mcset pt {Crosshair} {Cruz}
+::msgcat::mcset pt {Cross} {Cruz}
+::msgcat::mcset pt {Cubehelix}
+::msgcat::mcset pt {Cube}
+::msgcat::mcset pt {Cubic}
+::msgcat::mcset pt {Current Frame} {Frame atual}
+::msgcat::mcset pt {Current Range} {Intervalo atual}
+::msgcat::mcset pt {Current} {Atual}
+::msgcat::mcset pt {Cursor}
+::msgcat::mcset pt {Cut} {Cortar}
+::msgcat::mcset pt {Cyan} {Ciano}
+::msgcat::mcset pt {DPI}
+::msgcat::mcset pt {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset pt {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset pt {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset pt {DS9 has detected an older preferences file, do you wish to update?} [encoding convertfrom iso8859-1 {O DS9 detectou um arquivo de preferências antigo, você deseja atualizar?}]
+::msgcat::mcset pt {DS9 will complete the initialization process} [encoding convertfrom iso8859-1 {O DS9 completou o processo de inicialização}]
+::msgcat::mcset pt {Dash} [encoding convertfrom iso8859-1 {Traço}]
+::msgcat::mcset pt {Data Format} {Formato de dados}
+::msgcat::mcset pt {Dataset Name}
+::msgcat::mcset pt {Dataset} {Conjunto de dados}
+::msgcat::mcset pt {Data}
+::msgcat::mcset pt {Decrease} {Diminuir}
+::msgcat::mcset pt {Default All Files}
+::msgcat::mcset pt {Default Format}
+::msgcat::mcset pt {Default Length}
+::msgcat::mcset pt {Default} [encoding convertfrom iso8859-1 {Padrão}]
+::msgcat::mcset pt {Degrees} {Graus}
+::msgcat::mcset pt {Delete All Frames?} {Apagar todos Frames?}
+::msgcat::mcset pt {Delete All Frames} {Apagar todos Frames}
+::msgcat::mcset pt {Delete All Groups?} {Apagar todos os grupos?}
+::msgcat::mcset pt {Delete All Groups} {Apagar todos os grupos}
+::msgcat::mcset pt {Delete All Regions?} {Apagar todas as Regiões?}
+::msgcat::mcset pt {Delete All Regions} {Apagar todas as Regiões}
+::msgcat::mcset pt {Delete All}
+::msgcat::mcset pt {Delete Color Tags}
+::msgcat::mcset pt {Delete Frame} {Apague o Frame}
+::msgcat::mcset pt {Delete Group} {Apague o Grupo}
+::msgcat::mcset pt {Delete Selected Regions} [encoding convertfrom iso8859-1 {Apagar Regiões Selecionadas}]
+::msgcat::mcset pt {Delete} {Apagar}
+::msgcat::mcset pt {Depth} {Profundidade}
+::msgcat::mcset pt {Detector}
+::msgcat::mcset pt {Dialog Box} {Box de dialog}
+::msgcat::mcset pt {Diamond} {Diamante}
+::msgcat::mcset pt {Dimension} [encoding convertfrom iso8859-1 {Dimensão}]
+::msgcat::mcset pt {Direction}
+::msgcat::mcset pt {Disconnect}
+::msgcat::mcset pt {Display Header}
+::msgcat::mcset pt {Display Size} {Mostar tamanho}
+::msgcat::mcset pt {Dissolve}
+::msgcat::mcset pt {Distance}
+::msgcat::mcset pt {Done}
+::msgcat::mcset pt {Download Colormap}
+::msgcat::mcset pt {Download VOTABLE format if available}
+::msgcat::mcset pt {Drag to Center} {Arrate para centralizar}
+::msgcat::mcset pt {Duplicate Data}
+::msgcat::mcset pt {East} {Leste}
+::msgcat::mcset pt {Ecliptic} {Ecliptico}
+::msgcat::mcset pt {Edit Group Name} {Editar nome do Grupo}
+::msgcat::mcset pt {Edit} {Editar}
+::msgcat::mcset pt {Elevation}
+::msgcat::mcset pt {Ellipse Annulus}
+::msgcat::mcset pt {Ellipse Panda}
+::msgcat::mcset pt {Ellipse} {Elipse}
+::msgcat::mcset pt {Elliptical Annulus} {Annulus Elipse}
+::msgcat::mcset pt {Elliptical Panda} [encoding convertfrom iso8859-1 {Panda Elíptico}]
+::msgcat::mcset pt {Enable Confirmation Dialogs} {}
+::msgcat::mcset pt {Enable}
+::msgcat::mcset pt {End} {Fim}
+::msgcat::mcset pt {Enter Color}
+::msgcat::mcset pt {Enter Font Size}
+::msgcat::mcset pt {Enter Group Name} {Entre o nome do Grupo}
+::msgcat::mcset pt {Enter Search Expression}
+::msgcat::mcset pt {Enter URL}
+::msgcat::mcset pt {Entry}
+::msgcat::mcset pt {Equal Area} [encoding convertfrom iso8859-1 {Área Igual}]
+::msgcat::mcset pt {Equal Distance} [encoding convertfrom iso8859-1 {Distância Igual}]
+::msgcat::mcset pt {Equal Spacing}
+::msgcat::mcset pt {Equal Value}
+::msgcat::mcset pt {Error code was returned} [encoding convertfrom iso8859-1 {Retornou código de erro}]
+::msgcat::mcset pt {Error} {Erro}
+::msgcat::mcset pt {Examine Frame} {Examinar Frame}
+::msgcat::mcset pt {Examine} {Examinar}
+::msgcat::mcset pt {Exam}
+::msgcat::mcset pt {Exclude} {Excluir}
+::msgcat::mcset pt {Exit} {Sair}
+::msgcat::mcset pt {Export Array}
+::msgcat::mcset pt {Export}
+::msgcat::mcset pt {Extention}
+::msgcat::mcset pt {Exterior Axes} {Eixos exteriores}
+::msgcat::mcset pt {Exterior Numerics} [encoding convertfrom iso8859-1 {Numeração exterior}]
+::msgcat::mcset pt {FAQ}
+::msgcat::mcset pt {FK4}
+::msgcat::mcset pt {FK5}
+::msgcat::mcset pt {Factor}
+::msgcat::mcset pt {File not Found or Unable to load FITS data MIME type} [encoding convertfrom iso8859-1 {Arquivo não encontrado ou incapaz de carregar dados FITS do tipo MIME}]
+::msgcat::mcset pt {Filename} {Nome de Arquivo}
+::msgcat::mcset pt {File} {Arquivo}
+::msgcat::mcset pt {Fill}
+::msgcat::mcset pt {Filter} {Filtro}
+::msgcat::mcset pt {Find Next} [encoding convertfrom iso8859-1 {Encontrar próximo}]
+::msgcat::mcset pt {Find} {Encontrado}
+::msgcat::mcset pt {First Frame}
+::msgcat::mcset pt {First} {Primeiro}
+::msgcat::mcset pt {Fits}
+::msgcat::mcset pt {Fixed in Size} {Fixa em tamanho}
+::msgcat::mcset pt {Flat}
+::msgcat::mcset pt {Flip}
+::msgcat::mcset pt {Font} {Fonte}
+::msgcat::mcset pt {For more information, use --help}
+::msgcat::mcset pt {Format} {Formato}
+::msgcat::mcset pt {Forward} {Frente}
+::msgcat::mcset pt {Found} {Encontrado}
+::msgcat::mcset pt {Frame Information} [encoding convertfrom iso8859-1 {Informação do Frame}]
+::msgcat::mcset pt {Frame Parameters}
+::msgcat::mcset pt {Frames}
+::msgcat::mcset pt {Frame} {Frame}
+::msgcat::mcset pt {From}
+::msgcat::mcset pt {Front} {Frente}
+::msgcat::mcset pt {Full Range} {Intervalo completo}
+::msgcat::mcset pt {Function} [encoding convertfrom iso8859-1 {Função}]
+::msgcat::mcset pt {GUI Font}
+::msgcat::mcset pt {Galactic} [encoding convertfrom iso8859-1 {Galáctico}]
+::msgcat::mcset pt {Gap}
+::msgcat::mcset pt {Gaussian} {Gaussiano}
+::msgcat::mcset pt {General} {Geral}
+::msgcat::mcset pt {Generate} {Gerar}
+::msgcat::mcset pt {Generating Regions} [encoding convertfrom iso8859-1 {Gerando regiões}]
+::msgcat::mcset pt {Get Information} [encoding convertfrom iso8859-1 {Obter informações}]
+::msgcat::mcset pt {Gist}
+::msgcat::mcset pt {Global Properties}
+::msgcat::mcset pt {Global}
+::msgcat::mcset pt {Goto Frame}
+::msgcat::mcset pt {Graph Horz}
+::msgcat::mcset pt {Graph Vert}
+::msgcat::mcset pt {Graphics} [encoding convertfrom iso8859-1 {Gráficos}]
+::msgcat::mcset pt {Graphs}
+::msgcat::mcset pt {Graph} [encoding convertfrom iso8859-1 {Gráfico}]
+::msgcat::mcset pt {Grayscale} {Tons de cinza}
+::msgcat::mcset pt {Green} {Verde}
+::msgcat::mcset pt {Grid Gap}
+::msgcat::mcset pt {Grid} {Grade}
+::msgcat::mcset pt {Groove}
+::msgcat::mcset pt {Groups} {Grupos}
+::msgcat::mcset pt {HTTP}
+::msgcat::mcset pt {Header} [encoding convertfrom iso8859-1 {Cabeçário}]
+::msgcat::mcset pt {Height} {Altura}
+::msgcat::mcset pt {Help Desk} {Centro de ajuda}
+::msgcat::mcset pt {Help Me Choose} {Ajude-me escolher}
+::msgcat::mcset pt {Help} {Ajuda}
+::msgcat::mcset pt {Hide All} {Esconda tudo}
+::msgcat::mcset pt {Highlite}
+::msgcat::mcset pt {High} {Alto}
+::msgcat::mcset pt {Histogram Equalization} [encoding convertfrom iso8859-1 {Equalização de Histograma}]
+::msgcat::mcset pt {Histogram} {Histograma}
+::msgcat::mcset pt {Horizontal Graph} [encoding convertfrom iso8859-1 {Gráfico Horizontal}]
+::msgcat::mcset pt {Horizontal Layout} {Layout Horizontal}
+::msgcat::mcset pt {Horizontal}
+::msgcat::mcset pt {IAU Location Code}
+::msgcat::mcset pt {ICRS}
+::msgcat::mcset pt {Identification} [encoding convertfrom iso8859-1 {Identificação}]
+::msgcat::mcset pt {If} {Se}
+::msgcat::mcset pt {Image Servers}
+::msgcat::mcset pt {Image} {Imagem}
+::msgcat::mcset pt {Import Array}
+::msgcat::mcset pt {Import}
+::msgcat::mcset pt {Include} {Incluir}
+::msgcat::mcset pt {Increase} {Aumento}
+::msgcat::mcset pt {Information Panel} [encoding convertfrom iso8859-1 {Painel de informação}]
+::msgcat::mcset pt {Information} [encoding convertfrom iso8859-1 {Informação}]
+::msgcat::mcset pt {Initialize XPA} {Inicialize XPA}
+::msgcat::mcset pt {Inner} {Interno}
+::msgcat::mcset pt {Instrument FOV} {FOV do instrumento}
+::msgcat::mcset pt {Interior Axes} {Eixos Interiores}
+::msgcat::mcset pt {Interior Numerics} [encoding convertfrom iso8859-1 {Numeração Interior}]
+::msgcat::mcset pt {Internal Parse Error}
+::msgcat::mcset pt {Interval} {Intervalo}
+::msgcat::mcset pt {Invalid Column Name}
+::msgcat::mcset pt {Invalid formated multipart/mixed mime type message} [encoding convertfrom iso8859-1 {Mensagem tipo MIME multiparte/mista em formato inválido}]
+::msgcat::mcset pt {Invert Colormap} {Inverter mapa de cores}
+::msgcat::mcset pt {Invert Selection} [encoding convertfrom iso8859-1 {Inverter Seleção}]
+::msgcat::mcset pt {Invert} {Inverter}
+::msgcat::mcset pt {Italic} [encoding convertfrom iso8859-1 {Itálico}]
+::msgcat::mcset pt {Items Found} [encoding convertfrom iso8859-1 {Ítens Encontrados}]
+::msgcat::mcset pt {Iteration}
+::msgcat::mcset pt {JPEG Quality Factor} {Fator de qualidade JPEG}
+::msgcat::mcset pt {Keep-Alive}
+::msgcat::mcset pt {Kernel}
+::msgcat::mcset pt {Keyboard Shortcuts} {Atalhos do teclado}
+::msgcat::mcset pt {Keyboard} {Teclado}
+::msgcat::mcset pt {Keyword}
+::msgcat::mcset pt {Labels} {Legendas}
+::msgcat::mcset pt {Label} {Legenda}
+::msgcat::mcset pt {Landscape} {Paisagem}
+::msgcat::mcset pt {Language} [encoding convertfrom iso8859-1 {Língua}]
+::msgcat::mcset pt {Last Frame}
+::msgcat::mcset pt {Last} [encoding convertfrom iso8859-1 {Último}]
+::msgcat::mcset pt {Layout Horz}
+::msgcat::mcset pt {Layout Vert}
+::msgcat::mcset pt {Layout}
+::msgcat::mcset pt {Left}
+::msgcat::mcset pt {Legal}
+::msgcat::mcset pt {Legend Title}
+::msgcat::mcset pt {Legend}
+::msgcat::mcset pt {Length} {Comprimento}
+::msgcat::mcset pt {Letter} {Carta}
+::msgcat::mcset pt {Levels} [encoding convertfrom iso8859-1 {Níveis}]
+::msgcat::mcset pt {Level} {Nível}
+::msgcat::mcset pt {Limits} {Limiter}
+::msgcat::mcset pt {Line Plot Tool}
+::msgcat::mcset pt {Linear}
+::msgcat::mcset pt {Line} {Linha}
+::msgcat::mcset pt {List Data}
+::msgcat::mcset pt {List Regions} [encoding convertfrom iso8859-1 {Listar Regiões}]
+::msgcat::mcset pt {List} {Listar}
+::msgcat::mcset pt {Load Analysis Commands} [encoding convertfrom iso8859-1 {Ler Comandos de Análise}]
+::msgcat::mcset pt {Load Color Tags}
+::msgcat::mcset pt {Load Colormap} {Carregar Mapa de Cores}
+::msgcat::mcset pt {Load Configuration} [encoding convertfrom iso8859-1 {Carregar Configuração}]
+::msgcat::mcset pt {Load Contour Levels} [encoding convertfrom iso8859-1 {Carregar Níveis de Contorno}]
+::msgcat::mcset pt {Load Contours} {Carregar Contornos}
+::msgcat::mcset pt {Load Contrast/Bias} {Carregar Contraste/Bias}
+::msgcat::mcset pt {Load Data} {Carregar Dados}
+::msgcat::mcset pt {Load Mosaic} {Carregar Mosaico}
+::msgcat::mcset pt {Load Regions} [encoding convertfrom iso8859-1 {Carregar Regiões}]
+::msgcat::mcset pt {Load Template} {Carregar Template}
+::msgcat::mcset pt {Load into All Frames}
+::msgcat::mcset pt {Load into Current Frame}
+::msgcat::mcset pt {Loading Catalog}
+::msgcat::mcset pt {Loading}
+::msgcat::mcset pt {Load} {Carregar}
+::msgcat::mcset pt {Local}
+::msgcat::mcset pt {Lock Axes}
+::msgcat::mcset pt {Lock Bin}
+::msgcat::mcset pt {Lock Color}
+::msgcat::mcset pt {Lock Crop Amplifier}
+::msgcat::mcset pt {Lock Crop Detector}
+::msgcat::mcset pt {Lock Crop Image}
+::msgcat::mcset pt {Lock Crop None}
+::msgcat::mcset pt {Lock Crop Physical}
+::msgcat::mcset pt {Lock Crop WCS}
+::msgcat::mcset pt {Lock Crosshair Amplifier}
+::msgcat::mcset pt {Lock Crosshair Detector}
+::msgcat::mcset pt {Lock Crosshair Image}
+::msgcat::mcset pt {Lock Crosshair None}
+::msgcat::mcset pt {Lock Crosshair Physical}
+::msgcat::mcset pt {Lock Crosshair WCS}
+::msgcat::mcset pt {Lock Frame Amplifier}
+::msgcat::mcset pt {Lock Frame Detector}
+::msgcat::mcset pt {Lock Frame Image}
+::msgcat::mcset pt {Lock Frame None}
+::msgcat::mcset pt {Lock Frame Physical}
+::msgcat::mcset pt {Lock Frame WCS}
+::msgcat::mcset pt {Lock Limits}
+::msgcat::mcset pt {Lock Scale}
+::msgcat::mcset pt {Lock Slice Image}
+::msgcat::mcset pt {Lock Slice None}
+::msgcat::mcset pt {Lock Slice WCS}
+::msgcat::mcset pt {Lock Smooth}
+::msgcat::mcset pt {Lock} {Travar}
+::msgcat::mcset pt {Log Exponent}
+::msgcat::mcset pt {Log}
+::msgcat::mcset pt {Low High} {Baixo Alto}
+::msgcat::mcset pt {Lower Left Back}
+::msgcat::mcset pt {Lower Left Front}
+::msgcat::mcset pt {Lower Right Back}
+::msgcat::mcset pt {Lower Right Front}
+::msgcat::mcset pt {Low} {Baixo}
+::msgcat::mcset pt {MIP}
+::msgcat::mcset pt {Magenta} {Magenta}
+::msgcat::mcset pt {Magnification}
+::msgcat::mcset pt {Magnifier} {Lente}
+::msgcat::mcset pt {Major}
+::msgcat::mcset pt {Manual}
+::msgcat::mcset pt {Mask Parameters} [encoding convertfrom iso8859-1 {Parâmetros da máscara}]
+::msgcat::mcset pt {Match Axes}
+::msgcat::mcset pt {Match Bin}
+::msgcat::mcset pt {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset pt {Match Color}
+::msgcat::mcset pt {Match Crop Amplifier}
+::msgcat::mcset pt {Match Crop Detector}
+::msgcat::mcset pt {Match Crop Image}
+::msgcat::mcset pt {Match Crop Physical}
+::msgcat::mcset pt {Match Crop WCS}
+::msgcat::mcset pt {Match Crosshair Amplifier}
+::msgcat::mcset pt {Match Crosshair Detector}
+::msgcat::mcset pt {Match Crosshair Image}
+::msgcat::mcset pt {Match Crosshair Physical}
+::msgcat::mcset pt {Match Crosshair WCS}
+::msgcat::mcset pt {Match Frame Amplifier}
+::msgcat::mcset pt {Match Frame Detector}
+::msgcat::mcset pt {Match Frame Image}
+::msgcat::mcset pt {Match Frame Physical}
+::msgcat::mcset pt {Match Frame WCS}
+::msgcat::mcset pt {Match Limits}
+::msgcat::mcset pt {Match Scale}
+::msgcat::mcset pt {Match Slice Image}
+::msgcat::mcset pt {Match Slice WCS}
+::msgcat::mcset pt {Match Smooth}
+::msgcat::mcset pt {Match}
+::msgcat::mcset pt {Math Function} [encoding convertfrom iso8859-1 {Função Matemática}]
+::msgcat::mcset pt {Matplotlib}
+::msgcat::mcset pt {Max Rows} [encoding convertfrom iso8859-1 {Máximas linhas}]
+::msgcat::mcset pt {Maximum}
+::msgcat::mcset pt {Max} [encoding convertfrom iso8859-1 {Máximo}]
+::msgcat::mcset pt {Menus and Buttons}
+::msgcat::mcset pt {Menu}
+::msgcat::mcset pt {Message Log}
+::msgcat::mcset pt {Method} [encoding convertfrom iso8859-1 {Método}]
+::msgcat::mcset pt {Min Max Parameters}
+::msgcat::mcset pt {Min Max} [encoding convertfrom iso8859-1 {Min Máx}]
+::msgcat::mcset pt {Minimum}
+::msgcat::mcset pt {Minor} {Menor}
+::msgcat::mcset pt {Minutes}
+::msgcat::mcset pt {Min}
+::msgcat::mcset pt {Mission} [encoding convertfrom iso8859-1 {Missão}]
+::msgcat::mcset pt {Mode}
+::msgcat::mcset pt {Mosaic IRAF Segment}
+::msgcat::mcset pt {Mosaic IRAF}
+::msgcat::mcset pt {Mosaic WCS Segment}
+::msgcat::mcset pt {Mosaic WCS}
+::msgcat::mcset pt {Mosaic WFPC2}
+::msgcat::mcset pt {Mosaic}
+::msgcat::mcset pt {Mouse Click Epsilon}
+::msgcat::mcset pt {Mouse Wheel Bin}
+::msgcat::mcset pt {Mouse Wheel Zoom}
+::msgcat::mcset pt {Mouse and Keyboard}
+::msgcat::mcset pt {Move Back}
+::msgcat::mcset pt {Move First}
+::msgcat::mcset pt {Move Forward}
+::msgcat::mcset pt {Move Frame}
+::msgcat::mcset pt {Move Last}
+::msgcat::mcset pt {Move to Back} [encoding convertfrom iso8859-1 {Move para trás}]
+::msgcat::mcset pt {Move to Front} {Mover para frente}
+::msgcat::mcset pt {Movie}
+::msgcat::mcset pt {Multiple Extension Cube}
+::msgcat::mcset pt {Multiple Extension Frames}
+::msgcat::mcset pt {Multiple WCS} {Multiplos WCS}
+::msgcat::mcset pt {NRRD}
+::msgcat::mcset pt {Name Resolution} {Resolver o Nome}
+::msgcat::mcset pt {Name Server} {Servidor de Nomes}
+::msgcat::mcset pt {Name or Designation} [encoding convertfrom iso8859-1 {Nome ou designação}]
+::msgcat::mcset pt {Name}
+::msgcat::mcset pt {Native Dialog} {Dialog Nativo}
+::msgcat::mcset pt {New Features} {Novo}
+::msgcat::mcset pt {New Frame 3D}
+::msgcat::mcset pt {New Frame RGB} {Novo Frame RGB}
+::msgcat::mcset pt {New Frame each Time}
+::msgcat::mcset pt {New Frame} {Novo frame}
+::msgcat::mcset pt {New Group} {Novo grupo}
+::msgcat::mcset pt {New} {Novo}
+::msgcat::mcset pt {Next Frame}
+::msgcat::mcset pt {Next} [encoding convertfrom iso8859-1 {Próximo}]
+::msgcat::mcset pt {No Catalog specified} [encoding convertfrom iso8859-1 {Nenhum catálogo especificado}]
+::msgcat::mcset pt {No Data Available}
+::msgcat::mcset pt {No Items Found} [encoding convertfrom iso8859-1 {Nenhum ítem encontrado}]
+::msgcat::mcset pt {No current frame}
+::msgcat::mcset pt {Non-zero}
+::msgcat::mcset pt {None} {Nenhum}
+::msgcat::mcset pt {Normal}
+::msgcat::mcset pt {North} {Norte}
+::msgcat::mcset pt {Not Found}
+::msgcat::mcset pt {Not Supported}
+::msgcat::mcset pt {Number of Samples}
+::msgcat::mcset pt {Number of Threads}
+::msgcat::mcset pt {Number of Ticks}
+::msgcat::mcset pt {Number} [encoding convertfrom iso8859-1 {Número}]
+::msgcat::mcset pt {Numerics}
+::msgcat::mcset pt {OK}
+::msgcat::mcset pt {Object} {Objeto}
+::msgcat::mcset pt {Open File} {Abrir Arquivo}
+::msgcat::mcset pt {Open TCL Console}
+::msgcat::mcset pt {Open URL} {Abrir URL}
+::msgcat::mcset pt {Open as}
+::msgcat::mcset pt {Open} {Abrir}
+::msgcat::mcset pt {Operator} {Operador}
+::msgcat::mcset pt {Orientation} [encoding convertfrom iso8859-1 {Orientação}]
+::msgcat::mcset pt {Origin}
+::msgcat::mcset pt {Oscillate}
+::msgcat::mcset pt {Other Color}
+::msgcat::mcset pt {Other Font Size}
+::msgcat::mcset pt {Other} {Outro}
+::msgcat::mcset pt {Outer} {Fora}
+::msgcat::mcset pt {Overlap}
+::msgcat::mcset pt {PS Page Setup}
+::msgcat::mcset pt {PS Print}
+::msgcat::mcset pt {Page Setup} [encoding convertfrom iso8859-1 {Configuracoes de página}]
+::msgcat::mcset pt {Page Source} [encoding convertfrom iso8859-1 {Fonte da página}]
+::msgcat::mcset pt {Pan To}
+::msgcat::mcset pt {Pan Zoom Rotate Parameters}
+::msgcat::mcset pt {Pan Zoom}
+::msgcat::mcset pt {Pan then Zoom}
+::msgcat::mcset pt {Panda} {Panda}
+::msgcat::mcset pt {Panner}
+::msgcat::mcset pt {Pan}
+::msgcat::mcset pt {Parameters} [encoding convertfrom iso8859-1 {Parâmetros}]
+::msgcat::mcset pt {Password} {Senha}
+::msgcat::mcset pt {Paste Contours} {Colar Contornos}
+::msgcat::mcset pt {Paste} {Colar}
+::msgcat::mcset pt {Physical} [encoding convertfrom iso8859-1 {Físico}]
+::msgcat::mcset pt {Pixel Distribution} [encoding convertfrom iso8859-1 {Distribuição de Pixels}]
+::msgcat::mcset pt {Pixel Size} {Tamanho do Pixel}
+::msgcat::mcset pt {Pixel Table} {Tabela de Pixels}
+::msgcat::mcset pt {Pixels}
+::msgcat::mcset pt {Play} {Execute}
+::msgcat::mcset pt {Please Select a Region}
+::msgcat::mcset pt {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset pt {Please specify width, height, and either name or (ra,dec)}
+::msgcat::mcset pt {Plot 2D}
+::msgcat::mcset pt {Plot 3D}
+::msgcat::mcset pt {Plot Title} [encoding convertfrom iso8859-1 {Título}]
+::msgcat::mcset pt {Plotting Regions}
+::msgcat::mcset pt {Plot}
+::msgcat::mcset pt {Plus} {Mais}
+::msgcat::mcset pt {Pointer} {Ponteiro}
+::msgcat::mcset pt {Points} {Pntos}
+::msgcat::mcset pt {Point} {Ponto}
+::msgcat::mcset pt {Polygon} [encoding convertfrom iso8859-1 {Polígono}]
+::msgcat::mcset pt {Portrait} {Retrato}
+::msgcat::mcset pt {Poster}
+::msgcat::mcset pt {Postscript Page Setup}
+::msgcat::mcset pt {Postscript Print}
+::msgcat::mcset pt {Postscript}
+::msgcat::mcset pt {Power} [encoding convertfrom iso8859-1 {Potência}]
+::msgcat::mcset pt {Preferences} [encoding convertfrom iso8859-1 {Preferências}]
+::msgcat::mcset pt {Preserve During Load} {Preservar durante a carga}
+::msgcat::mcset pt {Previous Frame}
+::msgcat::mcset pt {Previous} {Anterior}
+::msgcat::mcset pt {Prev}
+::msgcat::mcset pt {Print Coordinates} {Imprimir Coordenadas}
+::msgcat::mcset pt {Print To} {Imprimir Para}
+::msgcat::mcset pt {Printer} {Impressora}
+::msgcat::mcset pt {Print} {Imprimir}
+::msgcat::mcset pt {Projection} [encoding convertfrom iso8859-1 {Projeção}]
+::msgcat::mcset pt {Properties} {Propriedades}
+::msgcat::mcset pt {Property} {Propriedade}
+::msgcat::mcset pt {Proxy Host} {Host Proxy}
+::msgcat::mcset pt {Proxy Port} {Porta do Proxy}
+::msgcat::mcset pt {Publication} [encoding convertfrom iso8859-1 {Publicação}]
+::msgcat::mcset pt {Quadratic} [encoding convertfrom iso8859-1 {Quadrático}]
+::msgcat::mcset pt {RGB Array}
+::msgcat::mcset pt {RGB Cube}
+::msgcat::mcset pt {RGB Image}
+::msgcat::mcset pt {RGB}
+::msgcat::mcset pt {Radial Profile}
+::msgcat::mcset pt {Radial}
+::msgcat::mcset pt {Radius} {Raio}
+::msgcat::mcset pt {Raised}
+::msgcat::mcset pt {Range}
+::msgcat::mcset pt {Redo} {Refazer}
+::msgcat::mcset pt {Red} {Vermelho}
+::msgcat::mcset pt {Reference Manual} [encoding convertfrom iso8859-1 {Manual de referência}]
+::msgcat::mcset pt {Reference} [encoding convertfrom iso8859-1 {Referência}]
+::msgcat::mcset pt {Refresh Frame} {Recarregar Frame}
+::msgcat::mcset pt {Refresh}
+::msgcat::mcset pt {Region Parameters}
+::msgcat::mcset pt {Region} [encoding convertfrom iso8859-1 {Região}]
+::msgcat::mcset pt {Release Notes} [encoding convertfrom iso8859-1 {Notas das Versão}]
+::msgcat::mcset pt {Release} [encoding convertfrom iso8859-1 {Versão}]
+::msgcat::mcset pt {Relief}
+::msgcat::mcset pt {Reload} {Recarregar}
+::msgcat::mcset pt {Render}
+::msgcat::mcset pt {Repeat}
+::msgcat::mcset pt {Reset Colormap} {Reiniciar mapa de cores}
+::msgcat::mcset pt {Reset Frame} {Reiniciar Frame}
+::msgcat::mcset pt {Reset}
+::msgcat::mcset pt {Restore}
+::msgcat::mcset pt {Retrieve} {Receber}
+::msgcat::mcset pt {Return}
+::msgcat::mcset pt {Right}
+::msgcat::mcset pt {Roman}
+::msgcat::mcset pt {Rotate} {Rodar}
+::msgcat::mcset pt {Rows} {Linhas}
+::msgcat::mcset pt {Row}
+::msgcat::mcset pt {Ruler} [encoding convertfrom iso8859-1 {Régua}]
+::msgcat::mcset pt {SAMP Image}
+::msgcat::mcset pt {SAMP Table}
+::msgcat::mcset pt {SAMP: already connected}
+::msgcat::mcset pt {SAMP: internal error}
+::msgcat::mcset pt {SAMP: not connected}
+::msgcat::mcset pt {SAMP: unable to locate HUB}
+::msgcat::mcset pt {SAMP}
+::msgcat::mcset pt {Sample Increment}
+::msgcat::mcset pt {Sample Parameters}
+::msgcat::mcset pt {Samples per Line} {Amostras por Linha}
+::msgcat::mcset pt {Sample}
+::msgcat::mcset pt {Save 3D Movie}
+::msgcat::mcset pt {Save Color Tags}
+::msgcat::mcset pt {Save Colormap} {Salvar Mapa de Cores}
+::msgcat::mcset pt {Save Configuration} [encoding convertfrom iso8859-1 {Salvar Configuração}]
+::msgcat::mcset pt {Save Contour Levels} {Salvar Níveis de Contorno}
+::msgcat::mcset pt {Save Contours} {Salvar Contornos}
+::msgcat::mcset pt {Save Contrast/Bias} {Salvar Contraste/Bias}
+::msgcat::mcset pt {Save Data} {Salvar Dados}
+::msgcat::mcset pt {Save Image on Download}
+::msgcat::mcset pt {Save Image} {Salvar Imagem}
+::msgcat::mcset pt {Save Regions} [encoding convertfrom iso8859-1 {Salvar Regiões}]
+::msgcat::mcset pt {Save Template}
+::msgcat::mcset pt {Save as}
+::msgcat::mcset pt {Save} {Salvar}
+::msgcat::mcset pt {Scale Parameters} [encoding convertfrom iso8859-1 {Parâmetros da Escala}]
+::msgcat::mcset pt {Scale and Limits}
+::msgcat::mcset pt {Scale} {Escala}
+::msgcat::mcset pt {Scan}
+::msgcat::mcset pt {Scatter Plot Tool}
+::msgcat::mcset pt {Scope} {Escopo}
+::msgcat::mcset pt {Search for Catalogs} [encoding convertfrom iso8859-1 {Buscar Catálogos}]
+::msgcat::mcset pt {Searching for catalogs} [encoding convertfrom iso8859-1 {Buscando Catálogos}]
+::msgcat::mcset pt {Seconds} {Segundos}
+::msgcat::mcset pt {Segment}
+::msgcat::mcset pt {Select All} {Selecionar tudo}
+::msgcat::mcset pt {Select Coordinate System } {Selecionar Sistema de Coordenadas}
+::msgcat::mcset pt {Select None} {Selecionar Nada}
+::msgcat::mcset pt {Select}
+::msgcat::mcset pt {Send}
+::msgcat::mcset pt {Server} {Servidor}
+::msgcat::mcset pt {Sexagesimal}
+::msgcat::mcset pt {Shape} {Formato}
+::msgcat::mcset pt {Show All} {Mostre todos}
+::msgcat::mcset pt {Show Command}
+::msgcat::mcset pt {Show Compass}
+::msgcat::mcset pt {Show Text}
+::msgcat::mcset pt {Show/Hide Frames} {Mostra/Esconde Frames}
+::msgcat::mcset pt {Show} {Mostrar}
+::msgcat::mcset pt {Simple Cross}
+::msgcat::mcset pt {Simple Plus}
+::msgcat::mcset pt {Single Frame} [encoding convertfrom iso8859-1 {Frame Único}]
+::msgcat::mcset pt {Single} [encoding convertfrom iso8859-1 {Único}]
+::msgcat::mcset pt {Sites}
+::msgcat::mcset pt {Size/Radius} {Tamanho/Raio}
+::msgcat::mcset pt {Size} {Tamanho}
+::msgcat::mcset pt {Skip First} {Pular Primeiro}
+::msgcat::mcset pt {Slice}
+::msgcat::mcset pt {Smooth Parameters} [encoding convertfrom iso8859-1 {Parâmetros da Suavização}]
+::msgcat::mcset pt {Smoothness}
+::msgcat::mcset pt {Smooth} {Suavizar}
+::msgcat::mcset pt {Solid}
+::msgcat::mcset pt {Sorry, DS9 does not support} [encoding convertfrom iso8859-1 {Perdão, o DS9 não suporta}]
+::msgcat::mcset pt {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset pt {Sort} {Organizar}
+::msgcat::mcset pt {Source TCL} [encoding convertfrom iso8859-1 {Código TCL}]
+::msgcat::mcset pt {Source} {Fonte}
+::msgcat::mcset pt {Space Equal Distance}
+::msgcat::mcset pt {Space Equal Value}
+::msgcat::mcset pt {Spacing} [encoding convertfrom iso8859-1 {Espaçamento}]
+::msgcat::mcset pt {Sqrt}
+::msgcat::mcset pt {Square Root} {Raiz Quadrada}
+::msgcat::mcset pt {Squared} {Quadrado}
+::msgcat::mcset pt {Square}
+::msgcat::mcset pt {Stacked}
+::msgcat::mcset pt {Starbase}
+::msgcat::mcset pt {Startup}
+::msgcat::mcset pt {Start} {Iniciar}
+::msgcat::mcset pt {Statistics}
+::msgcat::mcset pt {Stats}
+::msgcat::mcset pt {Status} {Estado}
+::msgcat::mcset pt {Step} {Passo}
+::msgcat::mcset pt {Stop} {Parar}
+::msgcat::mcset pt {Story of SAOImage DS9}
+::msgcat::mcset pt {Story}
+::msgcat::mcset pt {Sum} {Soma}
+::msgcat::mcset pt {Sunken}
+::msgcat::mcset pt {Symbol Editor}
+::msgcat::mcset pt {Symbol} [encoding convertfrom iso8859-1 {Símbolo}]
+::msgcat::mcset pt {Tab-Separated-Value}
+::msgcat::mcset pt {Table}
+::msgcat::mcset pt {Tabloid} [encoding convertfrom iso8859-1 {Tablóide}]
+::msgcat::mcset pt {Tag Color}
+::msgcat::mcset pt {Task}
+::msgcat::mcset pt {Template}
+::msgcat::mcset pt {Text Font}
+::msgcat::mcset pt {Text} {Texto}
+::msgcat::mcset pt {Then} [encoding convertfrom iso8859-1 {Então}]
+::msgcat::mcset pt {Thickness} {Expessura}
+::msgcat::mcset pt {This analysis task is already running. Do you wish to kill it?} [encoding convertfrom iso8859-1 {Esta análise já está sendo executada. Você deseja parar?}]
+::msgcat::mcset pt {This function is not available.}
+::msgcat::mcset pt {This function is not currently supported for this port.}
+::msgcat::mcset pt {Tickmarks}
+::msgcat::mcset pt {Tile Frames}
+::msgcat::mcset pt {Tile Parameters}
+::msgcat::mcset pt {Tile}
+::msgcat::mcset pt {Times}
+::msgcat::mcset pt {Title} [encoding convertfrom iso8859-1 {Título}]
+::msgcat::mcset pt {Tophat}
+::msgcat::mcset pt {Topographic}
+::msgcat::mcset pt {Top}
+::msgcat::mcset pt {To} {Para}
+::msgcat::mcset pt {Transparency}
+::msgcat::mcset pt {Triangle}
+::msgcat::mcset pt {Type} {Tipo}
+::msgcat::mcset pt {URL}
+::msgcat::mcset pt {Unable to connect directly: using Web Proxy}
+::msgcat::mcset pt {Unable to determine date of observation}
+::msgcat::mcset pt {Unable to determine time of observation}
+::msgcat::mcset pt {Unable to evaluate filter} {Incapaz de calcular filtro}
+::msgcat::mcset pt {Unable to find SIAP window}
+::msgcat::mcset pt {Unable to find URL column}
+::msgcat::mcset pt {Unable to find catalog window} [encoding convertfrom iso8859-1 {Incapaz de encontrar janela do catálogo}]
+::msgcat::mcset pt {Unable to find plot window} [encoding convertfrom iso8859-1 {Incapaz de encontrar janela de gráfico}]
+::msgcat::mcset pt {Unable to load RGB image into a non-rgb frame} [encoding convertfrom iso8859-1 {Incapaz de carregar imagem RGB em um frame não RGB}]
+::msgcat::mcset pt {Unable to load region file}
+::msgcat::mcset pt {Unable to load} {Incapaz de carregar}
+::msgcat::mcset pt {Unable to locate URL} {Incapaz de localizar URL}
+::msgcat::mcset pt {Unable to match target with XPA Mime request}
+::msgcat::mcset pt {Unable to open file} {Incapaz de abrir arquivo}
+::msgcat::mcset pt {Unable to process Analysis file}
+::msgcat::mcset pt {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset pt {Undo} {Voltar}
+::msgcat::mcset pt {Unique}
+::msgcat::mcset pt {Unists}
+::msgcat::mcset pt {Units} {Unidades}
+::msgcat::mcset pt {Unknown Colormap}
+::msgcat::mcset pt {Unknown command}
+::msgcat::mcset pt {Update Filter}
+::msgcat::mcset pt {Update Group} {Atualizar Grupo}
+::msgcat::mcset pt {Update from Current Crosshair} {Atualizar da Cruz Atual}
+::msgcat::mcset pt {Update from Current Frame} {Atualizar do Frame Atual}
+::msgcat::mcset pt {Update} {Atualizar}
+::msgcat::mcset pt {Upper Left Back}
+::msgcat::mcset pt {Upper Left Front}
+::msgcat::mcset pt {Upper Right Back}
+::msgcat::mcset pt {Upper Right Front}
+::msgcat::mcset pt {Use Authentication} [encoding convertfrom iso8859-1 {Utilizar Autenticação}]
+::msgcat::mcset pt {Use Current Frame on Download} {Utilizar Frame Atual ao Descarregar}
+::msgcat::mcset pt {Use Internal Web Browser} {Utilizar Navegador Web Interno}
+::msgcat::mcset pt {Use Proxy} {Utilizar Proxy}
+::msgcat::mcset pt {User Manual}
+::msgcat::mcset pt {Username} [encoding convertfrom iso8859-1 {Nome de usuário}]
+::msgcat::mcset pt {User} [encoding convertfrom iso8859-1 {Usuário}]
+::msgcat::mcset pt {Use} {Usar}
+::msgcat::mcset pt {VO Server}
+::msgcat::mcset pt {VO}
+::msgcat::mcset pt {Value} {Valor}
+::msgcat::mcset pt {Vector} {Vetor}
+::msgcat::mcset pt {Vertical Graph} [encoding convertfrom iso8859-1 {Gráfico Vertical}]
+::msgcat::mcset pt {Vertical Layout} {Layout Vertical}
+::msgcat::mcset pt {Vertical Text} {Texto Vertical}
+::msgcat::mcset pt {Vertical}
+::msgcat::mcset pt {View} {Visualizar}
+::msgcat::mcset pt {Virtual Observatory} [encoding convertfrom iso8859-1 {Observatório Virtual}]
+::msgcat::mcset pt {WCS Parameters}
+::msgcat::mcset pt {WCS}
+::msgcat::mcset pt {Wavelength} {Comprimento de Onda}
+::msgcat::mcset pt {Web Browser} {Navegador Web}
+::msgcat::mcset pt {White} {Branco}
+::msgcat::mcset pt {Width} {Largura}
+::msgcat::mcset pt {Window}
+::msgcat::mcset pt {Words matching title, description}
+::msgcat::mcset pt {X Axis Title}
+::msgcat::mcset pt {X Grid}
+::msgcat::mcset pt {XPA Information} [encoding convertfrom iso8859-1 {Informação sobre o XPA}]
+::msgcat::mcset pt {XPA not initialized} [encoding convertfrom iso8859-1 {XPA não inicializado}]
+::msgcat::mcset pt {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset pt {XPA}
+::msgcat::mcset pt {X}
+::msgcat::mcset pt {Y Axis Title}
+::msgcat::mcset pt {Y Grid}
+::msgcat::mcset pt {Yellow} {Amarelo}
+::msgcat::mcset pt {Y}
+::msgcat::mcset pt {Z Axis Scale}
+::msgcat::mcset pt {ZScale Parameters} [encoding convertfrom iso8859-1 {Parâmetros da escala Z}]
+::msgcat::mcset pt {Zero}
+::msgcat::mcset pt {Zoom Fit}
+::msgcat::mcset pt {Zoom In} {Aumentar}
+::msgcat::mcset pt {Zoom Out} {Diminuir}
+::msgcat::mcset pt {Zoom} {Fator}
+::msgcat::mcset pt {and}
+::msgcat::mcset pt {blue}
+::msgcat::mcset pt {b}
+::msgcat::mcset pt {color}
+::msgcat::mcset pt {cool}
+::msgcat::mcset pt {green}
+::msgcat::mcset pt {grey}
+::msgcat::mcset pt {g}
+::msgcat::mcset pt {h5utils}
+::msgcat::mcset pt {heat}
+::msgcat::mcset pt {not}
+::msgcat::mcset pt {only}
+::msgcat::mcset pt {or center of data} {ou centro dos dados}
+::msgcat::mcset pt {rainbow}
+::msgcat::mcset pt {red}
+::msgcat::mcset pt {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed} [encoding convertfrom iso8859-1 {colunas de dados foram descarregadas. Mais podem estar disponíveis. Você pode querer ajustar o máximo permitido}]
+::msgcat::mcset pt {r}
+::msgcat::mcset pt {staircase}
+::msgcat::mcset pt {standard}
+::msgcat::mcset pt {x}
+::msgcat::mcset pt {}
diff --git a/ds9/msgs/zh.msg b/ds9/msgs/zh.msg
new file mode 100644
index 0000000..5c73173
--- /dev/null
+++ b/ds9/msgs/zh.msg
@@ -0,0 +1,867 @@
+::msgcat::mcset zh {2D}
+::msgcat::mcset zh {3D}
+::msgcat::mcset zh {A postscript generation error has occurred}
+::msgcat::mcset zh {AIP}
+::msgcat::mcset zh {Abort}
+::msgcat::mcset zh {About SAOImage DS9}
+::msgcat::mcset zh {About} [encoding convertfrom big5 "\xC3\xF6 \xA9\xF3"]
+::msgcat::mcset zh {Acknowledgment}
+::msgcat::mcset zh {Add}
+::msgcat::mcset zh {Advanced}
+::msgcat::mcset zh {Aligned}
+::msgcat::mcset zh {Align} [encoding convertfrom big5 "\xB9\xEF \xBB\xF4 \xA4\xE8 \xA6\xEC"]
+::msgcat::mcset zh {All Columns}
+::msgcat::mcset zh {All Rows}
+::msgcat::mcset zh {All}
+::msgcat::mcset zh {Always save files during Backup}
+::msgcat::mcset zh {Amplifier}
+::msgcat::mcset zh {An error has occurred during backup}
+::msgcat::mcset zh {An error has occurred during restore}
+::msgcat::mcset zh {An error has occurred invoking the Analysis task}
+::msgcat::mcset zh {An error has occurred while creating image.}
+::msgcat::mcset zh {An error has occurred while creating the image. Please be sure that the ds9 window is in the upper left corner of the default screen and the entire window is visible.}
+::msgcat::mcset zh {An error has occurred while creating the image. Please be sure that the entire image window is visible on the screen.}
+::msgcat::mcset zh {An error has occurred while printing}
+::msgcat::mcset zh {An error has occurred while reading image.}
+::msgcat::mcset zh {An error has occurred while saving}
+::msgcat::mcset zh {An error has occurred while updating VO server list}
+::msgcat::mcset zh {An error has occurred while writing image.}
+::msgcat::mcset zh {An internal error has been detected}
+::msgcat::mcset zh {Analysis Command Log}
+::msgcat::mcset zh {Analysis Commands}
+::msgcat::mcset zh {Analysis File}
+::msgcat::mcset zh {Analysis Log}
+::msgcat::mcset zh {Analysis} [encoding convertfrom big5 "\xA4\xC0 \xAA\x52"]
+::msgcat::mcset zh {Angle Complement}
+::msgcat::mcset zh {Angles}
+::msgcat::mcset zh {Angle}
+::msgcat::mcset zh {Annuli}
+::msgcat::mcset zh {Annulus} [encoding convertfrom big5 "\xB6\xEA \xB0\xE9"]
+::msgcat::mcset zh {Apply}
+::msgcat::mcset zh {ArcMin}
+::msgcat::mcset zh {ArcSec}
+::msgcat::mcset zh {Architecture}
+::msgcat::mcset zh {Archives}
+::msgcat::mcset zh {Array}
+::msgcat::mcset zh {Arrow}
+::msgcat::mcset zh {Astronomy}
+::msgcat::mcset zh {At Startup}
+::msgcat::mcset zh {At least 2 different catalogs are required}
+::msgcat::mcset zh {Auto Centroid}
+::msgcat::mcset zh {Auto Plot 2D}
+::msgcat::mcset zh {Auto Plot 3D}
+::msgcat::mcset zh {Auto Plot Statistics}
+::msgcat::mcset zh {Auto Plot}
+::msgcat::mcset zh {Autoload FITS Regions}
+::msgcat::mcset zh {Autoload}
+::msgcat::mcset zh {Automatic}
+::msgcat::mcset zh {Average}
+::msgcat::mcset zh {Axes Number}
+::msgcat::mcset zh {Axes Order}
+::msgcat::mcset zh {Axes Title}
+::msgcat::mcset zh {Axes}
+::msgcat::mcset zh {Axis Length}
+::msgcat::mcset zh {Axis Numbers}
+::msgcat::mcset zh {Axis Title}
+::msgcat::mcset zh {Axis}
+::msgcat::mcset zh {Azimuth}
+::msgcat::mcset zh {Background Color}
+::msgcat::mcset zh {Background}
+::msgcat::mcset zh {Backup}
+::msgcat::mcset zh {Back}
+::msgcat::mcset zh {Bar Plot Tool}
+::msgcat::mcset zh {Bias}
+::msgcat::mcset zh {Bin 3rd Column}
+::msgcat::mcset zh {Bin Center}
+::msgcat::mcset zh {Bin Columns}
+::msgcat::mcset zh {Bin Filter}
+::msgcat::mcset zh {Bin Fit}
+::msgcat::mcset zh {Bin In}
+::msgcat::mcset zh {Bin Out}
+::msgcat::mcset zh {Binning Parameters}
+::msgcat::mcset zh {Bin}
+::msgcat::mcset zh {Black} [encoding convertfrom big5 "\xB6\xC2 \xA6\xE2"]
+::msgcat::mcset zh {Blank/Inf/NaN Color}
+::msgcat::mcset zh {Blink Frames}
+::msgcat::mcset zh {Blink Interval}
+::msgcat::mcset zh {Blink}
+::msgcat::mcset zh {Block Fit}
+::msgcat::mcset zh {Block In}
+::msgcat::mcset zh {Block Out}
+::msgcat::mcset zh {Block Parameters}
+::msgcat::mcset zh {Block}
+::msgcat::mcset zh {Blue}
+::msgcat::mcset zh {Bold}
+::msgcat::mcset zh {Border}
+::msgcat::mcset zh {Bottom}
+::msgcat::mcset zh {Box Annulus} [encoding convertfrom big5 "\xA4\xE8 \xA7\xCE \xB0\xE9"]
+::msgcat::mcset zh {Box Panda}
+::msgcat::mcset zh {BoxCircle}
+::msgcat::mcset zh {Boxcar}
+::msgcat::mcset zh {Box} [encoding convertfrom big5 "\xA4\xE8 \xA7\xCE"]
+::msgcat::mcset zh {Broadcast}
+::msgcat::mcset zh {Browser}
+::msgcat::mcset zh {Browse}
+::msgcat::mcset zh {Buffer}
+::msgcat::mcset zh {Buttonbar}
+::msgcat::mcset zh {Buttons} [encoding convertfrom big5 "\xAB\xF6 \xB6\x73 \xA6\x43"]
+::msgcat::mcset zh {Bytes}
+::msgcat::mcset zh {CMYK}
+::msgcat::mcset zh {Can Delete} [encoding convertfrom big5 "\xA5\x69 \xA5\x48 \xA7\x52 \xB0\xA3"]
+::msgcat::mcset zh {Can Edit} [encoding convertfrom big5 "\xA5\x69 \xA5\x48 \xBD\x73 \xBF\xE8"]
+::msgcat::mcset zh {Can Move} [encoding convertfrom big5 "\xA5\x69 \xA5\x48 \xB2\xBE \xB0\xCA"]
+::msgcat::mcset zh {Can Rotate} [encoding convertfrom big5 "\xA5\x69 \xA5\x48 \xB1\xDB \xC2\xE0"]
+::msgcat::mcset zh {Cancelled}
+::msgcat::mcset zh {Cancel}
+::msgcat::mcset zh {Cap}
+::msgcat::mcset zh {Catalog Server}
+::msgcat::mcset zh {Catalog Tool}
+::msgcat::mcset zh {Catalogs} [encoding convertfrom big5 "\xB8\xEA \xAE\xC6 \xAA\xED"]
+::msgcat::mcset zh {Catalog}
+::msgcat::mcset zh {Catrom}
+::msgcat::mcset zh {Cat}
+::msgcat::mcset zh {Center Image} [encoding convertfrom big5 "\xBC\x76 \xB9\xB3 \xB8\x6D \xA4\xA4"]
+::msgcat::mcset zh {Center Non-modal Dialogs}
+::msgcat::mcset zh {Center}
+::msgcat::mcset zh {Centroid Parameters} [encoding convertfrom big5 "\xA4\xA4 \xA4\xDF \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Centroid}
+::msgcat::mcset zh {Circle} [encoding convertfrom big5 "\xB6\xEA \xA7\xCE"]
+::msgcat::mcset zh {Clear All}
+::msgcat::mcset zh {Clear Analysis Commands}
+::msgcat::mcset zh {Clear Cache}
+::msgcat::mcset zh {Clear Data}
+::msgcat::mcset zh {Clear External Analysis Commands?}
+::msgcat::mcset zh {Clear Filter}
+::msgcat::mcset zh {Clear Frame} [encoding convertfrom big5 "\xB2\x4D \xB0\xA3 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Clear Preferences?}
+::msgcat::mcset zh {Clear Preferences}
+::msgcat::mcset zh {Clear} [encoding convertfrom big5 "\xB2\x4D \xB0\xA3"]
+::msgcat::mcset zh {Click to Center}
+::msgcat::mcset zh {Close}
+::msgcat::mcset zh {Colorbar Size}
+::msgcat::mcset zh {Colorbar} [encoding convertfrom big5 "\xA6\xE2 \xB6\xA5 \xB9\xCF \xA8\xD2"]
+::msgcat::mcset zh {Colormap Parameters} [encoding convertfrom big5 "\xC3\x43 \xA6\xE2 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Colormap}
+::msgcat::mcset zh {Color} [encoding convertfrom big5 "\xC3\x43 \xA6\xE2"]
+::msgcat::mcset zh {Columns} [encoding convertfrom big5 "\xA4\xE8 \xA6\xEC"]
+::msgcat::mcset zh {Column}
+::msgcat::mcset zh {Command not allowed}
+::msgcat::mcset zh {Command}
+::msgcat::mcset zh {Compass}
+::msgcat::mcset zh {Composite Region} [encoding convertfrom big5 "\xB2\x56 \xA6\x58 \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Composite}
+::msgcat::mcset zh {Compression}
+::msgcat::mcset zh {Configure}
+::msgcat::mcset zh {Connect Directly}
+::msgcat::mcset zh {Connect SAMP}
+::msgcat::mcset zh {Connect Using Web Proxy}
+::msgcat::mcset zh {Connect}
+::msgcat::mcset zh {Console}
+::msgcat::mcset zh {Contacting Image Server}
+::msgcat::mcset zh {Contour Parameters} [encoding convertfrom big5 "\xB5\xA5 \xAD\xC8 \xBD\x75 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Contours} [encoding convertfrom big5 "\xB5\xA5 \xAD\xC8 \xBD\x75"]
+::msgcat::mcset zh {Contour}
+::msgcat::mcset zh {Contrast}
+::msgcat::mcset zh {Convert to Polygons}
+::msgcat::mcset zh {Coordinate Grid Parameters} [encoding convertfrom big5 "\xAE\x79 \xBC\xD0 \xAE\xE6 \xBD\x75 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Coordinate Grid} [encoding convertfrom big5 "\xAE\x79 \xBC\xD0 \xAE\xE6 \xBD\x75"]
+::msgcat::mcset zh {Coordinate System}
+::msgcat::mcset zh {Coordinates}
+::msgcat::mcset zh {Coordinate}
+::msgcat::mcset zh {Copy Contours}
+::msgcat::mcset zh {Copy to Regions}
+::msgcat::mcset zh {Copy}
+::msgcat::mcset zh {Create Movie}
+::msgcat::mcset zh {Create New Frame on Download}
+::msgcat::mcset zh {Create} [encoding convertfrom big5 "\xBB\x73 \xB3\x79"]
+::msgcat::mcset zh {Crop Parameters}
+::msgcat::mcset zh {Crop}
+::msgcat::mcset zh {Crosshair Parameters}
+::msgcat::mcset zh {Crosshair To}
+::msgcat::mcset zh {Crosshair}
+::msgcat::mcset zh {Cross}
+::msgcat::mcset zh {Cubehelix}
+::msgcat::mcset zh {Cube}
+::msgcat::mcset zh {Cubic}
+::msgcat::mcset zh {Current Frame}
+::msgcat::mcset zh {Current Range}
+::msgcat::mcset zh {Current}
+::msgcat::mcset zh {Cursor}
+::msgcat::mcset zh {Cut}
+::msgcat::mcset zh {Cyan} [encoding convertfrom big5 "\xAB\x43 \xA6\xE2"]
+::msgcat::mcset zh {DPI}
+::msgcat::mcset zh {DS9 has detected a newer version of a backup file and therefore will not process this file.}
+::msgcat::mcset zh {DS9 has detected a newer version of a preferences file.}
+::msgcat::mcset zh {DS9 has detected an older backup file, do you wish to continue?}
+::msgcat::mcset zh {DS9 has detected an older preferences file, do you wish to update?}
+::msgcat::mcset zh {DS9 will complete the initialization process}
+::msgcat::mcset zh {Dash} [encoding convertfrom big5 "\xB5\xEA \xBD\x75"]
+::msgcat::mcset zh {Data Format}
+::msgcat::mcset zh {Dataset Name}
+::msgcat::mcset zh {Dataset}
+::msgcat::mcset zh {Data}
+::msgcat::mcset zh {Decrease}
+::msgcat::mcset zh {Default All Files}
+::msgcat::mcset zh {Default Format}
+::msgcat::mcset zh {Default Length}
+::msgcat::mcset zh {Default}
+::msgcat::mcset zh {Degrees}
+::msgcat::mcset zh {Delete All Frames?}
+::msgcat::mcset zh {Delete All Frames} [encoding convertfrom big5 "\xA7\x52 \xB0\xA3 \xA9\xD2 \xA6\xB3 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Delete All Groups?}
+::msgcat::mcset zh {Delete All Groups}
+::msgcat::mcset zh {Delete All Regions?}
+::msgcat::mcset zh {Delete All Regions} [encoding convertfrom big5 "\xA7\x52 \xB0\xA3 \xA5\xEF \xB3\xA1 \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Delete All}
+::msgcat::mcset zh {Delete Color Tags}
+::msgcat::mcset zh {Delete Frame} [encoding convertfrom big5 "\xA7\x52 \xB0\xA3 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Delete Group}
+::msgcat::mcset zh {Delete Selected Regions} [encoding convertfrom big5 "\xA7\x52 \xB0\xA3 \xBF\xEF \xA8\xFA \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Delete} [encoding convertfrom big5 "\xA7\x52 \xB0\xA3"]
+::msgcat::mcset zh {Depth}
+::msgcat::mcset zh {Detector}
+::msgcat::mcset zh {Dialog Box}
+::msgcat::mcset zh {Diamond}
+::msgcat::mcset zh {Dimension}
+::msgcat::mcset zh {Direction}
+::msgcat::mcset zh {Disconnect}
+::msgcat::mcset zh {Display Header}
+::msgcat::mcset zh {Display Size}
+::msgcat::mcset zh {Dissolve} [encoding convertfrom big5 "\xB8\xD1 \xB4\xB2"]
+::msgcat::mcset zh {Distance}
+::msgcat::mcset zh {Done}
+::msgcat::mcset zh {Download Colormap}
+::msgcat::mcset zh {Download VOTABLE format if available}
+::msgcat::mcset zh {Drag to Center}
+::msgcat::mcset zh {Duplicate Data}
+::msgcat::mcset zh {East}
+::msgcat::mcset zh {Ecliptic}
+::msgcat::mcset zh {Edit Group Name}
+::msgcat::mcset zh {Edit} [encoding convertfrom big5 "\xBD\x73 \xBF\xE8"]
+::msgcat::mcset zh {Elevation}
+::msgcat::mcset zh {Ellipse Annulus}
+::msgcat::mcset zh {Ellipse Panda}
+::msgcat::mcset zh {Ellipse} [encoding convertfrom big5 "\xBE\xF2 \xB6\xEA \xA7\xCE"]
+::msgcat::mcset zh {Elliptical Annulus} [encoding convertfrom big5 "\xBE\xF2 \xB6\xEA \xB0\xE9"]
+::msgcat::mcset zh {Elliptical Panda}
+::msgcat::mcset zh {Enable Confirmation Dialogs}
+::msgcat::mcset zh {Enable}
+::msgcat::mcset zh {End}
+::msgcat::mcset zh {Enter Color}
+::msgcat::mcset zh {Enter Font Size}
+::msgcat::mcset zh {Enter Group Name}
+::msgcat::mcset zh {Enter Search Expression}
+::msgcat::mcset zh {Enter URL}
+::msgcat::mcset zh {Entry}
+::msgcat::mcset zh {Equal Area}
+::msgcat::mcset zh {Equal Distance}
+::msgcat::mcset zh {Equal Spacing}
+::msgcat::mcset zh {Equal Value}
+::msgcat::mcset zh {Error code was returned}
+::msgcat::mcset zh {Error}
+::msgcat::mcset zh {Examine Frame}
+::msgcat::mcset zh {Examine} [encoding convertfrom big5 "\xA9\xF1 \xA4\x6A \xC0\xCB \xB5\xF8"]
+::msgcat::mcset zh {Exam}
+::msgcat::mcset zh {Exclude}
+::msgcat::mcset zh {Exit} [encoding convertfrom big5 "\xC2\xF7 \xB6\x7D"]
+::msgcat::mcset zh {Export Array}
+::msgcat::mcset zh {Export}
+::msgcat::mcset zh {Extention}
+::msgcat::mcset zh {Exterior Axes}
+::msgcat::mcset zh {Exterior Numerics}
+::msgcat::mcset zh {FAQ}
+::msgcat::mcset zh {FK4}
+::msgcat::mcset zh {FK5}
+::msgcat::mcset zh {Factor}
+::msgcat::mcset zh {File not Found or Unable to load FITS data MIME type}
+::msgcat::mcset zh {Filename} [encoding convertfrom big5 "\xC0\xC9 \xAE\xD7 \xA6\x57 \xBA\xD9"]
+::msgcat::mcset zh {File} [encoding convertfrom big5 "\xC0\xC9 \xAE\xD7"]
+::msgcat::mcset zh {Fill}
+::msgcat::mcset zh {Filter}
+::msgcat::mcset zh {Find Next}
+::msgcat::mcset zh {Find}
+::msgcat::mcset zh {First Frame} [encoding convertfrom big5 "\xB3\xCC \xA4\x57 \xBC\x68 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {First}
+::msgcat::mcset zh {Fits}
+::msgcat::mcset zh {Fixed in Size} [encoding convertfrom big5 "\xA9\x54 \xA9\x77 \xA4\x6A \xA4\x70"]
+::msgcat::mcset zh {Flat}
+::msgcat::mcset zh {Flip}
+::msgcat::mcset zh {Font}
+::msgcat::mcset zh {For more information, use --help}
+::msgcat::mcset zh {Format}
+::msgcat::mcset zh {Forward}
+::msgcat::mcset zh {Found}
+::msgcat::mcset zh {Frame Information} [encoding convertfrom big5 "\xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1 \xB8\xEA \xB0\x54"]
+::msgcat::mcset zh {Frame Parameters} [encoding convertfrom big5 "\xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Frames}
+::msgcat::mcset zh {Frame} [encoding convertfrom big5 "\xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {From}
+::msgcat::mcset zh {Front}
+::msgcat::mcset zh {Full Range}
+::msgcat::mcset zh {Function}
+::msgcat::mcset zh {GUI Font}
+::msgcat::mcset zh {Galactic}
+::msgcat::mcset zh {Gap}
+::msgcat::mcset zh {Gaussian}
+::msgcat::mcset zh {General}
+::msgcat::mcset zh {Generate}
+::msgcat::mcset zh {Generating Regions}
+::msgcat::mcset zh {Get Information} [encoding convertfrom big5 "\xB8\xFC \xA4\x4A \xB0\x54 \xAE\xA7"]
+::msgcat::mcset zh {Gist}
+::msgcat::mcset zh {Global Properties}
+::msgcat::mcset zh {Global}
+::msgcat::mcset zh {Goto Frame} [encoding convertfrom big5 "\xA8\xEC \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Graph Horz}
+::msgcat::mcset zh {Graph Vert}
+::msgcat::mcset zh {Graphics}
+::msgcat::mcset zh {Graphs}
+::msgcat::mcset zh {Graph}
+::msgcat::mcset zh {Grayscale}
+::msgcat::mcset zh {Green}
+::msgcat::mcset zh {Grid Gap}
+::msgcat::mcset zh {Grid}
+::msgcat::mcset zh {Groove}
+::msgcat::mcset zh {Groups}
+::msgcat::mcset zh {HTTP}
+::msgcat::mcset zh {Header}
+::msgcat::mcset zh {Height}
+::msgcat::mcset zh {Help Desk}
+::msgcat::mcset zh {Help Me Choose}
+::msgcat::mcset zh {Help} [encoding convertfrom big5 "\xBB\xA1 \xA9\xFA"]
+::msgcat::mcset zh {Hide All} [encoding convertfrom big5 "\xC1\xF4 \xC2\xC3 \xA5\xFE \xB3\xA1"]
+::msgcat::mcset zh {Highlite}
+::msgcat::mcset zh {High}
+::msgcat::mcset zh {Histogram Equalization}
+::msgcat::mcset zh {Histogram}
+::msgcat::mcset zh {Horizontal Graph}
+::msgcat::mcset zh {Horizontal Layout}
+::msgcat::mcset zh {Horizontal} [encoding convertfrom big5 "\xA4\xF4 \xA5\xAD"]
+::msgcat::mcset zh {IAU Location Code}
+::msgcat::mcset zh {ICRS}
+::msgcat::mcset zh {Identification}
+::msgcat::mcset zh {If}
+::msgcat::mcset zh {Image Servers}
+::msgcat::mcset zh {Image}
+::msgcat::mcset zh {Import Array}
+::msgcat::mcset zh {Import}
+::msgcat::mcset zh {Include}
+::msgcat::mcset zh {Increase}
+::msgcat::mcset zh {Information Panel} [encoding convertfrom big5 "\xB8\xEA \xB0\x54 \xA6\x43"]
+::msgcat::mcset zh {Information} [encoding convertfrom big5 "\xB8\xEA \xB0\x54"]
+::msgcat::mcset zh {Initialize XPA}
+::msgcat::mcset zh {Inner}
+::msgcat::mcset zh {Instrument FOV}
+::msgcat::mcset zh {Interior Axes}
+::msgcat::mcset zh {Interior Numerics}
+::msgcat::mcset zh {Internal Parse Error}
+::msgcat::mcset zh {Interval}
+::msgcat::mcset zh {Invalid Column Name}
+::msgcat::mcset zh {Invalid formated multipart/mixed mime type message}
+::msgcat::mcset zh {Invert Colormap} [encoding convertfrom big5 "\xA6\xE2 \xB1\x6D \xA4\xCF \xA6\x56"]
+::msgcat::mcset zh {Invert Selection} [encoding convertfrom big5 "\xA4\xCF \xA6\x56 \xBF\xEF \xA8\xFA"]
+::msgcat::mcset zh {Invert}
+::msgcat::mcset zh {Italic}
+::msgcat::mcset zh {Items Found}
+::msgcat::mcset zh {Iteration}
+::msgcat::mcset zh {JPEG Quality Factor}
+::msgcat::mcset zh {Keep-Alive}
+::msgcat::mcset zh {Kernel}
+::msgcat::mcset zh {Keyboard Shortcuts}
+::msgcat::mcset zh {Keyboard}
+::msgcat::mcset zh {Keyword}
+::msgcat::mcset zh {Labels}
+::msgcat::mcset zh {Label}
+::msgcat::mcset zh {Landscape}
+::msgcat::mcset zh {Language}
+::msgcat::mcset zh {Last Frame} [encoding convertfrom big5 "\xB3\xCC \xA9\xB3 \xBC\x68 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Last}
+::msgcat::mcset zh {Layout Horz}
+::msgcat::mcset zh {Layout Vert}
+::msgcat::mcset zh {Layout}
+::msgcat::mcset zh {Left}
+::msgcat::mcset zh {Legal}
+::msgcat::mcset zh {Legend Title}
+::msgcat::mcset zh {Legend}
+::msgcat::mcset zh {Length}
+::msgcat::mcset zh {Letter}
+::msgcat::mcset zh {Levels}
+::msgcat::mcset zh {Level}
+::msgcat::mcset zh {Limits}
+::msgcat::mcset zh {Line Plot Tool}
+::msgcat::mcset zh {Linear} [encoding convertfrom big5 "\xBD\x75 \xA9\xCA"]
+::msgcat::mcset zh {Line} [encoding convertfrom big5 "\xAA\xBD \xBD\x75"]
+::msgcat::mcset zh {List Data}
+::msgcat::mcset zh {List Regions} [encoding convertfrom big5 "\xA6\x43 \xA5\x58 \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {List}
+::msgcat::mcset zh {Load Analysis Commands}
+::msgcat::mcset zh {Load Color Tags}
+::msgcat::mcset zh {Load Colormap}
+::msgcat::mcset zh {Load Configuration}
+::msgcat::mcset zh {Load Contour Levels}
+::msgcat::mcset zh {Load Contours}
+::msgcat::mcset zh {Load Contrast/Bias}
+::msgcat::mcset zh {Load Data}
+::msgcat::mcset zh {Load Mosaic}
+::msgcat::mcset zh {Load Regions} [encoding convertfrom big5 "\xB8\xFC \xA4\x4A \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Load Template}
+::msgcat::mcset zh {Load into All Frames}
+::msgcat::mcset zh {Load into Current Frame}
+::msgcat::mcset zh {Loading Catalog}
+::msgcat::mcset zh {Loading}
+::msgcat::mcset zh {Load} [encoding convertfrom big5 "\xB8\xFC \xA4\x4A"]
+::msgcat::mcset zh {Local}
+::msgcat::mcset zh {Lock Axes}
+::msgcat::mcset zh {Lock Bin}
+::msgcat::mcset zh {Lock Color}
+::msgcat::mcset zh {Lock Crop Amplifier}
+::msgcat::mcset zh {Lock Crop Detector}
+::msgcat::mcset zh {Lock Crop Image}
+::msgcat::mcset zh {Lock Crop None}
+::msgcat::mcset zh {Lock Crop Physical}
+::msgcat::mcset zh {Lock Crop WCS}
+::msgcat::mcset zh {Lock Crosshair Amplifier}
+::msgcat::mcset zh {Lock Crosshair Detector}
+::msgcat::mcset zh {Lock Crosshair Image}
+::msgcat::mcset zh {Lock Crosshair None}
+::msgcat::mcset zh {Lock Crosshair Physical}
+::msgcat::mcset zh {Lock Crosshair WCS}
+::msgcat::mcset zh {Lock Frame Amplifier}
+::msgcat::mcset zh {Lock Frame Detector}
+::msgcat::mcset zh {Lock Frame Image}
+::msgcat::mcset zh {Lock Frame None}
+::msgcat::mcset zh {Lock Frame Physical}
+::msgcat::mcset zh {Lock Frame WCS}
+::msgcat::mcset zh {Lock Limits}
+::msgcat::mcset zh {Lock Scale}
+::msgcat::mcset zh {Lock Slice Image}
+::msgcat::mcset zh {Lock Slice None}
+::msgcat::mcset zh {Lock Slice WCS}
+::msgcat::mcset zh {Lock Smooth}
+::msgcat::mcset zh {Lock}
+::msgcat::mcset zh {Log Exponent}
+::msgcat::mcset zh {Log} [encoding convertfrom big5 "\xB9\xEF \xBC\xC6"]
+::msgcat::mcset zh {Low High}
+::msgcat::mcset zh {Lower Left Back}
+::msgcat::mcset zh {Lower Left Front}
+::msgcat::mcset zh {Lower Right Back}
+::msgcat::mcset zh {Lower Right Front}
+::msgcat::mcset zh {Low}
+::msgcat::mcset zh {MIP}
+::msgcat::mcset zh {Magenta} [encoding convertfrom big5 "\xAC\xF5 \xB5\xB5 \xA6\xE2"]
+::msgcat::mcset zh {Magnification}
+::msgcat::mcset zh {Magnifier} [encoding convertfrom big5 "\xA9\xF1 \xA4\x6A \xC3\xE8 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Major}
+::msgcat::mcset zh {Manual}
+::msgcat::mcset zh {Mask Parameters}
+::msgcat::mcset zh {Match Axes}
+::msgcat::mcset zh {Match Bin}
+::msgcat::mcset zh {Match Catalog requires at least 1 row per catalog}
+::msgcat::mcset zh {Match Color}
+::msgcat::mcset zh {Match Crop Amplifier}
+::msgcat::mcset zh {Match Crop Detector}
+::msgcat::mcset zh {Match Crop Image}
+::msgcat::mcset zh {Match Crop Physical}
+::msgcat::mcset zh {Match Crop WCS}
+::msgcat::mcset zh {Match Crosshair Amplifier}
+::msgcat::mcset zh {Match Crosshair Detector}
+::msgcat::mcset zh {Match Crosshair Image}
+::msgcat::mcset zh {Match Crosshair Physical}
+::msgcat::mcset zh {Match Crosshair WCS}
+::msgcat::mcset zh {Match Frame Amplifier}
+::msgcat::mcset zh {Match Frame Detector}
+::msgcat::mcset zh {Match Frame Image}
+::msgcat::mcset zh {Match Frame Physical}
+::msgcat::mcset zh {Match Frame WCS}
+::msgcat::mcset zh {Match Limits}
+::msgcat::mcset zh {Match Scale}
+::msgcat::mcset zh {Match Slice Image}
+::msgcat::mcset zh {Match Slice WCS}
+::msgcat::mcset zh {Match Smooth}
+::msgcat::mcset zh {Match}
+::msgcat::mcset zh {Math Function}
+::msgcat::mcset zh {Matplotlib}
+::msgcat::mcset zh {Max Rows}
+::msgcat::mcset zh {Maximum}
+::msgcat::mcset zh {Max}
+::msgcat::mcset zh {Menus and Buttons}
+::msgcat::mcset zh {Menu}
+::msgcat::mcset zh {Message Log}
+::msgcat::mcset zh {Method}
+::msgcat::mcset zh {Min Max Parameters}
+::msgcat::mcset zh {Min Max}
+::msgcat::mcset zh {Minimum}
+::msgcat::mcset zh {Minor}
+::msgcat::mcset zh {Minutes}
+::msgcat::mcset zh {Min}
+::msgcat::mcset zh {Mission}
+::msgcat::mcset zh {Mode}
+::msgcat::mcset zh {Mosaic IRAF Segment}
+::msgcat::mcset zh {Mosaic IRAF}
+::msgcat::mcset zh {Mosaic WCS Segment}
+::msgcat::mcset zh {Mosaic WCS}
+::msgcat::mcset zh {Mosaic WFPC2}
+::msgcat::mcset zh {Mosaic}
+::msgcat::mcset zh {Mouse Click Epsilon}
+::msgcat::mcset zh {Mouse Wheel Bin}
+::msgcat::mcset zh {Mouse Wheel Zoom}
+::msgcat::mcset zh {Mouse and Keyboard}
+::msgcat::mcset zh {Move Back}
+::msgcat::mcset zh {Move First}
+::msgcat::mcset zh {Move Forward}
+::msgcat::mcset zh {Move Frame} [encoding convertfrom big5 "\xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1 \xB6\xB6 \xA7\xC7"]
+::msgcat::mcset zh {Move Last}
+::msgcat::mcset zh {Move to Back}
+::msgcat::mcset zh {Move to Front}
+::msgcat::mcset zh {Movie}
+::msgcat::mcset zh {Multiple Extension Cube}
+::msgcat::mcset zh {Multiple Extension Frames}
+::msgcat::mcset zh {Multiple WCS}
+::msgcat::mcset zh {NRRD}
+::msgcat::mcset zh {Name Resolution}
+::msgcat::mcset zh {Name Server}
+::msgcat::mcset zh {Name or Designation}
+::msgcat::mcset zh {Name}
+::msgcat::mcset zh {Native Dialog}
+::msgcat::mcset zh {New Features}
+::msgcat::mcset zh {New Frame 3D}
+::msgcat::mcset zh {New Frame RGB}
+::msgcat::mcset zh {New Frame each Time}
+::msgcat::mcset zh {New Frame} [encoding convertfrom big5 "\xB7\x73 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {New Group}
+::msgcat::mcset zh {New}
+::msgcat::mcset zh {Next Frame} [encoding convertfrom big5 "\xAB\xE1 \xA4\x40 \xBC\x68 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Next}
+::msgcat::mcset zh {No Catalog specified}
+::msgcat::mcset zh {No Data Available}
+::msgcat::mcset zh {No Items Found}
+::msgcat::mcset zh {No current frame}
+::msgcat::mcset zh {Non-zero}
+::msgcat::mcset zh {None}
+::msgcat::mcset zh {Normal}
+::msgcat::mcset zh {North}
+::msgcat::mcset zh {Not Found}
+::msgcat::mcset zh {Not Supported}
+::msgcat::mcset zh {Number of Samples}
+::msgcat::mcset zh {Number of Threads}
+::msgcat::mcset zh {Number of Ticks}
+::msgcat::mcset zh {Number}
+::msgcat::mcset zh {Numerics} [encoding convertfrom big5 "\xBC\xC6 \xAD\xC8"]
+::msgcat::mcset zh {OK}
+::msgcat::mcset zh {Object} [encoding convertfrom big5 "\xA4\xD1 \xC5\xE9 \xA6\x57 \xBA\xD9"]
+::msgcat::mcset zh {Open File}
+::msgcat::mcset zh {Open TCL Console}
+::msgcat::mcset zh {Open URL}
+::msgcat::mcset zh {Open as}
+::msgcat::mcset zh {Open} [encoding convertfrom big5 "\xB6\x7D \xB1\xD2"]
+::msgcat::mcset zh {Operator}
+::msgcat::mcset zh {Orientation} [encoding convertfrom big5 "\xA4\xE8 \xA6\x56"]
+::msgcat::mcset zh {Origin}
+::msgcat::mcset zh {Oscillate}
+::msgcat::mcset zh {Other Color}
+::msgcat::mcset zh {Other Font Size}
+::msgcat::mcset zh {Other} [encoding convertfrom big5 "\xA8\xE4 \xA5\xA6"]
+::msgcat::mcset zh {Outer}
+::msgcat::mcset zh {Overlap}
+::msgcat::mcset zh {PS Page Setup}
+::msgcat::mcset zh {PS Print}
+::msgcat::mcset zh {Page Setup}
+::msgcat::mcset zh {Page Source}
+::msgcat::mcset zh {Pan To}
+::msgcat::mcset zh {Pan Zoom Rotate Parameters} [encoding convertfrom big5 "\xC1\x59 \xA9\xF1 \xB1\xDB \xC2\xE0 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Pan Zoom}
+::msgcat::mcset zh {Pan then Zoom}
+::msgcat::mcset zh {Panda}
+::msgcat::mcset zh {Panner} [encoding convertfrom big5 "\xC1\x59 \xB9\xCF"]
+::msgcat::mcset zh {Pan}
+::msgcat::mcset zh {Parameters}
+::msgcat::mcset zh {Password}
+::msgcat::mcset zh {Paste Contours}
+::msgcat::mcset zh {Paste}
+::msgcat::mcset zh {Physical}
+::msgcat::mcset zh {Pixel Distribution}
+::msgcat::mcset zh {Pixel Size}
+::msgcat::mcset zh {Pixel Table}
+::msgcat::mcset zh {Pixels}
+::msgcat::mcset zh {Play}
+::msgcat::mcset zh {Please Select a Region}
+::msgcat::mcset zh {Please change the file's permission to disable other users write access. Use anyway?}
+::msgcat::mcset zh {Please specify width, height, and either name or (ra,dec)}
+::msgcat::mcset zh {Plot 2D}
+::msgcat::mcset zh {Plot 3D}
+::msgcat::mcset zh {Plot Title}
+::msgcat::mcset zh {Plotting Regions}
+::msgcat::mcset zh {Plot}
+::msgcat::mcset zh {Plus}
+::msgcat::mcset zh {Pointer}
+::msgcat::mcset zh {Points}
+::msgcat::mcset zh {Point}
+::msgcat::mcset zh {Polygon} [encoding convertfrom big5 "\xA6\x68 \xA8\xA4 \xA7\xCE"]
+::msgcat::mcset zh {Portrait}
+::msgcat::mcset zh {Poster}
+::msgcat::mcset zh {Postscript Page Setup}
+::msgcat::mcset zh {Postscript Print}
+::msgcat::mcset zh {Postscript}
+::msgcat::mcset zh {Power} [encoding convertfrom big5 "\xAB\xFC \xBC\xC6"]
+::msgcat::mcset zh {Preferences} [encoding convertfrom big5 "\xB0\xBE \xA6\x6E \xB3\x5D \xA9\x77"]
+::msgcat::mcset zh {Preserve During Load}
+::msgcat::mcset zh {Previous Frame} [encoding convertfrom big5 "\xAB\x65 \xA4\x40 \xBC\x68 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Previous}
+::msgcat::mcset zh {Prev}
+::msgcat::mcset zh {Print Coordinates}
+::msgcat::mcset zh {Print To}
+::msgcat::mcset zh {Printer}
+::msgcat::mcset zh {Print} [encoding convertfrom big5 "\xA6\x43 \xA6\x4C"]
+::msgcat::mcset zh {Projection}
+::msgcat::mcset zh {Properties} [encoding convertfrom big5 "\xA6\x43 \xA6\x4C"]
+::msgcat::mcset zh {Property}
+::msgcat::mcset zh {Proxy Host}
+::msgcat::mcset zh {Proxy Port}
+::msgcat::mcset zh {Publication}
+::msgcat::mcset zh {Quadratic}
+::msgcat::mcset zh {RGB Array}
+::msgcat::mcset zh {RGB Cube}
+::msgcat::mcset zh {RGB Image}
+::msgcat::mcset zh {RGB}
+::msgcat::mcset zh {Radial Profile}
+::msgcat::mcset zh {Radial}
+::msgcat::mcset zh {Radius}
+::msgcat::mcset zh {Raised}
+::msgcat::mcset zh {Range}
+::msgcat::mcset zh {Redo}
+::msgcat::mcset zh {Red}
+::msgcat::mcset zh {Reference Manual}
+::msgcat::mcset zh {Reference}
+::msgcat::mcset zh {Refresh Frame} [encoding convertfrom big5 "\xAD\xAB \xB7\x73 \xBE\xE3 \xB2\x7A \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Refresh}
+::msgcat::mcset zh {Region Parameters} [encoding convertfrom big5 "\xB0\xCF \xB0\xEC \xB0\xD1\xBC\xC6"]
+::msgcat::mcset zh {Region} [encoding convertfrom big5 "\xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Release Notes}
+::msgcat::mcset zh {Release}
+::msgcat::mcset zh {Relief}
+::msgcat::mcset zh {Reload}
+::msgcat::mcset zh {Render}
+::msgcat::mcset zh {Repeat}
+::msgcat::mcset zh {Reset Colormap} [encoding convertfrom big5 "\xAD\xAB \xB3\x5D \xC3\x43 \xA6\xF2"]
+::msgcat::mcset zh {Reset Frame} [encoding convertfrom big5 "\xAD\xAB \xB3\x5D \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Reset}
+::msgcat::mcset zh {Restore}
+::msgcat::mcset zh {Retrieve}
+::msgcat::mcset zh {Return}
+::msgcat::mcset zh {Right}
+::msgcat::mcset zh {Roman}
+::msgcat::mcset zh {Rotate} [encoding convertfrom big5 "\xB1\xDB \xC2\xE0"]
+::msgcat::mcset zh {Rows}
+::msgcat::mcset zh {Row}
+::msgcat::mcset zh {Ruler} [encoding convertfrom big5 "\xA4\xD8 \xB3\x57"]
+::msgcat::mcset zh {SAMP Image}
+::msgcat::mcset zh {SAMP Table}
+::msgcat::mcset zh {SAMP: already connected}
+::msgcat::mcset zh {SAMP: internal error}
+::msgcat::mcset zh {SAMP: not connected}
+::msgcat::mcset zh {SAMP: unable to locate HUB}
+::msgcat::mcset zh {SAMP}
+::msgcat::mcset zh {Sample Increment}
+::msgcat::mcset zh {Sample Parameters}
+::msgcat::mcset zh {Samples per Line}
+::msgcat::mcset zh {Sample}
+::msgcat::mcset zh {Save 3D Movie}
+::msgcat::mcset zh {Save Color Tags}
+::msgcat::mcset zh {Save Colormap}
+::msgcat::mcset zh {Save Configuration}
+::msgcat::mcset zh {Save Contour Levels}
+::msgcat::mcset zh {Save Contours}
+::msgcat::mcset zh {Save Contrast/Bias}
+::msgcat::mcset zh {Save Data}
+::msgcat::mcset zh {Save Image on Download}
+::msgcat::mcset zh {Save Image} [encoding convertfrom big5 "\xC0\x78 \xA6\x73 \xBC\x76 \xB9\xB3"]
+::msgcat::mcset zh {Save Regions} [encoding convertfrom big5 "\xC0\x78 \xA6\x73 \xB0\xCF \xB0\xEC"]
+::msgcat::mcset zh {Save Template}
+::msgcat::mcset zh {Save as}
+::msgcat::mcset zh {Save} [encoding convertfrom big5 "\xC0\x78 \xA6\x73"]
+::msgcat::mcset zh {Scale Parameters} [encoding convertfrom big5 "\xA6\xE2 \xB6\xA5 \xB0\xD1 \xBC\xC6"]
+::msgcat::mcset zh {Scale and Limits}
+::msgcat::mcset zh {Scale} [encoding convertfrom big5 "\xA6\xE2 \xB6\xA5"]
+::msgcat::mcset zh {Scan}
+::msgcat::mcset zh {Scatter Plot Tool}
+::msgcat::mcset zh {Scope}
+::msgcat::mcset zh {Search for Catalogs}
+::msgcat::mcset zh {Searching for catalogs}
+::msgcat::mcset zh {Seconds}
+::msgcat::mcset zh {Segment}
+::msgcat::mcset zh {Select All} [encoding convertfrom big5 "\xBF\xEF \xA8\xFA \xA5\xFE \xB3\xA1"]
+::msgcat::mcset zh {Select Coordinate System }
+::msgcat::mcset zh {Select None} [encoding convertfrom big5 "\xA8\xFA \xAE\xF8 \xBF\xEF \xA8\xFA"]
+::msgcat::mcset zh {Select}
+::msgcat::mcset zh {Send}
+::msgcat::mcset zh {Server}
+::msgcat::mcset zh {Sexagesimal}
+::msgcat::mcset zh {Shape} [encoding convertfrom big5 "\xA7\xCE \xAA\xAC"]
+::msgcat::mcset zh {Show All} [encoding convertfrom big5 "\xC5\xE3 \xA5\xDC \xA5\xFE \xB3\xA1"]
+::msgcat::mcset zh {Show Command}
+::msgcat::mcset zh {Show Compass}
+::msgcat::mcset zh {Show Text}
+::msgcat::mcset zh {Show/Hide Frames}
+::msgcat::mcset zh {Show} [encoding convertfrom big5 "\xC5\xE3 \xA5\xDC"]
+::msgcat::mcset zh {Simple Cross}
+::msgcat::mcset zh {Simple Plus}
+::msgcat::mcset zh {Single Frame} [encoding convertfrom big5 "\xB3\xE6 \xA4\x40 \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Single} [encoding convertfrom big5 "\xB3\xE6 \xA4\x40"]
+::msgcat::mcset zh {Sites}
+::msgcat::mcset zh {Size/Radius}
+::msgcat::mcset zh {Size}
+::msgcat::mcset zh {Skip First}
+::msgcat::mcset zh {Slice}
+::msgcat::mcset zh {Smooth Parameters}
+::msgcat::mcset zh {Smoothness}
+::msgcat::mcset zh {Smooth}
+::msgcat::mcset zh {Solid}
+::msgcat::mcset zh {Sorry, DS9 does not support}
+::msgcat::mcset zh {Sorry, DS9 requires a Truecolor8, Truecolor16, Truecolor24 visual be available}
+::msgcat::mcset zh {Sort}
+::msgcat::mcset zh {Source TCL}
+::msgcat::mcset zh {Source}
+::msgcat::mcset zh {Space Equal Distance}
+::msgcat::mcset zh {Space Equal Value}
+::msgcat::mcset zh {Spacing}
+::msgcat::mcset zh {Sqrt}
+::msgcat::mcset zh {Square Root}
+::msgcat::mcset zh {Squared}
+::msgcat::mcset zh {Square}
+::msgcat::mcset zh {Stacked}
+::msgcat::mcset zh {Starbase}
+::msgcat::mcset zh {Startup}
+::msgcat::mcset zh {Start}
+::msgcat::mcset zh {Statistics}
+::msgcat::mcset zh {Stats}
+::msgcat::mcset zh {Status}
+::msgcat::mcset zh {Step}
+::msgcat::mcset zh {Stop}
+::msgcat::mcset zh {Story of SAOImage DS9}
+::msgcat::mcset zh {Story}
+::msgcat::mcset zh {Sum}
+::msgcat::mcset zh {Sunken}
+::msgcat::mcset zh {Symbol Editor}
+::msgcat::mcset zh {Symbol}
+::msgcat::mcset zh {Tab-Separated-Value}
+::msgcat::mcset zh {Table}
+::msgcat::mcset zh {Tabloid}
+::msgcat::mcset zh {Tag Color}
+::msgcat::mcset zh {Task}
+::msgcat::mcset zh {Template} [encoding convertfrom big5 "\xBC\xCB \xA5\xBB"]
+::msgcat::mcset zh {Text Font}
+::msgcat::mcset zh {Text} [encoding convertfrom big5 "\xA4\xE5 \xA6\x72"]
+::msgcat::mcset zh {Then}
+::msgcat::mcset zh {Thickness}
+::msgcat::mcset zh {This analysis task is already running. Do you wish to kill it?}
+::msgcat::mcset zh {This function is not available.}
+::msgcat::mcset zh {This function is not currently supported for this port.}
+::msgcat::mcset zh {Tickmarks}
+::msgcat::mcset zh {Tile Frames} [encoding convertfrom big5 "\xA6\x58 \xAD\xAB \xBC\x76 \xB9\xB3 \xB5\xF8 \xB5\xA1"]
+::msgcat::mcset zh {Tile Parameters}
+::msgcat::mcset zh {Tile} [encoding convertfrom big5 "\xA6\x58 \xAD\xAB"]
+::msgcat::mcset zh {Times}
+::msgcat::mcset zh {Title}
+::msgcat::mcset zh {Tophat}
+::msgcat::mcset zh {Topographic}
+::msgcat::mcset zh {Top}
+::msgcat::mcset zh {To}
+::msgcat::mcset zh {Transparency}
+::msgcat::mcset zh {Triangle}
+::msgcat::mcset zh {Type}
+::msgcat::mcset zh {URL}
+::msgcat::mcset zh {Unable to connect directly: using Web Proxy}
+::msgcat::mcset zh {Unable to determine date of observation}
+::msgcat::mcset zh {Unable to determine time of observation}
+::msgcat::mcset zh {Unable to evaluate filter}
+::msgcat::mcset zh {Unable to find SIAP window}
+::msgcat::mcset zh {Unable to find URL column}
+::msgcat::mcset zh {Unable to find catalog window}
+::msgcat::mcset zh {Unable to find plot window}
+::msgcat::mcset zh {Unable to load RGB image into a non-rgb frame}
+::msgcat::mcset zh {Unable to load region file}
+::msgcat::mcset zh {Unable to load}
+::msgcat::mcset zh {Unable to locate URL}
+::msgcat::mcset zh {Unable to match target with XPA Mime request}
+::msgcat::mcset zh {Unable to open file}
+::msgcat::mcset zh {Unable to process Analysis file}
+::msgcat::mcset zh {Unable to save RGB image from a non-rgb frame}
+::msgcat::mcset zh {Undo}
+::msgcat::mcset zh {Unique}
+::msgcat::mcset zh {Unists}
+::msgcat::mcset zh {Units}
+::msgcat::mcset zh {Unknown Colormap}
+::msgcat::mcset zh {Unknown command}
+::msgcat::mcset zh {Update Filter}
+::msgcat::mcset zh {Update Group}
+::msgcat::mcset zh {Update from Current Crosshair}
+::msgcat::mcset zh {Update from Current Frame}
+::msgcat::mcset zh {Update}
+::msgcat::mcset zh {Upper Left Back}
+::msgcat::mcset zh {Upper Left Front}
+::msgcat::mcset zh {Upper Right Back}
+::msgcat::mcset zh {Upper Right Front}
+::msgcat::mcset zh {Use Authentication}
+::msgcat::mcset zh {Use Current Frame on Download}
+::msgcat::mcset zh {Use Internal Web Browser}
+::msgcat::mcset zh {Use Proxy}
+::msgcat::mcset zh {User Manual}
+::msgcat::mcset zh {Username}
+::msgcat::mcset zh {User}
+::msgcat::mcset zh {Use}
+::msgcat::mcset zh {VO Server}
+::msgcat::mcset zh {VO}
+::msgcat::mcset zh {Value}
+::msgcat::mcset zh {Vector} [encoding convertfrom big5 "\xA6\x56 \xB6\x71"]
+::msgcat::mcset zh {Vertical Graph}
+::msgcat::mcset zh {Vertical Layout}
+::msgcat::mcset zh {Vertical Text}
+::msgcat::mcset zh {Vertical} [encoding convertfrom big5 "\xAB\xAB \xAA\xBD"]
+::msgcat::mcset zh {View} [encoding convertfrom big5 "\xC0\xCB \xB5\xF8"]
+::msgcat::mcset zh {Virtual Observatory}
+::msgcat::mcset zh {WCS Parameters}
+::msgcat::mcset zh {WCS} [encoding convertfrom big5 "\xA7\x79 \xBC\xD0"]
+::msgcat::mcset zh {Wavelength}
+::msgcat::mcset zh {Web Browser}
+::msgcat::mcset zh {White} [encoding convertfrom big5 "\xA5\xD5 \xA6\xE2"]
+::msgcat::mcset zh {Width} [encoding convertfrom big5 "\xBC\x65 \xAB\xD7"]
+::msgcat::mcset zh {Window}
+::msgcat::mcset zh {Words matching title, description}
+::msgcat::mcset zh {X Axis Title}
+::msgcat::mcset zh {X Grid}
+::msgcat::mcset zh {XPA Information}
+::msgcat::mcset zh {XPA not initialized}
+::msgcat::mcset zh {XPA unable to verify hostname, setting XPA_METHOD to LOCAL}
+::msgcat::mcset zh {XPA}
+::msgcat::mcset zh {X}
+::msgcat::mcset zh {Y Axis Title}
+::msgcat::mcset zh {Y Grid}
+::msgcat::mcset zh {Yellow} [encoding convertfrom big5 "\xB6\xC0 \xA6\xE2"]
+::msgcat::mcset zh {Y}
+::msgcat::mcset zh {Z Axis Scale}
+::msgcat::mcset zh {ZScale Parameters}
+::msgcat::mcset zh {Zero}
+::msgcat::mcset zh {Zoom Fit}
+::msgcat::mcset zh {Zoom In} [encoding convertfrom big5 "\xA9\xF1 \xA4\x6A"]
+::msgcat::mcset zh {Zoom Out} [encoding convertfrom big5 "\xC1\x59 \xA4\x70"]
+::msgcat::mcset zh {Zoom} [encoding convertfrom big5 "\xC1\x59 \xA9\xF1"]
+::msgcat::mcset zh {and}
+::msgcat::mcset zh {blue} [encoding convertfrom big5 "\xC2\xC5"]
+::msgcat::mcset zh {b}
+::msgcat::mcset zh {color}
+::msgcat::mcset zh {cool}
+::msgcat::mcset zh {green} [encoding convertfrom big5 "\xBA\xF1"]
+::msgcat::mcset zh {grey} [encoding convertfrom big5 "\xA6\xC7"]
+::msgcat::mcset zh {g}
+::msgcat::mcset zh {h5utils}
+::msgcat::mcset zh {heat}
+::msgcat::mcset zh {not}
+::msgcat::mcset zh {only}
+::msgcat::mcset zh {or center of data}
+::msgcat::mcset zh {rainbow}
+::msgcat::mcset zh {red} [encoding convertfrom big5 "\xAC\xF5"]
+::msgcat::mcset zh {rows of data have been downloaded. More may be available. You may wish to adjust the maximum allowed}
+::msgcat::mcset zh {r}
+::msgcat::mcset zh {staircase}
+::msgcat::mcset zh {standard}
+::msgcat::mcset zh {x}
+::msgcat::mcset zh {}
diff --git a/ds9/template/chandra/acis/acis-i.tpl b/ds9/template/chandra/acis/acis-i.tpl
new file mode 100644
index 0000000..7994c62
--- /dev/null
+++ b/ds9/template/chandra/acis/acis-i.tpl
@@ -0,0 +1,18 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(359.99565,0.0059387181) || # point=boxcircle color=blue
+point(359.99369,0.0057314379) || # point=boxcircle
+box(359.99369,0.0057314379,16",16",0.0074458093) || # color=red
+line(359.99369,-0.019268453,359.9937,0.03073116) || # line=0 0 color=red
+line(359.96869,0.0057351065,0.018691898,0.0057284211) || # line=0 0 color=red
+# text(0.074983471,-0.07503056) || textangle=359.45857 color=blue text={I0}
+polygon(0.14468917,-0.14493171,0.14506091,-0.0051482778,0.0052770566,-0.0051292868,0.0049055019,-0.14491342) || # color=blue
+# text(359.93236,-0.075069338) || textangle=359.45857 color=blue text={I1}
+polygon(359.86231,-0.0051675813,359.86264,-0.14495208,0.0024209693,-0.14496979,0.0020857765,-0.0051863415) || # color=blue
+# text(0.075029991,0.0678101) || textangle=359.45857 color=blue text={I2}
+polygon(0.14508996,-0.0020934155,0.14475484,0.13769617,0.0049709953,0.13771371,0.0053064433,-0.0020753216) || # color=blue
+# text(359.93241,0.067857426) || textangle=359.45857 color=blue text={I3}
+polygon(359.86271,0.13776073,359.86234,-0.0020285164,0.0021152286,-0.0020463747,0.0024869566,0.13774255) # color=blue
diff --git a/ds9/template/chandra/acis/acis-is.tpl b/ds9/template/chandra/acis/acis-is.tpl
new file mode 100644
index 0000000..fede600
--- /dev/null
+++ b/ds9/template/chandra/acis/acis-is.tpl
@@ -0,0 +1,30 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(359.9814,-0.1158516) || # point=boxcircle color=blue
+point(359.97944,-0.11605888) || # point=boxcircle
+box(359.97944,-0.11605888,16",16",0.0074458169) || # color=red
+line(359.97944,-0.14105864,359.97944,-0.091059238) || # line=0 0 color=red
+line(359.95444,-0.11605518,0.0044416507,-0.1160619) || # line=0 0 color=red
+# text(0.060733243,-0.19682027) || textangle=359.45857 color=blue text={I0}
+polygon(0.13043901,-0.26672034,0.13081075,-0.12693824,359.99103,-0.12691956,359.99066,-0.26670229) || # color=blue
+# text(359.91811,-0.19685894) || textangle=359.45857 color=blue text={I1}
+polygon(359.84806,-0.12695743,359.84839,-0.26674043,359.98817,-0.26675865,359.98784,-0.12697661) || # color=blue
+# text(0.060779763,-0.053980247) || textangle=359.45857 color=blue text={I2}
+polygon(0.13083979,-0.12388339,0.13050467,0.015906345,359.99072,0.015923489,359.99106,-0.12386561) || # color=blue
+# text(359.91816,-0.053932908) || textangle=359.45857 color=blue text={I3}
+polygon(359.84846,0.015970851,359.84809,-0.12381838,359.98786,-0.12383666,359.98824,0.015952329) || # color=blue
+# text(0.37184311,0.1320915) || textangle=359.45857 color=blue text={S0}
+polygon(0.44178599,0.20209913,0.30184873,0.20204633,0.30189968,0.062083348,0.4418371,0.062137092) || # color=blue dashlist=12 4 background
+# text(0.22927653,0.13201944) || textangle=359.45857 color=blue text={S1}
+polygon(0.2991992,0.20204725,0.15925574,0.2019529,0.15935471,0.061990276,0.29929739,0.062090227) || # color=blue dashlist=12 4 background
+# text(0.086742871,0.13196478) || textangle=359.45857 color=blue text={S2}
+polygon(0.15667073,0.20199168,0.016716491,0.20189768,0.016814458,0.061935721,0.15676886,0.062034932) || # color=blue
+# text(359.94399,0.13190556) || textangle=359.45857 color=blue text={S3}
+polygon(0.013935284,0.20191224,359.87399,0.20185577,359.87404,0.061899917,0.013991488,0.061955169) || # color=blue
+# text(359.8016,0.13185239) || textangle=359.45857 color=blue text={S4}
+polygon(359.87155,0.20185484,359.7316,0.2018065,359.73165,0.061850174,359.8716,0.061898904) || # color=blue dashlist=12 4 background
+# text(359.65917,0.13179423) || textangle=359.45857 color=blue text={S5}
+polygon(359.72912,0.20179225,359.58918,0.20175502,359.58922,0.061799638,359.72916,0.061830852) # color=blue dashlist=12 4 background
diff --git a/ds9/template/chandra/acis/acis-s.tpl b/ds9/template/chandra/acis/acis-s.tpl
new file mode 100644
index 0000000..723dd03
--- /dev/null
+++ b/ds9/template/chandra/acis/acis-s.tpl
@@ -0,0 +1,22 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(359.97589,-0.00023858801) || # point=boxcircle color=blue
+point(359.97739,-0.00030415722) || # point=boxcircle
+box(359.97739,-0.00030415722,16",16",0.0074458058) || # color=red
+line(359.97738,-0.025304045,359.97739,0.024695564) || # line=0 0 color=red
+line(359.95239,-0.00030048775,0.0023881862,-0.00030717384) || # line=0 0 color=red
+# text(0.36595192,0.00027268306) || textangle=359.45857 color=blue text={S0}
+polygon(0.4358959,0.070278402,0.29595769,0.070227238,0.29600903,-0.069733324,0.4359469,-0.069682246) || # color=blue
+# text(0.22338589,0.00020314963) || textangle=359.45857 color=blue text={S1}
+polygon(0.29330794,0.070228032,0.1533645,0.070135307,0.15346356,-0.069824861,0.29340664,-0.069726563) || # color=blue
+# text(0.080851968,0.00014900597) || textangle=359.45857 color=blue text={S2}
+polygon(0.15078032,0.070173966,0.010825204,0.070081577,0.01092379,-0.06987889,0.15087857,-0.069781319) || # color=blue
+# text(359.9381,8.9273906e-05) || textangle=359.45857 color=blue text={S3}
+polygon(0.0080444743,0.070095011,359.8681,0.070039132,359.86815,-0.069915191,0.0081003229,-0.069859569) || # color=blue
+# text(359.79571,3.6603168e-05) || textangle=359.45857 color=blue text={S4}
+polygon(359.86566,0.070038097,359.72571,0.069988331,359.72576,-0.069965427,359.86571,-0.069916317) || # color=blue
+# text(359.65328,-2.3084464e-05) || textangle=359.45857 color=blue text={S5}
+polygon(359.72323,0.069974963,359.58329,0.069936296,359.58333,-0.070018472,359.72327,-0.069984864) # color=blue
diff --git a/ds9/template/chandra/acis/acis-si.tpl b/ds9/template/chandra/acis/acis-si.tpl
new file mode 100644
index 0000000..2f630b9
--- /dev/null
+++ b/ds9/template/chandra/acis/acis-si.tpl
@@ -0,0 +1,30 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(359.98115,0.082070413) || # point=boxcircle color=blue
+point(359.98265,0.082004845) || # point=boxcircle
+box(359.98265,0.082004845,16",16",0.0074458153) || # color=red
+line(359.98265,0.057004991,359.98265,0.1070045) || # line=0 0 color=red
+line(359.95765,0.082008495,0.0076502475,0.082001831) || # line=0 0 color=red
+# text(0.060103564,-0.24632926) || textangle=359.45857 color=blue text={I0}
+polygon(0.12980967,-0.3162311,0.13018093,-0.17644548,359.9904,-0.17642695,359.99003,-0.31621219) || # color=blue
+# text(359.91749,-0.24636747) || textangle=359.45857 color=blue text={I1}
+polygon(359.84743,-0.17646563,359.84776,-0.31625111,359.98754,-0.31626967,359.98721,-0.17648316) || # color=blue
+# text(0.060150801,-0.1034866) || textangle=359.45857 color=blue text={I2}
+polygon(0.13021067,-0.17339142,0.12987474,-0.033600335,359.99009,-0.033582341,359.99043,-0.17337279) || # color=blue
+# text(359.91753,-0.10343879) || textangle=359.45857 color=blue text={I3}
+polygon(359.84783,-0.033535754,359.84746,-0.17332537,359.98724,-0.17334399,359.98761,-0.033553613) || # color=blue
+# text(0.37121376,0.08257996) || textangle=359.45857 color=blue text={S0}
+polygon(0.44115766,0.15258465,0.30121961,0.1525348,0.30127095,0.012574598,0.44120866,0.012624389) || # color=blue dashlist=12 4 background
+# text(0.22864787,0.082511499) || textangle=359.45857 color=blue text={S1}
+polygon(0.29856987,0.15253562,0.15862653,0.15244371,0.15872558,0.012483867,0.29866856,0.012581379) || # color=blue dashlist=12 4 background
+# text(0.086114019,0.082457918) || textangle=359.45857 color=blue text={S2}
+polygon(0.15604234,0.15248238,0.016087265,0.15239031,0.016185851,0.012430134,0.15614059,0.01252742) || # color=blue
+# text(359.94336,0.082398238) || textangle=359.45857 color=blue text={S3}
+polygon(0.013306535,0.15240374,359.87336,0.15234768,359.87341,0.01239362,0.013362384,0.012449456) || # color=blue
+# text(359.80097,0.082345111) || textangle=359.45857 color=blue text={S4}
+polygon(359.87092,0.15234664,359.73097,0.15229619,359.73102,0.012342662,359.87097,0.012392486) || # color=blue dashlist=12 4 background
+# text(359.65854,0.082284459) || textangle=359.45857 color=blue text={S5}
+polygon(359.7285,0.15228281,359.58855,0.15224296,359.58859,0.012288386,359.72853,0.012323208) # color=blue dashlist=12 4 background
diff --git a/ds9/template/chandra/hrc/hrc-i.tpl b/ds9/template/chandra/hrc/hrc-i.tpl
new file mode 100644
index 0000000..22c7196
--- /dev/null
+++ b/ds9/template/chandra/hrc/hrc-i.tpl
@@ -0,0 +1,13 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(359.99932,0.0042101979) || # point=boxcircle color=blue
+point(0.00069740655,0.0082266505) || # point=boxcircle
+box(0.00069740655,0.0082266505,40",40",0.0074458119) || # color=red
+line(0.00069392696,-0.01677324,0.00070029419,0.033226372) || # line=0 0 color=red
+line(359.9757,0.0082303192,0.025697186,0.0082236331) || # line=0 0 color=red
+# text(0.0060229964,-0.071730321) || textangle=359.45857 color=blue text={I0}
+polygon(359.99635,-0.35905082,359.63404,0.0033523352,359.99665,0.36586903,0.35895968,0.0034650549) || # color=blue
+polygon(359.99531,-0.3931907,359.57097,0.031258645,359.99542,0.45559694,0.4197573,0.031147222) # color=blue dashlist=12 4 background
diff --git a/ds9/template/chandra/hrc/hrc-s.tpl b/ds9/template/chandra/hrc/hrc-s.tpl
new file mode 100644
index 0000000..5bbd134
--- /dev/null
+++ b/ds9/template/chandra/hrc/hrc-s.tpl
@@ -0,0 +1,25 @@
+# Region file format: DS9 version 4.1
+# Filename: /tmp/ds9sao26241407288736.fits.gz
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,359.45114) || composite=0
+point(0.014345364,-0.0013056111) || # point=boxcircle color=blue
+point(0.016219966,0.0012246581) || # point=boxcircle
+box(0.016219966,0.0012246581,40",40",0.0074458106) || # color=red
+line(0.016216487,-0.023775231,0.016222854,0.02622438) || # line=0 0 color=red
+line(359.99122,0.0012283276,0.041219741,0.0012216413) || # line=0 0 color=red
+# text(359.38538,0.0030653744) || textangle=359.45857 color=blue text={S1}
+polygon(359.14343,0.056577828,359.14354,-0.050535114,359.68674,-0.049942976,359.68662,0.057169491) || # color=blue
+line(359.14351,-0.019991269,359.6867,-0.019398968) || # line=0 0 color=blue
+polygon(359.08396,0.077760121,359.08412,-0.072286681,359.6868,-0.071629351,359.68663,0.078416884) || # color=blue background
+# text(359.98814,0.0037220871) || textangle=359.45857 color=blue text={S2}
+polygon(359.70851,0.057193071,359.70863,-0.049919757,0.27053203,-0.049307389,0.27041232,0.057805635) || # color=blue
+line(359.7086,-0.019374933,359.92699,-0.019136806) || # line=0 0 color=blue
+line(359.92699,-0.019136806,359.9269,0.057431375) || # line=0 0 color=blue
+line(0.10661832,0.057626818,0.1067037,-0.01894101) || # line=0 0 color=blue
+line(0.1067037,-0.01894101,0.27049777,-0.018762924) || # line=0 0 color=blue
+polygon(359.68663,0.078416884,359.6868,-0.071629351,0.28965388,-0.070972867,0.28948516,0.079073122) || # color=blue background
+# text(0.59092858,0.0043780574) || textangle=359.45857 color=blue text={S3}
+polygon(0.29539512,0.057832417,0.29551495,-0.049280661,0.8367598,-0.048690494,0.83664301,0.058421797) || # color=blue
+line(0.29548067,-0.018735466,0.83672616,-0.018146798) || # line=0 0 color=blue
+polygon(0.28948516,0.079073122,0.28965388,-0.070972867,0.89236821,-0.070316746,0.89220504,0.079728383) # color=blue background
diff --git a/ds9/template/heasarc/suzaku/hxd.tpl b/ds9/template/heasarc/suzaku/hxd.tpl
new file mode 100644
index 0000000..bf75c81
--- /dev/null
+++ b/ds9/template/heasarc/suzaku/hxd.tpl
@@ -0,0 +1,9 @@
+# Created with aemkreg version 6.1 with Euler angles (0, 90, 0)
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,0) || composite=1
+polygon( 0.563355, -0.621657,359.436645, -0.621657,359.436652, 0.504992, 0.563348, 0.504992) || #text={PIN (FULL)}
+polygon(360.000000, -0.340000,359.718333, -0.058333, 0.000000, 0.223333, 0.281667, -0.058333) || #text={PIN (FWHM)}
+polygon( 4.574921, -4.618431,355.425079, -4.618431,355.425574, 4.501888, 4.574426, 4.501888) || #text={GSO (FULL)}
+polygon(360.000000, -2.340833,357.717499, -0.058318, 0.000000, 2.224167, 2.282501, -0.058318) || #text={GSO (FWHM)}
+polygon( 0.008333, -0.066667,359.991667, -0.066667,359.991667, -0.050000, 0.008333, -0.050000) #text={HXD-nominal}
diff --git a/ds9/template/heasarc/suzaku/xis.tpl b/ds9/template/heasarc/suzaku/xis.tpl
new file mode 100644
index 0000000..0eef3a9
--- /dev/null
+++ b/ds9/template/heasarc/suzaku/xis.tpl
@@ -0,0 +1,5 @@
+# Created with aemkreg version 6.1 with Euler angles (0, 90, 0)
+global color=blue dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,0) || composite=1
+polygon( 0.150000, -0.150000,359.850000, -0.150000,359.850000, 0.150000, 0.150000, 0.150000) #text=XIS
diff --git a/ds9/template/heasarc/suzaku/xrs.tpl b/ds9/template/heasarc/suzaku/xrs.tpl
new file mode 100644
index 0000000..da21c93
--- /dev/null
+++ b/ds9/template/heasarc/suzaku/xrs.tpl
@@ -0,0 +1,34 @@
+# Created with aemkreg version 6.1 with Euler angles (0, 90, 0)
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal roman" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,0) || composite=1
+polygon( 0.008047, 0.016399, 0.008047, 0.024344, 0.000102, 0.024344, 0.000102, 0.016399) || #text=XRS
+polygon( 0.008047, 0.008251, 0.008047, 0.016196, 0.000102, 0.016196, 0.000102, 0.008251) || #text=XRS
+polygon( 0.024344, 0.008251, 0.024344, 0.016196, 0.016399, 0.016196, 0.016399, 0.008251) || #text=XRS
+polygon( 0.016196, 0.000102, 0.016196, 0.008047, 0.008251, 0.008047, 0.008251, 0.000102) || #text=XRS
+polygon( 0.024344, 0.000102, 0.024344, 0.008047, 0.016399, 0.008047, 0.016399, 0.000102) || #text=XRS
+polygon( 0.008047, 0.000102, 0.008047, 0.008047, 0.000102, 0.008047, 0.000102, 0.000102) || #text=XRS
+polygon( 0.008047, -0.008047, 0.008047, -0.000102, 0.000102, -0.000102, 0.000102, -0.008047) || #text=XRS
+polygon( 0.008047, -0.024344, 0.008047, -0.016399, 0.000102, -0.016399, 0.000102, -0.024344) || #text=XRS
+polygon( 0.008047, -0.016196, 0.008047, -0.008251, 0.000102, -0.008251, 0.000102, -0.016196) || #text=XRS
+polygon( 0.016196, -0.024344, 0.016196, -0.016399, 0.008251, -0.016399, 0.008251, -0.024344) || #text=XRS
+polygon( 0.016196, -0.016196, 0.016196, -0.008251, 0.008251, -0.008251, 0.008251, -0.016196) || #text=XRS
+polygon( 0.024344, -0.016196, 0.024344, -0.008251, 0.016399, -0.008251, 0.016399, -0.016196) || #text=XRS
+polygon( 0.016196, -0.008047, 0.016196, -0.000102, 0.008251, -0.000102, 0.008251, -0.008047) || #text=XRS
+polygon( 0.024344, -0.008047, 0.024344, -0.000102, 0.016399, -0.000102, 0.016399, -0.008047) || #text=XRS
+polygon(359.999898, -0.024344,359.999898, -0.016399,359.991953, -0.016399,359.991953, -0.024344) || #text=XRS
+polygon(359.999898, -0.016196,359.999898, -0.008251,359.991953, -0.008251,359.991953, -0.016196) || #text=XRS
+polygon(359.991749, -0.024344,359.991749, -0.016399,359.983804, -0.016399,359.983804, -0.024344) || #text=XRS
+polygon(359.991749, -0.016196,359.991749, -0.008251,359.983804, -0.008251,359.983804, -0.016196) || #text=XRS
+polygon(359.983601, -0.016196,359.983601, -0.008251,359.975656, -0.008251,359.975656, -0.016196) || #text=XRS
+polygon(359.991749, -0.008047,359.991749, -0.000102,359.983804, -0.000102,359.983804, -0.008047) || #text=XRS
+polygon(359.983601, -0.008047,359.983601, -0.000102,359.975656, -0.000102,359.975656, -0.008047) || #text=XRS
+polygon(359.999898, -0.008047,359.999898, -0.000102,359.991953, -0.000102,359.991953, -0.008047) || #text=XRS
+polygon(359.999898, 0.000102,359.999898, 0.008047,359.991953, 0.008047,359.991953, 0.000102) || #text=XRS
+polygon(359.999898, 0.016399,359.999898, 0.024344,359.991953, 0.024344,359.991953, 0.016399) || #text=XRS
+polygon(359.999898, 0.008251,359.999898, 0.016196,359.991953, 0.016196,359.991953, 0.008251) || #text=XRS
+polygon(359.991749, 0.016399,359.991749, 0.024344,359.983804, 0.024344,359.983804, 0.016399) || #text=XRS
+polygon(359.991749, 0.008251,359.991749, 0.016196,359.983804, 0.016196,359.983804, 0.008251) || #text=XRS
+polygon(359.983601, 0.008251,359.983601, 0.016196,359.975656, 0.016196,359.975656, 0.008251) || #text=XRS
+polygon(359.991749, 0.000102,359.991749, 0.008047,359.983804, 0.008047,359.983804, 0.000102) || #text=XRS
+polygon(359.983601, 0.000102,359.983601, 0.008047,359.975656, 0.008047,359.975656, 0.000102) #text=XRS
diff --git a/ds9/template/mmt/binospec.tpl b/ds9/template/mmt/binospec.tpl
new file mode 100644
index 0000000..5f8179a
--- /dev/null
+++ b/ds9/template/mmt/binospec.tpl
@@ -0,0 +1,6 @@
+# Region file format: DS9 version 4.0
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) || composite=1
+box(359.9225,0,480",900",0) || # tag={Bino}
+box(0.077500142,0,480",900",0) # tag={Bino}
diff --git a/ds9/template/mmt/hecto/hectochelle.tpl b/ds9/template/mmt/hecto/hectochelle.tpl
new file mode 100644
index 0000000..66bca36
--- /dev/null
+++ b/ds9/template/mmt/hecto/hectochelle.tpl
@@ -0,0 +1,6 @@
+# Region file format: DS9 version 4.0
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) ||
+point(0,0) || # point=boxcircle
+circle(0,0,1800")
diff --git a/ds9/template/mmt/hecto/hectospec.tpl b/ds9/template/mmt/hecto/hectospec.tpl
new file mode 100644
index 0000000..66bca36
--- /dev/null
+++ b/ds9/template/mmt/hecto/hectospec.tpl
@@ -0,0 +1,6 @@
+# Region file format: DS9 version 4.0
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) ||
+point(0,0) || # point=boxcircle
+circle(0,0,1800")
diff --git a/ds9/template/mmt/megacam/megacam-amp-guide.tpl b/ds9/template/mmt/megacam/megacam-amp-guide.tpl
new file mode 100644
index 0000000..5596c05
--- /dev/null
+++ b/ds9/template/mmt/megacam/megacam-amp-guide.tpl
@@ -0,0 +1,153 @@
+# Region file format: DS9 version 4.0
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0|| composite=1
+point(0,0) || # point=boxcircle
+# text(359.83864,-0.20117642) || textangle=89.5 text={A1}
+box(359.83867,-0.20115398,81.586975",367.7002",89.5) ||
+# text(359.83844,-0.1784702) || textangle=89.5 text={A2}
+box(359.83847,-0.17844776,81.586975",367.7002",89.5) ||
+# text(359.83823,-0.15407873) || textangle=89.5 text={A3}
+box(359.83825,-0.15405641,81.586975",367.7002",89.5) ||
+# text(359.83803,-0.13137242) || textangle=89.5 text={A4}
+box(359.83805,-0.13135009,81.586975",367.7002",89.5) ||
+# text(359.83783,-0.10698076) || textangle=89.5 text={A5}
+box(359.83785,-0.10695843,81.586975",367.7002",89.5) ||
+# text(359.83762,-0.084274433) || textangle=89.5 text={A6}
+box(359.83764,-0.084252106,81.586975",367.7002",89.5) ||
+# text(359.83742,-0.059882774) || textangle=89.5 text={A7}
+box(359.83744,-0.059860347,81.586975",367.7002",89.5) ||
+# text(359.83722,-0.037176259) || textangle=89.5 text={A8}
+box(359.83724,-0.037153931,81.586975",367.7002",89.5) ||
+# text(359.837,-0.012784701) || textangle=89.5 text={A9}
+box(359.83703,-0.012762259,81.586975",367.7002",89.5) ||
+# text(359.8368,0.0099217144) || textangle=89.5 text={A10}
+box(359.83683,0.0099441558,81.586975",367.7002",89.5) ||
+# text(359.83658,0.034313386) || textangle=89.5 text={A11}
+box(359.8366,0.034335714,81.586975",367.7002",89.5) ||
+# text(359.83639,0.057019803) || textangle=89.5 text={A12}
+box(359.8364,0.05704213,81.586975",367.7002",89.5) ||
+# text(359.83618,0.081411562) || textangle=89.5 text={A13}
+box(359.8362,0.081433889,81.586975",367.7002",89.5) ||
+# text(359.83597,0.10411788) || textangle=89.5 text={A14}
+box(359.83599,0.10414022,81.586975",367.7002",89.5) ||
+# text(359.83577,0.12850954) || textangle=89.5 text={A15}
+box(359.83579,0.12853188,81.586975",367.7002",89.5) ||
+# text(359.83557,0.15121586) || textangle=89.5 text={A16}
+box(359.83559,0.15123819,81.586975",367.7002",89.5) ||
+# text(359.83535,0.17560722) || textangle=89.5 text={A17}
+box(359.83537,0.17562955,81.586975",367.7002",89.5) ||
+# text(359.83515,0.19831344) || textangle=89.5 text={A18}
+box(359.83518,0.19833588,81.586975",367.7002",89.5) ||
+# text(359.95003,-0.20020716) || textangle=89.5 text={A19}
+box(359.95007,-0.2001846,81.586975",367.7002",89.5) ||
+# text(359.94983,-0.17750084) || textangle=89.5 text={A20}
+box(359.94987,-0.17747829,81.586975",367.7002",89.5) ||
+# text(359.94962,-0.15310927) || textangle=89.5 text={A21}
+box(359.94966,-0.15308671,81.586975",367.7002",89.5) ||
+# text(359.94942,-0.13040286) || textangle=89.5 text={A22}
+box(359.94946,-0.1303804,81.586975",367.7002",89.5) ||
+# text(359.9492,-0.1060113) || textangle=89.5 text={A23}
+box(359.94924,-0.10598873,81.586975",367.7002",89.5) ||
+# text(359.94901,-0.08330477) || textangle=89.5 text={A24}
+box(359.94905,-0.083282213,81.586975",367.7002",89.5) ||
+# text(359.94878,-0.058913113) || textangle=89.5 text={A25}
+box(359.94883,-0.058890441,81.586975",367.7002",89.5) ||
+# text(359.94859,-0.036206483) || textangle=89.5 text={A26}
+box(359.94863,-0.036184025,81.586975",367.7002",89.5) ||
+# text(359.94838,-0.011814738) || textangle=89.5 text={A27}
+box(359.94843,-0.011792066,81.586975",367.7002",89.5) ||
+# text(359.94818,0.010891805) || textangle=89.5 text={A28}
+box(359.94822,0.010914362,81.586975",367.7002",89.5) ||
+# text(359.94797,0.03528355) || textangle=89.5 text={A29}
+box(359.94802,0.035306221,81.586975",367.7002",89.5) ||
+# text(359.94777,0.057990092) || textangle=89.5 text={A30}
+box(359.94781,0.058012649,81.586975",367.7002",89.5) ||
+# text(359.94756,0.082381837) || textangle=89.5 text={A31}
+box(359.94761,0.082404408,81.586975",367.7002",89.5) ||
+# text(359.94735,0.10508817) || textangle=89.5 text={A32}
+box(359.9474,0.10511083,81.586975",367.7002",89.5) ||
+# text(359.94715,0.12947993) || textangle=89.5 text={A33}
+box(359.9472,0.12950259,81.586975",367.7002",89.5) ||
+# text(359.94695,0.15218634) || textangle=89.5 text={A34}
+box(359.947,0.15220891,81.586975",367.7002",89.5) ||
+# text(359.94673,0.17657792) || textangle=89.5 text={A35}
+box(359.94678,0.17660058,81.586975",367.7002",89.5) ||
+# text(359.94654,0.19928423) || textangle=89.5 text={A36}
+box(359.94659,0.1993068,81.586975",367.7002",89.5) ||
+# text(0.053422167,-0.19930672) || textangle=89.5 text={A37}
+box(0.053451906,-0.19928428,81.586975",367.7002",89.5) ||
+# text(0.053230353,-0.17660032) || textangle=89.5 text={A38}
+box(0.053250094,-0.17657799,81.586975",367.7002",89.5) ||
+# text(0.053019108,-0.15220873) || textangle=89.5 text={A39}
+box(0.053038849,-0.1521864,81.586975",367.7002",89.5) ||
+# text(0.052817296,-0.12950244) || textangle=89.5 text={A40}
+box(0.052837036,-0.12948012,81.586975",367.7002",89.5) ||
+# text(0.052606049,-0.10511075) || textangle=89.5 text={A41}
+box(0.052625787,-0.10508833,81.586975",367.7002",89.5) ||
+# text(0.052404233,-0.082404267) || textangle=89.5 text={A42}
+box(0.052423972,-0.082381938,81.586975",367.7002",89.5) ||
+# text(0.052192982,-0.058012476) || textangle=89.5 text={A43}
+box(0.052212722,-0.057990148,81.586975",367.7002",89.5) ||
+# text(0.051991165,-0.035306089) || textangle=89.5 text={A44}
+box(0.052010904,-0.035283661,81.586975",367.7002",89.5) ||
+# text(0.051779913,-0.010914299) || textangle=89.5 text={A45}
+box(0.051799651,-0.010891871,81.586975",367.7002",89.5) ||
+# text(0.051578093,0.011792188) || textangle=89.5 text={A46}
+box(0.051597832,0.011814616,81.586975",367.7002",89.5) ||
+# text(0.051366839,0.036183977) || textangle=89.5 text={A47}
+box(0.051386577,0.036206406,81.586975",367.7002",89.5) ||
+# text(0.051165016,0.058890464) || textangle=89.5 text={A48}
+box(0.051194752,0.058912908,81.586975",367.7002",89.5) ||
+# text(0.05095376,0.083282255) || textangle=89.5 text={A49}
+box(0.050973498,0.083304583,81.586975",367.7002",89.5) ||
+# text(0.050761932,0.10598876) || textangle=89.5 text={A50}
+box(0.050781669,0.10601119,81.586975",367.7002",89.5) ||
+# text(0.050540675,0.13038043) || textangle=89.5 text={A51}
+box(0.05057041,0.13040288,81.586975",367.7002",89.5) ||
+# text(0.050348846,0.15308683) || textangle=89.5 text={A52}
+box(0.050368584,0.15310917,81.586975",367.7002",89.5) ||
+# text(0.050127588,0.17747831) || textangle=89.5 text={A53}
+box(0.050157322,0.17750076,81.586975",367.7002",89.5) ||
+# text(0.049935755,0.20018471) || textangle=89.5 text={A54}
+box(0.049955493,0.20020703,81.586975",367.7002",89.5) ||
+# text(0.16483089,-0.19833571) || textangle=89.5 text={A55}
+box(0.16485064,-0.19831338,81.586975",367.7002",89.5) ||
+# text(0.16462814,-0.17562963) || textangle=89.5 text={A56}
+box(0.16465787,-0.17560709,81.586975",367.7002",89.5) ||
+# text(0.16441587,-0.15123805) || textangle=89.5 text={A57}
+box(0.16443561,-0.15121572,81.586975",367.7002",89.5) ||
+# text(0.1642231,-0.12853175) || textangle=89.5 text={A58}
+box(0.16424285,-0.12850943,81.586975",367.7002",89.5) ||
+# text(0.16401084,-0.10414017) || textangle=89.5 text={A59}
+box(0.16403057,-0.10411775,81.586975",367.7002",89.5) ||
+# text(0.16380807,-0.081433798) || textangle=89.5 text={A60}
+box(0.16382782,-0.081411469,81.586975",367.7002",89.5) ||
+# text(0.16359581,-0.057042117) || textangle=89.5 text={A61}
+box(0.16361554,-0.057019787,81.586975",367.7002",89.5) ||
+# text(0.16339304,-0.034335739) || textangle=89.5 text={A62}
+box(0.16342277,-0.034313294,81.586975",367.7002",89.5) ||
+# text(0.16318077,-0.0099440576) || textangle=89.5 text={A63}
+box(0.16320051,-0.0099217278,81.586975",367.7002",89.5) ||
+# text(0.162988,0.012762437) || textangle=89.5 text={A64}
+box(0.16300773,0.012784766,81.586975",367.7002",89.5) ||
+# text(0.16277572,0.037154118) || textangle=89.5 text={A65}
+box(0.16279546,0.037176447,81.586975",367.7002",89.5) ||
+# text(0.16257296,0.059860497) || textangle=89.5 text={A66}
+box(0.16259269,0.059882825,81.586975",367.7002",89.5) ||
+# text(0.16236067,0.084252178) || textangle=89.5 text={A67}
+box(0.16238042,0.084274507,81.586975",367.7002",89.5) ||
+# text(0.1621579,0.10695856) || textangle=89.5 text={A68}
+box(0.16217764,0.10698089,81.586975",367.7002",89.5) ||
+# text(0.16194562,0.13135014) || textangle=89.5 text={A69}
+box(0.16196536,0.13137247,81.586975",367.7002",89.5) ||
+# text(0.16175284,0.15405653) || textangle=89.5 text={A70}
+box(0.16177259,0.15407886,81.586975",367.7002",89.5) ||
+# text(0.16153057,0.1784479) || textangle=89.5 text={A71}
+box(0.1615603,0.17847035,81.586975",367.7002",89.5) ||
+# text(0.16133779,0.20115409) || textangle=89.5 text={A72}
+box(0.16135752,0.20117652,81.586975",367.7002",89.5)||
+# text(359.99712,0.32469933) || textangle=89.429076 text={G1}
+box(359.99712,0.32469933,163.33361",367.7002",89.429076) ||
+# text(0.0028790655,-0.32469933) || textangle=89.429076 text={G2}
+box(0.0028790655,-0.32469933,163.33361",367.7002",89.429076)
diff --git a/ds9/template/mmt/megacam/megacam-amp.tpl b/ds9/template/mmt/megacam/megacam-amp.tpl
new file mode 100644
index 0000000..e17f862
--- /dev/null
+++ b/ds9/template/mmt/megacam/megacam-amp.tpl
@@ -0,0 +1,150 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/sao/megacam.fits[IM1]
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) ||
+point(0,0) || # point=boxcircle
+# text(359.83689,-0.19976359) || textangle=90 text={A1}
+box(359.83692,-0.19974141,81.586975",367.7002",90) ||
+# text(359.83689,-0.17705651) || textangle=90 text={A2}
+box(359.83692,-0.17703433,81.586975",367.7002",90) ||
+# text(359.83689,-0.15266411) || textangle=90 text={A3}
+box(359.83691,-0.15264196,81.586975",367.7002",90) ||
+# text(359.83689,-0.12995693) || textangle=90 text={A4}
+box(359.83691,-0.12993478,81.586975",367.7002",90) ||
+# text(359.8369,-0.10556443) || textangle=90 text={A5}
+box(359.83692,-0.10554228,81.586975",367.7002",90) ||
+# text(359.83689,-0.082857155) || textangle=90 text={A6}
+box(359.83691,-0.082835001,81.586975",367.7002",90) ||
+# text(359.8369,-0.058464655) || textangle=90 text={A7}
+box(359.83692,-0.058442401,81.586975",367.7002",90) ||
+# text(359.8369,-0.035757276) || textangle=90 text={A8}
+box(359.83692,-0.035735122,81.586975",367.7002",90) ||
+# text(359.83689,-0.011364703) || textangle=90 text={A9}
+box(359.83692,-0.011342522,81.586975",367.7002",90) ||
+# text(359.83689,0.011342576) || textangle=90 text={A10}
+box(359.83692,0.011364757,81.586975",367.7002",90) ||
+# text(359.83689,0.035735176) || textangle=90 text={A11}
+box(359.83691,0.03575733,81.586975",367.7002",90) ||
+# text(359.83689,0.058442456) || textangle=90 text={A12}
+box(359.83691,0.05846461,81.586975",367.7002",90) ||
+# text(359.8369,0.082835056) || textangle=90 text={A13}
+box(359.83692,0.08285721,81.586975",367.7002",90) ||
+# text(359.83689,0.10554233) || textangle=90 text={A14}
+box(359.83691,0.10556449,81.586975",367.7002",90) ||
+# text(359.8369,0.12993483) || textangle=90 text={A15}
+box(359.83692,0.12995699,81.586975",367.7002",90) ||
+# text(359.8369,0.15264201) || textangle=90 text={A16}
+box(359.83692,0.15266417,81.586975",367.7002",90) ||
+# text(359.83689,0.17703439) || textangle=90 text={A17}
+box(359.83691,0.17705654,81.586975",367.7002",90) ||
+# text(359.83689,0.19974147) || textangle=90 text={A18}
+box(359.83692,0.19976365,81.586975",367.7002",90) ||
+# text(359.94828,-0.19976436) || textangle=90 text={A19}
+box(359.94832,-0.19974215,81.586975",367.7002",90) ||
+# text(359.94828,-0.17705718) || textangle=90 text={A20}
+box(359.94832,-0.17703497,81.586975",367.7002",90) ||
+# text(359.94828,-0.15266468) || textangle=90 text={A21}
+box(359.94832,-0.15264247,81.586975",367.7002",90) ||
+# text(359.94828,-0.1299574) || textangle=90 text={A22}
+box(359.94832,-0.12993529,81.586975",367.7002",90) ||
+# text(359.94827,-0.10556483) || textangle=90 text={A23}
+box(359.94832,-0.10554269,81.586975",367.7002",90) ||
+# text(359.94828,-0.082857522) || textangle=90 text={A24}
+box(359.94832,-0.082835313,81.586975",367.7002",90) ||
+# text(359.94827,-0.05846485) || textangle=90 text={A25}
+box(359.94832,-0.058442613,81.586975",367.7002",90) ||
+# text(359.94828,-0.035757443) || textangle=90 text={A26}
+box(359.94832,-0.035735333,81.586975",367.7002",90) ||
+# text(359.94828,-0.01136477) || textangle=90 text={A27}
+box(359.94833,-0.011342533,81.586975",367.7002",90) ||
+# text(359.94828,0.011342636) || textangle=90 text={A28}
+box(359.94832,0.011364846,81.586975",367.7002",90) ||
+# text(359.94828,0.035735309) || textangle=90 text={A29}
+box(359.94833,0.035757546,81.586975",367.7002",90) ||
+# text(359.94828,0.058442715) || textangle=90 text={A30}
+box(359.94832,0.058464925,81.586975",367.7002",90) ||
+# text(359.94828,0.082835388) || textangle=90 text={A31}
+box(359.94833,0.082857525,81.586975",367.7002",90) ||
+# text(359.94827,0.10554267) || textangle=90 text={A32}
+box(359.94832,0.1055649,81.586975",367.7002",90) ||
+# text(359.94828,0.12993527) || textangle=90 text={A33}
+box(359.94833,0.1299575,81.586975",367.7002",90) ||
+# text(359.94828,0.15264255) || textangle=90 text={A34}
+box(359.94833,0.15266468,81.586975",367.7002",90) ||
+# text(359.94828,0.17703505) || textangle=90 text={A35}
+box(359.94833,0.17705728,81.586975",367.7002",90) ||
+# text(359.94828,0.19974223) || textangle=90 text={A36}
+box(359.94833,0.19976436,81.586975",367.7002",90) ||
+# text(0.051677255,-0.19976435) || textangle=90 text={A37}
+box(0.051707189,-0.19974217,81.586975",367.7002",90) ||
+# text(0.051684011,-0.17705714) || textangle=90 text={A38}
+box(0.051703946,-0.17703499,81.586975",367.7002",90) ||
+# text(0.051686072,-0.15266464) || textangle=90 text={A39}
+box(0.051706007,-0.15264249,81.586975",367.7002",90) ||
+# text(0.051682828,-0.12995746) || textangle=90 text={A40}
+box(0.051702762,-0.12993531,81.586975",367.7002",90) ||
+# text(0.051684887,-0.10556486) || textangle=90 text={A41}
+box(0.051704821,-0.10554261,81.586975",367.7002",90) ||
+# text(0.05168164,-0.082857485) || textangle=90 text={A42}
+box(0.051701574,-0.082835329,81.586975",367.7002",90) ||
+# text(0.051683696,-0.058464784) || textangle=90 text={A43}
+box(0.05170363,-0.058442629,81.586975",367.7002",90) ||
+# text(0.051680447,-0.035757505) || textangle=90 text={A44}
+box(0.051700381,-0.03573525,81.586975",367.7002",90) ||
+# text(0.051682501,-0.011364805) || textangle=90 text={A45}
+box(0.051702435,-0.011342549,81.586975",367.7002",90) ||
+# text(0.05167925,0.011342574) || textangle=90 text={A46}
+box(0.051699184,0.01136483,81.586975",367.7002",90) ||
+# text(0.051681302,0.035735274) || textangle=90 text={A47}
+box(0.051701235,0.03575753,81.586975",367.7002",90) ||
+# text(0.051678048,0.058442653) || textangle=90 text={A48}
+box(0.051707979,0.058464837,81.586975",367.7002",90) ||
+# text(0.051680098,0.082835354) || textangle=90 text={A49}
+box(0.051700031,0.082857509,81.586975",367.7002",90) ||
+# text(0.051686839,0.10554266) || textangle=90 text={A50}
+box(0.051706772,0.10556492,81.586975",367.7002",90) ||
+# text(0.051678889,0.12993533) || textangle=90 text={A51}
+box(0.051708819,0.12995752,81.586975",367.7002",90) ||
+# text(0.051685628,0.15264254) || textangle=90 text={A52}
+box(0.051705561,0.1526647,81.586975",367.7002",90) ||
+# text(0.051677676,0.17703501) || textangle=90 text={A53}
+box(0.051707605,0.1770572,81.586975",367.7002",90) ||
+# text(0.051684413,0.19974222) || textangle=90 text={A54}
+box(0.051704345,0.19976437,81.586975",367.7002",90) ||
+# text(0.16309024,-0.19976357) || textangle=90 text={A55}
+box(0.16311018,-0.19974141,81.586975",367.7002",90) ||
+# text(0.16308605,-0.17705659) || textangle=90 text={A56}
+box(0.16311598,-0.17703431,81.586975",367.7002",90) ||
+# text(0.16308709,-0.15266409) || textangle=90 text={A57}
+box(0.16310702,-0.15264193,81.586975",367.7002",90) ||
+# text(0.16309289,-0.12995698) || textangle=90 text={A58}
+box(0.16311283,-0.12993483,81.586975",367.7002",90) ||
+# text(0.16309393,-0.10556448) || textangle=90 text={A59}
+box(0.16311386,-0.10554223,81.586975",367.7002",90) ||
+# text(0.16308973,-0.082857204) || textangle=90 text={A60}
+box(0.16310967,-0.082835048,81.586975",367.7002",90) ||
+# text(0.16309077,-0.058464604) || textangle=90 text={A61}
+box(0.1631107,-0.058442447,81.586975",367.7002",90) ||
+# text(0.16308657,-0.035757325) || textangle=90 text={A62}
+box(0.1631165,-0.03573514,81.586975",367.7002",90) ||
+# text(0.1630876,-0.011364725) || textangle=90 text={A63}
+box(0.16310754,-0.011342568,81.586975",367.7002",90) ||
+# text(0.1630934,0.011342583) || textangle=90 text={A64}
+box(0.16311333,0.011364739,81.586975",367.7002",90) ||
+# text(0.16309443,0.035735183) || textangle=90 text={A65}
+box(0.16311436,0.035757339,81.586975",367.7002",90) ||
+# text(0.16309023,0.058442462) || textangle=90 text={A66}
+box(0.16311016,0.058464618,81.586975",367.7002",90) ||
+# text(0.16309125,0.082835062) || textangle=90 text={A67}
+box(0.16311119,0.082857219,81.586975",367.7002",90) ||
+# text(0.16308705,0.10554234) || textangle=90 text={A68}
+box(0.16310698,0.1055645,81.586975",367.7002",90) ||
+# text(0.16308807,0.12993484) || textangle=90 text={A69}
+box(0.16310801,0.129957,81.586975",367.7002",90) ||
+# text(0.16309386,0.15264205) || textangle=90 text={A70}
+box(0.1631138,0.1526642,81.586975",367.7002",90) ||
+# text(0.16308489,0.17703442) || textangle=90 text={A71}
+box(0.16311482,0.17705661,81.586975",367.7002",90) ||
+# text(0.16309068,0.19974143) || textangle=90 text={A72}
+box(0.16311061,0.19976368,81.586975",367.7002",90)
diff --git a/ds9/template/mmt/megacam/megacam-chip-guide.tpl b/ds9/template/mmt/megacam/megacam-chip-guide.tpl
new file mode 100644
index 0000000..ce8bdc1
--- /dev/null
+++ b/ds9/template/mmt/megacam/megacam-chip-guide.tpl
@@ -0,0 +1,82 @@
+# Region file format: DS9 version 4.0
+# Filename: /tmp/dss1224085352034269.fits.gz
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) || composite=1
+point(0,0) || # point=boxcircle
+# text(359.83879,-0.19000008) || textangle=89.429076 text={C1}
+box(359.83881,-0.19002199,163.33361",367.7002",89.429076) ||
+# text(359.83831,-0.14290288) || textangle=89.429076 text={C2}
+box(359.83833,-0.14292488,163.33361",367.7002",89.429076) ||
+# text(359.83784,-0.095805501) || textangle=89.429076 text={C3}
+box(359.83787,-0.095827401,163.33361",367.7002",89.429076) ||
+# text(359.83737,-0.048708098) || textangle=89.429076 text={C4}
+box(359.83739,-0.048729996,163.33361",367.7002",89.429076) ||
+# text(359.8369,-0.0016104951) || textangle=89.429076 text={C5}
+box(359.83692,-0.0016323935,163.33361",367.7002",89.429076) ||
+# text(359.83644,0.045487183) || textangle=89.429076 text={C6}
+box(359.83646,0.045465284,163.33361",367.7002",89.429076) ||
+# text(359.83596,0.092584587) || textangle=89.429076 text={C7}
+box(359.83598,0.09256259,163.33361",367.7002",89.429076) ||
+# text(359.8355,0.13968217) || textangle=89.429076 text={C8}
+box(359.83551,0.13966,163.33361",367.7002",89.429076) ||
+# text(359.83503,0.18677928) || textangle=89.429076 text={C9}
+box(359.83505,0.18675738,163.33361",367.7002",89.429076) ||
+# text(359.95017,-0.1888932) || textangle=89.429076 text={C10}
+box(359.9502,-0.188915,163.33361",367.7002",89.429076) ||
+# text(359.94969,-0.1417959) || textangle=89.429076 text={C11}
+box(359.94971,-0.1418178,163.33361",367.7002",89.429076) ||
+# text(359.94922,-0.094698394) || textangle=89.429076 text={C12}
+box(359.94924,-0.094720293,163.33361",367.7002",89.429076) ||
+# text(359.94875,-0.047600518) || textangle=89.429076 text={C13}
+box(359.94878,-0.047622515,163.33361",367.7002",89.429076) ||
+# text(359.94828,-0.00050291415) || textangle=89.429076 text={C14}
+box(359.9483,-0.00052481167,163.33361",367.7002",89.429076) ||
+# text(359.94781,0.046594788) || textangle=89.429076 text={C15}
+box(359.94783,0.046572792,163.33361",367.7002",89.429076) ||
+# text(359.94734,0.093692567) || textangle=89.429076 text={C16}
+box(359.94736,0.09367067,163.33361",367.7002",89.429076) ||
+# text(359.94687,0.14079007) || textangle=89.429076 text={C17}
+box(359.94689,0.14076818,163.33361",367.7002",89.429076) ||
+# text(359.94642,0.18788765) || textangle=89.429076 text={C18}
+box(359.94644,0.18786575,163.33361",367.7002",89.429076) ||
+# text(0.053560184,-0.18786505) || textangle=89.429076 text={C19}
+box(0.053590399,-0.18788685,163.33361",367.7002",89.429076) ||
+# text(0.053088973,-0.14076769) || textangle=89.429076 text={C20}
+box(0.053119188,-0.1407895,163.33361",367.7002",89.429076) ||
+# text(0.052617761,-0.093670143) || textangle=89.429076 text={C21}
+box(0.052647975,-0.093691943,163.33361",367.7002",89.429076) ||
+# text(0.052156546,-0.046572288) || textangle=89.429076 text={C22}
+box(0.052176763,-0.046594288,163.33361",367.7002",89.429076) ||
+# text(0.051685335,0.00052536623) || textangle=89.429076 text={C23}
+box(0.051705551,0.00050346653,163.33361",367.7002",89.429076) ||
+# text(0.051214124,0.047623121) || textangle=89.429076 text={C24}
+box(0.05123434,0.047601121,163.33361",367.7002",89.429076) ||
+# text(0.050742913,0.094720775) || textangle=89.429076 text={C25}
+box(0.050763127,0.094698876,163.33361",367.7002",89.429076) ||
+# text(0.0502717,0.14181833) || textangle=89.429076 text={C26}
+box(0.050291915,0.14179643,163.33361",367.7002",89.429076) ||
+# text(0.049800489,0.18891568) || textangle=89.429076 text={C27}
+box(0.049820703,0.18889379,163.33361",367.7002",89.429076) ||
+# text(0.1649667,-0.18675652) || textangle=89.429076 text={C28}
+box(0.16498692,-0.18677841,163.33361",367.7002",89.429076) ||
+# text(0.16449352,-0.13965928) || textangle=89.429076 text={C29}
+box(0.16451373,-0.13968127,163.33361",367.7002",89.429076) ||
+# text(0.16402034,-0.092561943) || textangle=89.429076 text={C30}
+box(0.16405055,-0.092583842,163.33361",367.7002",89.429076) ||
+# text(0.16355716,-0.045464409) || textangle=89.429076 text={C31}
+box(0.16357738,-0.045486307,163.33361",367.7002",89.429076) ||
+# text(0.16308398,0.001633126) || textangle=89.429076 text={C32}
+box(0.16310419,0.0016112271,163.33361",367.7002",89.429076) ||
+# text(0.16261079,0.04873076) || textangle=89.429076 text={C33}
+box(0.16264101,0.048708862,163.33361",367.7002",89.429076) ||
+# text(0.16214762,0.095828296) || textangle=89.429076 text={C34}
+box(0.16216783,0.095806296,163.33361",367.7002",89.429076) ||
+# text(0.16167444,0.14292563) || textangle=89.429076 text={C35}
+box(0.16169464,0.14290364,163.33361",367.7002",89.429076) ||
+# text(0.16120125,0.19002276) || textangle=89.429076 text={C36}
+box(0.16122147,0.19000087,163.33361",367.7002",89.429076) ||
+# text(359.9993,0.32469933) || textangle=89.429076 text={G1}
+box(359.9993,0.32469933,163.33361",364",89.429076) ||
+# text(0.0007,-0.32469933) || textangle=89.429076 text={G2}
+box(0.0007,-0.32469933,163.33361",364",89.429076)
diff --git a/ds9/template/mmt/megacam/megacam-chip.tpl b/ds9/template/mmt/megacam/megacam-chip.tpl
new file mode 100644
index 0000000..532298f
--- /dev/null
+++ b/ds9/template/mmt/megacam/megacam-chip.tpl
@@ -0,0 +1,78 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/sao/megacam.fits[IM1]
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) ||
+point(0,0) || # point=boxcircle
+# text(359.8369,-0.1883876) || textangle=90 text={C1}
+box(359.83692,-0.18840971,163.33361",367.7002",90) ||
+# text(359.8369,-0.141288) || textangle=90 text={C2}
+box(359.83692,-0.14131021,163.33361",367.7002",90) ||
+# text(359.83689,-0.094188304) || textangle=90 text={C3}
+box(359.83692,-0.094210505,163.33361",367.7002",90) ||
+# text(359.83689,-0.047088504) || textangle=90 text={C4}
+box(359.83691,-0.047110605,163.33361",367.7002",90) ||
+# text(359.8369,1.1396249e-05) || textangle=90 text={C5}
+box(359.83692,-1.0704976e-05,163.33361",367.7002",90) ||
+# text(359.8369,0.047111296) || textangle=90 text={C6}
+box(359.83692,0.047089195,163.33361",367.7002",90) ||
+# text(359.83689,0.094211197) || textangle=90 text={C7}
+box(359.83691,0.094188996,163.33361",367.7002",90) ||
+# text(359.8369,0.1413109) || textangle=90 text={C8}
+box(359.83692,0.1412887,163.33361",367.7002",90) ||
+# text(359.8369,0.1884104) || textangle=90 text={C9}
+box(359.83692,0.1883883,163.33361",367.7002",90) ||
+# text(359.94828,-0.1883883) || textangle=90 text={C10}
+box(359.94831,-0.1884104,163.33361",367.7002",90) ||
+# text(359.94828,-0.1412886) || textangle=90 text={C11}
+box(359.9483,-0.1413107,163.33361",367.7002",90) ||
+# text(359.94828,-0.0941887) || textangle=90 text={C12}
+box(359.9483,-0.094210801,163.33361",367.7002",90) ||
+# text(359.94828,-0.047088601) || textangle=90 text={C13}
+box(359.9483,-0.047110801,163.33361",367.7002",90) ||
+# text(359.94828,1.1399465e-05) || textangle=90 text={C14}
+box(359.9483,-1.0700924e-05,163.33361",367.7002",90) ||
+# text(359.94828,0.047111499) || textangle=90 text={C15}
+box(359.9483,0.047089299,163.33361",367.7002",90) ||
+# text(359.94828,0.0942115) || textangle=90 text={C16}
+box(359.9483,0.094189399,163.33361",367.7002",90) ||
+# text(359.94828,0.1413114) || textangle=90 text={C17}
+box(359.9483,0.1412893,163.33361",367.7002",90) ||
+# text(359.94829,0.1884111) || textangle=90 text={C18}
+box(359.94831,0.188389,163.33361",367.7002",90) ||
+# text(0.051681678,-0.1883883) || textangle=90 text={C19}
+box(0.051711674,-0.1884104,163.33361",367.7002",90) ||
+# text(0.051680764,-0.1412886) || textangle=90 text={C20}
+box(0.051710759,-0.1413107,163.33361",367.7002",90) ||
+# text(0.051679849,-0.094188702) || textangle=90 text={C21}
+box(0.051709844,-0.094210801,163.33361",367.7002",90) ||
+# text(0.051688932,-0.047088601) || textangle=90 text={C22}
+box(0.051708928,-0.047110801,163.33361",367.7002",90) ||
+# text(0.051688017,1.1398494e-05) || textangle=90 text={C23}
+box(0.051708013,-1.0701118e-05,163.33361",367.7002",90) ||
+# text(0.051687103,0.047111498) || textangle=90 text={C24}
+box(0.051707098,0.047089299,163.33361",367.7002",90) ||
+# text(0.051686188,0.094211499) || textangle=90 text={C25}
+box(0.051706183,0.094189399,163.33361",367.7002",90) ||
+# text(0.051685273,0.1413114) || textangle=90 text={C26}
+box(0.051705268,0.1412893,163.33361",367.7002",90) ||
+# text(0.051684358,0.1884111) || textangle=90 text={C27}
+box(0.051704353,0.188389,163.33361",367.7002",90) ||
+# text(0.16309374,-0.18838761) || textangle=90 text={C28}
+box(0.16311374,-0.1884097,163.33361",367.7002",90) ||
+# text(0.16309085,-0.14128801) || textangle=90 text={C29}
+box(0.16311085,-0.1413102,163.33361",367.7002",90) ||
+# text(0.16308797,-0.094188306) || textangle=90 text={C30}
+box(0.16311796,-0.094210504,163.33361",367.7002",90) ||
+# text(0.16309508,-0.047088505) || textangle=90 text={C31}
+box(0.16311508,-0.047110604,163.33361",367.7002",90) ||
+# text(0.16309219,1.1394411e-05) || textangle=90 text={C32}
+box(0.16311219,-1.0704364e-05,163.33361",367.7002",90) ||
+# text(0.1630893,0.047111394) || textangle=90 text={C33}
+box(0.1631193,0.047089196,163.33361",367.7002",90) ||
+# text(0.16309642,0.094211195) || textangle=90 text={C34}
+box(0.16311641,0.094188996,163.33361",367.7002",90) ||
+# text(0.16309353,0.14131089) || textangle=90 text={C35}
+box(0.16311352,0.1412887,163.33361",367.7002",90) ||
+# text(0.16309064,0.18841039) || textangle=90 text={C36}
+box(0.16311064,0.1883883,163.33361",367.7002",90)
diff --git a/ds9/template/mmt/mmirs/image.tpl b/ds9/template/mmt/mmirs/image.tpl
new file mode 100644
index 0000000..9c2768d
--- /dev/null
+++ b/ds9/template/mmt/mmirs/image.tpl
@@ -0,0 +1,14 @@
+# Region file format: DS9 version 4.1
+# Filename: test.fits
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,5.2213707e-05) || composite=1
+box(0,0,408",408",5.2213707e-05) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016979321,359.89215,0.057385486,359.90996,0.092233383,359.94322,0.11811841,359.98286,0.13249802,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,359.98288,0.073283367,359.94221,0.069587115,359.92874,0.054886822,359.92887,-0.055011809,359.94234,-0.069675137,359.98292,-0.073297943,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,359.98294,-0.13251162,359.94344,-0.11820308,359.91024,-0.092419349,359.89236,-0.057641649,359.89229,-0.017235729) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016944321,359.89215,0.056508482,359.91364,0.088477822,359.94746,0.1093244,359.98286,0.1175641,359.98287,0.091928249,359.93711,0.086467601,359.92194,0.079989511,359.91524,0.062597422,359.91542,-0.062765368,359.92215,-0.080135045,359.93729,-0.08656855,359.98293,-0.091941579,359.98293,-0.117578,359.94765,-0.10939812,359.9139,-0.088649851,359.89236,-0.056764653,359.89229,-0.017200729) || # tag={Mask}
+# text(359.90741,-9.7747524e-05) || textangle=270.00005 text={Camera 1} tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283029,0.017027184,0.11290769,0.057431829,0.090040766,0.092277881,0.056787713,0.11814596,0.017143943,0.13250625,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,0.017125131,0.073291941,0.057793497,0.069616127,0.071262324,0.054922962,0.071130502,-0.054973028,0.057658219,-0.069643411,0.017083571,-0.073288523,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,0.017068804,-0.13250186,0.056562363,-0.11817101,0.089760798,-0.092369245,0.11268869,-0.057590992,0.11276514,-0.017186583) || # tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283022,0.016992185,0.11192484,0.056556496,0.086360832,0.088520613,0.052547573,0.10935005,0.017139089,0.11757242,0.017130929,0.091936714,0.062891853,0.086498803,0.078062803,0.080028419,0.084756883,0.062640181,0.084577917,-0.062719024,0.077852405,-0.080091921,0.0627089,-0.086533678,0.017078796,-0.091932052,0.017072419,-0.11756833,0.052354648,-0.1093686,0.086103276,-0.088601901,0.11171106,-0.056712414,0.11276521,-0.017151584) || # tag={Mask}
+# text(0.092595036,-4.9017175e-05) || textangle=90.000052 text={Camera 2} tag={Mask}
+# vector(359.96798,0.055537453,180",180.00005) || vector=1 tag={Mask}
+# text(359.98315,0.062281588) textangle=180.00005 text={Wavelength} tag={Mask}
diff --git a/ds9/template/mmt/mmirs/longslit.tpl b/ds9/template/mmt/mmirs/longslit.tpl
new file mode 100644
index 0000000..7087e80
--- /dev/null
+++ b/ds9/template/mmt/mmirs/longslit.tpl
@@ -0,0 +1,14 @@
+# Region file format: DS9 version 4.1
+# Filename: test.fits
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,5.2213707e-05) || composite=1
+box(0,0,1",408",5.2213707e-05) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016979321,359.89215,0.057385486,359.90996,0.092233383,359.94322,0.11811841,359.98286,0.13249802,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,359.98288,0.073283367,359.94221,0.069587115,359.92874,0.054886822,359.92887,-0.055011809,359.94234,-0.069675137,359.98292,-0.073297943,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,359.98294,-0.13251162,359.94344,-0.11820308,359.91024,-0.092419349,359.89236,-0.057641649,359.89229,-0.017235729) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016944321,359.89215,0.056508482,359.91364,0.088477822,359.94746,0.1093244,359.98286,0.1175641,359.98287,0.091928249,359.93711,0.086467601,359.92194,0.079989511,359.91524,0.062597422,359.91542,-0.062765368,359.92215,-0.080135045,359.93729,-0.08656855,359.98293,-0.091941579,359.98293,-0.117578,359.94765,-0.10939812,359.9139,-0.088649851,359.89236,-0.056764653,359.89229,-0.017200729) || # tag={Mask}
+# text(359.90741,-9.7747524e-05) || textangle=270.00005 text={Camera 1} tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283029,0.017027184,0.11290769,0.057431829,0.090040766,0.092277881,0.056787713,0.11814596,0.017143943,0.13250625,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,0.017125131,0.073291941,0.057793497,0.069616127,0.071262324,0.054922962,0.071130502,-0.054973028,0.057658219,-0.069643411,0.017083571,-0.073288523,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,0.017068804,-0.13250186,0.056562363,-0.11817101,0.089760798,-0.092369245,0.11268869,-0.057590992,0.11276514,-0.017186583) || # tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283022,0.016992185,0.11192484,0.056556496,0.086360832,0.088520613,0.052547573,0.10935005,0.017139089,0.11757242,0.017130929,0.091936714,0.062891853,0.086498803,0.078062803,0.080028419,0.084756883,0.062640181,0.084577917,-0.062719024,0.077852405,-0.080091921,0.0627089,-0.086533678,0.017078796,-0.091932052,0.017072419,-0.11756833,0.052354648,-0.1093686,0.086103276,-0.088601901,0.11171106,-0.056712414,0.11276521,-0.017151584) || # tag={Mask}
+# text(0.092595036,-4.9017175e-05) || textangle=90.000052 text={Camera 2} tag={Mask}
+# vector(359.96798,0.055537453,180",180.00005) || vector=1 tag={Mask}
+# text(359.98315,0.062281588) textangle=180.00005 text={Wavelength} tag={Mask}
diff --git a/ds9/template/mmt/mmirs/mask.tpl b/ds9/template/mmt/mmirs/mask.tpl
new file mode 100644
index 0000000..eae9fb2
--- /dev/null
+++ b/ds9/template/mmt/mmirs/mask.tpl
@@ -0,0 +1,14 @@
+# Region file format: DS9 version 4.1
+# Filename: test.fits
+global color=green dashlist=8 3 width=1 font="helvetica 10 normal" select=1 highlite=1 dash=0 fixed=0 edit=1 move=1 delete=1 include=1 source=1
+wcs0;fk5
+# composite(0,0,5.2213707e-05) || composite=1
+box(0,0,240",408",5.2213707e-05) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016979321,359.89215,0.057385486,359.90996,0.092233383,359.94322,0.11811841,359.98286,0.13249802,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,359.98288,0.073283367,359.94221,0.069587115,359.92874,0.054886822,359.92887,-0.055011809,359.94234,-0.069675137,359.98292,-0.073297943,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,359.98294,-0.13251162,359.94344,-0.11820308,359.91024,-0.092419349,359.89236,-0.057641649,359.89229,-0.017235729) || # tag={Mask}
+polygon(359.89225,-0.00012771548,359.89222,0.016944321,359.89215,0.056508482,359.91364,0.088477822,359.94746,0.1093244,359.98286,0.1175641,359.98287,0.091928249,359.93711,0.086467601,359.92194,0.079989511,359.91524,0.062597422,359.91542,-0.062765368,359.92215,-0.080135045,359.93729,-0.08656855,359.98293,-0.091941579,359.98293,-0.117578,359.94765,-0.10939812,359.9139,-0.088649851,359.89236,-0.056764653,359.89229,-0.017200729) || # tag={Mask}
+# text(359.90741,-9.7747524e-05) || textangle=270.00005 text={Camera 1} tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283029,0.017027184,0.11290769,0.057431829,0.090040766,0.092277881,0.056787713,0.11814596,0.017143943,0.13250625,1.6000224e-06,0.11759077,8.5553752e-07,0.091934992,0.017125131,0.073291941,0.057793497,0.069616127,0.071262324,0.054922962,0.071130502,-0.054973028,0.057658219,-0.069643411,0.017083571,-0.073288523,1.9770939e-06,-0.091934318,3.0342173e-06,-0.11759067,0.017068804,-0.13250186,0.056562363,-0.11817101,0.089760798,-0.092369245,0.11268869,-0.057590992,0.11276514,-0.017186583) || # tag={Mask}
+polygon(0.11279767,-7.9210806e-05,0.11283022,0.016992185,0.11192484,0.056556496,0.086360832,0.088520613,0.052547573,0.10935005,0.017139089,0.11757242,0.017130929,0.091936714,0.062891853,0.086498803,0.078062803,0.080028419,0.084756883,0.062640181,0.084577917,-0.062719024,0.077852405,-0.080091921,0.0627089,-0.086533678,0.017078796,-0.091932052,0.017072419,-0.11756833,0.052354648,-0.1093686,0.086103276,-0.088601901,0.11171106,-0.056712414,0.11276521,-0.017151584) || # tag={Mask}
+# text(0.092595036,-4.9017175e-05) || textangle=90.000052 text={Camera 2} tag={Mask}
+# vector(359.96798,0.055537453,180",180.00005) || vector=1 tag={Mask}
+# text(359.98315,0.062281588) textangle=180.00005 text={Wavelength} tag={Mask}
diff --git a/ds9/template/mmt/swirc.tpl b/ds9/template/mmt/swirc.tpl
new file mode 100644
index 0000000..be64c9f
--- /dev/null
+++ b/ds9/template/mmt/swirc.tpl
@@ -0,0 +1,42 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/sao/swirc.fits
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(0,0,0) ||
+point(0,0) || # point=boxcircle
+# text(359.97636,0.021004921) || font="times 12 normal" text={I}
+# text(359.97633,-0.021495059) || font="times 12 normal" text={II}
+# text(0.023662353,-0.021532975) || font="times 12 normal" text={III}
+# text(0.023196531,0.021134073) || font="times 12 normal" text={IV}
+box(0.021365501,0.02401054,153.6",19.2",0) ||
+box(0.021361229,0.01867721,153.6",19.2",0) ||
+box(359.97603,0.021380188,19.2",153.6",0) ||
+box(359.97866,-0.01862193,153.6",19.2",0) ||
+box(359.97866,-0.023955261,153.6",19.2",0) ||
+box(0.023995853,-0.021324909,19.2",153.6",0) ||
+box(0.021348413,0.0026772167,153.6",19.2",0) ||
+box(0.021352685,0.0080105479,153.6",19.2",0) ||
+box(0.021356957,0.013343879,153.6",19.2",0) ||
+box(0.021369773,0.02934387,153.6",19.2",0) ||
+box(0.021374046,0.0346772,153.6",19.2",0) ||
+box(0.021378318,0.040010529,153.6",19.2",0) ||
+box(359.97865,-0.039955249,153.6",19.2",0) ||
+box(359.97865,-0.03462192,153.6",19.2",0) ||
+box(359.97866,-0.029288591,153.6",19.2",0) ||
+box(359.97867,-0.013288599,153.6",19.2",0) ||
+box(359.97867,-0.0079552683,153.6",19.2",0) ||
+box(359.97868,-0.0026219371,153.6",19.2",0) ||
+box(359.96003,0.021393001,19.2",153.6",0) ||
+box(359.96536,0.021388731,19.2",153.6",0) ||
+box(359.9707,0.021384459,19.2",153.6",0) ||
+box(359.98136,0.021375917,19.2",153.6",0) ||
+box(359.9867,0.021371645,19.2",153.6",0) ||
+box(359.99203,0.021367373,19.2",153.6",0) ||
+box(359.99736,0.021363101,19.2",153.6",0) ||
+box(0.0026625281,-0.021307822,19.2",153.6",0) ||
+box(0.0079958596,-0.021312094,19.2",153.6",0) ||
+box(0.013329191,-0.021316366,19.2",153.6",0) ||
+box(0.018662522,-0.021320637,19.2",153.6",0) ||
+box(0.029329184,-0.02132918,19.2",153.6",0) ||
+box(0.034662514,-0.021333451,19.2",153.6",0) ||
+box(0.039995843,-0.021337722,19.2",153.6",0)
diff --git a/ds9/template/xmm/epicmos1.tpl b/ds9/template/xmm/epicmos1.tpl
new file mode 100644
index 0000000..9c5c257
--- /dev/null
+++ b/ds9/template/xmm/epicmos1.tpl
@@ -0,0 +1,20 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/xmm/epicmos/image_epicmos1.ds
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(-0.017,-0.014495,0) ||
+point(359.98122,-0.014772826) || # point=boxcircle
+# text(0.095331979,0.18528183) || text={5}
+# text(0.18353977,0.0004077268) || text={6}
+# text(359.99987,0.00040772889) || text={1}
+# text(359.90683,0.18649016) || text={4}
+# text(359.81379,0.0016160537) || text={3}
+# text(0.092915319,-0.18325807) || text={7}
+# text(359.90925,-0.18204976) || text={2}
+polygon(0.18524639,0.27414948,0.0045201849,0.27427278,0.0056046815,0.09358257,0.1845215,0.093406209) ||
+polygon(0.18400899,-0.094584329,0.0032641713,-0.093859609,0.0043500151,-0.27454963,0.18385383,-0.2741015) ||
+polygon(0.27711421,0.089482136,0.094538624,0.090759,0.093867077,-0.091797152,0.27761497,-0.091828859) ||
+polygon(0.092712157,0.091309595,359.91014,0.092586111,359.91122,-0.088106013,0.092552581,-0.088209985) ||
+polygon(0.0033282835,0.27363238,359.82076,0.27490768,359.82001,0.094768685,0.0031744198,0.094115539) ||
+polygon(359.90953,0.092568474,359.72696,0.093844064,359.72812,-0.089262169,359.90881,-0.088176995) ||
+polygon(0.0019846216,-0.091478854,359.81886,-0.092032372,359.8205,-0.27089198,0.0018258799,-0.27099729)
diff --git a/ds9/template/xmm/epicmos2.tpl b/ds9/template/xmm/epicmos2.tpl
new file mode 100644
index 0000000..9e2f307
--- /dev/null
+++ b/ds9/template/xmm/epicmos2.tpl
@@ -0,0 +1,20 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/xmm/epicmos/image_epicmos2.ds
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(-.02,-.015099,0) ||
+point(359.98032,-0.015255945) || # point=boxcircle
+# text(0.002598154,-7.5391061e-05) || text={1}
+# text(0.19351408,-0.090699798) || text={2}
+# text(0.0013898207,-0.18132479) || text={3}
+# text(359.80806,-0.090699806) || text={4}
+# text(0.19351408,0.09175734) || text={7}
+# text(0.00018148737,0.18600729) || text={6}
+# text(359.80927,0.092965679) || text={5}
+polygon(0.092381631,0.092656826,359.91167,0.092172121,359.91162,-0.090971255,0.092913154,-0.089866031) ||
+polygon(0.091779215,-0.092315194,359.90928,-0.093457297,359.91102,-0.2759413,0.092316593,-0.27483652) ||
+polygon(359.90894,-8.3494418e-05,359.72643,-0.00062029737,359.72749,-0.18040463,359.90763,-0.18114781) ||
+polygon(359.90805,0.18424156,359.72735,0.1837549,359.7273,0.00061430326,359.90859,0.0017195055) ||
+polygon(0.091791652,0.27698791,359.91108,0.27650239,359.91103,0.09336198,0.092327659,0.094467032) ||
+polygon(0.27583152,0.18479008,0.095118571,0.18430591,0.095069778,0.001163703,0.27636646,0.0022696912) ||
+polygon(0.27552481,0.00013033963,0.094815474,-0.00035441732,0.094691734,-0.18108137,0.27625199,-0.17875761)
diff --git a/ds9/template/xmm/epicpn.tpl b/ds9/template/xmm/epicpn.tpl
new file mode 100644
index 0000000..417b07c
--- /dev/null
+++ b/ds9/template/xmm/epicpn.tpl
@@ -0,0 +1,31 @@
+# Region file format: DS9 version 4.0
+# Filename: /home/joye/templates/xmm/epicpn/image_epicpn.ds
+global color=green font="helvetica 10 normal" select=1 highlite=1 edit=1 move=1 delete=1 include=1 fixed=0 source
+wcs0;fk5
+# composite(-0.032,0.0166,0) ||
+point(359.9684,0.017688302) || # point=boxcircle
+polygon(0.0024077734,-0.00014830005,359.78785,-0.00041752552,359.78786,-0.072646412,0.0018211508,-0.072695941) ||
+# text(359.90368,-0.036006347) || text={1}
+polygon(0.0024077734,-0.00014830005,359.78785,-0.00041752552,359.78786,-0.072646412,0.0018211508,-0.072695941) ||
+# text(359.90247,-0.11213125) || text={2}
+polygon(0.0021963947,-0.075102588,359.78764,-0.075372326,359.78765,-0.14760027,0.0016077991,-0.14765228) ||
+# text(359.90368,-0.18704668) || text={3}
+polygon(0.0019729992,-0.14975594,359.78741,-0.15002511,359.78742,-0.2222521,0.0013929609,-0.22230368) ||
+# text(359.90247,0.041326975) || text={4}
+polygon(0.0026231785,0.074806934,359.78805,0.074537239,359.78807,0.0023093611,0.0020385428,0.0022583476) ||
+# text(359.90126,0.11382726) || text={5}
+polygon(0.0028373576,0.14976211,359.78827,0.14949189,359.78828,0.077263098,0.0022494778,0.077213572) ||
+# text(359.90247,0.18632595) || text={6}
+polygon(0.0030451022,0.22471722,359.78848,0.2244455,359.78849,0.15221877,0.0024592092,0.15216874) ||
+# text(0.11272235,0.040118972) || text={7}
+polygon(0.21961801,0.074544059,0.0050560461,0.074274386,0.0050631475,0.0020453621,0.21903517,0.0019959256) ||
+# text(0.11272285,0.11141062) || text={8}
+polygon(0.21982932,0.14949757,0.0052702679,0.14922958,0.0052781157,0.077000618,0.21924514,0.076949464) ||
+# text(0.11513727,0.18753426) || text={9}
+polygon(0.22003744,0.22445102,0.0054832423,0.22418372,0.0054866164,0.15195581,0.21945715,0.15190497) ||
+# text(0.1115122,-0.037214702) || text={10}
+polygon(0.21940876,-0.00041148409,0.0048458181,-0.00068086539,0.0048521831,-0.072908947,0.21882206,-0.07295968) ||
+# text(0.1127201,-0.11333958) || text={11}
+polygon(0.21919634,-0.075366094,0.0046291113,-0.075636181,0.0046399943,-0.14786432,0.21860577,-0.14791435) ||
+# text(0.11272043,-0.1870464) || text={12}
+polygon(0.21897336,-0.15001881,0.0044055854,-0.15028956,0.0044157238,-0.22251775,0.21838946,-0.22256606)
diff --git a/ds9/unix/Makefile.in b/ds9/unix/Makefile.in
new file mode 100644
index 0000000..653472d
--- /dev/null
+++ b/ds9/unix/Makefile.in
@@ -0,0 +1,214 @@
+include ../../make.pkgs
+
+TCL_LIB_SPEC = @TCL_LIB_SPEC@
+TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@
+TK_LIBS = @TK_LIBS@
+TK_LIB_SPEC = @TK_LIB_SPEC@
+TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@
+
+CC = @CC@
+CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
+CFLAGS_WARNING = @CFLAGS_WARNING@
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+
+INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
+
+PKG_CFLAGS = @PKG_CFLAGS@
+DEFS = @DEFS@ $(PKG_CFLAGS)
+
+CPPFLAGS = @CPPFLAGS@
+LIBS = @PKG_LIBS@ @LIBS@
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+
+system = @system@
+
+.SUFFIXES: .c .C .$(OBJEXT)
+
+.c.@OBJEXT@:
+ $(COMPILE) -c `@CYGPATH@ $<` -o $@
+
+.C.@OBJEXT@:
+ $(COMPILE) -c `@CYGPATH@ $<` -o $@
+
+#--------------------------defines
+
+ID = $(shell finger $(shell whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo)
+
+ZDIR = zvfsmntpt
+OBJS = ds9.o tkAppInit.o
+
+FILES = \
+ $(ZDIR)/tcl$(TCLVER) \
+ $(ZDIR)/tcl8 \
+ $(ZDIR)/tk$(TCLVER) \
+ $(ZDIR)/tkblt \
+ $(ZDIR)/tcllib \
+ $(ZDIR)/tkcon \
+ $(ZDIR)/library \
+ $(ZDIR)/msgs \
+ $(ZDIR)/doc \
+ $(ZDIR)/cmaps \
+ $(ZDIR)/template
+
+LLIBS = \
+ ../../lib/tksao$(TKSAOVER)/libtksao$(TKSAOVER).a \
+ ../../lib/libfuntools.a \
+ ../../lib/libast.a \
+ ../../lib/libast_err.a \
+ ../../lib/libast_pal.a \
+ ../../lib/tksao$(TKSAOVER)/libtksao$(TKSAOVER).a \
+ ../../lib/tkhtml1$(TKHTMLVER)/libtkhtml1$(TKHTMLVER).a \
+ ../../lib/tkmpeg$(TKMPEGVER)/libtkmpeg$(TKMPEGVER).a \
+ ../../lib/Tclxml$(TCLXMLVER)/libTclxml$(TCLXMLVER).a \
+ ../../lib/Tktable$(TKTABLEVER)/libTktable$(TKTABLEVER).a \
+ ../../lib/Img$(TKIMGVER)/libtkimgpng1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libpngtcl1.4.12.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgtiff1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libtifftcl3.9.4.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgjpeg1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libjpegtcl8.4.a \
+ ../../lib/Img$(TKIMGVER)/libtkimggif1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgwindow1.4.2.a \
+ ../../lib/Img$(TKIMGVER)/libzlibtcl1.2.8.a \
+ ../../lib/Img$(TKIMGVER)/libtkimg1.4.2.a \
+ ../../lib/tclzvfs$(TCLZVFSVER)/libtclzvfs$(TCLZVFSVER).a \
+ ../../lib/libxpa.a \
+ ../../lib/tcliis$(TCLIISVER)/libtcliis$(TCLIISVER).a \
+ ../../lib/tclcheckdns$(TCLCHECKDNSVER)/libtclcheckdns$(TCLCHECKDNSVER).a \
+ ../../lib/tclsignal$(TCLSIGNALVER)/libtclsignal$(TCLSIGNALVER).a \
+ ../../lib/tkblt$(TKBLTVER)/libtkbltstub$(TKBLTVER).a \
+ ../../lib/tkblt$(TKBLTVER)/libtkblt$(TKBLTVER).a
+
+#--------------------------main
+
+.NOTPARALLEL :
+.PHONY : debug
+
+ifeq (,$(findstring Darwin,$(system)))
+
+ds9 : ds9base ds9.zip
+ $(RM) ds9
+ strip ds9base
+ cat ds9base ds9.zip > ds9
+ zip -A ds9
+ chmod 755 ds9
+ cp ds9 ../../bin/.
+
+debug : ds9base ds9.zip
+ $(RM) ds9
+ cat ds9base ds9.zip > ds9
+ zip -A ds9
+ chmod 755 ds9
+ cp ds9 ../../bin/.
+
+else
+
+ds9 : ds9base ds9.zip
+ $(RM) ds9
+ strip ds9base
+ cp ds9base ds9
+ cp ds9 ../../bin/.
+ cp ds9.zip ../../bin/.
+ cd ../../bin; codesign -s "$(ID)" ds9
+
+debug: ds9base ds9.zip
+ $(RM) ds9
+ cp ds9base ds9
+ cp ds9 ../../bin/.
+ cp ds9.zip ../../bin/.
+ cd ../../bin; codesign -s "$(ID)" ds9
+
+endif
+
+ds9base : $(OBJS) $(LLIBS)
+ $(RM) $@
+ $(CC) $(CFLAGS) -o $@ \
+ $(OBJS) \
+ $(LLIBS) \
+ $(LIBS) \
+ $(TK_STUB_LIB_SPEC) $(TK_LIB_SPEC) \
+ $(TCL_STUB_LIB_SPEC) $(TCL_LIB_SPEC) \
+ $(TK_LIBS)
+
+ds9.zip : $(ZDIR) $(FILES)
+ $(RM) $@
+ find $(ZDIR) -depth -name "CVS" -exec rm -r {} \;
+ zip -r ds9.zip $(ZDIR)
+
+tkAppInit.o : tkAppInit.c
+ $(COMPILE) -DTK_LOCAL_APPINIT=SAOAppInit \
+ -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook -c tkAppInit.c -o $@
+
+tkAppInit.c : ../../tk$(TCLVER)/unix/tkAppInit.c
+ cp ../../tk$(TCLVER)/unix/tkAppInit.c .
+
+$(ZDIR) :
+ mkdir $@
+
+$(ZDIR)/tcl$(TCLVER) : ../../lib/tcl$(TCLVER)
+ $(RM) -r $@
+ cp -r ../../lib/tcl$(TCLVER) $(ZDIR)/.
+
+$(ZDIR)/tcl8 : ../../lib/tcl8
+ $(RM) -r $@
+ cp -r ../../lib/tcl8 $(ZDIR)/.
+
+$(ZDIR)/tk$(TCLVER) : ../../lib/tk$(TCLVER)
+ $(RM) -r $@
+ cp -r ../../lib/tk$(TCLVER) $(ZDIR)/.
+ rm -rf $(ZDIR)/tk$(TCLVER)/images
+ rm -rf $(ZDIR)/tk$(TCLVER)/demos
+
+$(ZDIR)/tkblt :
+ $(RM) -r $@
+ mkdir $(ZDIR)/tkblt
+ cp ../../tkblt/library/graph.tcl $(ZDIR)/tkblt/.
+
+$(ZDIR)/tcllib :
+ $(RM) -r $@
+ mkdir $(ZDIR)/tcllib
+ cp -r ../../tcllib/modules/base64 $(ZDIR)/tcllib/.
+ cp -r ../../tcllib/modules/ftp $(ZDIR)/tcllib/.
+ cp -r ../../tcllib/modules/log $(ZDIR)/tcllib/.
+ cp -r ../../tcllib/modules/textutil $(ZDIR)/tcllib/.
+ cp -r ../../tcllib/modules/math $(ZDIR)/tcllib/.
+
+$(ZDIR)/tkcon : ../../lib/tkcon$(TKCONVER)
+ $(RM) -r $@
+ cp -r ../../lib/tkcon$(TKCONVER) $@
+
+$(ZDIR)/library : ../library/*.tcl
+ $(RM) -r $@
+ cp -r ../library $(ZDIR)/.
+
+$(ZDIR)/msgs : ../msgs/*
+ $(RM) -r $@
+ cp -r ../msgs $(ZDIR)/.
+
+$(ZDIR)/doc : ../doc/* ../doc/ref/* ../doc/user/* ../doc/release/*
+ $(RM) -r $@
+ cd ..; find doc -name "*.html" | cpio -pdmuv unix/$(ZDIR)
+ cd ..; find doc -name "*.gif" | cpio -pdmuv unix/$(ZDIR)
+ cd ..; find doc -name "*.png" | cpio -pdmuv unix/$(ZDIR)
+
+$(ZDIR)/cmaps : ../cmaps/*
+ $(RM) -r $@
+ cp -r ../cmaps $(ZDIR)/.
+
+$(ZDIR)/template : ../template/*
+ $(RM) -r $@
+ cd ..; find template -name "*.tpl" | cpio -pdmuv unix/$(ZDIR)
+
+#--------------------------cleanup
+
+.PHONY : clean distclean
+
+clean :
+ cd ../library; $(MAKE) clean
+ $(RM) core *~ *# ds9base ds9 *.zip *.o
+ $(RM) -r $(ZDIR)
+
+distclean: clean
+ -rm -f Makefile config.cache config.log config.status
diff --git a/ds9/unix/aclocal.m4 b/ds9/unix/aclocal.m4
new file mode 100755
index 0000000..0b05739
--- /dev/null
+++ b/ds9/unix/aclocal.m4
@@ -0,0 +1,9 @@
+#
+# Include the TEA standard macro set
+#
+
+builtin(include,tclconfig/tcl.m4)
+
+#
+# Add here whatever m4 macros you want to define for your package
+#
diff --git a/ds9/unix/configure b/ds9/unix/configure
new file mode 100755
index 0000000..0a2e25e
--- /dev/null
+++ b/ds9/unix/configure
@@ -0,0 +1,10330 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for ds9 7.5.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='ds9'
+PACKAGE_TARNAME='ds9'
+PACKAGE_VERSION='7.5'
+PACKAGE_STRING='ds9 7.5'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+VC_MANIFEST_EMBED_EXE
+VC_MANIFEST_EMBED_DLL
+RANLIB_STUB
+MAKE_STUB_LIB
+MAKE_STATIC_LIB
+MAKE_SHARED_LIB
+MAKE_LIB
+TCL_DBGX
+LDFLAGS_DEFAULT
+CFLAGS_DEFAULT
+LD_LIBRARY_PATH_VAR
+SHLIB_CFLAGS
+SHLIB_LD_LIBS
+SHLIB_LD
+STLIB_LD
+CFLAGS_WARNING
+CFLAGS_OPTIMIZE
+CFLAGS_DEBUG
+RC
+CELIB_DIR
+AR
+TCL_THREADS
+XMKMF
+TK_INCLUDES
+TCL_INCLUDES
+system
+MATH_LIBS
+EGREP
+GREP
+RANLIB
+SET_MAKE
+INSTALL
+CPP
+TK_XINCLUDES
+TK_LIBS
+TK_STUB_LIB_SPEC
+TK_STUB_LIB_FLAG
+TK_STUB_LIB_FILE
+TK_LIB_SPEC
+TK_LIB_FLAG
+TK_LIB_FILE
+TK_SRC_DIR
+TK_BIN_DIR
+TK_VERSION
+TCL_SHLIB_LD_LIBS
+TCL_LD_FLAGS
+TCL_EXTRA_CFLAGS
+TCL_DEFS
+TCL_LIBS
+CLEANFILES
+OBJEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+TCL_STUB_LIB_SPEC
+TCL_STUB_LIB_FLAG
+TCL_STUB_LIB_FILE
+TCL_LIB_SPEC
+TCL_LIB_FLAG
+TCL_LIB_FILE
+TCL_SRC_DIR
+TCL_BIN_DIR
+TCL_PATCH_LEVEL
+TCL_VERSION
+PKG_CFLAGS
+PKG_LIBS
+PKG_INCLUDES
+PKG_HEADERS
+PKG_TCL_SOURCES
+PKG_STUB_OBJECTS
+PKG_STUB_SOURCES
+PKG_STUB_LIB_FILE
+PKG_LIB_FILE
+EXEEXT
+CYGPATH
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_tcl
+with_tk
+with_tclinclude
+with_tkinclude
+with_x
+enable_threads
+enable_64bit
+enable_64bit_vis
+enable_rpath
+enable_wince
+with_celib
+enable_symbols
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+XMKMF'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ds9 7.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/ds9]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+X features:
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ds9 7.5:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-threads build with threads
+ --enable-64bit enable 64bit support (default: off)
+ --enable-64bit-vis enable 64bit Sparc VIS support (default: off)
+ --disable-rpath disable rpath support (default: on)
+ --enable-wince enable Win/CE support (where applicable)
+ --enable-symbols build with debugging symbols (default: off)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-tcl directory containing tcl configuration
+ (tclConfig.sh)
+ --with-tk directory containing tk configuration (tkConfig.sh)
+ --with-tclinclude directory containing the public Tcl header files
+ --with-tkinclude directory containing the public Tk header files
+ --with-x use the X Window System
+ --with-celib=DIR use Windows/CE support library from DIR
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ XMKMF Path to xmkmf, Makefile generator for X Window System
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ds9 configure 7.5
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5
+$as_echo_n "checking for correct TEA configuration... " >&6; }
+ if test x"${PACKAGE_NAME}" = x ; then
+ as_fn_error $? "
+The PACKAGE_NAME variable must be defined by your TEA configure.in" "$LINENO" 5
+ fi
+ if test x"3.9" = x ; then
+ as_fn_error $? "
+TEA version not specified." "$LINENO" 5
+ elif test "3.9" != "${TEA_VERSION}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5
+$as_echo "warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5
+$as_echo "ok (TEA ${TEA_VERSION})" >&6; }
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ # Extract the first word of "cygpath", so it can be a program name with args.
+set dummy cygpath; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CYGPATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CYGPATH"; then
+ ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CYGPATH="cygpath -w"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
+fi
+fi
+CYGPATH=$ac_cv_prog_CYGPATH
+if test -n "$CYGPATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
+$as_echo "$CYGPATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5
+$as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;}
+
+
+
+
+ # This package name must be replaced statically for AC_SUBST to work
+
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in tclconfig "$srcdir"/tclconfig; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in tclconfig \"$srcdir\"/tclconfig" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+
+
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+
+# Check whether --with-tcl was given.
+if test "${with_tcl+set}" = set; then :
+ withval=$with_tcl; with_tclconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5
+$as_echo_n "checking for Tcl configuration... " >&6; }
+ if ${ac_cv_c_tclconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+ fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; }
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5
+$as_echo_n "checking platform... " >&6; }
+ hold_cc=$CC; CC="$TCL_CC"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _WIN32
+ #error win32
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ TEA_PLATFORM="unix"
+else
+ TEA_PLATFORM="windows"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CC=$hold_cc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5
+$as_echo "$TEA_PLATFORM" >&6; }
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_${PACKAGE_NAME} /**/
+_ACEOF
+
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+
+# Check whether --with-tk was given.
+if test "${with_tk+set}" = set; then :
+ withval=$with_tk; with_tkconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5
+$as_echo_n "checking for Tk configuration... " >&6; }
+ if ${ac_cv_c_tkconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;}
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ as_fn_error $? "Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" "$LINENO" 5
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; }
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+
+$as_echo "#define MAC_OSX_TK 1" >>confdefs.h
+
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # TEA specific:
+
+
+
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
+$as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
+ prefix=${TCL_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5
+$as_echo "$as_me: --prefix defaulting to /usr/local" >&6;}
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
+ exec_prefix=$prefix
+ fi
+ fi
+
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
+$as_echo_n "checking if the compiler understands -pipe... " >&6; }
+if ${tcl_cv_cc_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cc_pipe=yes
+else
+ tcl_cv_cc_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
+$as_echo "$tcl_cv_cc_pipe" >&6; }
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+ if test "${TEA_PLATFORM}" = "unix" ; then
+
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin"
+if test "x$ac_cv_func_sin" = xyes; then :
+ MATH_LIBS=""
+else
+ MATH_LIBS="-lm"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5
+$as_echo_n "checking for main in -lieee... " >&6; }
+if ${ac_cv_lib_ieee_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lieee $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ieee_main=yes
+else
+ ac_cv_lib_ieee_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5
+$as_echo "$ac_cv_lib_ieee_main" >&6; }
+if test "x$ac_cv_lib_ieee_main" = xyes; then :
+ MATH_LIBS="-lieee $MATH_LIBS"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5
+$as_echo_n "checking for main in -linet... " >&6; }
+if ${ac_cv_lib_inet_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-linet $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_inet_main=yes
+else
+ ac_cv_lib_inet_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5
+$as_echo "$ac_cv_lib_inet_main" >&6; }
+if test "x$ac_cv_lib_inet_main" = xyes; then :
+ LIBS="$LIBS -linet"
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_errno_h" = xyes; then :
+
+
+$as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
+if test "x$ac_cv_func_connect" = xyes; then :
+ tcl_checkSocket=0
+else
+ tcl_checkSocket=1
+fi
+
+ if test "$tcl_checkSocket" = 1; then
+ ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setsockopt ();
+int
+main ()
+{
+return setsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_setsockopt=yes
+else
+ ac_cv_lib_socket_setsockopt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
+ LIBS="$LIBS -lsocket"
+else
+ tcl_checkBoth=1
+fi
+
+fi
+
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept"
+if test "x$ac_cv_func_accept" = xyes; then :
+ tcl_checkNsl=0
+else
+ LIBS=$tk_oldLibs
+fi
+
+ fi
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+ LIBS="$LIBS -lnsl"
+fi
+
+fi
+
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5
+$as_echo_n "checking dirent.h... " >&6; }
+if ${tcl_cv_dirent_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_dirent_h=yes
+else
+ tcl_cv_dirent_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5
+$as_echo "$tcl_cv_dirent_h" >&6; }
+
+ if test $tcl_cv_dirent_h = no; then
+
+$as_echo "#define NO_DIRENT_H 1" >>confdefs.h
+
+ fi
+
+ # TEA specific:
+ ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default"
+if test "x$ac_cv_header_float_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_FLOAT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default"
+if test "x$ac_cv_header_values_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_VALUES_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default"
+if test "x$ac_cv_header_limits_h" = xyes; then :
+
+$as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h
+
+else
+
+$as_echo "#define NO_LIMITS_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtol" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtoul" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtod" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STDLIB_H 1" >>confdefs.h
+
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
+if test "x$ac_cv_header_string_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strstr" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strerror" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STRING_H 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_wait_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_DLFCN_H 1" >>confdefs.h
+
+fi
+
+
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ for ac_header in sys/param.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PARAM_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+
+ vars="-lstdc++"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5
+$as_echo_n "checking system version... " >&6; }
+if ${tcl_cv_sys_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
+$as_echo "$as_me: WARNING: can't find uname command" >&2;}
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
+$as_echo "$tcl_cv_sys_version" >&6; }
+ system=$tcl_cv_sys_version
+
+case $system in
+ Darwin*)
+ $as_echo "#define ZIPFILE 1" >>confdefs.h
+
+ ;;
+ *)
+ ;;
+esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlInitParser in -lxml2" >&5
+$as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
+if ${ac_cv_lib_xml2_xmlInitParser+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxml2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitParser ();
+int
+main ()
+{
+return xmlInitParser ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_xml2_xmlInitParser=yes
+else
+ ac_cv_lib_xml2_xmlInitParser=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlInitParser" >&5
+$as_echo "$ac_cv_lib_xml2_xmlInitParser" >&6; }
+if test "x$ac_cv_lib_xml2_xmlInitParser" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML2 1
+_ACEOF
+
+ LIBS="-lxml2 $LIBS"
+
+fi
+
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
+$as_echo_n "checking for Tcl public headers... " >&6; }
+
+
+# Check whether --with-tclinclude was given.
+if test "${with_tclinclude+set}" = set; then :
+ withval=$with_tclinclude; with_tclinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tclh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5
+$as_echo "${ac_cv_c_tclh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+#TEA_PRIVATE_TCL_HEADERS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5
+$as_echo_n "checking for Tk public headers... " >&6; }
+
+
+# Check whether --with-tkinclude was given.
+if test "${with_tkinclude+set}" = set; then :
+ withval=$with_tkinclude; with_tkinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tkh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ as_fn_error $? "tk.h not found. Please specify its location with --with-tkinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5
+$as_echo "${ac_cv_c_tkh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
+$as_echo_n "checking for X11 header files... " >&6; }
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5
+$as_echo "${INCLUDE_DIR_NATIVE}" >&6; }
+ fi
+
+#TEA_PRIVATE_TK_HEADERS
+
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then :
+ withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ case $x_includes,$x_libraries in #(
+ *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
+ *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+ cd conftest.dir
+ cat >Imakefile <<'_ACEOF'
+incroot:
+ @echo incroot='${INCROOT}'
+usrlibdir:
+ @echo usrlibdir='${USRLIBDIR}'
+libdir:
+ @echo libdir='${LIBDIR}'
+_ACEOF
+ if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+ for ac_var in incroot usrlibdir libdir; do
+ eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+ done
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl dylib la dll; do
+ if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+ test -f "$ac_im_libdir/libX11.$ac_extension"; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case $ac_im_incroot in
+ /usr/include) ac_x_includes= ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+ esac
+ case $ac_im_usrlibdir in
+ /usr/lib | /usr/lib64 | /lib | /lib64) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+ esac
+ fi
+ cd ..
+ rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R7/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R7
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R7/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R7
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Xlib.h.
+ # First, try using that file with no special directory specified.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ for ac_dir in $ac_x_header_dirs; do
+ if test -r "$ac_dir/X11/Xlib.h"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+done
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+ # Check for the libraries.
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS=$LIBS
+ LIBS="-lX11 $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ LIBS=$ac_save_LIBS
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+ # Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl dylib la dll; do
+ if test -r "$ac_dir/libX11.$ac_extension"; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+ no,* | *,no | *\'*)
+ # Didn't find X, or a directory has "'" in its name.
+ ac_cv_have_x="have_x=no";; #(
+ *)
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$ac_x_includes'\
+ ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+ *) have_x=yes;;
+ esac
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes\
+ ac_x_includes='$x_includes'\
+ ac_x_libraries='$x_libraries'"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ not_really_there="yes"
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ else
+ if test ! -r $x_includes/X11/Xlib.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
+$as_echo_n "checking for X11 header files... " >&6; }
+ found_xincludes="no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ found_xincludes="yes"
+else
+ found_xincludes="no"
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Xlib.h; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
+$as_echo "$i" >&6; }
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test "$found_xincludes" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5
+$as_echo "couldn't find any!" >&6; }
+ fi
+
+ if test "$no_x" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5
+$as_echo_n "checking for X11 libraries... " >&6; }
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5
+$as_echo "$i" >&6; }
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5
+$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; }
+if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXwindow $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char XCreateWindow ();
+int
+main ()
+{
+return XCreateWindow ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_Xwindow_XCreateWindow=yes
+else
+ ac_cv_lib_Xwindow_XCreateWindow=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5
+$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; }
+if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then :
+ XLIBSW=-lXwindow
+fi
+
+ fi
+ if test "$XLIBSW" = nope ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find any! Using -lX11." >&5
+$as_echo "could not find any! Using -lX11." >&6; }
+ XLIBSW=-lX11
+ fi
+ # TEA specific:
+ if test x"${XLIBSW}" != x ; then
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
+ fi
+
+ fi
+
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+
+ # Check whether --enable-threads was given.
+if test "${enable_threads+set}" = set; then :
+ enableval=$enable_threads; tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi
+
+
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ # We are always OK on Windows, so check what this platform wants:
+
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+
+$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+ if test "`uname -s`" = "SunOS" ; then
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ fi
+
+$as_echo "#define _THREAD_SAFE 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5
+$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread_pthread_mutex_init=yes
+else
+ ac_cv_lib_pthread_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5
+$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char __pthread_mutex_init ();
+int
+main ()
+{
+return __pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthread___pthread_mutex_init=yes
+else
+ ac_cv_lib_pthread___pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5
+$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; }
+if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthreads $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_pthreads_pthread_mutex_init=yes
+else
+ ac_cv_lib_pthreads_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5
+$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; }
+if ${ac_cv_lib_c_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_pthread_mutex_init=yes
+else
+ ac_cv_lib_c_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5
+$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; }
+if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_mutex_init ();
+int
+main ()
+{
+return pthread_mutex_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_c_r_pthread_mutex_init=yes
+else
+ ac_cv_lib_c_r_pthread_mutex_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5
+$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&5
+$as_echo "$as_me: WARNING: Do not know how to find pthread lib on your system - thread support disabled" >&2;}
+ fi
+ fi
+ fi
+ fi
+ fi
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5
+$as_echo_n "checking for building with threads... " >&6; }
+ if test "${TCL_THREADS}" = 1; then
+
+$as_echo "#define TCL_THREADS 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
+$as_echo "yes (default)" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ # TCL_THREADS sanity checking. See if our request for building with
+ # threads is the same as the way Tcl was built. If not, warn the user.
+ case ${TCL_DEFS} in
+ *THREADS=1*)
+ if test "${TCL_THREADS}" = "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads." >&5
+$as_echo "$as_me: WARNING:
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads." >&2;}
+ fi
+ ;;
+ *)
+ if test "${TCL_THREADS}" = "1"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core." >&5
+$as_echo "$as_me: WARNING:
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core." >&2;}
+ fi
+ ;;
+ esac
+
+
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+
+ # Step 0.a: Enable 64 bit support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5
+$as_echo_n "checking if 64bit support is requested... " >&6; }
+ # Check whether --enable-64bit was given.
+if test "${enable_64bit+set}" = set; then :
+ enableval=$enable_64bit; do64bit=$enableval
+else
+ do64bit=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5
+$as_echo "$do64bit" >&6; }
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5
+$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; }
+ # Check whether --enable-64bit-vis was given.
+if test "${enable_64bit_vis+set}" = set; then :
+ enableval=$enable_64bit_vis; do64bitVIS=$enableval
+else
+ do64bitVIS=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5
+$as_echo "$do64bitVIS" >&6; }
+ # Force 64bit on with VIS
+ if test "$do64bitVIS" = "yes"; then :
+ do64bit=yes
+fi
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5
+$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; }
+if ${tcl_cv_cc_visibility_hidden+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}
+int
+main ()
+{
+f();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_visibility_hidden=yes
+else
+ tcl_cv_cc_visibility_hidden=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5
+$as_echo "$tcl_cv_cc_visibility_hidden" >&6; }
+ if test $tcl_cv_cc_visibility_hidden = yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h
+
+
+$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h
+
+
+fi
+
+ # Step 0.d: Disable -rpath support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5
+$as_echo_n "checking if rpath support is requested... " >&6; }
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; doRpath=$enableval
+else
+ doRpath=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5
+$as_echo "$doRpath" >&6; }
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ if test "${TEA_PLATFORM}" = windows; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5
+$as_echo_n "checking if Windows/CE build is requested... " >&6; }
+ # Check whether --enable-wince was given.
+if test "${enable_wince+set}" = set; then :
+ enableval=$enable_wince; doWince=$enableval
+else
+ doWince=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5
+$as_echo "$doWince" >&6; }
+
+fi
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5
+$as_echo_n "checking system version... " >&6; }
+if ${tcl_cv_sys_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
+$as_echo "$as_me: WARNING: can't find uname command" >&2;}
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
+$as_echo "$tcl_cv_sys_version" >&6; }
+ system=$tcl_cv_sys_version
+
+
+ # Require ranlib early so we can override it in special cases below.
+
+
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ if test "$GCC" = yes; then :
+
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+
+else
+
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+
+fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ if test "x$SHLIB_VERSION" = x; then :
+ SHLIB_VERSION="1.0"
+fi
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
+$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5
+$as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
+ do64bit="no"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5
+$as_echo " Using 64-bit $MACHINE mode" >&6; }
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5
+ fi
+ if test "$GCC" = "yes" ; then
+ as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5
+ fi
+
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+
+# Check whether --with-celib was given.
+if test "${with_celib+set}" = set; then :
+ withval=$with_celib; with_celibconfig=${withval}
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5
+$as_echo_n "checking for Windows/CE celib directory... " >&6; }
+ if ${ac_cv_c_celibconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5
+$as_echo "found $CELIB_DIR" >&6; }
+ fi
+ fi
+
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
+ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
+ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
+ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+
+ vars="bufferoverflowU.lib"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower($0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+
+cat >>confdefs.h <<_ACEOF
+#define $i 1
+_ACEOF
+
+ done
+
+cat >>confdefs.h <<_ACEOF
+#define _WIN32_WCE $CEVERSION
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNDER_CE $CEVERSION
+_ACEOF
+
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RC"; then
+ ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RC="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
+$as_echo "$RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+ ac_ct_RC=$RC
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RC"; then
+ ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RC="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5
+$as_echo "$ac_ct_RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RC" = x; then
+ RC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RC=$ac_ct_RC
+ fi
+else
+ RC="$ac_cv_prog_RC"
+fi
+
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5
+$as_echo_n "checking for cross-compile version of gcc... " >&6; }
+if ${ac_cv_cross+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_cross=yes
+else
+ ac_cv_cross=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5
+$as_echo "$ac_cv_cross" >&6; }
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then :
+
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
+$as_echo "Using $CC for compiling with threads" >&6; }
+
+fi
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+
+fi
+
+fi
+
+ if test "`uname -m`" = ia64; then :
+
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ if test "$GCC" = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+
+else
+
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+
+fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+else
+
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+
+else
+
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+
+fi
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5
+$as_echo_n "checking for inet_ntoa in -lbind... " >&6; }
+if ${ac_cv_lib_bind_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbind $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bind_inet_ntoa=yes
+else
+ ac_cv_lib_bind_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lbind -lsocket"
+fi
+
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5
+$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; }
+if ${ac_cv_lib_network_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetwork $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_network_inet_ntoa=yes
+else
+ ac_cv_lib_network_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lnetwork"
+fi
+
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+
+$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
+
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ if test "`uname -m`" = ia64; then :
+
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+
+else
+
+ SHLIB_SUFFIX=".sl"
+
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+
+fi
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes"; then :
+
+ if test "$GCC" = yes; then :
+
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+ ;;
+ esac
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+
+fi
+
+fi ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+
+else
+
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+
+fi
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
+
+else
+
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+
+fi
+
+fi
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "`uname -m`" = "alpha"; then :
+ CFLAGS="$CFLAGS -mieee"
+fi
+ if test $do64bit = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5
+$as_echo_n "checking if compiler accepts -m64 flag... " >&6; }
+if ${tcl_cv_cc_m64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_m64=yes
+else
+ tcl_cv_cc_m64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5
+$as_echo "$tcl_cv_cc_m64" >&6; }
+ if test $tcl_cv_cc_m64 = yes; then :
+
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+
+fi
+
+fi
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ if test x"${USE_COMPAT}" != x; then :
+ CFLAGS="$CFLAGS -fno-inline"
+fi
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+
+fi
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$@"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
+ if test $do64bit = yes; then :
+
+ case `arch` in
+ ppc)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; }
+if ${tcl_cv_cc_arch_ppc64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_ppc64=yes
+else
+ tcl_cv_cc_arch_ppc64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
+$as_echo "$tcl_cv_cc_arch_ppc64" >&6; }
+ if test $tcl_cv_cc_arch_ppc64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+
+fi;;
+ i386)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; }
+if ${tcl_cv_cc_arch_x86_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_x86_64=yes
+else
+ tcl_cv_cc_arch_x86_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5
+$as_echo "$tcl_cv_cc_arch_x86_64" >&6; }
+ if test $tcl_cv_cc_arch_x86_64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+
+fi;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
+$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
+ esac
+
+else
+
+ # Check for combined 32-bit and 64-bit fat build
+ if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then :
+
+ fat_32_64=yes
+fi
+
+fi
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
+$as_echo_n "checking if ld accepts -single_module flag... " >&6; }
+if ${tcl_cv_ld_single_module+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_single_module=yes
+else
+ tcl_cv_ld_single_module=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5
+$as_echo "$tcl_cv_ld_single_module" >&6; }
+ if test $tcl_cv_ld_single_module = yes; then :
+
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+
+fi
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then :
+
+ LDFLAGS="$LDFLAGS -prebind"
+fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
+$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
+if ${tcl_cv_ld_search_paths_first+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_search_paths_first=yes
+else
+ tcl_cv_ld_search_paths_first=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5
+$as_echo "$tcl_cv_ld_search_paths_first" >&6; }
+ if test $tcl_cv_ld_search_paths_first = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+
+fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h
+
+ tcl_cv_cc_visibility_hidden=yes
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then :
+
+ if test "${TEA_WINDOWINGSYSTEM}" = x11; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5
+$as_echo_n "checking for 64-bit X11... " >&6; }
+if ${tcl_cv_lib_x11_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_x11_64=yes
+else
+ tcl_cv_lib_x11_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5
+$as_echo "$tcl_cv_lib_x11_64" >&6; }
+
+fi
+ if test "${TEA_WINDOWINGSYSTEM}" = aqua; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5
+$as_echo_n "checking for 64-bit Tk... " >&6; }
+if ${tcl_cv_lib_tk_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <tk.h>
+int
+main ()
+{
+Tk_InitStubs(NULL, "", 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_tk_64=yes
+else
+ tcl_cv_lib_tk_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5
+$as_echo "$tcl_cv_lib_tk_64" >&6; }
+
+fi
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5
+$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done
+fi
+
+fi
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+
+$as_echo "#define _OE_SOCKETS 1" >>confdefs.h
+
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ if test "$SHARED_BUILD" = 1; then :
+
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+
+else
+
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+
+fi
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+ CFLAGS="$CFLAGS -mieee"
+else
+
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
+fi
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ if test "${TCL_THREADS}" = 1; then :
+
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = yes; then :
+
+ LIBS="$LIBS -lpthread -lmach -lexc"
+
+else
+
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+
+fi
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ if test "$GCC" = yes; then :
+
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+
+else
+
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+
+fi
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[0-6])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ arch=`isainfo`
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ if test "$GCC" = yes; then :
+
+ if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+
+fi
+
+else
+
+ do64bit_ok=yes
+ if test "$do64bitVIS" = yes; then :
+
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+
+else
+
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+
+fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+
+fi
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
+ esac
+
+else
+
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
+fi
+fi
+
+fi
+
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$do64bit_ok" = yes; then :
+
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+
+fi
+fi
+
+fi
+
+else
+
+ case $system in
+ SunOS-5.[1-9][0-9]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+fi
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5
+$as_echo_n "checking for ld accepts -Bexport flag... " >&6; }
+if ${tcl_cv_ld_Bexport+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_Bexport=yes
+else
+ tcl_cv_ld_Bexport=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5
+$as_echo "$tcl_cv_ld_Bexport" >&6; }
+ if test $tcl_cv_ld_Bexport = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ if test "$do64bit" = yes -a "$do64bit_ok" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
+$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
+
+fi
+
+
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac
+fi
+
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern" >>confdefs.h
+
+
+fi
+
+ if test "$SHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
+fi
+ if test "$UNSHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
+fi
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5
+$as_echo_n "checking for SEH support in compiler... " >&6; }
+if ${tcl_cv_seh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ tcl_cv_seh=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ tcl_cv_seh=yes
+else
+ tcl_cv_seh=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5
+$as_echo "$tcl_cv_seh" >&6; }
+ if test "$tcl_cv_seh" = "no" ; then
+
+$as_echo "#define HAVE_NO_SEH 1" >>confdefs.h
+
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5
+$as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; }
+if ${tcl_cv_eh_disposition+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ EXCEPTION_DISPOSITION x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_eh_disposition=yes
+else
+ tcl_cv_eh_disposition=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5
+$as_echo "$tcl_cv_eh_disposition" >&6; }
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+
+$as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h
+
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5
+$as_echo_n "checking for winnt.h that ignores VOID define... " >&6; }
+if ${tcl_cv_winnt_ignore_void+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ CHAR c;
+ SHORT s;
+ LONG l;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_winnt_ignore_void=yes
+else
+ tcl_cv_winnt_ignore_void=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5
+$as_echo "$tcl_cv_winnt_ignore_void" >&6; }
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+
+$as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h
+
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
+$as_echo_n "checking for cast to union support... " >&6; }
+if ${tcl_cv_cast_to_union+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cast_to_union=yes
+else
+ tcl_cv_cast_to_union=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
+$as_echo "$tcl_cv_cast_to_union" >&6; }
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+
+$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5
+$as_echo_n "checking for required early compiler flags... " >&6; }
+ tcl_flags=""
+
+ if ${tcl_cv_flag__isoc99_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _ISOC99_SOURCE 1
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=yes
+else
+ tcl_cv_flag__isoc99_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
+
+$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _ISOC99_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile64_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE64_SOURCE 1
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=yes
+else
+ tcl_cv_flag__largefile64_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile_source64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE64 1
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=yes
+else
+ tcl_cv_flag__largefile_source64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
+ fi
+
+ if test "x${tcl_flags}" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5
+$as_echo "${tcl_flags}" >&6; }
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5
+$as_echo_n "checking for 64-bit integer type... " >&6; }
+ if ${tcl_cv_type_64bit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+__int64 value = (__int64) 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_type_64bit=__int64
+else
+ tcl_type_64bit="long long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+switch (0) {
+ case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_64bit=${tcl_type_64bit}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "${tcl_cv_type_64bit}" = none ; then
+
+$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5
+$as_echo "using long" >&6; }
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5
+$as_echo "using Tcl header defaults" >&6; }
+ else
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5
+$as_echo "${tcl_cv_type_64bit}" >&6; }
+
+ # Now check for auxiliary declarations
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
+$as_echo_n "checking for struct dirent64... " >&6; }
+if ${tcl_cv_struct_dirent64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+struct dirent64 p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_dirent64=yes
+else
+ tcl_cv_struct_dirent64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5
+$as_echo "$tcl_cv_struct_dirent64" >&6; }
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
+$as_echo_n "checking for struct stat64... " >&6; }
+if ${tcl_cv_struct_stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 p;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_stat64=yes
+else
+ tcl_cv_struct_stat64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
+$as_echo "$tcl_cv_struct_stat64" >&6; }
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
+
+ fi
+
+ for ac_func in open64 lseek64
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
+$as_echo_n "checking for off64_t... " >&6; }
+ if ${tcl_cv_type_off64_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+off64_t offset;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_off64_t=yes
+else
+ tcl_cv_type_off64_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+
+$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ fi
+
+
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5
+$as_echo_n "checking for build with symbols... " >&6; }
+ # Check whether --enable-symbols was given.
+if test "${enable_symbols+set}" = set; then :
+ enableval=$enable_symbols; tcl_ok=$enableval
+else
+ tcl_ok=no
+fi
+
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5
+$as_echo "yes (standard debugging)" >&6; }
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+
+
+
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+
+$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h
+
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5
+$as_echo "enabled symbols mem debugging" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5
+$as_echo "enabled $tcl_ok debugging" >&6; }
+ fi
+ fi
+
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "manifest needed" >/dev/null 2>&1; then :
+
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+
+ CLEANFILES="$CLEANFILES *.manifest"
+
+
+fi
+rm -f conftest*
+
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+ds9 config.status 7.5
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/ds9/unix/configure.in b/ds9/unix/configure.in
new file mode 100755
index 0000000..5244f36
--- /dev/null
+++ b/ds9/unix/configure.in
@@ -0,0 +1,198 @@
+#!/bin/bash -norc
+dnl This file is an input file used by the GNU "autoconf" program to
+dnl generate the file "configure", which is run during Tcl installation
+dnl to configure the system for the local environment.
+
+#-----------------------------------------------------------------------
+# Sample configure.in for Tcl Extensions. The only places you should
+# need to modify this file are marked by the string __CHANGE__
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Set your package name and version numbers here.
+#
+# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
+# set as provided. These will also be added as -D defs in your Makefile
+# so you can encode the package version directly into the source files.
+# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
+# so that we create the export library with the dll.
+#-----------------------------------------------------------------------
+
+AC_INIT([ds9], [7.5])
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+TEA_INIT([3.9])
+
+AC_CONFIG_AUX_DIR(tclconfig)
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+TEA_PATH_TCLCONFIG
+TEA_LOAD_TCLCONFIG
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+TEA_PATH_TKCONFIG
+TEA_LOAD_TKCONFIG
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+TEA_PREFIX
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+TEA_SETUP_COMPILER
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+TEA_ADD_LIBS([-lstdc++])
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+TEA_CONFIG_SYSTEM
+case $system in
+ Darwin*)
+ AC_DEFINE([ZIPFILE])
+ ;;
+ *)
+ ;;
+esac
+
+AC_SUBST(system)
+AC_CHECK_LIB([xml2],[xmlInitParser])
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+TEA_PUBLIC_TCL_HEADERS
+#TEA_PRIVATE_TCL_HEADERS
+
+TEA_PUBLIC_TK_HEADERS
+#TEA_PRIVATE_TK_HEADERS
+TEA_PATH_X
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_THREADS
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+TEA_CONFIG_CFLAGS
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_SYMBOLS
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+TEA_MAKE_LIB
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+AC_OUTPUT([Makefile])
diff --git a/ds9/unix/ds9.C b/ds9/unix/ds9.C
new file mode 100644
index 0000000..90c4573
--- /dev/null
+++ b/ds9/unix/ds9.C
@@ -0,0 +1,247 @@
+// Copyright (C) 1999-2015
+// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+// For conditions of distribution and use, see copyright notice in "copyright"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <iostream>
+#include <sstream>
+using namespace std;
+
+#include <tcl.h>
+#include <tk.h>
+
+extern "C" {
+ int SAOAppInit(Tcl_Interp *interp);
+ int SAOLocalMainHook(int* argc, char*** argv);
+
+ void TclSetStartupScriptFileName(const char*);
+
+ int Zvfs_Init(Tcl_Interp*);
+ int Zvfs_Mount(Tcl_Interp*, char*, char *);
+
+ int Tkblt_Init(Tcl_Interp*);
+ int Tktable_Init(Tcl_Interp*);
+ int Tclcheckdns_Init(Tcl_Interp*);
+ int Tksao_Init(Tcl_Interp*);
+ int Tkhtml1_Init(Tcl_Interp*);
+ int Tkmpeg_Init(Tcl_Interp*);
+
+ int Tkimg_Init(Tcl_Interp*);
+ int Zlibtcl_Init(Tcl_Interp*);
+ int Jpegtcl_Init(Tcl_Interp*);
+ int Tkimgjpeg_Init(Tcl_Interp*);
+ int Tifftcl_Init(Tcl_Interp*);
+ int Tkimgtiff_Init(Tcl_Interp*);
+ int Pngtcl_Init(Tcl_Interp*);
+ int Tkimgpng_Init(Tcl_Interp*);
+ int Tkimggif_Init(Tcl_Interp*);
+ int Tkimgwindow_Init(Tcl_Interp*);
+
+ int Tclxpa_Init(Tcl_Interp*);
+ int Tcliis_Init(Tcl_Interp*);
+
+ int Tclxml_Init(Tcl_Interp*);
+ int Tclxml_libxml2_Init(Tcl_Interp*);
+
+ int Signal_ext_Init(Tcl_Interp*);
+}
+
+Tcl_Interp *global_interp;
+
+void internalError(const char* msg)
+{
+ Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY);
+}
+
+// currently use relative path
+// using full path with spaces causes problems
+// with htmwidget and tcl/tk
+
+int SAOLocalMainHook(int* argcPtr, char*** argvPtr)
+{
+ // sync C++ io calls with C io calls
+ ios::sync_with_stdio();
+
+ // do this first
+ Tcl_FindExecutable((*argvPtr)[0]);
+
+ // so that tcl and tk know where to find their libs
+ // we do it here before InitLibraryPath is called
+ putenv((char*)"TCL_LIBRARY=./zvfsmntpt/tcl8.6");
+ putenv((char*)"TK_LIBRARY=./zvfsmntpt/tk8.6");
+
+ // startup script
+ Tcl_Obj *path = Tcl_NewStringObj("./zvfsmntpt/library/ds9.tcl",-1);
+ Tcl_SetStartupScript(path, NULL);
+
+ return TCL_OK;
+}
+
+int SAOAppInit(Tcl_Interp *interp)
+{
+ // save interp for cputs function
+ global_interp = interp;
+
+ // We have to initialize the virtual filesystem before calling
+ // Tcl_Init(). Otherwise, Tcl_Init() will not be able to find
+ // its startup script files.
+ if (Zvfs_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "zvfs", Zvfs_Init, (Tcl_PackageInitProc*)NULL);
+
+ // find current working directory, and set as mount point
+ {
+ Tcl_DString pwd;
+ Tcl_DStringInit(&pwd);
+ Tcl_GetCwd(interp, &pwd);
+
+#ifdef ZIPFILE
+ ostringstream str;
+ str << (char *)Tcl_GetNameOfExecutable()
+ << ".zip"
+ << ends;
+ if( Zvfs_Mount(interp, (char*)str.str().c_str(), Tcl_DStringValue(&pwd)) != TCL_OK ){
+ char str[] = "ERROR: Unable to open the auxiliary ds9 file 'ds9.zip'. If you moved the ds9 program from its original location, please also move the zip file to the same place.";
+
+ cerr << str << endl;
+ exit(1);
+ }
+#else
+ Zvfs_Mount(interp, (char *)Tcl_GetNameOfExecutable(),
+ Tcl_DStringValue(&pwd));
+#endif
+ Tcl_DStringFree(&pwd);
+ }
+
+ // Tcl
+ if (Tcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tk
+ if (Tk_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
+
+ // Tkblt
+ if (Tkblt_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp, "tkblt", Tkblt_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tktable
+ if (Tktable_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tktable", Tktable_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclcheckdns
+ if (Tclcheckdns_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tclcheckdns", Tclcheckdns_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tksao
+ if (Tksao_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tksao", Tksao_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkhtml1
+ if (Tkhtml1_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkhtml1", Tkhtml1_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxpa
+ if (Tclxpa_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tcliis
+ if (Tcliis_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tcliis", Tcliis_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkmpeg
+ if (Tkmpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkmpeg", Tkmpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxml
+ if (Tclxml_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tkimg
+ if (Tkimg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "img", Tkimg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // zlibtcl
+ if (Zlibtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "zlibtcl", Zlibtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // jpegtcl
+ if (Jpegtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpegtcl", Jpegtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgjpeg
+ if (Tkimgjpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpeg", Tkimgjpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tifftcl
+ if (Tifftcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tifftcl", Tifftcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgtiff
+ if (Tkimgtiff_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tiff", Tkimgtiff_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Pngtcl
+ if (Pngtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "pngtcl", Pngtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgpng
+ if (Tkimgpng_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "png", Tkimgpng_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimggif
+ if (Tkimggif_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "gif", Tkimggif_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgwindow
+ if (Tkimgwindow_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "window", Tkimgwindow_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Signal_Ext
+ if (Signal_ext_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "signal", Signal_ext_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ return TCL_OK;
+}
diff --git a/ds9/unix/tclconfig/ChangeLog b/ds9/unix/tclconfig/ChangeLog
new file mode 100644
index 0000000..ffda2bb
--- /dev/null
+++ b/ds9/unix/tclconfig/ChangeLog
@@ -0,0 +1,980 @@
+2013-07-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [3324676]: AC_PROG_INSTALL incompat,
+ Bug [3606445]: Unneeded -DHAVE_NO_SEH=1 when not building on Windows
+
+2013-07-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4
+ (thanks to Brian Griffin)
+
+2013-06-20 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Use X11/Xlib.h for checking where X11 can be found
+ in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti.
+
+2013-06-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Eliminate NO_VIZ macro as current
+ zlib uses HAVE_HIDDEN in stead. One more last-moment
+ fix for FreeBSD by Pietro Cerutti
+
+2013-05-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Fix for FreeBSD, and remove support for old
+ FreeBSD versions. Patch by Pietro Cerutti
+
+2013-03-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Patch by Andrew Shadura, providing better support for
+ * three architectures they have in Debian.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Added "-DNDEBUG" to CFLAGS_DEFAULT
+ when building with --disable-symbols.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3555058]: Checkin [30736d63f0] broke
+ CFLAGS_DEFAULT, LDFLAGS_DEFAULT
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-08-07 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-07-25 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: My previous commit (2012-04-03) broke the ActiveTcl
+ build for AMD64, because of the quotes in "C:/<path>/AMD64/cl.exe".
+ It turns out that the AC_TRY_COMPILE macro cannot handle that.
+
+2012-07-22 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Tidy: consistency, spelling, phrasing, whitespace.
+ No functional change.
+
+2012-04-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806] Compiler checks too early
+ This change allows to build the cygwin and mingw32 ports of
+ Tcl/Tk extensions to build out-of-the-box using a native or
+ cross-compiler, e.g. on Cygwin, Linux or Darwin.
+
+2011-04-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh: Fix issue with library stripping in install-sh
+ (backported from kevin_walzer's patch from Tcl 8.6 trunk)
+
+2011-04-05 Andreas Kupries <andreask@activestate.com>
+
+ * tcl.m4: Applied patch by Jeff Lawson. Nicer error message when
+ tclConfig.sh was not found.
+
+2010-12-15 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * install-sh: Upgrade to newer install-sh and use it.
+ * tcl.m4:
+
+2010-12-14 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Better building on OpenBSD.
+
+2010-12-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: when using gcc, don't try to determine Win64 SDK
+
+2010-12-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Determine correctly a cross-compiler-windres
+
+2010-11-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: add some cross-compile support, borrowed from Tcl 8.6
+
+2010-09-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX LDFLAGS (only used when building big shell)
+
+2010-09-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add extra if check for .manifest file generation
+ Add notice about package name and version being built.
+
+2010-09-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [FREQ #3058486] TEA_LOAD_CONFIG doesn't set all BUILD_ vars
+ Slightly related: defining BUILD_$1 on all platforms - not only win -
+ allows the -fvisibility feature to be used in extensions as well, at
+ least if you compile against tcl >= 8.5.
+
+2010-08-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: ensure safe quoting for autoheader usage
+
+2010-08-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add TEA_ADD_CLEANFILES macro to make adding cleanfiles
+ easier, and add *.exp to CLEANFILES Windows default.
+ (TEA_MAKE_LIB): Enhanced to check for MSVC that requires manifests
+ and auto-embed it into proj DLL via MAKE_SHARED_LIB. Also define
+ VC_MANIFEST_EMBED_DLL and VC_MANIFEST_EMBED_EXE that do the same
+ magic in case it is needed for extended TEA projects.
+
+2010-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.9 ***
+ If upgrading from TEA_VERSION 3.8, copy over tcl.m4, change
+ TEA_INIT to use 3.9 and reconfigure (ac-2.59+).
+ BUILD_${PACKAGE_NAME} will be auto-defined on Windows for
+ correct setting of TCL_STORAGE_CLASS.
+ TEA_LOAD_CONFIG users should remove the SHLIB_LD_LIBS setting done
+ in configure.in (LIBS will be automagically populated by
+ TEA_LOAD_CONFIG).
+ TEA_EXPORT_CONFIG has been added for ${pkg}Config.sh creators
+ SHLIB_LD_FLAGS was deprecated a while ago, remove it if it is
+ still in your Makefile.in.
+
+ * tcl.m4: add /usr/lib64 to set of auto-search dirs. [Bug 1230554]
+ Auto-define BUILD_$PACKAGE_NAME so users don't need to. This
+ needs to correspond with $pkg.h define magic for TCL_STORAGE_CLASS.
+ Auto-define CLEANFILES. Users can expand it.
+ (SHLIB_LD_LIBS): define to '${LIBS}' default and change it only if
+ necessary. Platforms not using this may simply not work or have
+ very funky linkers.
+ (TEA_LOAD_CONFIG): When loading config for another extension,
+ auto-add stub libraries found with TEA_ADD_LIBS. Eases
+ configure.in for modules like itk and img::*.
+ (TEA_EXPORT_CONFIG): Add standardized function for exporting a
+ ${pkg}Config.sh. See use by img::* and itcl.
+
+2010-08-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.8 ***
+ If upgrading from TEA_VERSION 3.7, copy over tcl.m4, change
+ TEA_INIT to use 3.8 and reconfigure (ac-2.59+).
+ No other changes should be necessary.
+
+ * tcl.m4: remove more vestigial bits from removed platforms.
+ Add back SCO_SV-3.2*.
+ Remove use of DL_LIBS and DL_OBJS and related baggage - these are
+ only needed by the core to support 'load'.
+ Allow for macosx in TEA_ADD_SOURCES.
+ Correct check for found_xincludes=no in TEA_PATH_UNIX_X.
+
+2010-08-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove the following old platform configurations:
+ UNIX_SV*|UnixWare-5*, SunOS-4.*, SINIX*5.4*, SCO_SV-3.2*<readded>,
+ OSF1-1.*, NEXTSTEP-*, NetBSD-1.*|FreeBSD-[[1-2]].*, MP-RAS-*,
+ IRIX-5.*, HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*, dgux*,
+ BSD/OS-2.1*|BSD/OS-3*
+ (AIX): drop AIX-pre4 support and use of ldAix, use -bexpall/-brtl
+
+2010-07-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Patch #1055668] removal of exported internals from
+ tclInt.h (EXTERN macro)
+
+2010-04-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4 - Backport a lot of quoting fixes from tcl8.6/unix/tcl.m4
+ - Fix determination of CYGPATH for CYGWIN
+ With those fixes, itcl and tdbc compile fine with CYGWIN
+
+2010-04-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh [Bug 2982540] configure and install* script files
+ should always have LF
+
+2010-02-19 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Correct compiler/linker flags for threaded builds on
+ OpenBSD.
+
+2010-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Detect CYGWIN variant: win32 or unix
+
+2010-01-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tcl.m4 (TEA_CONFIG_CFLAGS): [Tcl Bug 1636685]: Use the
+ configuration for modern FreeBSD suggested by the FreeBSD porter.
+
+2009-10-22 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Tcl Patch #2883533] tcl.m4 support for Haiku OS
+
+2009-04-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): harden the check to add _r to CC on
+ AIX with threads.
+
+2009-04-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): check for 64-bit TkAqua.
+
+2009-03-26 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tclconfig/tcl.m4: Adapt LDFLAGS and LD_SEARCH_FLAGS
+ together with SHLIB_LD definition to unbreak building on HPUX.
+
+2009-03-20 Andreas Kupries <andreask@activestate.com>
+
+ * tclconfig/tcl.m4: Changed SHLIB_LD definition to unbreak
+ building on HPUX.
+
+2009-03-16 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4(TEA_PUBLIC_TK_HEADERS): Look at ${TK_INCLUDE_SPEC}
+ (found in tkConfig.sh) when trying to guess where tk.h might be
+ [Patch 1960628].
+
+2009-03-11 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Allow ${SHLIB_SUFFIX} to be overridden at
+ configure-time [Patch 1960628]. Also fix some comment typos,
+ and an uninitialized variable bug-waiting-to-happen.
+
+2008-12-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 2073255] Tcl_GetString(NULL) doesn't crash on HP-UX
+ (this bug report was for Tcl, but holds for TEA as well.)
+
+2008-12-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: sync with tdbc tcl.m4 changes
+ (SunOS-5.11): Sun cc SHLIB_LD: use LDFLAGS_DEFAULT instead of LDFLAGS
+
+2008-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.7 ***
+
+ * tcl.m4: in private header check, check for <plat>Port.h instead
+ of Int.h to ensure all private headers are available.
+
+2008-11-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): sync TEA_PRIVATE_TK_HEADERS handling of
+ Tk.framework PrivateHeaders with TEA_PRIVATE_TCL_HEADERS.
+
+2008-11-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG, TEA_PATH_TKCONFIG): exit with error
+ when tclConfig.sh cannot be found. [Bug #1997760]
+ (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): allow for
+ finding the headers installed in the public areas, e.g. a result of
+ make install-private-headers. [Bug #1631922]
+
+2008-08-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): link shlib with current and compatiblity version
+ flags; look for libX11.dylib when searching for X11 libraries.
+
+2008-06-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
+
+2008-03-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166]
+
+2008-02-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Updated to work at least in part with
+ more modern VC versions. Currently just made the linker flags more
+ flexible; more work may be needed.
+
+2007-10-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for 64-bit X11.
+
+2007-10-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Tagged tea-3-branch to start TEA 4 development on HEAD ***
+
+2007-09-17 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable'
+ to build shared libraries on current NetBSDs [Bug 1749251].
+
+2007-09-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: replace all direct references to compiler by ${CC} to
+ enable CC overriding at configure & make time.
+ (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by
+ 'cc' compiler driver.
+
+2007-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check Ttk dir for Tk private headers (8.5).
+ Add some comments to other bits.
+
+2007-06-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): move where / is added.
+
+2007-06-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: fix --with-tkinclude alignment. [Bug 1506111]
+
+2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fix 64bit arch removal in fat 32&64bit builds.
+
+2007-05-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4: Added quoting so that paths with spaces cause fewer
+ problems.
+
+2007-03-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in -mmacosx-version-min check.
+
+2007-02-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct private header check to search in generic subdir
+
+2007-02-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.6 ***
+
+ * tcl.m4: correct -d to -f
+ (TEA_CONFIG_CFLAGS): SHLIB_SUFFIX is .so on HP ia64 [Bug 1615058]
+
+2007-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): check
+ that the dirs actually have private headers. [Bug 1631922]
+
+2007-02-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching to -pipe check.
+
+2007-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and
+ move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to
+ avoid errors about multiple -isysroot flags from some older gcc builds.
+
+2006-01-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861]
+ (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
+ present in CFLAGS to avoid discrepancies between what headers configure
+ sees during preprocessing tests and compiling tests.
+
+2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch flag
+ succeeds before enabling 64bit build.
+
+2006-12-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): fix previous change to use makefile variable
+ LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker
+ flags in sampleextension Makefile are picked up.
+
+2006-11-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558]
+
+2006-08-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
+ universal builds including x86_64 and for use of -mmacosx-version-min
+ instead of MACOSX_DEPLOYMENT_TARGET. For Tk extensions, remove 64-bit
+ arch flags from CFLAGS like in the Tk configure, as neither TkAqua nor
+ TkX11 can be built for 64-bit at present.
+
+2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: []-quote AC_DEFUN functions.
+ (TEA_PATH_TKCONFIG): Fixed Windows-specific check for tkConfig.sh.
+ (TEA_MAKE_LIB): Prepend 'lib' for Windows-gcc configs.
+
+2006-03-07 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD,
+ as per the other *BSD variants [Bug 1334613].
+
+2006-01-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA version 3.5 ***
+
+ * tcl.m4: keep LD_SEARCH_FLAGS and CC_SEARCH_FLAGS synchronous
+ with core tcl.m4 meaning.
+
+2006-01-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): use makefile variable LDFLAGS_DEFAULT instead of
+ LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile
+ are picked up. [Bug 1403343]
+
+2006-01-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add C:/Tcl/lib and C:/Progra~1/Tcl/lib dirs to check for
+ *Config.sh on Windows. [Bug 1407544]
+
+2006-01-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): for Tk extensions, remove -arch ppc64 from CFLAGS
+ like in the Tk configure, as neither TkAqua nor TkX11 can be built for
+ 64bit at present (no 64bit GUI libraries).
+
+2006-01-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: restore system=windows on Windows.
+ Remove error if 'ar' isn't found (it may not be on Windows).
+ Do not add -lxnet or define _XOPEN_SOURCE on HP-UX by default.
+ Ensure the C|LDFLAGS_DEFAULT gets the fully sub'd value at
+ configure time.
+
+2006-01-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching, use AC_CACHE_CHECK instead of AC_CACHE_VAL
+ where possible, consistent message quoting, sync relevant
+ tcl/unix/tcl.m4 HEAD changes and gratuitous formatting differences
+ (notably sunc removal of support for for ancient BSD's, IRIX 4,
+ RISCos and Ultrix by kennykb), Darwin improvements to
+ TEA_LOAD_*CONFIG to make linking work against Tcl/Tk frameworks
+ installed in arbitrary location, change TEA_PROG_* search order
+ (look in *_BIN_DIR parents before *_PREFIX).
+
+2006-01-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add dkf's system config refactor
+
+2006-01-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove extraneous ' that causes bash 3.1 to choke
+
+2005-12-19 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG &c): Look for tclConfig.sh &c
+ in ${libdir}, where they are installed by default [Patch #1377407].
+
+2005-12-05 Don Porter <dgp@users.sf.net>
+
+ * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding
+ header files for uninstalled Tcl and Tk.
+
+2005-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correctly bump TEA_VERSION var to 3.4
+
+2005-12-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
+
+2005-11-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Bump to TEA version 3.4 ***
+ Add Windows x64 build support.
+ Remove TEA_PATH_NOSPACE and handle the problem with ""s where
+ necessary - the macro relied on TCLSH_PROG which didn't work for
+ cross-compiles.
+
+2005-11-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to
+ support passing -isysroot in env(CFLAGS) to configure (flag can't
+ be present twice, so can't be in both CFLAGS and LDFLAGS during
+ configure), don't use -prebind when deploying on 10.4.
+ (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching.
+
+2005-10-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that
+ should have been for `uname -s` = "Darwin" instead; added some
+ missing quoting.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that
+ install location of tclConfig.sh/tkConfig.sh allows to determine
+ the tclsh/wish install dir via ../bin. Indeed tcl/tk can be
+ configured with arbitrary --libdir and --bindir (independent of
+ prefix) and such a configuration is in fact standard with Darwin
+ framework builds. At least now also check ${TCL_PREFIX}/bin
+ resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk
+ have been configured with arbitrary --bindir, this will still not
+ find them, for a general solution *Config.sh would need to contain
+ the values of bindir/libdir/includedir passed to configure).
+
+2005-10-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds.
+
+2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro
+ (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func
+
+2005-09-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Update to TEA version 3.3 ***
+ define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG.
+ Make --enable-threads the default (users can --disable-threads).
+ Improve AIX ${CC}_r fix to better check existing ${CC} value.
+ Do the appropriate evals to not require the *TOP_DIR_NATIVE vars
+ be set for extensions that use private headers.
+ Make aqua check for Xlib compat headers the same as win32.
+
+2005-07-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH): Remove
+ TEA_BUILD_TCLSH and TEA_BUILD_WISH because
+ of complaints that it broke the build when
+ only an installed version of Tcl was available
+ at extension build time. The TEA_PROG_TCLSH and
+ TEA_PROG_WISH macros will no longer search the
+ path at all. The build tclsh or installed
+ tclsh shell will now be found by TEA_PROG_TCLSH.
+
+2005-07-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH):
+ Split confused search for tclsh on PATH and
+ build and install locations into two macros.
+ TEA_PROG_TCLSH and TEA_PROG_WISH search the
+ system PATH for an installed tclsh or wish.
+ The TEA_BUILD_TCLSH and TEA_BUILD_WISH
+ macros determine the name of tclsh or
+ wish in the Tcl or Tk build directory even
+ if tclsh or wish has not yet been built.
+ [Tcl bug 1160114]
+ [Tcl patch 1244153]
+
+2005-06-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to
+ TK_INCLUDES when building against TkAqua.
+
+ * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE
+
+ * tcl.m4: changes to better support framework builds of Tcl and Tk out
+ of the box: search framework install locations for *Config.sh, and if in
+ presence of a framework build, use the framework's Headers and
+ PrivateHeaders directories for public and private includes. [FR 947735]
+
+2005-06-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to
+ ensure we can always relocate binaries with install_name_tool.
+
+2005-06-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib
+ compat headers are available in tkheaders location, otherwise add xlib
+ sourcedir to TK_XINCLUDES.
+
+2005-04-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow
+ use with autoheader.
+ (Darwin): added configure checks for recently added linker flags
+ -single_module and -search_paths_first to allow building with older
+ tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD.
+ (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check.
+ (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4).
+
+2005-03-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide
+ int type only on Windows when __int64 is detected as valid.
+
+2005-03-24 Don Porter <dgp@users.sf.net>
+
+ * README.txt: Update reference to "SC_* macros" to "TEA_* macros".
+ * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG
+ and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG.
+ Corrected search path in TEA_PATH_CONFIG and added
+ AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load
+ the configuration of another package can know where they loaded
+ it from.
+
+2005-03-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have
+ variant LD_SEARCH_FLAGS for gcc and cc builds.
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check.
+
+2005-03-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Correct gcc build and HP-UX-11.
+
+2005-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -.
+ (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build.
+ (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed).
+
+2005-02-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: redo of 2005-01-27 changes to correctly handle paths
+ with spaces. Win/CE and Win/64 builds now require a prebuilt
+ tclsh to handle conversion to short pathnames. This is done in
+ the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the
+ compiler and move the necessary includes to CFLAGS.
+ (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to
+ be set in the env and prevent resetting.
+ (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib
+ args to -lfoo, for use with mingw.
+ *** POTENTIAL INCOMPATABILITY ***
+ (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box.
+ Bumped TEA to 3.2.
+
+2005-01-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove cygpath calls to support msys.
+ Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003".
+ Make STLIB_LD use $LINKBIN -lib.
+
+2005-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fixed bug with static build linking to dynamic
+ library in /usr/lib etc instead of linking to static library earlier
+ in search path. [Tcl Bug 956908]
+ Removed obsolete references to Rhapsody.
+
+2004-12-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS
+ options, using better default -O levels. [Bug 1092952, 1091967]
+
+2004-12-29 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Do not use ${DBGX} suffix when building
+ shared libraries [patch #1081595, TIP #34]
+
+2004-09-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds
+
+2004-08-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to
+ work around subdir configures since autoconf only propagates the
+ prefix (not exec_prefix).
+
+2004-07-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with
+ Tcl 8.5 HEAD config, removed core specific & obsolete settings.
+
+2004-07-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if
+ we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that
+ reflects 'tk windowingsystem' value.
+
+2004-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when
+ building against a threaded core.
+ (CFLAGS_WARNING): Remove -Wconversion for gcc builds
+ (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build
+ configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058]
+ Update to latest Tcl 8.5 head config settings.
+ Call this TEA version 3.1.
+
+2004-04-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with
+ AC_TRY_COMPILE for the long vs. long long check. (kenny)
+
+2004-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to
+ define TCL_WIDE_INT_IS_LONG if 'using long'.
+
+2004-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB
+
+2004-02-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it
+ doesn't need the eval.
+
+2004-02-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the
+ DIR_NATIVE vars defined when using private headers on unix.
+ Allow $... to TEA_ADD_SOURCES for constructs like
+ TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to
+ place more in the Makefile.in.
+ tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+ CHECK on limits.h
+
+2003-12-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and
+ * configure: TEA_ADD_CFLAGS to configurable parameters with
+ * configure.in: PKG_* equivs in the Makefile. This allows the
+ * tclconfig/tcl.m4: user to worry less about actual magic VAR names.
+ Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires
+ exact file names.
+
+2003-12-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff)
+
+2003-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure:
+ * configure.in:
+ * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the
+ first part of VPATH can get chopped off.
+ Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes.
+ * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub
+ generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as
+ the way the user specifies library files.
+
+2003-12-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure: Update of TEA spec to (hopefully) simplify
+ * configure.in: some aspects of TEA by making use of more
+ * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead
+ * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of
+ * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA
+ package name and version.
+ Provide a version argument to TEA_INIT - starting with 3.0.
+ Drop all use of interior shell substs that older makefiles didn't
+ like. Use PKG_* naming convention instead.
+ Move specification of source files and public headers into
+ configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will
+ be munged during ./configure into the right obj file names (no
+ $(SOURCES:.c=.obj) needed).
+ There is almost nothing that should be touched in Makefile.in now
+ for the developer. May want to add a TEA_ADD_TCL_SOURCES for the
+ RUNTIME_SOURCES that remains.
+ Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does.
+ Only specify the user requested LDFLAGS/CFLAGS in the Makefile,
+ don't mention the _OPTIMIZE/_DEBUG variants.
+
+2003-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the
+ TEA_SETUP_COMPILER macro. They are split so the check for CC
+ occurs before any use of CC. Also add AC_PROG_CPP to the compiler
+ checks.
+
+2003-10-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updated for autoconf 2.5x prereq.
+ Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks
+ in tcl.h, which also handles TCL_LL_MODIFIER* properly.
+
+2003-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct default setting of ARCH for WinCE builds.
+ Correct \ escaping for CE sed macros.
+
+2003-04-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: replace $(syscal) construct with older `syscall` for
+ systems where sh != bash.
+
+2003-04-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib
+ options for Windows/CE compilation support. Requires the
+ Microsoft eMbedded SDK and Keuchel's celib emulation layer.
+
+2003-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on
+ the link line when checking for the pthread_attr_setstacksize
+ symbol. (dejong)
+
+ * tcl.m4 (TEA_SETUP_COMPILER): added default calls to
+ TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS,
+ TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD.
+
+2003-02-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX ia64 --enable-64bit build flags
+
+2003-01-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when
+ looking for tcl|tkConfig.sh, as this check is done before we would
+ set exec_prefix when the user does not define it.
+
+2003-01-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support
+ for mingw, the previous implementation would
+ use VC++ when compiling with mingw gcc. Don't
+ pass -fPIC since gcc always compiles pic code
+ under win32. Change some hard coded cases
+ of gcc to ${CC}.
+
+2002-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to
+ TEA_MAKE_LIB because setting too early confuses other AC_* macros.
+ Correct the HP-11 SHLIB_LD_LIBS setting.
+
+ * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and
+ make it pick up the env CFLAGS at configure time.
+
+2002-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG.
+ Improved AIX 64-bit build support, allow it on AIX-4 as well.
+ Enable 64-bit HP-11 compilation with gcc.
+ Enable 64-bit IRIX64-6 cc build support.
+ Correct FreeBSD thread library linkage.
+ Add OSF1 static build support.
+ Improve SunOS-5 shared build SHLIB_LD macro.
+
+2002-07-20 Zoran Vasiljevic <zoran@archiware.com>
+
+ * tcl.m4: Added MINGW32 to list of systems checked for Windows build.
+ Also, fixes some indentation issues with "--with-XXX" options.
+
+2002-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to
+ use new threaded allocatory by default on Unix for Tcl 8.4.
+ (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+.
+
+2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that
+ we can use autoconf 2.5x as well as 2.13. This prevents us from
+ being able to warn against the use of cygwin gcc at configure
+ time, but allows autoconf 2.5x, which is what is shipped with most
+ newer systems.
+
+2002-04-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Enabled COFF as well as CV style debug info with
+ --enable-symbols to allow Dr. Watson users to see function info.
+ More info on debugging levels can be obtained at:
+ http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+
+2002-04-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for
+ Scriptics, which is no more. TEA represents a better, independent
+ prefix that won't need changing.
+ Added preliminary mingw gcc support. [Patch #538772]
+ Added TEA_PREFIX macro that handles defaulting the prefix and
+ exec_prefix vars to those used by Tcl if none were specified.
+ Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC
+ check and several other basic AC_PROG checks needed for making
+ executables. This greatly simplifies user's configure.in files.
+ Collapsed AIX-5 defines into AIX-* with extra checks for doing the
+ ELF stuff on AIX-5-ia64.
+ Updated TEA_ENABLE_THREADS to take an optional arg to allow
+ switching it on by default (for Thread) and add sanity checking to
+ warn the user if configuring threads incompatibly.
+
+2002-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT.
+ Removed --enable-64bit support for AIX-4 because it wasn't correct.
+ Added -MT or -MD Windows linker switches to properly support
+ symbols-enabled builds.
+
+2002-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first
+ instead of calling it as that inlines it each time in shell code.
+ Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti.
+ Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds.
+ A few changes to support itcl (and perhaps others):
+ Added support for making your own stub libraries to SC_MAKE_LIB.
+ New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg
+ and find that ${pkg}Config.sh file. itk uses this for itcl.
+
+2002-03-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk
+ build dir setup.
+ Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS.
+ Added XLIBSW onto LIBS when it is defined.
+ Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS
+ instead to not rely as much on tclConfig.sh cached info.
+ Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH.
+ These move towards making TEA much more independent of *Config.sh.
+
+2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and
+ SHLIB_SUFFIX defines for Win.
+ (SC_PATH_X): made this only do the check on unix platforms.
+
+2002-03-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README.txt: updated to reflect fewer files
+
+2002-03-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * config.guess (removed):
+ * config.sub (removed): removed unnecessary files
+
+ * installFile.tcl (removed):
+ * mkinstalldirs (removed): these aren't really necessary for
+ making TEA work
+
+ * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't
+ check /usr(/local)/include for includes on Windows when not using
+ gcc
+
+2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: added warnings on Windows, removed RELPATH define and
+ added TCL_LIBS to MAKE_LIB macro.
+
+ This import represents 2.0.0, or a new start at attempting to
+ make TEA much easier for C extension developers.
+
+ **** moved from tclpro project to core tcl project, ****
+ **** renamed to 'tclconfig' ****
+
+2001-03-15 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added updating of the modification time of
+ the target file whether we overwrote it or decided that it
+ hadn't changed. This was necessary for us to be able to
+ determine whether or not a module install touched the file.
+
+2001-03-08 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added support for converting new-style (1.1+)
+ Cygnus drive paths to Tcl-style.
+
+2001-01-15 <brent.welch@interwoven.com>
+
+ * tcl.m4: Added FreeBSD clause.
+
+2001-01-03 <brent.welch@interwoven.com>
+
+ * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking
+ for exec-prefix.
+
+2000-12-01 <brent.welch@interwoven.com>
+
+ * tcl.m4: Concatenated most of the Ajuba acsite.m4 file
+ so we don't need to modify the autoconf installation.
+ * config.guess:
+ * config.sub:
+ * installFile.tcl:
+ Added files from the itcl config subdirectory,
+ which should go away.
+
+2000-7-29 <welch@ajubasolutions.com>
+
+ * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within
+ TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent
+ change from $(srcdir) to $(srcdir)/..
diff --git a/ds9/unix/tclconfig/README.txt b/ds9/unix/tclconfig/README.txt
new file mode 100644
index 0000000..59b5a3e
--- /dev/null
+++ b/ds9/unix/tclconfig/README.txt
@@ -0,0 +1,26 @@
+These files comprise the basic building blocks for a Tcl Extension
+Architecture (TEA) extension. For more information on TEA see:
+
+ http://www.tcl.tk/doc/tea/
+
+This package is part of the Tcl project at SourceForge, and latest
+sources should be available there:
+
+ http://tcl.sourceforge.net/
+
+This package is a freely available open source package. You can do
+virtually anything you like with it, such as modifying it, redistributing
+it, and selling it either in whole or in part.
+
+CONTENTS
+========
+The following is a short description of the files you will find in
+the sample extension.
+
+README.txt This file
+
+install-sh Program used for copying binaries and script files
+ to their install locations.
+
+tcl.m4 Collection of Tcl autoconf macros. Included by a package's
+ aclocal.m4 to define TEA_* macros.
diff --git a/ds9/unix/tclconfig/install-sh b/ds9/unix/tclconfig/install-sh
new file mode 100755
index 0000000..7c34c3f
--- /dev/null
+++ b/ds9/unix/tclconfig/install-sh
@@ -0,0 +1,528 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-04-20.01; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -S $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -S) stripcmd="$stripprog $2"
+ shift;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ds9/unix/tclconfig/tcl.m4 b/ds9/unix/tclconfig/tcl.m4
new file mode 100644
index 0000000..8bc9c83
--- /dev/null
+++ b/ds9/unix/tclconfig/tcl.m4
@@ -0,0 +1,4150 @@
+# tcl.m4 --
+#
+# This file provides a set of autoconf macros to help TEA-enable
+# a Tcl extension.
+#
+# Copyright (c) 1999-2000 Ajuba Solutions.
+# Copyright (c) 2002-2005 ActiveState Corporation.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+AC_PREREQ(2.57)
+
+dnl TEA extensions pass us the version of TEA they think they
+dnl are compatible with (must be set in TEA_INIT below)
+dnl TEA_VERSION="3.9"
+
+# Possible values for key variables defined:
+#
+# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
+# TEA_PLATFORM - windows unix
+#
+
+#------------------------------------------------------------------------
+# TEA_PATH_TCLCONFIG --
+#
+# Locate the tclConfig.sh file and perform a sanity check on
+# the Tcl compile flags
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the directory containing
+# the tclConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TCLCONFIG], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+ AC_ARG_WITH(tcl,
+ AC_HELP_STRING([--with-tcl],
+ [directory containing tcl configuration (tclConfig.sh)]),
+ with_tclconfig="${withval}")
+ AC_MSG_CHECKING([for Tcl configuration])
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_TKCONFIG --
+#
+# Locate the tkConfig.sh file
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tk=...
+#
+# Defines the following vars:
+# TK_BIN_DIR Full path to the directory containing
+# the tkConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TKCONFIG], [
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+ AC_ARG_WITH(tk,
+ AC_HELP_STRING([--with-tk],
+ [directory containing tk configuration (tkConfig.sh)]),
+ with_tkconfig="${withval}")
+ AC_MSG_CHECKING([for Tk configuration])
+ AC_CACHE_VAL(ac_cv_c_tkconfig,[
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TCLCONFIG --
+#
+# Load the tclConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TCL_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_BIN_DIR
+# TCL_SRC_DIR
+# TCL_LIB_FILE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TCLCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
+ AC_SUBST(TCL_PATCH_LEVEL)
+ AC_SUBST(TCL_BIN_DIR)
+ AC_SUBST(TCL_SRC_DIR)
+
+ AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
+
+ AC_MSG_CHECKING([platform])
+ hold_cc=$CC; CC="$TCL_CC"
+ AC_TRY_COMPILE(,[
+ #ifdef _WIN32
+ #error win32
+ #endif
+ ], TEA_PLATFORM="unix",
+ TEA_PLATFORM="windows"
+ )
+ CC=$hold_cc
+ AC_MSG_RESULT($TEA_PLATFORM)
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+ AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [],
+ [Building extension source?])
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+ AC_SUBST(CLEANFILES)
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(TCL_DEFS)
+ AC_SUBST(TCL_EXTRA_CFLAGS)
+ AC_SUBST(TCL_LD_FLAGS)
+ AC_SUBST(TCL_SHLIB_LD_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TKCONFIG --
+#
+# Load the tkConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TK_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tkConfig.sh:
+# TK_BIN_DIR
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TKCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+ AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+ AC_SUBST(TK_VERSION)
+ AC_SUBST(TK_BIN_DIR)
+ AC_SUBST(TK_SRC_DIR)
+
+ AC_SUBST(TK_LIB_FILE)
+ AC_SUBST(TK_LIB_FLAG)
+ AC_SUBST(TK_LIB_SPEC)
+
+ AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TK_STUB_LIB_FLAG)
+ AC_SUBST(TK_STUB_LIB_SPEC)
+
+ # TEA specific:
+ AC_SUBST(TK_LIBS)
+ AC_SUBST(TK_XINCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_TCLSH
+# Determine the fully qualified path name of the tclsh executable
+# in the Tcl build directory or the tclsh installed in a bin
+# directory. This macro will correctly determine the name
+# of the tclsh executable even if tclsh has not yet been
+# built in the build directory. The tclsh found is always
+# associated with a tclConfig.sh file. This tclsh should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# TCLSH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_TCLSH], [
+ AC_MSG_CHECKING([for tclsh])
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ # tclConfig.sh is in Tcl build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
+ fi
+ else
+ # tclConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
+ fi
+ list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${TCLSH_PROG}" ; then
+ REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
+ fi
+ AC_MSG_RESULT([${TCLSH_PROG}])
+ AC_SUBST(TCLSH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_WISH
+# Determine the fully qualified path name of the wish executable
+# in the Tk build directory or the wish installed in a bin
+# directory. This macro will correctly determine the name
+# of the wish executable even if wish has not yet been
+# built in the build directory. The wish found is always
+# associated with a tkConfig.sh file. This wish should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# WISH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_WISH], [
+ AC_MSG_CHECKING([for wish])
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ # tkConfig.sh is in Tk build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="${TK_BIN_DIR}/wish"
+ fi
+ else
+ # tkConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
+ fi
+ list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${WISH_PROG}" ; then
+ REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
+ fi
+ AC_MSG_RESULT([${WISH_PROG}])
+ AC_SUBST(WISH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SHARED --
+#
+# Allows the building of shared libraries
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-shared=yes|no
+#
+# Defines the following vars:
+# STATIC_BUILD Used for building import/export libraries
+# on Windows.
+#
+# Sets the following vars:
+# SHARED_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SHARED], [
+ AC_MSG_CHECKING([how to build libraries])
+ AC_ARG_ENABLE(shared,
+ AC_HELP_STRING([--enable-shared],
+ [build and link with shared libraries (default: on)]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([shared])
+ SHARED_BUILD=1
+ else
+ AC_MSG_RESULT([static])
+ SHARED_BUILD=0
+ AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
+ fi
+ AC_SUBST(SHARED_BUILD)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled. If "yes" is specified
+# as an arg (optional), threads are enabled by default, "no" means
+# threads are disabled. "yes" is the default.
+#
+# TCL_THREADS is checked so that if you are compiling an extension
+# against a threaded core, your extension must be compiled threaded
+# as well.
+#
+# Note that it is legal to have a thread enabled extension run in a
+# threaded or non-threaded Tcl core, but a non-threaded extension may
+# only run in a non-threaded Tcl core.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads
+#
+# Sets the following vars:
+# THREADS_LIBS Thread library(s)
+#
+# Defines the following vars:
+# TCL_THREADS
+# _REENTRANT
+# _THREAD_SAFE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_THREADS], [
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads],
+ [build with threads]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ # We are always OK on Windows, so check what this platform wants:
+
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC, 1,
+ [Do we want to use the threaded memory allocator?])
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+ fi
+ AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
+ fi
+ fi
+ fi
+ fi
+ fi
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ AC_MSG_CHECKING([for building with threads])
+ if test "${TCL_THREADS}" = 1; then
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
+ AC_MSG_RESULT([yes (default)])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ # TCL_THREADS sanity checking. See if our request for building with
+ # threads is the same as the way Tcl was built. If not, warn the user.
+ case ${TCL_DEFS} in
+ *THREADS=1*)
+ if test "${TCL_THREADS}" = "0"; then
+ AC_MSG_WARN([
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads.])
+ fi
+ ;;
+ *)
+ if test "${TCL_THREADS}" = "1"; then
+ AC_MSG_WARN([
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core.])
+ fi
+ ;;
+ esac
+ AC_SUBST(TCL_THREADS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SYMBOLS --
+#
+# Specify if debugging symbols should be used.
+# Memory (TCL_MEM_DEBUG) debugging can also be enabled.
+#
+# Arguments:
+# none
+#
+# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
+# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
+# Requires the following vars to be set in the Makefile:
+# CFLAGS_DEFAULT
+# LDFLAGS_DEFAULT
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-symbols
+#
+# Defines the following vars:
+# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
+# Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false
+# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
+# Sets to $(LDFLAGS_OPTIMIZE) if false
+# DBGX Formerly used as debug library extension;
+# always blank now.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SYMBOLS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_CONFIG_CFLAGS])
+ AC_MSG_CHECKING([for build with symbols])
+ AC_ARG_ENABLE(symbols,
+ AC_HELP_STRING([--enable-symbols],
+ [build with debugging symbols (default: off)]),
+ [tcl_ok=$enableval], [tcl_ok=no])
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ AC_MSG_RESULT([no])
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ AC_MSG_RESULT([yes (standard debugging)])
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+ AC_SUBST(CFLAGS_DEFAULT)
+ AC_SUBST(LDFLAGS_DEFAULT)
+ AC_SUBST(TCL_DBGX)
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ AC_MSG_RESULT([enabled symbols mem debugging])
+ else
+ AC_MSG_RESULT([enabled $tcl_ok debugging])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_LANGINFO --
+#
+# Allows use of modern nl_langinfo check for better l10n.
+# This is only relevant for Unix.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-langinfo=yes|no (default is yes)
+#
+# Defines the following vars:
+# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_LANGINFO], [
+ AC_ARG_ENABLE(langinfo,
+ AC_HELP_STRING([--enable-langinfo],
+ [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
+
+ HAVE_LANGINFO=0
+ if test "$langinfo_ok" = "yes"; then
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
+ fi
+ AC_MSG_CHECKING([whether to use nl_langinfo])
+ if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h, [
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
+ AC_MSG_RESULT([$tcl_cv_langinfo_h])
+ if test $tcl_cv_langinfo_h = yes; then
+ AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
+ fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_SYSTEM
+#
+# Determine what the system is (some things cannot be easily checked
+# on a feature-driven basis, alas). This can usually be done via the
+# "uname" command.
+#
+# Arguments:
+# none
+#
+# Results:
+# Defines the following var:
+#
+# system - System/platform/version identification code.
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_SYSTEM], [
+ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ AC_MSG_WARN([can't find uname command])
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+ ])
+ system=$tcl_cv_sys_version
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_CFLAGS
+#
+# Try to determine the proper flags to pass to the compiler
+# for building shared libraries and other such nonsense.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substitutes the following vars:
+#
+# DL_OBJS, DL_LIBS - removed for TEA, only needed by core.
+# LDFLAGS - Flags to pass to the compiler when linking object
+# files into an executable application binary such
+# as tclsh.
+# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile. Could
+# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
+# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile.
+# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
+# of a shared library (may request position-independent
+# code, among other things).
+# SHLIB_LD - Base command to use for combining object files
+# into a shared library.
+# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
+# creating shared libraries. This symbol typically
+# goes at the end of the "ld" commands that build
+# shared libraries. The value of the symbol defaults to
+# "${LIBS}" if all of the dependent libraries should
+# be specified when creating a shared library. If
+# dependent libraries should not be specified (as on
+# SunOS 4.x, where they cause the link to fail, or in
+# general if Tcl and Tk aren't themselves shared
+# libraries), then this symbol has an empty string
+# as its value.
+# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
+# extensions. An empty string means we don't know how
+# to use shared libraries on this platform.
+# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
+# in a static or shared library name, using the $PACKAGE_VERSION variable
+# to put the version in the right place. This is used
+# by platforms that need non-standard library names.
+# Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs
+# to have a version after the .so, and ${PACKAGE_VERSION}.a
+# on AIX, since a shared library needs to have
+# a .a extension whereas shared objects for loadable
+# extensions have a .so extension. Defaults to
+# ${PACKAGE_VERSION}${SHLIB_SUFFIX}.
+# CFLAGS_DEBUG -
+# Flags used when running the compiler in debug mode
+# CFLAGS_OPTIMIZE -
+# Flags used when running the compiler in optimize mode
+# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_CFLAGS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+
+ # Step 0.a: Enable 64 bit support?
+
+ AC_MSG_CHECKING([if 64bit support is requested])
+ AC_ARG_ENABLE(64bit,
+ AC_HELP_STRING([--enable-64bit],
+ [enable 64bit support (default: off)]),
+ [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT([$do64bit])
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
+ AC_ARG_ENABLE(64bit-vis,
+ AC_HELP_STRING([--enable-64bit-vis],
+ [enable 64bit Sparc VIS support (default: off)]),
+ [do64bitVIS=$enableval], [do64bitVIS=no])
+ AC_MSG_RESULT([$do64bitVIS])
+ # Force 64bit on with VIS
+ AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ AC_CACHE_CHECK([if compiler supports visibility "hidden"],
+ tcl_cv_cc_visibility_hidden, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ AC_TRY_LINK([
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
+ ])
+
+ # Step 0.d: Disable -rpath support?
+
+ AC_MSG_CHECKING([if rpath support is requested])
+ AC_ARG_ENABLE(rpath,
+ AC_HELP_STRING([--disable-rpath],
+ [disable rpath support (default: on)]),
+ [doRpath=$enableval], [doRpath=yes])
+ AC_MSG_RESULT([$doRpath])
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ AS_IF([test "${TEA_PLATFORM}" = windows], [
+ AC_MSG_CHECKING([if Windows/CE build is requested])
+ AC_ARG_ENABLE(wince,
+ AC_HELP_STRING([--enable-wince],
+ [enable Win/CE support (where applicable)]),
+ [doWince=$enableval], [doWince=no])
+ AC_MSG_RESULT([$doWince])
+ ])
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+ TEA_CONFIG_SYSTEM
+
+ # Require ranlib early so we can override it in special cases below.
+
+ AC_REQUIRE([AC_PROG_RANLIB])
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+ ], [
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+ ])
+ AC_CHECK_TOOL(AR, ar)
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION="1.0"])
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
+ AC_MSG_WARN([Ensure latest Platform SDK is installed])
+ do64bit="no"
+ else
+ AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
+ fi
+ if test "$GCC" = "yes" ; then
+ AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
+ fi
+ TEA_PATH_CELIB
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
+ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
+ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
+ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+ TEA_ADD_LIBS([bufferoverflowU.lib])
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+ AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
+ done
+ AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
+ AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+ AC_SUBST(CELIB_DIR)
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ AC_CHECK_TOOL(RC, windres)
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ AC_CACHE_CHECK(for cross-compile version of gcc,
+ ac_cv_cross,
+ AC_TRY_COMPILE([
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+ ], [],
+ ac_cv_cross=yes,
+ ac_cv_cross=no)
+ )
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
+ ;;
+ esac
+ AC_MSG_RESULT([Using $CC for compiling with threads])
+ ])
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+ ])
+ ])
+
+ AS_IF([test "`uname -m`" = ia64], [
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ AS_IF([test "$GCC" = yes], [
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ ], [
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+ ])
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ], [
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+ ], [
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+ ])
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ AS_IF([test "`uname -m`" = ia64], [
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+ ], [
+ SHLIB_SUFFIX=".sl"
+ ])
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ AS_IF([test "$tcl_ok" = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ ])
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ ])
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = "yes"], [
+ AS_IF([test "$GCC" = yes], [
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ;;
+ esac
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+ ])
+ ]) ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+ ], [
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+ ])
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported by gcc])
+ ], [
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+ ])
+ ])
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
+ AS_IF([test $do64bit = yes], [
+ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_m64 = yes], [
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+ ])
+ ])
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+ ])
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$[@]"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
+ AS_IF([test $do64bit = yes], [
+ case `arch` in
+ ppc)
+ AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
+ tcl_cv_cc_arch_ppc64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+ tcl_cv_cc_arch_ppc64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+ ]);;
+ i386)
+ AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
+ tcl_cv_cc_arch_x86_64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+ tcl_cv_cc_arch_x86_64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+ ]);;
+ *)
+ AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
+ esac
+ ], [
+ # Check for combined 32-bit and 64-bit fat build
+ AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
+ fat_32_64=yes])
+ ])
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_single_module = yes], [
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+ ])
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
+ LDFLAGS="$LDFLAGS -prebind"])
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
+ tcl_cv_ld_search_paths_first, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
+ tcl_cv_ld_search_paths_first=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ ])
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [__private_extern__],
+ [Compiler support for module scope symbols])
+ tcl_cv_cc_visibility_hidden=yes
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
+ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
+ tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [
+ AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ AC_TRY_LINK([#include <tk.h>], [Tk_InitStubs(NULL, "", 0);],
+ tcl_cv_lib_tk_64=yes, tcl_cv_lib_tk_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [
+ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done])
+ ])
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+ AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
+ [Should OS/390 do the right thing with sockets?])
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ AS_IF([test "$SHARED_BUILD" = 1], [
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ ], [
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ ])
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ AS_IF([test "${TCL_THREADS}" = 1], [
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ AS_IF([test "$GCC" = yes], [
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ ], [
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ])
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ ], [
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ ])
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[[0-6]])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ arch=`isainfo`
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ AS_IF([test "$GCC" = yes], [
+ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+ ])
+ ], [
+ do64bit_ok=yes
+ AS_IF([test "$do64bitVIS" = yes], [
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+ ], [
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+ ])
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+ ])
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
+ esac
+ ], [
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+ ])
+ ], [AC_MSG_WARN([64bit mode not supported for $arch])])])
+ ])
+
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "$do64bit_ok" = yes], [
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+ ])])
+ ])
+ ], [
+ case $system in
+ SunOS-5.[[1-9]][[0-9]]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ])
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_Bexport = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
+ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
+ ])
+
+dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
+dnl # until the end of configure, as configure's compile and link tests use
+dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
+dnl # preprocessing tests use only CPPFLAGS.
+ AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac])
+
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [extern],
+ [No Compiler support for module scope symbols])
+ ])
+
+ AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
+ AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ AC_CACHE_CHECK(for SEH support in compiler,
+ tcl_cv_seh,
+ AC_TRY_RUN([
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+ ],
+ tcl_cv_seh=yes,
+ tcl_cv_seh=no,
+ tcl_cv_seh=no)
+ )
+ if test "$tcl_cv_seh" = "no" ; then
+ AC_DEFINE(HAVE_NO_SEH, 1,
+ [Defined when mingw does not support SEH])
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
+ tcl_cv_eh_disposition,
+ AC_TRY_COMPILE([
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+ ],[
+ EXCEPTION_DISPOSITION x;
+ ],
+ tcl_cv_eh_disposition=yes,
+ tcl_cv_eh_disposition=no)
+ )
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+ AC_DEFINE(EXCEPTION_DISPOSITION, int,
+ [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ AC_CACHE_CHECK(for winnt.h that ignores VOID define,
+ tcl_cv_winnt_ignore_void,
+ AC_TRY_COMPILE([
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+ ], [
+ CHAR c;
+ SHORT s;
+ LONG l;
+ ],
+ tcl_cv_winnt_ignore_void=yes,
+ tcl_cv_winnt_ignore_void=no)
+ )
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+ AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
+ [Defined when cygwin/mingw ignores VOID define in winnt.h])
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_TRY_COMPILE([],
+ [
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ],
+ tcl_cv_cast_to_union=yes,
+ tcl_cv_cast_to_union=no)
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
+
+ AC_SUBST(CFLAGS_DEBUG)
+ AC_SUBST(CFLAGS_OPTIMIZE)
+ AC_SUBST(CFLAGS_WARNING)
+
+ AC_SUBST(STLIB_LD)
+ AC_SUBST(SHLIB_LD)
+
+ AC_SUBST(SHLIB_LD_LIBS)
+ AC_SUBST(SHLIB_CFLAGS)
+
+ AC_SUBST(LD_LIBRARY_PATH_VAR)
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+ TEA_TCL_EARLY_FLAGS
+ TEA_TCL_64BIT_FLAGS
+])
+
+#--------------------------------------------------------------------
+# TEA_SERIAL_PORT
+#
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
+# USE_TERMIOS
+# USE_TERMIO
+# USE_SGTTY
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_SERIAL_PORT], [
+ AC_CHECK_HEADERS(sys/modem.h)
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
+ AC_TRY_RUN([
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
+ termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
+ sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_MISSING_POSIX_HEADERS
+#
+# Supply substitutes for missing POSIX header files. Special
+# notes:
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod in some versions of SunOS
+# - some versions of string.h don't declare procedures such
+# as strstr
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# NO_DIRENT_H
+# NO_ERRNO_H
+# NO_VALUES_H
+# HAVE_LIMITS_H or NO_LIMITS_H
+# NO_STDLIB_H
+# NO_STRING_H
+# NO_SYS_WAIT_H
+# NO_DLFCN_H
+# HAVE_SYS_PARAM_H
+#
+# HAVE_STRING_H ?
+#
+# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+# CHECK on limits.h
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
+ AC_TRY_LINK([#include <sys/types.h>
+#include <dirent.h>], [
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
+
+ if test $tcl_cv_dirent_h = no; then
+ AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
+ fi
+
+ # TEA specific:
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
+ AC_CHECK_HEADER(limits.h,
+ [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
+ [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
+ fi
+ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
+ fi
+
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ AC_HAVE_HEADERS(sys/param.h)
+])
+
+#--------------------------------------------------------------------
+# TEA_PATH_X
+#
+# Locate the X11 header files and the X11 library archive. Try
+# the ac_path_x macro first, but if it doesn't find the X stuff
+# (e.g. because there's no xmkmf program) then check through
+# a list of possible directories. Under some conditions the
+# autoconf macro will return an include directory that contains
+# no include files, so double-check its result just to be safe.
+#
+# This should be called after TEA_CONFIG_CFLAGS as setting the
+# LIBS line can confuse some configure macro magic.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets the following vars:
+# XINCLUDES
+# XLIBSW
+# PKG_LIBS (appends to)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_X], [
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
+ TEA_PATH_UNIX_X
+ fi
+])
+
+AC_DEFUN([TEA_PATH_UNIX_X], [
+ AC_PATH_X
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
+ else
+ if test ! -r $x_includes/X11/Xlib.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ AC_MSG_CHECKING([for X11 header files])
+ found_xincludes="no"
+ AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Xlib.h; then
+ AC_MSG_RESULT([$i])
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test "$found_xincludes" = "no"; then
+ AC_MSG_RESULT([couldn't find any!])
+ fi
+
+ if test "$no_x" = yes; then
+ AC_MSG_CHECKING([for X11 libraries])
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
+ AC_MSG_RESULT([$i])
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_MSG_RESULT([could not find any! Using -lX11.])
+ XLIBSW=-lX11
+ fi
+ # TEA specific:
+ if test x"${XLIBSW}" != x ; then
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BLOCKING_STYLE
+#
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# HAVE_SYS_IOCTL_H
+# HAVE_SYS_FILIO_H
+# USE_FIONBIO
+# O_NONBLOCK
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BLOCKING_STYLE], [
+ AC_CHECK_HEADERS(sys/ioctl.h)
+ AC_CHECK_HEADERS(sys/filio.h)
+ TEA_CONFIG_SYSTEM
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
+ case $system in
+ OSF*)
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ *)
+ AC_MSG_RESULT([O_NONBLOCK])
+ ;;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_TIME_HANDLER
+#
+# Checks how the system deals with time.h, what time structures
+# are used on the system, and what fields the structures have.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# USE_DELTA_FOR_TZ
+# HAVE_TM_GMTOFF
+# HAVE_TM_TZADJ
+# HAVE_TIMEZONE_VAR
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TIME_HANDLER], [
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_HEADER_TIME
+ AC_STRUCT_TIMEZONE
+
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
+
+ AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
+ if test $tcl_cv_member_tm_tzadj = yes ; then
+ AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
+ fi
+
+ AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
+ AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
+ fi
+
+ #
+ # Its important to include time.h in this check, as some systems
+ # (like convex) have timezone functions, etc.
+ #
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern long timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
+ if test $tcl_cv_timezone_long = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ else
+ #
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
+ if test $tcl_cv_timezone_time = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BUGGY_STRTOD
+#
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" (provided by Tcl) that corrects the error.
+# Also, on Compaq's Tru64 Unix 5.0,
+# strtod(" ") returns 0.0 instead of a failure to convert.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Might defines some of the following vars:
+# strtod (=fixstrtod)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BUGGY_STRTOD], [
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
+ if test "$tcl_strtod" = 1; then
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
+ tcl_cv_strtod_buggy=buggy)])
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ AC_LIBOBJ([fixstrtod])
+ USE_COMPAT=1
+ AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_LINK_LIBS
+#
+# Search for the libraries needed to link the Tcl shell.
+# Things like the math library (-lm) and socket stuff (-lsocket vs.
+# -lnsl) are dealt with here.
+#
+# Arguments:
+# Requires the following vars to be set in the Makefile:
+# DL_LIBS (not in TEA, only needed in core)
+# LIBS
+# MATH_LIBS
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_LIBS
+# MATH_LIBS
+#
+# Might append to the following vars:
+# LIBS
+#
+# Might define the following vars:
+# HAVE_NET_ERRNO_H
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_LINK_LIBS], [
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
+ AC_CHECK_HEADER(net/errno.h, [
+ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
+ if test "$tcl_checkSocket" = 1; then
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
+ fi
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
+ [LIBS="$LIBS -lnsl"])])
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(MATH_LIBS)
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_EARLY_FLAGS
+#
+# Check for what flags are needed to be passed so the correct OS
+# features are available.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# _ISOC99_SOURCE
+# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_EARLY_FLAG],[
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
+ AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
+ tcl_flags="$tcl_flags $1"
+ fi
+])
+
+AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
+ AC_MSG_CHECKING([for required early compiler flags])
+ tcl_flags=""
+ TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
+ [char *p = (char *)open64;])
+ if test "x${tcl_flags}" = "x" ; then
+ AC_MSG_RESULT([none])
+ else
+ AC_MSG_RESULT([${tcl_flags}])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_64BIT_FLAGS
+#
+# Check for what is defined in the way of 64-bit features.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# TCL_WIDE_INT_IS_LONG
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_STAT64
+# HAVE_TYPE_OFF64_T
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
+ AC_MSG_CHECKING([for 64-bit integer type])
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ AC_TRY_COMPILE(,[switch (0) {
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
+ if test "${tcl_cv_type_64bit}" = none ; then
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
+ AC_MSG_RESULT([using long])
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ AC_MSG_RESULT([using Tcl header defaults])
+ else
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
+ [What type should be used to define wide integers?])
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
+
+ # Now check for auxiliary declarations
+ AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
+ fi
+
+ AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
+ fi
+
+ AC_CHECK_FUNCS(open64 lseek64)
+ AC_MSG_CHECKING([for off64_t])
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
+ dnl functions lseek64 and open64 are defined.
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+])
+
+##
+## Here ends the standard Tcl configuration bits and starts the
+## TEA specific functions
+##
+
+#------------------------------------------------------------------------
+# TEA_INIT --
+#
+# Init various Tcl Extension Architecture (TEA) variables.
+# This should be the first called TEA_* macro.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substs the following vars:
+# CYGPATH
+# EXEEXT
+# Defines only:
+# TEA_VERSION
+# TEA_INITED
+# TEA_PLATFORM (windows or unix)
+#
+# "cygpath" is used on windows to generate native path names for include
+# files. These variables should only be used with the compiler and linker
+# since they generate native path names.
+#
+# EXEEXT
+# Select the executable extension based on the host type. This
+# is a lightweight replacement for AC_EXEEXT that doesn't require
+# a compiler.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_INIT], [
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ AC_MSG_CHECKING([for correct TEA configuration])
+ if test x"${PACKAGE_NAME}" = x ; then
+ AC_MSG_ERROR([
+The PACKAGE_NAME variable must be defined by your TEA configure.in])
+ fi
+ if test x"$1" = x ; then
+ AC_MSG_ERROR([
+TEA version not specified.])
+ elif test "$1" != "${TEA_VERSION}" ; then
+ AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
+ else
+ AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}])
+
+ AC_SUBST(EXEEXT)
+ AC_SUBST(CYGPATH)
+
+ # This package name must be replaced statically for AC_SUBST to work
+ AC_SUBST(PKG_LIB_FILE)
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+ AC_SUBST(PKG_STUB_LIB_FILE)
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+ AC_SUBST(PKG_TCL_SOURCES)
+ AC_SUBST(PKG_HEADERS)
+ AC_SUBST(PKG_INCLUDES)
+ AC_SUBST(PKG_LIBS)
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_SOURCES
+# PKG_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ case $i in
+ [\$]*)
+ # allow $-var names
+ PKG_SOURCES="$PKG_SOURCES $i"
+ PKG_OBJECTS="$PKG_OBJECTS $i"
+ ;;
+ *)
+ # check for existence - allows for generic/win/unix VPATH
+ # To add more dirs here (like 'src'), you have to update VPATH
+ # in Makefile.in as well
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find source file '$i'])
+ fi
+ PKG_SOURCES="$PKG_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_OBJECTS="$PKG_OBJECTS $j"
+ ;;
+ esac
+ done
+ AC_SUBST(PKG_SOURCES)
+ AC_SUBST(PKG_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_STUB_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_STUB_SOURCES
+# PKG_STUB_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_STUB_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence - allows for generic/win/unix VPATH
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find stub source file '$i'])
+ fi
+ PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
+ done
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_TCL_SOURCES --
+#
+# Specify one or more Tcl source files. These should be platform
+# independent runtime files.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_TCL_SOURCES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_TCL_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
+ fi
+ PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
+ done
+ AC_SUBST(PKG_TCL_SOURCES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_HEADERS --
+#
+# Specify one or more source headers. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_HEADERS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_HEADERS], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
+ fi
+ PKG_HEADERS="$PKG_HEADERS $i"
+ done
+ AC_SUBST(PKG_HEADERS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_INCLUDES --
+#
+# Specify one or more include dirs. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_INCLUDES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_INCLUDES], [
+ vars="$@"
+ for i in $vars; do
+ PKG_INCLUDES="$PKG_INCLUDES $i"
+ done
+ AC_SUBST(PKG_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_LIBS --
+#
+# Specify one or more libraries. Users should check for
+# the right platform before adding to their list. For Windows,
+# libraries provided in "foo.lib" format will be converted to
+# "-lfoo" when using GCC (mingw).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_LIBS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_LIBS], [
+ vars="$@"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+ AC_SUBST(PKG_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CFLAGS --
+#
+# Specify one or more CFLAGS. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_CFLAGS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CFLAGS], [
+ PKG_CFLAGS="$PKG_CFLAGS $@"
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CLEANFILES --
+#
+# Specify one or more CLEANFILES.
+#
+# Arguments:
+# one or more file names to clean target
+#
+# Results:
+#
+# Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CLEANFILES], [
+ CLEANFILES="$CLEANFILES $@"
+])
+
+#------------------------------------------------------------------------
+# TEA_PREFIX --
+#
+# Handle the --prefix=... option by defaulting to what Tcl gave
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# If --prefix or --exec-prefix was not specified, $prefix and
+# $exec_prefix will be set to the values given to Tcl when it was
+# configured.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_PREFIX], [
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
+ prefix=${TCL_PREFIX}
+ else
+ AC_MSG_NOTICE([--prefix defaulting to /usr/local])
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
+ exec_prefix=$prefix
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER_CC --
+#
+# Do compiler checks the way we want. This is just a replacement
+# for AC_PROG_CC in TEA configure.in files to make them cleaner.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER_CC], [
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ AC_PROG_CC
+ AC_PROG_CPP
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+ AC_SUBST(INSTALL)
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ AC_PROG_MAKE_SET
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ AC_CHECK_TOOL(RANLIB, ranlib)
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+ AC_OBJEXT
+ AC_EXEEXT
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER --
+#
+# Do compiler checks that use the compiler. This must go after
+# TEA_SETUP_COMPILER_CC, which does the actual compiler check.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER], [
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+ AC_REQUIRE([TEA_SETUP_COMPILER_CC])
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ AC_CACHE_CHECK([if the compiler understands -pipe],
+ tcl_cv_cc_pipe, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ AC_C_BIGENDIAN
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ TEA_TCL_LINK_LIBS
+ TEA_MISSING_POSIX_HEADERS
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_MAKE_LIB --
+#
+# Generate a line that can be used to build a shared/unshared library
+# in a platform independent manner.
+#
+# Arguments:
+# none
+#
+# Requires:
+#
+# Results:
+#
+# Defines the following vars:
+# CFLAGS - Done late here to note disturb other AC macros
+# MAKE_LIB - Command to execute to build the Tcl library;
+# differs depending on whether or not Tcl is being
+# compiled as a shared library.
+# MAKE_SHARED_LIB Makefile rule for building a shared library
+# MAKE_STATIC_LIB Makefile rule for building a static library
+# MAKE_STUB_LIB Makefile rule for building a stub library
+# VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL
+# VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_MAKE_LIB], [
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
+ AC_EGREP_CPP([manifest needed], [
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+ ], [
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+ TEA_ADD_CLEANFILES([*.manifest])
+ ])
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+ AC_SUBST(MAKE_LIB)
+ AC_SUBST(MAKE_SHARED_LIB)
+ AC_SUBST(MAKE_STATIC_LIB)
+ AC_SUBST(MAKE_STUB_LIB)
+ AC_SUBST(RANLIB_STUB)
+ AC_SUBST(VC_MANIFEST_EMBED_DLL)
+ AC_SUBST(VC_MANIFEST_EMBED_EXE)
+])
+
+#------------------------------------------------------------------------
+# TEA_LIB_SPEC --
+#
+# Compute the name of an existing object library located in libdir
+# from the given base name and produce the appropriate linker flags.
+#
+# Arguments:
+# basename The base name of the library without version
+# numbers, extensions, or "lib" prefixes.
+# extra_dir Extra directory in which to search for the
+# library. This location is used first, then
+# $prefix/$exec-prefix, then some defaults.
+#
+# Requires:
+# TEA_INIT and TEA_PREFIX must be called first.
+#
+# Results:
+#
+# Defines the following vars:
+# ${basename}_LIB_NAME The computed library name.
+# ${basename}_LIB_SPEC The computed linker flags.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LIB_SPEC], [
+ AC_MSG_CHECKING([for $1 library])
+
+ # Look in exec-prefix for the library (defined by TEA_PREFIX).
+
+ tea_lib_name_dir="${exec_prefix}/lib"
+
+ # Or in a user-specified location.
+
+ if test x"$2" != x ; then
+ tea_extra_lib_dir=$2
+ else
+ tea_extra_lib_dir=NONE
+ fi
+
+ for i in \
+ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
+ if test -f "$i" ; then
+ tea_lib_name_dir=`dirname $i`
+ $1_LIB_NAME=`basename $i`
+ $1_LIB_PATH_NAME=$i
+ break
+ fi
+ done
+
+ if test "${TEA_PLATFORM}" = "windows"; then
+ $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
+ else
+ # Strip off the leading "lib" and trailing ".a" or ".so"
+
+ tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
+ $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
+ fi
+
+ if test "x${$1_LIB_NAME}" = x ; then
+ AC_MSG_ERROR([not found])
+ else
+ AC_MSG_RESULT([${$1_LIB_SPEC}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TCL_HEADERS --
+#
+# Locate the private Tcl include files
+#
+# Arguments:
+#
+# Requires:
+# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_TOP_DIR_NATIVE
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
+ # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh}
+ AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS])
+ AC_MSG_CHECKING([for Tcl private include files])
+
+ TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
+ TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
+
+ # Check to see if tcl<Plat>Port.h isn't already with the public headers
+ # Don't look for tclInt.h because that resides with tcl.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tclh}/tclWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tclh}/tclUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
+ else
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TCL_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -d "${TCL_BIN_DIR}/Headers" -a \
+ -d "${TCL_BIN_DIR}/PrivateHeaders"; then
+ TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"
+ else
+ TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TCL_INCLUDES}"
+ else
+ if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
+ fi
+ result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TCL_TOP_DIR_NATIVE)
+
+ AC_SUBST(TCL_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TCL_HEADERS --
+#
+# Locate the installed public Tcl header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tclinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
+ AC_MSG_CHECKING([for Tcl public headers])
+
+ AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tclh, [
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tclh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TCL_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TK_HEADERS --
+#
+# Locate the private Tk include files
+#
+# Arguments:
+#
+# Requires:
+# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
+ # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}
+ AC_REQUIRE([TEA_PUBLIC_TK_HEADERS])
+ AC_MSG_CHECKING([for Tk private include files])
+
+ TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
+ TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
+
+ # Check to see if tk<Plat>Port.h isn't already with the public headers
+ # Don't look for tkInt.h because that resides with tk.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tkh}/tkWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tkh}/tkUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
+ TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
+ else
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TK_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
+ # Detect and add ttk subdir
+ if test -d "${TK_SRC_DIR}/generic/ttk"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
+ fi
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -d "${TK_BIN_DIR}/Headers" -a \
+ -d "${TK_BIN_DIR}/PrivateHeaders"; then
+ TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
+ else
+ TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TK_INCLUDES}"
+ else
+ if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
+ fi
+ result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TK_TOP_DIR_NATIVE)
+ AC_SUBST(TK_XLIB_DIR_NATIVE)
+
+ AC_SUBST(TK_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TK_HEADERS --
+#
+# Locate the installed public Tk header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tkinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
+ AC_MSG_CHECKING([for Tk public headers])
+
+ AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tkh, [
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tkh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TK_INCLUDES)
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ AC_MSG_CHECKING([for X11 header files])
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+ AC_SUBST(TK_XINCLUDES)
+ fi
+ AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_CONFIG --
+#
+# Locate the ${1}Config.sh file and perform a sanity check on
+# the ${1} compile flags. These are used by packages like
+# [incr Tk] that load *Config.sh files from more than Tcl and Tk.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-$1=...
+#
+# Defines the following vars:
+# $1_BIN_DIR Full path to the directory containing
+# the $1Config.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CONFIG], [
+ #
+ # Ok, lets find the $1 configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-$1
+ #
+
+ if test x"${no_$1}" = x ; then
+ # we reset no_$1 in case something fails here
+ no_$1=true
+ AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
+ AC_MSG_CHECKING([for $1 configuration])
+ AC_CACHE_VAL(ac_cv_c_$1config,[
+
+ # First check to see if --with-$1 was specified.
+ if test x"${with_$1config}" != x ; then
+ case ${with_$1config} in
+ */$1Config.sh )
+ if test -f ${with_$1config}; then
+ AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
+ with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
+ fi;;
+ esac
+ if test -f "${with_$1config}/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
+ else
+ AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
+ fi
+ fi
+
+ # then check for a private $1 installation
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in \
+ ../$1 \
+ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../$1 \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../../$1 \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../$1 \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ if test -f "$i/unix/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_$1config}" = x ; then
+ $1_BIN_DIR="# no $1 configs found"
+ AC_MSG_WARN([Cannot find $1 configuration definitions])
+ exit 0
+ else
+ no_$1=
+ $1_BIN_DIR=${ac_cv_c_$1config}
+ AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG --
+#
+# Load the $1Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# $1_SRC_DIR
+# $1_LIB_FILE
+# $1_LIB_SPEC
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_CONFIG], [
+ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
+
+ if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${$1_BIN_DIR}/$1Config.sh"
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+
+ #
+ # If the $1_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable $1_LIB_SPEC will be set to the value
+ # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
+ # instead of $1_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f "${$1_BIN_DIR}/Makefile" ; then
+ AC_MSG_WARN([Found Makefile - using build library specs for $1])
+ $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
+ $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
+ $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
+ $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
+ $1_LIBRARY_PATH=${$1_LIBRARY_PATH}
+ fi
+
+ AC_SUBST($1_VERSION)
+ AC_SUBST($1_BIN_DIR)
+ AC_SUBST($1_SRC_DIR)
+
+ AC_SUBST($1_LIB_FILE)
+ AC_SUBST($1_LIB_SPEC)
+
+ AC_SUBST($1_STUB_LIB_FILE)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ # Allow the caller to prevent this auto-check by specifying any 2nd arg
+ AS_IF([test "x$2" = x], [
+ # Check both upper and lower-case variants
+ # If a dev wanted non-stubs libs, this function could take an option
+ # to not use _STUB in the paths below
+ AS_IF([test "x${$1_STUB_LIB_SPEC}" = x],
+ [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)],
+ [TEA_LOAD_CONFIG_LIB($1_STUB)])
+ ])
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG_LIB --
+#
+# Helper function to load correct library from another extension's
+# ${PACKAGE}Config.sh.
+#
+# Results:
+# Adds to LIBS the appropriate extension library
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_LOAD_CONFIG_LIB], [
+ AC_MSG_CHECKING([For $1 library for LIBS])
+ # This simplifies the use of stub libraries by automatically adding
+ # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
+ # but this is called before CONFIG_CFLAGS. More importantly, this adds
+ # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
+ if test "x${$1_LIB_SPEC}" != "x" ; then
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
+ TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"])
+ AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}])
+ else
+ TEA_ADD_LIBS([${$1_LIB_SPEC}])
+ AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}])
+ fi
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_EXPORT_CONFIG --
+#
+# Define the data to insert into the ${PACKAGE}Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1
+#
+# Results:
+# Substitutes the following vars:
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_EXPORT_CONFIG], [
+ #--------------------------------------------------------------------
+ # These are for $1Config.sh
+ #--------------------------------------------------------------------
+
+ # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
+ eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}"
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}"
+ else
+ eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ fi
+ $1_BUILD_LIB_SPEC="-L`pwd` ${$1_LIB_FLAG}"
+ $1_LIB_SPEC="-L${pkglibdir} ${$1_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_SPEC="-L`pwd` [$]{$1_STUB_LIB_FLAG}"
+ $1_STUB_LIB_SPEC="-L${pkglibdir} [$]{$1_STUB_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}"
+ $1_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}"
+
+ AC_SUBST($1_BUILD_LIB_SPEC)
+ AC_SUBST($1_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_PATH)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ AC_SUBST(MAJOR_VERSION)
+ AC_SUBST(MINOR_VERSION)
+ AC_SUBST(PATCHLEVEL)
+])
+
+
+#------------------------------------------------------------------------
+# TEA_PATH_CELIB --
+#
+# Locate Keuchel's celib emulation layer for targeting Win/CE
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-celib=...
+#
+# Defines the following vars:
+# CELIB_DIR Full path to the directory containing
+# the include and platform lib files
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CELIB], [
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+ AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
+ AC_MSG_CHECKING([for Windows/CE celib directory])
+ AC_CACHE_VAL(ac_cv_c_celibconfig,[
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ AC_MSG_ERROR([Cannot find celib support library directory])
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ AC_MSG_RESULT([found $CELIB_DIR])
+ fi
+ fi
+])
+
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/ds9/unix/tkAppInit.c b/ds9/unix/tkAppInit.c
new file mode 100644
index 0000000..13bcdde
--- /dev/null
+++ b/ds9/unix/tkAppInit.c
@@ -0,0 +1,156 @@
+/*
+ * tkAppInit.c --
+ *
+ * Provides a default version of the main program and Tcl_AppInit
+ * procedure for wish and other Tk-based applications.
+ *
+ * Copyright (c) 1993 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998-1999 Scriptics Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ */
+
+#undef BUILD_tk
+#undef STATIC_BUILD
+#include "tk.h"
+
+#ifdef TK_TEST
+extern Tcl_PackageInitProc Tktest_Init;
+#endif /* TK_TEST */
+
+/*
+ * The following #if block allows you to change the AppInit function by using
+ * a #define of TCL_LOCAL_APPINIT instead of rewriting this entire file. The
+ * #if checks for that #define and uses Tcl_AppInit if it doesn't exist.
+ */
+
+#ifndef TK_LOCAL_APPINIT
+#define TK_LOCAL_APPINIT Tcl_AppInit
+#endif
+#ifndef MODULE_SCOPE
+# define MODULE_SCOPE extern
+#endif
+MODULE_SCOPE int TK_LOCAL_APPINIT(Tcl_Interp *);
+MODULE_SCOPE int main(int, char **);
+
+/*
+ * The following #if block allows you to change how Tcl finds the startup
+ * script, prime the library or encoding paths, fiddle with the argv, etc.,
+ * without needing to rewrite Tk_Main()
+ */
+
+#ifdef TK_LOCAL_MAIN_HOOK
+MODULE_SCOPE int TK_LOCAL_MAIN_HOOK(int *argc, char ***argv);
+#endif
+
+/* Make sure the stubbed variants of those are never used. */
+#undef Tcl_ObjSetVar2
+#undef Tcl_NewStringObj
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * main --
+ *
+ * This is the main program for the application.
+ *
+ * Results:
+ * None: Tk_Main never returns here, so this procedure never returns
+ * either.
+ *
+ * Side effects:
+ * Just about anything, since from here we call arbitrary Tcl code.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+main(
+ int argc, /* Number of command-line arguments. */
+ char **argv) /* Values of command-line arguments. */
+{
+#ifdef TK_LOCAL_MAIN_HOOK
+ TK_LOCAL_MAIN_HOOK(&argc, &argv);
+#endif
+
+ Tk_Main(argc, argv, TK_LOCAL_APPINIT);
+ return 0; /* Needed only to prevent compiler warning. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_AppInit --
+ *
+ * This procedure performs application-specific initialization. Most
+ * applications, especially those that incorporate additional packages,
+ * will have their own version of this procedure.
+ *
+ * Results:
+ * Returns a standard Tcl completion code, and leaves an error message in
+ * the interp's result if an error occurs.
+ *
+ * Side effects:
+ * Depends on the startup script.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_AppInit(
+ Tcl_Interp *interp) /* Interpreter for application. */
+{
+ if ((Tcl_Init)(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+
+ if (Tk_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+
+#ifdef TK_TEST
+ if (Tktest_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_StaticPackage(interp, "Tktest", Tktest_Init, 0);
+#endif /* TK_TEST */
+
+ /*
+ * Call the init procedures for included packages. Each call should look
+ * like this:
+ *
+ * if (Mod_Init(interp) == TCL_ERROR) {
+ * return TCL_ERROR;
+ * }
+ *
+ * where "Mod" is the name of the module. (Dynamically-loadable packages
+ * should have the same entry-point name.)
+ */
+
+ /*
+ * Call Tcl_CreateObjCommand for application-specific commands, if they
+ * weren't already created by the init procedures called above.
+ */
+
+ /*
+ * Specify a user-specific startup file to invoke if the application is
+ * run interactively. Typically the startup file is "~/.apprc" where "app"
+ * is the name of the application. If this line is deleted then no user-
+ * specific startup file will be run under any conditions.
+ */
+
+ Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL,
+ Tcl_NewStringObj("~/.wishrc", -1), TCL_GLOBAL_ONLY);
+ return TCL_OK;
+}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */
diff --git a/ds9/util/mergedict.tcl b/ds9/util/mergedict.tcl
new file mode 100644
index 0000000..47a7c08
--- /dev/null
+++ b/ds9/util/mergedict.tcl
@@ -0,0 +1,68 @@
+# usage: mergedict <##>
+
+set mm [lindex $argv 0]
+set enc [lindex $argv 1]
+set fn "msgs/${mm}.msg"
+
+# read in original msg file
+if {[catch {open $fn r} id]} {
+ puts "Error: can't open $fn for reading"
+ return
+}
+fconfigure $id -encoding $enc
+
+set orgmsg {}
+while {[gets $id line] >= 0} {
+ lappend orgmsg $line
+}
+set orgmsg [lsort -unique $orgmsg]
+catch {close $id}
+
+# read current msgs
+set curmsg {}
+while {[gets stdin line] >= 0} {
+ set exp {.*msgcat::mc {([^\}]*)}}
+ if [regexp $exp $line foo aa] {
+ lappend curmsg "::msgcat::mcset $mm {$aa} "
+ }
+}
+set curmsg [lsort -unique $curmsg]
+
+# now merge original against current
+set mermsg {}
+foreach ll $curmsg {
+ set ii [lsearch -glob $orgmsg "$ll*"]
+ if {$ii != -1} {
+ lappend mermsg [lindex $orgmsg $ii]
+ } else {
+ lappend mermsg $ll
+ }
+}
+set mermsg [lsort -unique $mermsg]
+
+# now find unused entries in original
+foreach ll $orgmsg {
+ set ii [lsearch -exact $mermsg $ll]
+
+ if {$ii == -1} {
+ if {[string range $ll 0 0] != {#}} {
+ lappend mermsg "# $ll"
+ } else {
+ lappend mermsg "$ll"
+ }
+ }
+}
+set mermsg [lsort -unique $mermsg]
+
+# write new msg file
+if {[catch {open $fn w} id]} {
+ puts "Error: can't open $fn for writing"
+ return
+}
+fconfigure $id -encoding $enc
+
+foreach ll $mermsg {
+ puts $id $ll
+}
+
+catch {close $id}
diff --git a/ds9/win/Makefile.in b/ds9/win/Makefile.in
new file mode 100755
index 0000000..fda5e0b
--- /dev/null
+++ b/ds9/win/Makefile.in
@@ -0,0 +1,158 @@
+include ../../make.pkgs
+
+TCL_LIB_SPEC = @TCL_LIB_SPEC@
+TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@
+TK_LIBS = @TK_LIBS@
+TK_LIB_SPEC = @TK_LIB_SPEC@
+TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@
+
+CC = @CC@
+CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
+CFLAGS_WARNING = @CFLAGS_WARNING@
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+
+INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
+
+PKG_CFLAGS = @PKG_CFLAGS@
+DEFS = @DEFS@ $(PKG_CFLAGS)
+
+CPPFLAGS = @CPPFLAGS@
+LIBS = @PKG_LIBS@ @LIBS@
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+
+STRIP = i686-w64-mingw32-strip.exe
+
+.SUFFIXES: .c .C .$(OBJEXT)
+
+.c.@OBJEXT@:
+ $(COMPILE) -DSTATIC_BUILD -c $< -o $@
+
+.C.@OBJEXT@:
+ $(COMPILE) -DSTATIC_BUILD -c $< -o $@
+
+#--------------------------defines
+
+OBJS = ds9.o winMain.o ds9.res.o
+
+LLIBS = \
+ ../../lib/tksao$(TKSAOVER)/tksao10.a \
+ ../../lib/libfuntools.a \
+ ../../lib/libast.a \
+ ../../lib/libast_err.a \
+ ../../lib/libast_pal.a \
+ ../../lib/tksao$(TKSAOVER)/tksao10.a \
+ ../../lib/tkhtml1$(TKHTMLVER)/tkhtml110.a \
+ ../../lib/tkmpeg$(TKMPEGVER)/tkmpeg10.a \
+ ../../lib/Tclxml$(TCLXMLVER)/Tclxml32.a \
+ ../../lib/Tktable$(TKTABLEVER)/Tktable210.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgpng142.a \
+ ../../lib/Img$(TKIMGVER)/libpngtcl1412.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgtiff142.a \
+ ../../lib/Img$(TKIMGVER)/libtifftcl394.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgjpeg142.a \
+ ../../lib/Img$(TKIMGVER)/libjpegtcl84.a \
+ ../../lib/Img$(TKIMGVER)/libtkimggif142.a \
+ ../../lib/Img$(TKIMGVER)/libtkimgwindow142.a \
+ ../../lib/Img$(TKIMGVER)/zlibtcl128.a \
+ ../../lib/Img$(TKIMGVER)/libtkimg142.a \
+ ../../lib/libxpa.a \
+ ../../lib/tkblt$(TKBLTVER)/libtkbltstub32.a \
+ ../../lib/tkblt$(TKBLTVER)/tkblt32.a \
+ ../../lib/tkwin$(TKWINVER)/tkwin10.a \
+ ../../lib/libxml2.a \
+ ../../lib/libz.a
+
+APPDIR = ../../bin/ds9app
+
+#--------------------------main
+
+.NOTPARALLEL :
+.PHONY : ds9 debug appdir framework tcltk tcllib tkcon tkblt xpa cleanup
+
+ds9 : ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt xpa cleanup
+ cp -p ds9base$(EXEEXT) ds9$(EXEEXT)
+ $(STRIP) ds9$(EXEEXT)
+ cp -p ds9$(EXEEXT) $(APPDIR)/.
+
+debug : ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt cleanup
+ mv ds9base$(EXEEXT) ds9$(EXEEXT)
+ cp -p ds9$(EXEEXT) $(APPDIR)/.
+
+ds9Base$(EXEEXT): $(OBJS) $(LLIBS)
+ $(RM) $@
+ $(CC) $(CFLAGS) -o $@ \
+ $(OBJS) \
+ $(LLIBS) \
+ $(LIBS) \
+ $(TK_STUB_LIB_SPEC) $(TK_LIB_SPEC) \
+ $(TCL_STUB_LIB_SPEC) $(TCL_LIB_SPEC) \
+ $(TK_LIBS) \
+ -mwindows -static
+
+winMain.o : winMain.c
+ $(COMPILE) \
+ -DSTATIC_BUILD \
+ -DTK_LOCAL_APPINIT=SAOAppInit -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook \
+ -c winMain.c -o $@
+
+winMain.c : ../../tk$(TCLVER)/win/winMain.c
+ cp ../../tk$(TCLVER)/win/winMain.c .
+
+ds9.res.o: ds9.rc ds9.ico
+ i686-w64-mingw32-windres -o $@ \
+ --define STATIC_BUILD --include ../../tk$(TCLVER)/generic \
+ --include ../../$(TCLDIR)/generic --include ../../tk$(TCLVER)/win/rc \
+ ds9.rc
+
+appdir :
+ rm -rf $(APPDIR)
+ mkdir $(APPDIR)
+
+framework:
+ cp install.vbs $(APPDIR)/.
+ cp -pr ../library $(APPDIR)/.
+ cp -pr ../msgs $(APPDIR)/.
+ cp -pr ../doc $(APPDIR)/.
+ cp -pr ../cmaps $(APPDIR)/.
+ cp -pr ../template $(APPDIR)/.
+ echo "pkg_mkIndex $(APPDIR)/library *.tcl; exit" | ../../bin/tclsh86s
+
+tcltk :
+ cp -pr ../../lib/tcl8 $(APPDIR)/.
+ cp -pr ../../lib/tcl8.6 $(APPDIR)/.
+ cp -pr ../../lib/tk8.6 $(APPDIR)/.
+
+tkblt :
+ mkdir $(APPDIR)/tkblt
+ cp -p ../../tkblt/library/graph.tcl $(APPDIR)/tkblt/.
+ echo "pkg_mkIndex $(APPDIR)/tkblt *.tcl; exit" | ../../bin/tclsh86s
+
+tcllib :
+ cp -pr ../../tcllib/modules/base64 $(APPDIR)/.
+ cp -pr ../../tcllib/modules/ftp $(APPDIR)/.
+ cp -pr ../../tcllib/modules/log $(APPDIR)/.
+ cp -pr ../../tcllib/modules/textutil $(APPDIR)/.
+ cp -pr ../../tcllib/modules/math $(APPDIR)/.
+
+tkcon :
+ mkdir $(APPDIR)/tkcon
+ cp -p ../../tkcon/*.tcl $(APPDIR)/tkcon/.
+
+xpa :
+ cp -p ../../bin/xpans.exe $(APPDIR)/.
+
+cleanup:
+ cd $(APPDIR); find . -depth -name CVS -exec rm -rf {} \;
+
+#--------------------------cleanup
+
+.PHONY : clean distclean
+
+clean :
+ cd ../library; $(MAKE) clean
+ $(RM) core *~ *# ds9Base ds9 *.o
+
+distclean: clean
+ -rm -f Makefile config.cache config.log config.status
diff --git a/ds9/win/Makefile.old b/ds9/win/Makefile.old
new file mode 100644
index 0000000..755d0db
--- /dev/null
+++ b/ds9/win/Makefile.old
@@ -0,0 +1,120 @@
+include ../../make.pkgs
+
+#--------------------------defines
+
+CFLAGS= -g -DSTATIC_BUILD -mnop-fun-dllimport -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I../../include -I../../include/X11
+CXXFLAGS = $(CFLAGS)
+
+OBJS = ds9.o winMain.o ds9.res.o
+
+ZDIR = zipdir/zvfsmntpt
+FFILES = \
+ $(ZDIR)/$(TCLVER) \
+ $(ZDIR)/tcl8 \
+ $(ZDIR)/$(TKVER) \
+ $(ZDIR)/$(TKBLTDIR) \
+ $(ZDIR)/$(TCLLIBVER) \
+ $(ZDIR)/$(TKCONVER) \
+ $(ZDIR)/$(XMLRPCVER) \
+ $(ZDIR)/library \
+ $(ZDIR)/msgs \
+ $(ZDIR)/doc \
+ $(ZDIR)/cmaps \
+ $(ZDIR)/template
+
+ifdef FILTERCOMPILER
+ FILES = $(FFILES) $(ZDIR)/$(FILTERCOMPILER)
+else
+ FILES = $(FFILES)
+endif
+
+LIBS = \
+ ../../lib/$(TKSAODIR)/libtksao10.a \
+ ../../lib/$(TKSAODIR)/libfuntools.a \
+ ../../lib/$(TKSAODIR)/libast.a \
+ ../../lib/$(TKSAODIR)/libast_err.a \
+ ../../lib/$(TKSAODIR)/libast_pal.a \
+ ../../lib/$(TKHTMLDIR)/libtkhtml10.a \
+ ../../lib/$(TKMPEGDIR)/libtkmpeg10.a \
+ ../../lib/$(TCLXMLVER)/Tclxml32.a \
+ ../../lib/$(TKTABLEVER)/Tktable210.a \
+ ../../lib/$(TKIMGVER)/tkimgpng14.a \
+ ../../lib/$(TKIMGVER)/pngtcl143.a \
+ ../../lib/$(TKIMGVER)/tkimgtiff14.a \
+ ../../lib/$(TKIMGVER)/tifftcl394.a \
+ ../../lib/$(TKIMGVER)/tkimgjpeg14.a \
+ ../../lib/$(TKIMGVER)/jpegtcl82.a \
+ ../../lib/$(TKIMGVER)/tkimggif14.a \
+ ../../lib/$(TKIMGVER)/tkimgwindow14.a \
+ ../../lib/$(TKIMGVER)/zlibtcl125.a \
+ ../../lib/$(TKIMGVER)/tkimg14.a \
+ ../../lib/libtiff.a \
+ ../../lib/$(TCLZVFSDIR/libtclzvfs10.a \
+ ../../lib/libxpa.a \
+ ../../lib/$(TKBLTDIR)/libtkblt30.a \
+ ../../lib/libtk86.a \
+ ../../lib/libtkstub86.a \
+ ../../lib/libtcl86.a \
+ ../../lib/libtclstub86.a
+
+#--------------------------main
+
+all: ds9.exe
+
+winMain.o : winMain.c
+ $(CC) $(CFLAGS) -DTK_LOCAL_APPINIT=SAOAppInit \
+ -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook -c winMain.c -o $@
+
+winMain.c : ../../$(TKDIR)/winMain.c
+ cp ../../$(TKDIR)/winMain.c .
+
+ds9.exe : ds9Base.exe ds9.zip ../../bin/tcc
+ $(RM) $@
+ strip ds9Base.exe
+ cp ds9Base.exe ds9.exe
+ cp ds9.exe ../../bin/.
+ cp ds9.zip ../../bin/.
+
+debug : ds9Base.exe ds9.zip ../../bin/tcc
+ $(RM) $@
+ cp ds9Base.exe ds9.exe
+
+ds9app : ds9.exe
+ $(RM) -r ../../bin/ds9app
+ mkdir ../../bin/ds9app
+ cp ds9.exe ../../bin/ds9app/.
+ cp ds9.zip ../../bin/ds9app/.
+ cp -rp ../../bin/tcc ../../bin/ds9app/.
+ cp ../../ds9/install.vbs ../../bin/ds9app/.
+
+ds9Base.exe: $(OBJS) $(LIBS)
+ $(RM) $@
+ $(CXX) ${OPTS} \
+ -o $@ $(OBJS) $(LIBS) \
+ -lxml2 -ljbig \
+ -lws2_32 -limm32 -lcomctl32 -mwindows
+
+ds9.res.o: ds9.rc ds9.ico
+ windres -o $@ --define STATIC_BUILD --include ../../$(TKDIR)/generic \
+ --include ../../$(TCLDIR)/generic --include ../../$(TKDIR)/rc \
+ --include win ds9.rc
+
+../../bin/tcc: ../../compilers/$(TCC)
+ $(RM) -r $@
+ cd ../../bin; unzip ../../compilers/$(TCC)
+ chmod +x ../../bin/tcc/tcc.exe
+ touch $@
+
+#--------------------------cleanup
+
+clean : FORCE
+ cd ../library; $(MAKE) clean
+ $(RM) core *~ *#
+
+distclean: FORCE
+ cd ../library; $(MAKE) distclean
+ $(RM) core *~ *# ds9Base.exe ds9.exe *.zip *.o
+ $(RM) -r zipdir bin/tcc
+
+FORCE :
+
diff --git a/ds9/win/about.txt b/ds9/win/about.txt
new file mode 100644
index 0000000..335c8b0
--- /dev/null
+++ b/ds9/win/about.txt
@@ -0,0 +1,4 @@
+SAOImage DS9 installation program.
+For futher information, please visit
+us at http://ds9.si.edu
+or contact us at saord @ cfa.harvard.edu.
diff --git a/ds9/win/aclocal.m4 b/ds9/win/aclocal.m4
new file mode 100755
index 0000000..0b05739
--- /dev/null
+++ b/ds9/win/aclocal.m4
@@ -0,0 +1,9 @@
+#
+# Include the TEA standard macro set
+#
+
+builtin(include,tclconfig/tcl.m4)
+
+#
+# Add here whatever m4 macros you want to define for your package
+#
diff --git a/ds9/win/buttons.bmp b/ds9/win/buttons.bmp
new file mode 100644
index 0000000..f37a4c9
--- /dev/null
+++ b/ds9/win/buttons.bmp
Binary files differ
diff --git a/ds9/win/configure b/ds9/win/configure
new file mode 100755
index 0000000..21689c8
--- /dev/null
+++ b/ds9/win/configure
@@ -0,0 +1,9621 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for ds9 7.5.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='ds9'
+PACKAGE_TARNAME='ds9'
+PACKAGE_VERSION='7.5'
+PACKAGE_STRING='ds9 7.5'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+VC_MANIFEST_EMBED_EXE
+VC_MANIFEST_EMBED_DLL
+RANLIB_STUB
+MAKE_STUB_LIB
+MAKE_STATIC_LIB
+MAKE_SHARED_LIB
+MAKE_LIB
+TCL_DBGX
+LDFLAGS_DEFAULT
+CFLAGS_DEFAULT
+LD_LIBRARY_PATH_VAR
+SHLIB_CFLAGS
+SHLIB_LD_LIBS
+SHLIB_LD
+STLIB_LD
+CFLAGS_WARNING
+CFLAGS_OPTIMIZE
+CFLAGS_DEBUG
+RC
+CELIB_DIR
+AR
+SHARED_BUILD
+TK_INCLUDES
+TCL_INCLUDES
+MATH_LIBS
+EGREP
+GREP
+RANLIB
+SET_MAKE
+INSTALL
+CPP
+TK_XINCLUDES
+TK_LIBS
+TK_STUB_LIB_SPEC
+TK_STUB_LIB_FLAG
+TK_STUB_LIB_FILE
+TK_LIB_SPEC
+TK_LIB_FLAG
+TK_LIB_FILE
+TK_SRC_DIR
+TK_BIN_DIR
+TK_VERSION
+TCL_SHLIB_LD_LIBS
+TCL_LD_FLAGS
+TCL_EXTRA_CFLAGS
+TCL_DEFS
+TCL_LIBS
+CLEANFILES
+OBJEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+TCL_STUB_LIB_SPEC
+TCL_STUB_LIB_FLAG
+TCL_STUB_LIB_FILE
+TCL_LIB_SPEC
+TCL_LIB_FLAG
+TCL_LIB_FILE
+TCL_SRC_DIR
+TCL_BIN_DIR
+TCL_PATCH_LEVEL
+TCL_VERSION
+PKG_CFLAGS
+PKG_LIBS
+PKG_INCLUDES
+PKG_HEADERS
+PKG_TCL_SOURCES
+PKG_STUB_OBJECTS
+PKG_STUB_SOURCES
+PKG_STUB_LIB_FILE
+PKG_LIB_FILE
+EXEEXT
+CYGPATH
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_tcl
+with_tk
+with_tclinclude
+with_tkinclude
+enable_shared
+enable_64bit
+enable_64bit_vis
+enable_rpath
+enable_wince
+with_celib
+enable_symbols
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures ds9 7.5 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/ds9]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of ds9 7.5:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-shared build and link with shared libraries (default: on)
+ --enable-64bit enable 64bit support (default: off)
+ --enable-64bit-vis enable 64bit Sparc VIS support (default: off)
+ --disable-rpath disable rpath support (default: on)
+ --enable-wince enable Win/CE support (where applicable)
+ --enable-symbols build with debugging symbols (default: off)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-tcl directory containing tcl configuration
+ (tclConfig.sh)
+ --with-tk directory containing tk configuration (tkConfig.sh)
+ --with-tclinclude directory containing the public Tcl header files
+ --with-tkinclude directory containing the public Tk header files
+ --with-celib=DIR use Windows/CE support library from DIR
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+ds9 configure 7.5
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct TEA configuration" >&5
+$as_echo_n "checking for correct TEA configuration... " >&6; }
+ if test x"${PACKAGE_NAME}" = x ; then
+ as_fn_error $? "
+The PACKAGE_NAME variable must be defined by your TEA configure.in" "$LINENO" 5
+ fi
+ if test x"3.9" = x ; then
+ as_fn_error $? "
+TEA version not specified." "$LINENO" 5
+ elif test "3.9" != "${TEA_VERSION}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&5
+$as_echo "warning: requested TEA version \"3.9\", have \"${TEA_VERSION}\"" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (TEA ${TEA_VERSION})" >&5
+$as_echo "ok (TEA ${TEA_VERSION})" >&6; }
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ # Extract the first word of "cygpath", so it can be a program name with args.
+set dummy cygpath; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CYGPATH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CYGPATH"; then
+ ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CYGPATH="cygpath -w"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo"
+fi
+fi
+CYGPATH=$ac_cv_prog_CYGPATH
+if test -n "$CYGPATH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
+$as_echo "$CYGPATH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&5
+$as_echo "$as_me: configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}" >&6;}
+
+
+
+
+ # This package name must be replaced statically for AC_SUBST to work
+
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in tclconfig "$srcdir"/tclconfig; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in tclconfig \"$srcdir\"/tclconfig" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+
+
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+
+# Check whether --with-tcl was given.
+if test "${with_tcl+set}" = set; then :
+ withval=$with_tcl; with_tclconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5
+$as_echo_n "checking for Tcl configuration... " >&6; }
+ if ${ac_cv_c_tclconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;}
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+ fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; }
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5
+$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking platform" >&5
+$as_echo_n "checking platform... " >&6; }
+ hold_cc=$CC; CC="$TCL_CC"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _WIN32
+ #error win32
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ TEA_PLATFORM="unix"
+else
+ TEA_PLATFORM="windows"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CC=$hold_cc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEA_PLATFORM" >&5
+$as_echo "$TEA_PLATFORM" >&6; }
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+
+cat >>confdefs.h <<_ACEOF
+#define BUILD_${PACKAGE_NAME} /**/
+_ACEOF
+
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+
+# Check whether --with-tk was given.
+if test "${with_tk+set}" = set; then :
+ withval=$with_tk; with_tkconfig="${withval}"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk configuration" >&5
+$as_echo_n "checking for Tk configuration... " >&6; }
+ if ${ac_cv_c_tkconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;}
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ as_fn_error $? "${with_tkconfig} directory doesn't contain tkConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ as_fn_error $? "Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh" "$LINENO" 5
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "found ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo_n "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... " >&6; }
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5
+$as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+
+$as_echo "#define MAC_OSX_TK 1" >>confdefs.h
+
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # TEA specific:
+
+
+
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5
+$as_echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;}
+ prefix=${TCL_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --prefix defaulting to /usr/local" >&5
+$as_echo "$as_me: --prefix defaulting to /usr/local" >&6;}
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}" >&6;}
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: --exec-prefix defaulting to ${prefix}" >&5
+$as_echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;}
+ exec_prefix=$prefix
+ fi
+ fi
+
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5
+$as_echo_n "checking if the compiler understands -pipe... " >&6; }
+if ${tcl_cv_cc_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cc_pipe=yes
+else
+ tcl_cv_cc_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5
+$as_echo "$tcl_cv_cc_pipe" >&6; }
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if ${ac_cv_c_bigendian+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+ if test "${TEA_PLATFORM}" = "unix" ; then
+
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin"
+if test "x$ac_cv_func_sin" = xyes; then :
+ MATH_LIBS=""
+else
+ MATH_LIBS="-lm"
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5
+$as_echo_n "checking for main in -lieee... " >&6; }
+if ${ac_cv_lib_ieee_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lieee $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ieee_main=yes
+else
+ ac_cv_lib_ieee_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5
+$as_echo "$ac_cv_lib_ieee_main" >&6; }
+if test "x$ac_cv_lib_ieee_main" = xyes; then :
+ MATH_LIBS="-lieee $MATH_LIBS"
+fi
+
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -linet" >&5
+$as_echo_n "checking for main in -linet... " >&6; }
+if ${ac_cv_lib_inet_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-linet $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_inet_main=yes
+else
+ ac_cv_lib_inet_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inet_main" >&5
+$as_echo "$ac_cv_lib_inet_main" >&6; }
+if test "x$ac_cv_lib_inet_main" = xyes; then :
+ LIBS="$LIBS -linet"
+fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "net/errno.h" "ac_cv_header_net_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_net_errno_h" = xyes; then :
+
+
+$as_echo "#define HAVE_NET_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
+if test "x$ac_cv_func_connect" = xyes; then :
+ tcl_checkSocket=0
+else
+ tcl_checkSocket=1
+fi
+
+ if test "$tcl_checkSocket" = 1; then
+ ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char setsockopt ();
+int
+main ()
+{
+return setsockopt ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_socket_setsockopt=yes
+else
+ ac_cv_lib_socket_setsockopt=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
+ LIBS="$LIBS -lsocket"
+else
+ tcl_checkBoth=1
+fi
+
+fi
+
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ ac_fn_c_check_func "$LINENO" "accept" "ac_cv_func_accept"
+if test "x$ac_cv_func_accept" = xyes; then :
+ tcl_checkNsl=0
+else
+ LIBS=$tk_oldLibs
+fi
+
+ fi
+ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+ LIBS="$LIBS -lnsl"
+fi
+
+fi
+
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dirent.h" >&5
+$as_echo_n "checking dirent.h... " >&6; }
+if ${tcl_cv_dirent_h+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_dirent_h=yes
+else
+ tcl_cv_dirent_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_dirent_h" >&5
+$as_echo "$tcl_cv_dirent_h" >&6; }
+
+ if test $tcl_cv_dirent_h = no; then
+
+$as_echo "#define NO_DIRENT_H 1" >>confdefs.h
+
+ fi
+
+ # TEA specific:
+ ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default"
+if test "x$ac_cv_header_errno_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_ERRNO_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default"
+if test "x$ac_cv_header_float_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_FLOAT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "values.h" "ac_cv_header_values_h" "$ac_includes_default"
+if test "x$ac_cv_header_values_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_VALUES_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default"
+if test "x$ac_cv_header_limits_h" = xyes; then :
+
+$as_echo "#define HAVE_LIMITS_H 1" >>confdefs.h
+
+else
+
+$as_echo "#define NO_LIMITS_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtol" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtoul" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strtod" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STDLIB_H 1" >>confdefs.h
+
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
+if test "x$ac_cv_header_string_h" = xyes; then :
+ tcl_ok=1
+else
+ tcl_ok=0
+fi
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strstr" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "strerror" >/dev/null 2>&1; then :
+
+else
+ tcl_ok=0
+fi
+rm -f conftest*
+
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+
+$as_echo "#define NO_STRING_H 1" >>confdefs.h
+
+ fi
+
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_wait_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_SYS_WAIT_H 1" >>confdefs.h
+
+fi
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+
+else
+
+$as_echo "#define NO_DLFCN_H 1" >>confdefs.h
+
+fi
+
+
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ for ac_header in sys/param.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_PARAM_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+
+ vars="-lstdc++"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl public headers" >&5
+$as_echo_n "checking for Tcl public headers... " >&6; }
+
+
+# Check whether --with-tclinclude was given.
+if test "${with_tclinclude+set}" = set; then :
+ withval=$with_tclinclude; with_tclinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tclh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ as_fn_error $? "${with_tclinclude} directory does not contain tcl.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ as_fn_error $? "tcl.h not found. Please specify its location with --with-tclinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tclh}" >&5
+$as_echo "${ac_cv_c_tclh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+#TEA_PRIVATE_TCL_HEADERS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tk public headers" >&5
+$as_echo_n "checking for Tk public headers... " >&6; }
+
+
+# Check whether --with-tkinclude was given.
+if test "${with_tkinclude+set}" = set; then :
+ withval=$with_tkinclude; with_tkinclude=${withval}
+fi
+
+
+ if ${ac_cv_c_tkh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ as_fn_error $? "${with_tkinclude} directory does not contain tk.h" "$LINENO" 5
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ as_fn_error $? "tk.h not found. Please specify its location with --with-tkinclude" "$LINENO" 5
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_c_tkh}" >&5
+$as_echo "${ac_cv_c_tkh}" >&6; }
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5
+$as_echo_n "checking for X11 header files... " >&6; }
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${INCLUDE_DIR_NATIVE}" >&5
+$as_echo "${INCLUDE_DIR_NATIVE}" >&6; }
+ fi
+
+#TEA_PRIVATE_TK_HEADERS
+#TEA_PATH_X
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_THREADS
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5
+$as_echo_n "checking how to build libraries... " >&6; }
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi
+
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5
+$as_echo "shared" >&6; }
+ SHARED_BUILD=1
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+ SHARED_BUILD=0
+
+$as_echo "#define STATIC_BUILD 1" >>confdefs.h
+
+ fi
+
+
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+
+
+ # Step 0.a: Enable 64 bit support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5
+$as_echo_n "checking if 64bit support is requested... " >&6; }
+ # Check whether --enable-64bit was given.
+if test "${enable_64bit+set}" = set; then :
+ enableval=$enable_64bit; do64bit=$enableval
+else
+ do64bit=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5
+$as_echo "$do64bit" >&6; }
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5
+$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; }
+ # Check whether --enable-64bit-vis was given.
+if test "${enable_64bit_vis+set}" = set; then :
+ enableval=$enable_64bit_vis; do64bitVIS=$enableval
+else
+ do64bitVIS=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5
+$as_echo "$do64bitVIS" >&6; }
+ # Force 64bit on with VIS
+ if test "$do64bitVIS" = "yes"; then :
+ do64bit=yes
+fi
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5
+$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; }
+if ${tcl_cv_cc_visibility_hidden+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}
+int
+main ()
+{
+f();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_visibility_hidden=yes
+else
+ tcl_cv_cc_visibility_hidden=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5
+$as_echo "$tcl_cv_cc_visibility_hidden" >&6; }
+ if test $tcl_cv_cc_visibility_hidden = yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h
+
+
+$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h
+
+
+fi
+
+ # Step 0.d: Disable -rpath support?
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5
+$as_echo_n "checking if rpath support is requested... " >&6; }
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; doRpath=$enableval
+else
+ doRpath=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5
+$as_echo "$doRpath" >&6; }
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ if test "${TEA_PLATFORM}" = windows; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Windows/CE build is requested" >&5
+$as_echo_n "checking if Windows/CE build is requested... " >&6; }
+ # Check whether --enable-wince was given.
+if test "${enable_wince+set}" = set; then :
+ enableval=$enable_wince; doWince=$enableval
+else
+ doWince=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doWince" >&5
+$as_echo "$doWince" >&6; }
+
+fi
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5
+$as_echo_n "checking system version... " >&6; }
+if ${tcl_cv_sys_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5
+$as_echo "$as_me: WARNING: can't find uname command" >&2;}
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5
+$as_echo "$tcl_cv_sys_version" >&6; }
+ system=$tcl_cv_sys_version
+
+
+ # Require ranlib early so we can override it in special cases below.
+
+
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ if test "$GCC" = yes; then :
+
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+
+else
+
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+
+fi
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ if test "x$SHLIB_VERSION" = x; then :
+ SHLIB_VERSION="1.0"
+fi
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5
+$as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5
+$as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;}
+ do64bit="no"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5
+$as_echo " Using 64-bit $MACHINE mode" >&6; }
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ as_fn_error $? "Windows/CE and 64-bit builds incompatible" "$LINENO" 5
+ fi
+ if test "$GCC" = "yes" ; then
+ as_fn_error $? "Windows/CE and GCC builds incompatible" "$LINENO" 5
+ fi
+
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+
+# Check whether --with-celib was given.
+if test "${with_celib+set}" = set; then :
+ withval=$with_celib; with_celibconfig=${withval}
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Windows/CE celib directory" >&5
+$as_echo_n "checking for Windows/CE celib directory... " >&6; }
+ if ${ac_cv_c_celibconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ as_fn_error $? "${with_celibconfig} directory doesn't contain inc directory" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ as_fn_error $? "Cannot find celib support library directory" "$LINENO" 5
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $CELIB_DIR" >&5
+$as_echo "found $CELIB_DIR" >&6; }
+ fi
+ fi
+
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \
+ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \
+ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \
+ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ as_fn_error $? "could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" "$LINENO" 5
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+
+ vars="bufferoverflowU.lib"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower($0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+
+cat >>confdefs.h <<_ACEOF
+#define $i 1
+_ACEOF
+
+ done
+
+cat >>confdefs.h <<_ACEOF
+#define _WIN32_WCE $CEVERSION
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define UNDER_CE $CEVERSION
+_ACEOF
+
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
+set dummy ${ac_tool_prefix}windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RC"; then
+ ac_cv_prog_RC="$RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RC="${ac_tool_prefix}windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RC=$ac_cv_prog_RC
+if test -n "$RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
+$as_echo "$RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RC"; then
+ ac_ct_RC=$RC
+ # Extract the first word of "windres", so it can be a program name with args.
+set dummy windres; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RC"; then
+ ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RC="windres"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RC=$ac_cv_prog_ac_ct_RC
+if test -n "$ac_ct_RC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RC" >&5
+$as_echo "$ac_ct_RC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RC" = x; then
+ RC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RC=$ac_ct_RC
+ fi
+else
+ RC="$ac_cv_prog_RC"
+fi
+
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cross-compile version of gcc" >&5
+$as_echo_n "checking for cross-compile version of gcc... " >&6; }
+if ${ac_cv_cross+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_cross=yes
+else
+ ac_cv_cross=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cross" >&5
+$as_echo "$ac_cv_cross" >&6; }
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then :
+
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'`
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5
+$as_echo "Using $CC for compiling with threads" >&6; }
+
+fi
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+
+fi
+
+fi
+
+ if test "`uname -m`" = ia64; then :
+
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ if test "$GCC" = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+
+else
+
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+
+fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+else
+
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+
+else
+
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+
+fi
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5
+$as_echo_n "checking for inet_ntoa in -lbind... " >&6; }
+if ${ac_cv_lib_bind_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbind $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_bind_inet_ntoa=yes
+else
+ ac_cv_lib_bind_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lbind -lsocket"
+fi
+
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5
+$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; }
+if ${ac_cv_lib_network_inet_ntoa+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnetwork $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_ntoa ();
+int
+main ()
+{
+return inet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_network_inet_ntoa=yes
+else
+ ac_cv_lib_network_inet_ntoa=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5
+$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; }
+if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then :
+ LIBS="$LIBS -lnetwork"
+fi
+
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+
+$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h
+
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ if test "`uname -m`" = ia64; then :
+
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+
+else
+
+ SHLIB_SUFFIX=".sl"
+
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ tcl_ok=yes
+else
+ tcl_ok=no
+fi
+
+ if test "$tcl_ok" = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+
+fi
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes"; then :
+
+ if test "$GCC" = yes; then :
+
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;}
+ ;;
+ esac
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+
+fi
+
+fi ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+
+else
+
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+
+fi
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = yes; then :
+
+ if test "$GCC" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
+
+else
+
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+
+fi
+
+fi
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "`uname -m`" = "alpha"; then :
+ CFLAGS="$CFLAGS -mieee"
+fi
+ if test $do64bit = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5
+$as_echo_n "checking if compiler accepts -m64 flag... " >&6; }
+if ${tcl_cv_cc_m64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_m64=yes
+else
+ tcl_cv_cc_m64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5
+$as_echo "$tcl_cv_cc_m64" >&6; }
+ if test $tcl_cv_cc_m64 = yes; then :
+
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+
+fi
+
+fi
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ if test x"${USE_COMPAT}" != x; then :
+ CFLAGS="$CFLAGS -fno-inline"
+fi
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+
+fi
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$@"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+fi
+ if test "${TCL_THREADS}" = "1"; then :
+
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+fi
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`"
+ if test $do64bit = yes; then :
+
+ case `arch` in
+ ppc)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; }
+if ${tcl_cv_cc_arch_ppc64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_ppc64=yes
+else
+ tcl_cv_cc_arch_ppc64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5
+$as_echo "$tcl_cv_cc_arch_ppc64" >&6; }
+ if test $tcl_cv_cc_arch_ppc64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+
+fi;;
+ i386)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5
+$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; }
+if ${tcl_cv_cc_arch_x86_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_cc_arch_x86_64=yes
+else
+ tcl_cv_cc_arch_x86_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS=$hold_cflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5
+$as_echo "$tcl_cv_cc_arch_x86_64" >&6; }
+ if test $tcl_cv_cc_arch_x86_64 = yes; then :
+
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+
+fi;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
+$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
+ esac
+
+else
+
+ # Check for combined 32-bit and 64-bit fat build
+ if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then :
+
+ fat_32_64=yes
+fi
+
+fi
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5
+$as_echo_n "checking if ld accepts -single_module flag... " >&6; }
+if ${tcl_cv_ld_single_module+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_single_module=yes
+else
+ tcl_cv_ld_single_module=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5
+$as_echo "$tcl_cv_ld_single_module" >&6; }
+ if test $tcl_cv_ld_single_module = yes; then :
+
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+
+fi
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([0-9]\{1,5\}\)\(\(\.[0-9]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ if test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4; then :
+
+ LDFLAGS="$LDFLAGS -prebind"
+fi
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5
+$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; }
+if ${tcl_cv_ld_search_paths_first+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_search_paths_first=yes
+else
+ tcl_cv_ld_search_paths_first=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5
+$as_echo "$tcl_cv_ld_search_paths_first" >&6; }
+ if test $tcl_cv_ld_search_paths_first = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+
+fi
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h
+
+ tcl_cv_cc_visibility_hidden=yes
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ if test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"; then :
+
+ if test "${TEA_WINDOWINGSYSTEM}" = x11; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5
+$as_echo_n "checking for 64-bit X11... " >&6; }
+if ${tcl_cv_lib_x11_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_x11_64=yes
+else
+ tcl_cv_lib_x11_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5
+$as_echo "$tcl_cv_lib_x11_64" >&6; }
+
+fi
+ if test "${TEA_WINDOWINGSYSTEM}" = aqua; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit Tk" >&5
+$as_echo_n "checking for 64-bit Tk... " >&6; }
+if ${tcl_cv_lib_tk_64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <tk.h>
+int
+main ()
+{
+Tk_InitStubs(NULL, "", 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_lib_tk_64=yes
+else
+ tcl_cv_lib_tk_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_tk_64" >&5
+$as_echo "$tcl_cv_lib_tk_64" >&6; }
+
+fi
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ if test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5
+$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;}
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done
+fi
+
+fi
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+
+$as_echo "#define _OE_SOCKETS 1" >>confdefs.h
+
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ if test "$SHARED_BUILD" = 1; then :
+
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+
+else
+
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+
+fi
+ SHLIB_SUFFIX=".so"
+ if test $doRpath = yes; then :
+
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+fi
+ if test "$GCC" = yes; then :
+ CFLAGS="$CFLAGS -mieee"
+else
+
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"
+fi
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ if test "${TCL_THREADS}" = 1; then :
+
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = yes; then :
+
+ LIBS="$LIBS -lpthread -lmach -lexc"
+
+else
+
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+
+fi
+
+fi
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ if test "$GCC" = yes; then :
+
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+
+else
+
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+
+fi
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[0-6])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+else
+
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+
+fi
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+
+$as_echo "#define _REENTRANT 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = yes; then :
+
+ arch=`isainfo`
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ if test "$GCC" = yes; then :
+
+ if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;}
+
+else
+
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+
+fi
+
+else
+
+ do64bit_ok=yes
+ if test "$do64bitVIS" = yes; then :
+
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+
+else
+
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+
+fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+
+fi
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};;
+ esac
+
+else
+
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+
+fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5
+$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;}
+fi
+fi
+
+fi
+
+ SHLIB_SUFFIX=".so"
+ if test "$GCC" = yes; then :
+
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$do64bit_ok" = yes; then :
+
+ if test "$arch" = "sparcv9 sparc"; then :
+
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+
+else
+ if test "$arch" = "amd64 i386"; then :
+
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+
+fi
+fi
+
+fi
+
+else
+
+ case $system in
+ SunOS-5.[1-9][0-9]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+
+fi
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5
+$as_echo_n "checking for ld accepts -Bexport flag... " >&6; }
+if ${tcl_cv_ld_Bexport+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ tcl_cv_ld_Bexport=yes
+else
+ tcl_cv_ld_Bexport=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$hold_ldflags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5
+$as_echo "$tcl_cv_ld_Bexport" >&6; }
+ if test $tcl_cv_ld_Bexport = yes; then :
+
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+
+fi
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ if test "$do64bit" = yes -a "$do64bit_ok" = no; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5
+$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;}
+
+fi
+
+
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ if test "$GCC" = yes; then :
+
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac
+fi
+
+ if test "$tcl_cv_cc_visibility_hidden" != yes; then :
+
+
+$as_echo "#define MODULE_SCOPE extern" >>confdefs.h
+
+
+fi
+
+ if test "$SHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'
+fi
+ if test "$UNSHARED_LIB_SUFFIX" = ""; then :
+
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'
+fi
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEH support in compiler" >&5
+$as_echo_n "checking for SEH support in compiler... " >&6; }
+if ${tcl_cv_seh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ tcl_cv_seh=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ tcl_cv_seh=yes
+else
+ tcl_cv_seh=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_seh" >&5
+$as_echo "$tcl_cv_seh" >&6; }
+ if test "$tcl_cv_seh" = "no" ; then
+
+$as_echo "#define HAVE_NO_SEH 1" >>confdefs.h
+
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXCEPTION_DISPOSITION support in include files" >&5
+$as_echo_n "checking for EXCEPTION_DISPOSITION support in include files... " >&6; }
+if ${tcl_cv_eh_disposition+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ EXCEPTION_DISPOSITION x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_eh_disposition=yes
+else
+ tcl_cv_eh_disposition=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_eh_disposition" >&5
+$as_echo "$tcl_cv_eh_disposition" >&6; }
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+
+$as_echo "#define EXCEPTION_DISPOSITION int" >>confdefs.h
+
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for winnt.h that ignores VOID define" >&5
+$as_echo_n "checking for winnt.h that ignores VOID define... " >&6; }
+if ${tcl_cv_winnt_ignore_void+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+int
+main ()
+{
+
+ CHAR c;
+ SHORT s;
+ LONG l;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_winnt_ignore_void=yes
+else
+ tcl_cv_winnt_ignore_void=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_winnt_ignore_void" >&5
+$as_echo "$tcl_cv_winnt_ignore_void" >&6; }
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+
+$as_echo "#define HAVE_WINNT_IGNORE_VOID 1" >>confdefs.h
+
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5
+$as_echo_n "checking for cast to union support... " >&6; }
+if ${tcl_cv_cast_to_union+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_cast_to_union=yes
+else
+ tcl_cv_cast_to_union=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5
+$as_echo "$tcl_cv_cast_to_union" >&6; }
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+
+$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h
+
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5
+$as_echo_n "checking for required early compiler flags... " >&6; }
+ tcl_flags=""
+
+ if ${tcl_cv_flag__isoc99_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _ISOC99_SOURCE 1
+#include <stdlib.h>
+int
+main ()
+{
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__isoc99_source=yes
+else
+ tcl_cv_flag__isoc99_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
+
+$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _ISOC99_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile64_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE64_SOURCE 1
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 buf; int i = stat64("/", &buf);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile64_source=yes
+else
+ tcl_cv_flag__largefile64_source=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
+ fi
+
+
+ if ${tcl_cv_flag__largefile_source64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#define _LARGEFILE_SOURCE64 1
+#include <sys/stat.h>
+int
+main ()
+{
+char *p = (char *)open64;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_flag__largefile_source64=yes
+else
+ tcl_cv_flag__largefile_source64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then
+
+$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h
+
+ tcl_flags="$tcl_flags _LARGEFILE_SOURCE64"
+ fi
+
+ if test "x${tcl_flags}" = "x" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5
+$as_echo "${tcl_flags}" >&6; }
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5
+$as_echo_n "checking for 64-bit integer type... " >&6; }
+ if ${tcl_cv_type_64bit+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+__int64 value = (__int64) 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_type_64bit=__int64
+else
+ tcl_type_64bit="long long"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+switch (0) {
+ case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
+ }
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_64bit=${tcl_type_64bit}
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "${tcl_cv_type_64bit}" = none ; then
+
+$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5
+$as_echo "using long" >&6; }
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Tcl header defaults" >&5
+$as_echo "using Tcl header defaults" >&6; }
+ else
+
+cat >>confdefs.h <<_ACEOF
+#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5
+$as_echo "${tcl_cv_type_64bit}" >&6; }
+
+ # Now check for auxiliary declarations
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5
+$as_echo_n "checking for struct dirent64... " >&6; }
+if ${tcl_cv_struct_dirent64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <dirent.h>
+int
+main ()
+{
+struct dirent64 p;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_dirent64=yes
+else
+ tcl_cv_struct_dirent64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5
+$as_echo "$tcl_cv_struct_dirent64" >&6; }
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h
+
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5
+$as_echo_n "checking for struct stat64... " >&6; }
+if ${tcl_cv_struct_stat64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/stat.h>
+int
+main ()
+{
+struct stat64 p;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_struct_stat64=yes
+else
+ tcl_cv_struct_stat64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5
+$as_echo "$tcl_cv_struct_stat64" >&6; }
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+
+$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h
+
+ fi
+
+ for ac_func in open64 lseek64
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
+$as_echo_n "checking for off64_t... " >&6; }
+ if ${tcl_cv_type_off64_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+off64_t offset;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ tcl_cv_type_off64_t=yes
+else
+ tcl_cv_type_off64_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+
+$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ fi
+
+
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5
+$as_echo_n "checking for build with symbols... " >&6; }
+ # Check whether --enable-symbols was given.
+if test "${enable_symbols+set}" = set; then :
+ enableval=$enable_symbols; tcl_ok=$enableval
+else
+ tcl_ok=no
+fi
+
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5
+$as_echo "yes (standard debugging)" >&6; }
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+
+
+
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+
+$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h
+
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5
+$as_echo "enabled symbols mem debugging" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5
+$as_echo "enabled $tcl_ok debugging" >&6; }
+ fi
+ fi
+
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "manifest needed" >/dev/null 2>&1; then :
+
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \$@.manifest ; then mt.exe -nologo -manifest \$@.manifest -outputresource:\$@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+
+ CLEANFILES="$CLEANFILES *.manifest"
+
+
+fi
+rm -f conftest*
+
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+
+
+
+
+
+
+
+
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by ds9 $as_me 7.5, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+ds9 config.status 7.5
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/ds9/win/configure.in b/ds9/win/configure.in
new file mode 100755
index 0000000..4a32194
--- /dev/null
+++ b/ds9/win/configure.in
@@ -0,0 +1,186 @@
+#!/bin/bash -norc
+dnl This file is an input file used by the GNU "autoconf" program to
+dnl generate the file "configure", which is run during Tcl installation
+dnl to configure the system for the local environment.
+
+#-----------------------------------------------------------------------
+# Sample configure.in for Tcl Extensions. The only places you should
+# need to modify this file are marked by the string __CHANGE__
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Set your package name and version numbers here.
+#
+# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
+# set as provided. These will also be added as -D defs in your Makefile
+# so you can encode the package version directly into the source files.
+# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
+# so that we create the export library with the dll.
+#-----------------------------------------------------------------------
+
+AC_INIT([ds9], [7.5])
+
+#--------------------------------------------------------------------
+# Call TEA_INIT as the first TEA_ macro to set up initial vars.
+# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
+# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
+#--------------------------------------------------------------------
+
+TEA_INIT([3.9])
+
+AC_CONFIG_AUX_DIR(tclconfig)
+
+#--------------------------------------------------------------------
+# Load the tclConfig.sh file
+#--------------------------------------------------------------------
+
+TEA_PATH_TCLCONFIG
+TEA_LOAD_TCLCONFIG
+
+#--------------------------------------------------------------------
+# Load the tkConfig.sh file if necessary (Tk extension)
+#--------------------------------------------------------------------
+
+TEA_PATH_TKCONFIG
+TEA_LOAD_TKCONFIG
+
+#-----------------------------------------------------------------------
+# Handle the --prefix=... option by defaulting to what Tcl gave.
+# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
+#-----------------------------------------------------------------------
+
+TEA_PREFIX
+
+#-----------------------------------------------------------------------
+# Standard compiler checks.
+# This sets up CC by using the CC env var, or looks for gcc otherwise.
+# This also calls AC_PROG_CC and a few others to create the basic setup
+# necessary to compile executables.
+#-----------------------------------------------------------------------
+
+TEA_SETUP_COMPILER
+
+#-----------------------------------------------------------------------
+# __CHANGE__
+# Specify the C source files to compile in TEA_ADD_SOURCES,
+# public headers that need to be installed in TEA_ADD_HEADERS,
+# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
+# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
+# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
+# and PKG_TCL_SOURCES.
+#-----------------------------------------------------------------------
+
+#TEA_ADD_SOURCES([sample.c tclsample.c])
+#TEA_ADD_HEADERS([])
+#TEA_ADD_INCLUDES([])
+TEA_ADD_LIBS([-lstdc++])
+#TEA_ADD_CFLAGS([])
+#TEA_ADD_STUB_SOURCES([])
+#TEA_ADD_TCL_SOURCES([])
+
+#--------------------------------------------------------------------
+# __CHANGE__
+#
+# You can add more files to clean if your extension creates any extra
+# files by extending CLEANFILES.
+# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
+# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
+#
+# A few miscellaneous platform-specific items:
+# TEA_ADD_* any platform specific compiler/build info here.
+#--------------------------------------------------------------------
+
+#CLEANFILES="$CLEANFILES pkgIndex.tcl"
+if test "${TEA_PLATFORM}" = "windows" ; then
+ # Ensure no empty if clauses
+ :
+ #TEA_ADD_SOURCES([win/winFile.c])
+ #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
+else
+ # Ensure no empty else clauses
+ :
+ #TEA_ADD_SOURCES([unix/unixFile.c])
+ #TEA_ADD_LIBS([-lsuperfly])
+fi
+
+#--------------------------------------------------------------------
+# __CHANGE__
+# Choose which headers you need. Extension authors should try very
+# hard to only rely on the Tcl public header files. Internal headers
+# contain private data structures and are subject to change without
+# notice.
+# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
+#--------------------------------------------------------------------
+
+TEA_PUBLIC_TCL_HEADERS
+#TEA_PRIVATE_TCL_HEADERS
+
+TEA_PUBLIC_TK_HEADERS
+#TEA_PRIVATE_TK_HEADERS
+#TEA_PATH_X
+
+#--------------------------------------------------------------------
+# Check whether --enable-threads or --disable-threads was given.
+# This auto-enables if Tcl was compiled threaded.
+#--------------------------------------------------------------------
+
+#TEA_ENABLE_THREADS
+
+#--------------------------------------------------------------------
+# The statement below defines a collection of symbols related to
+# building as a shared library instead of a static library.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_SHARED
+
+#--------------------------------------------------------------------
+# This macro figures out what flags to use with the compiler/linker
+# when building shared/static debug/optimized objects. This information
+# can be taken from the tclConfig.sh file, but this figures it all out.
+#--------------------------------------------------------------------
+
+TEA_CONFIG_CFLAGS
+
+#--------------------------------------------------------------------
+# Set the default compiler switches based on the --enable-symbols option.
+#--------------------------------------------------------------------
+
+TEA_ENABLE_SYMBOLS
+
+#--------------------------------------------------------------------
+# Everyone should be linking against the Tcl stub library. If you
+# can't for some reason, remove this definition. If you aren't using
+# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
+# link against the non-stubbed Tcl library. Add Tk too if necessary.
+#--------------------------------------------------------------------
+
+#AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
+#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
+
+#--------------------------------------------------------------------
+# This macro generates a line to use when building a library. It
+# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
+# and TEA_LOAD_TCLCONFIG macros above.
+#--------------------------------------------------------------------
+
+TEA_MAKE_LIB
+
+#--------------------------------------------------------------------
+# Determine the name of the tclsh and/or wish executables in the
+# Tcl and Tk build directories or the location they were installed
+# into. These paths are used to support running test cases only,
+# the Makefile should not be making use of these paths to generate
+# a pkgIndex.tcl file or anything else at extension build time.
+#--------------------------------------------------------------------
+
+#TEA_PROG_TCLSH
+#TEA_PROG_WISH
+
+#--------------------------------------------------------------------
+# Finally, substitute all of the various values into the Makefile.
+# You may alternatively have a special pkgIndex.tcl.in or other files
+# which require substituting th AC variables in. Include these here.
+#--------------------------------------------------------------------
+
+AC_OUTPUT([Makefile])
diff --git a/ds9/win/ds9.C b/ds9/win/ds9.C
new file mode 100644
index 0000000..6291ebf
--- /dev/null
+++ b/ds9/win/ds9.C
@@ -0,0 +1,248 @@
+// Copyright (C) 1999-2015
+// Smithsonian Astrophysical Observatory, Cambridge, MA, USA
+// For conditions of distribution and use, see copyright notice in "copyright"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <iostream>
+#include <sstream>
+using namespace std;
+
+#include <tcl.h>
+#include <tk.h>
+
+#define DEBUGS(x) {FILE* fp=fopen("debug.txt","a+");fprintf(fp,"%s\n",x);fclose(fp);}
+
+extern "C" {
+ int SAOAppInit(Tcl_Interp *interp);
+ int SAOLocalMainHook(int* argc, char*** argv);
+
+ void TclSetStartupScriptFileName(const char*);
+
+ int Tkblt_Init(Tcl_Interp*);
+ int Tktable_Init(Tcl_Interp*);
+ // int Tclcheckdns_Init(Tcl_Interp*);
+ int Tksao_Init(Tcl_Interp*);
+ int Tkhtml1_Init(Tcl_Interp*);
+ int Tkmpeg_Init(Tcl_Interp*);
+
+ int Tkimg_Init(Tcl_Interp*);
+ int Zlibtcl_Init(Tcl_Interp*);
+ int Jpegtcl_Init(Tcl_Interp*);
+ int Tkimgjpeg_Init(Tcl_Interp*);
+ int Tifftcl_Init(Tcl_Interp*);
+ int Tkimgtiff_Init(Tcl_Interp*);
+ int Pngtcl_Init(Tcl_Interp*);
+ int Tkimgpng_Init(Tcl_Interp*);
+ int Tkimggif_Init(Tcl_Interp*);
+ int Tkimgwindow_Init(Tcl_Interp*);
+
+ int Tclxpa_Init(Tcl_Interp*);
+ // int Tcliis_Init(Tcl_Interp*);
+
+ int Tclxml_Init(Tcl_Interp*);
+ int Tclxml_libxml2_Init(Tcl_Interp*);
+
+ // int Signal_ext_Init(Tcl_Interp*);
+
+ int Tkwin32_Init(Tcl_Interp*);
+}
+
+Tcl_Interp *global_interp;
+
+void internalError(const char* msg)
+{
+ Tcl_SetVar2(global_interp, "ds9", "msg", msg, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2(global_interp, "ds9", "msg,level", "error", TCL_GLOBAL_ONLY);
+}
+
+#define PATHSIZE 2048
+int SAOLocalMainHook(int* argcPtr, char*** argvPtr)
+{
+ // sync C++ io calls with C io calls
+ ios::sync_with_stdio();
+
+ // use exec path
+ char** argv = *argvPtr;
+ char ss[PATHSIZE];
+ strncpy(ss,argv[0],PATHSIZE);
+
+ // now remove "/ds9.exe"
+ char* ptr = ss+strlen(ss);
+ while (*ptr != '/' && ptr != ss)
+ ptr--;
+ *ptr = '\0';
+
+ char rr[PATHSIZE];
+
+ // so that tcl and tk know where to find their libs
+ // we do it here before InitLibraryPath is called
+ {
+ strncpy(rr,ss,PATHSIZE);
+ strncat(rr,"/tcl8.6",PATHSIZE);
+ ostringstream str;
+ str << "TCL_LIBRARY=" << rr << ends;
+ putenv((char*)str.str().c_str());
+ }
+
+ {
+ strncpy(rr,ss,PATHSIZE);
+ strncat(rr,"/tk8.6",PATHSIZE);
+ ostringstream str;
+ str << "TK_LIBRARY=" << rr << ends;
+ putenv((char*)str.str().c_str());
+ }
+
+ // do this first
+ Tcl_FindExecutable((*argvPtr)[0]);
+
+ // and add startup script
+ strncpy(rr,ss,PATHSIZE);
+ strncat(rr,"/library/ds9.tcl",PATHSIZE);
+ Tcl_Obj *path = Tcl_NewStringObj(rr,-1);
+ Tcl_SetStartupScript(path, NULL);
+
+ return TCL_OK;
+}
+
+int SAOAppInit(Tcl_Interp *interp)
+{
+ // save interp for cputs function
+ global_interp = interp;
+
+ // Initialize Tcl and Tk
+ if (Tcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tk
+ if (Tk_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp,"Tk", Tk_Init, Tk_SafeInit);
+
+ // Tkblt
+ if (Tkblt_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage(interp, "tkblt", Tkblt_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tktable
+ if (Tktable_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tktable", Tktable_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclcheckdns
+ // if (Tclcheckdns_Init(interp) == TCL_ERROR)
+ // return TCL_ERROR;
+ // Tcl_StaticPackage (interp, "tclcheckdns", Tclcheckdns_Init,
+ // (Tcl_PackageInitProc*)NULL);
+
+ // Tksao
+ if (Tksao_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tksao", Tksao_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkhtml1
+ if (Tkhtml1_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkhtml1", Tkhtml1_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxpa
+ if (Tclxpa_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "Tclxpa", Tclxpa_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tcliis
+ // if (Tcliis_Init(interp) == TCL_ERROR)
+ // return TCL_ERROR;
+ // Tcl_StaticPackage (interp, "tcliis", Tcliis_Init,
+ // (Tcl_PackageInitProc*)NULL);
+
+ // Tkmpeg
+ if (Tkmpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkmpeg", Tkmpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tclxml
+ if (Tclxml_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+
+ // Tkimg
+ if (Tkimg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "img", Tkimg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // zlibtcl
+ if (Zlibtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "zlibtcl", Zlibtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // jpegtcl
+ if (Jpegtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpegtcl", Jpegtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgjpeg
+ if (Tkimgjpeg_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "jpeg", Tkimgjpeg_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tifftcl
+ if (Tifftcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tifftcl", Tifftcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgtiff
+ if (Tkimgtiff_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tiff", Tkimgtiff_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Pngtcl
+ if (Pngtcl_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "pngtcl", Pngtcl_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgpng
+ if (Tkimgpng_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "png", Tkimgpng_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimggif
+ if (Tkimggif_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "gif", Tkimggif_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Tkimgwindow
+ if (Tkimgwindow_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "window", Tkimgwindow_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ // Signal_Ext
+ // if (Signal_ext_Init(interp) == TCL_ERROR)
+ // return TCL_ERROR;
+ // Tcl_StaticPackage (interp, "signal", Signal_ext_Init,
+ // (Tcl_PackageInitProc*)NULL);
+
+ // Tkwin32
+ if (Tkwin32_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tkwin32", Tkwin32_Init,
+ (Tcl_PackageInitProc*)NULL);
+
+ return TCL_OK;
+}
diff --git a/ds9/win/ds9.ico b/ds9/win/ds9.ico
new file mode 100644
index 0000000..916602b
--- /dev/null
+++ b/ds9/win/ds9.ico
Binary files differ
diff --git a/ds9/win/ds9.rc b/ds9/win/ds9.rc
new file mode 100644
index 0000000..8e654d8
--- /dev/null
+++ b/ds9/win/ds9.rc
@@ -0,0 +1,134 @@
+#include <windows.h>
+
+#define VV "7.5rc2"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 7,5,0,0
+ PRODUCTVERSION 7,5,0,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "SAOImage DS9 " VV
+ VALUE "OriginalFilename", "ds9.exe"
+ VALUE "CompanyName", "Smithsonian Astrophysical Observatory"
+ VALUE "FileVersion", VV
+ VALUE "LegalCopyright", "Copyright 1999-2016 by Smithsonian Astrophysical Observatory"
+ VALUE "ProductName", "SAOImage DS9"
+ VALUE "ProductVersion", VV
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+tk ICON DISCARDABLE "ds9.ico"
+
+//
+// Bitmaps
+//
+
+buttons BITMAP DISCARDABLE "buttons.bmp"
+
+//
+// Cursors
+//
+
+X_cursor CURSOR DISCARDABLE "cursor00.cur"
+arrow CURSOR DISCARDABLE "cursor02.cur"
+based_arrow_down CURSOR DISCARDABLE "cursor04.cur"
+based_arrow_up CURSOR DISCARDABLE "cursor06.cur"
+boat CURSOR DISCARDABLE "cursor08.cur"
+bogosity CURSOR DISCARDABLE "cursor0a.cur"
+bottom_left_corner CURSOR DISCARDABLE "cursor0c.cur"
+bottom_right_corner CURSOR DISCARDABLE "cursor0e.cur"
+bottom_side CURSOR DISCARDABLE "cursor10.cur"
+bottom_tee CURSOR DISCARDABLE "cursor12.cur"
+box_spiral CURSOR DISCARDABLE "cursor14.cur"
+center_ptr CURSOR DISCARDABLE "cursor16.cur"
+circle CURSOR DISCARDABLE "cursor18.cur"
+clock CURSOR DISCARDABLE "cursor1a.cur"
+coffee_mug CURSOR DISCARDABLE "cursor1c.cur"
+cross CURSOR DISCARDABLE "cursor1e.cur"
+cross_reverse CURSOR DISCARDABLE "cursor20.cur"
+crosshair CURSOR DISCARDABLE "cursor22.cur"
+diamond_cross CURSOR DISCARDABLE "cursor24.cur"
+dot CURSOR DISCARDABLE "cursor26.cur"
+dotbox CURSOR DISCARDABLE "cursor28.cur"
+double_arrow CURSOR DISCARDABLE "cursor2a.cur"
+draft_large CURSOR DISCARDABLE "cursor2c.cur"
+draft_small CURSOR DISCARDABLE "cursor2e.cur"
+draped_box CURSOR DISCARDABLE "cursor30.cur"
+exchange CURSOR DISCARDABLE "cursor32.cur"
+fleur CURSOR DISCARDABLE "cursor34.cur"
+gobbler CURSOR DISCARDABLE "cursor36.cur"
+gumby CURSOR DISCARDABLE "cursor38.cur"
+hand1 CURSOR DISCARDABLE "cursor3a.cur"
+hand2 CURSOR DISCARDABLE "cursor3c.cur"
+heart CURSOR DISCARDABLE "cursor3e.cur"
+icon CURSOR DISCARDABLE "cursor40.cur"
+iron_cross CURSOR DISCARDABLE "cursor42.cur"
+left_ptr CURSOR DISCARDABLE "cursor44.cur"
+left_side CURSOR DISCARDABLE "cursor46.cur"
+left_tee CURSOR DISCARDABLE "cursor48.cur"
+leftbutton CURSOR DISCARDABLE "cursor4a.cur"
+ll_angle CURSOR DISCARDABLE "cursor4c.cur"
+lr_angle CURSOR DISCARDABLE "cursor4e.cur"
+man CURSOR DISCARDABLE "cursor50.cur"
+middlebutton CURSOR DISCARDABLE "cursor52.cur"
+mouse CURSOR DISCARDABLE "cursor54.cur"
+pencil CURSOR DISCARDABLE "cursor56.cur"
+pirate CURSOR DISCARDABLE "cursor58.cur"
+plus CURSOR DISCARDABLE "cursor5a.cur"
+question_arrow CURSOR DISCARDABLE "cursor5c.cur"
+right_ptr CURSOR DISCARDABLE "cursor5e.cur"
+right_side CURSOR DISCARDABLE "cursor60.cur"
+right_tee CURSOR DISCARDABLE "cursor62.cur"
+rightbutton CURSOR DISCARDABLE "cursor64.cur"
+rtl_logo CURSOR DISCARDABLE "cursor66.cur"
+sailboat CURSOR DISCARDABLE "cursor68.cur"
+sb_down_arrow CURSOR DISCARDABLE "cursor6a.cur"
+sb_h_double_arrow CURSOR DISCARDABLE "cursor6c.cur"
+sb_left_arrow CURSOR DISCARDABLE "cursor6e.cur"
+sb_right_arrow CURSOR DISCARDABLE "cursor70.cur"
+sb_up_arrow CURSOR DISCARDABLE "cursor72.cur"
+sb_v_double_arrow CURSOR DISCARDABLE "cursor74.cur"
+shuttle CURSOR DISCARDABLE "cursor76.cur"
+sizing CURSOR DISCARDABLE "cursor78.cur"
+spider CURSOR DISCARDABLE "cursor7a.cur"
+spraycan CURSOR DISCARDABLE "cursor7c.cur"
+star CURSOR DISCARDABLE "cursor7e.cur"
+target CURSOR DISCARDABLE "cursor80.cur"
+tcross CURSOR DISCARDABLE "cursor82.cur"
+top_left_arrow CURSOR DISCARDABLE "cursor84.cur"
+top_left_corner CURSOR DISCARDABLE "cursor86.cur"
+top_right_corner CURSOR DISCARDABLE "cursor88.cur"
+top_side CURSOR DISCARDABLE "cursor8a.cur"
+top_tee CURSOR DISCARDABLE "cursor8c.cur"
+trek CURSOR DISCARDABLE "cursor8e.cur"
+ul_angle CURSOR DISCARDABLE "cursor90.cur"
+umbrella CURSOR DISCARDABLE "cursor92.cur"
+ur_angle CURSOR DISCARDABLE "cursor94.cur"
+watch CURSOR DISCARDABLE "cursor96.cur"
+xterm CURSOR DISCARDABLE "cursor98.cur"
+none CURSOR DISCARDABLE "cursor9a.cur"
+
+//
+// This enables themed scrollbars in XP by trying to use comctl32 v6.
+//
+
+#ifndef RT_MANIFEST
+#define RT_MANIFEST 24
+#endif
+#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#endif
+
diff --git a/ds9/win/install.vbs b/ds9/win/install.vbs
new file mode 100644
index 0000000..7223ce0
--- /dev/null
+++ b/ds9/win/install.vbs
@@ -0,0 +1,15 @@
+'
+' Copy to destination
+'
+'dim fso
+'set fso = CreateObject("Scripting.FileSystemObject")
+'fso.CopyFolder "..\WZSE0.TMP","c:\ds9",True
+'
+' Create a ds9 shortcut on the Desktop
+'
+set WshShell = CreateObject("WScript.Shell")
+strDesktop = WshShell.SpecialFolders("Desktop")
+set oMyShortCut= WshShell.CreateShortcut(strDesktop+"\SAOImage DS9.lnk")
+oMyShortCut.WindowStyle = 7
+oMyShortCut.TargetPath = "c:\ds9\ds9.exe"
+oMyShortCut.Save
diff --git a/ds9/win/message.txt b/ds9/win/message.txt
new file mode 100644
index 0000000..7292b86
--- /dev/null
+++ b/ds9/win/message.txt
@@ -0,0 +1 @@
+To install SAOImage DS9 in C:\ds9, please select the Setup button.
diff --git a/ds9/win/tclconfig/ChangeLog b/ds9/win/tclconfig/ChangeLog
new file mode 100644
index 0000000..ffda2bb
--- /dev/null
+++ b/ds9/win/tclconfig/ChangeLog
@@ -0,0 +1,980 @@
+2013-07-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [3324676]: AC_PROG_INSTALL incompat,
+ Bug [3606445]: Unneeded -DHAVE_NO_SEH=1 when not building on Windows
+
+2013-07-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Bug [32afa6e256]: dirent64 check is incorrect in tcl.m4
+ (thanks to Brian Griffin)
+
+2013-06-20 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Use X11/Xlib.h for checking where X11 can be found
+ in stead of X11/XIntrinsic.h. Suggested by Pietro Cerutti.
+
+2013-06-04 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Eliminate NO_VIZ macro as current
+ zlib uses HAVE_HIDDEN in stead. One more last-moment
+ fix for FreeBSD by Pietro Cerutti
+
+2013-05-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Fix for FreeBSD, and remove support for old
+ FreeBSD versions. Patch by Pietro Cerutti
+
+2013-03-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * unix/tcl.m4: Patch by Andrew Shadura, providing better support for
+ * three architectures they have in Debian.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Added "-DNDEBUG" to CFLAGS_DEFAULT
+ when building with --disable-symbols.
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3555058]: Checkin [30736d63f0] broke
+ CFLAGS_DEFAULT, LDFLAGS_DEFAULT
+
+2012-08-07 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-08-07 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806]: Checkin [30736d63f0] broke CFLAGS
+
+2012-07-25 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: My previous commit (2012-04-03) broke the ActiveTcl
+ build for AMD64, because of the quotes in "C:/<path>/AMD64/cl.exe".
+ It turns out that the AC_TRY_COMPILE macro cannot handle that.
+
+2012-07-22 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Tidy: consistency, spelling, phrasing, whitespace.
+ No functional change.
+
+2012-04-03 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 3511806] Compiler checks too early
+ This change allows to build the cygwin and mingw32 ports of
+ Tcl/Tk extensions to build out-of-the-box using a native or
+ cross-compiler, e.g. on Cygwin, Linux or Darwin.
+
+2011-04-02 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh: Fix issue with library stripping in install-sh
+ (backported from kevin_walzer's patch from Tcl 8.6 trunk)
+
+2011-04-05 Andreas Kupries <andreask@activestate.com>
+
+ * tcl.m4: Applied patch by Jeff Lawson. Nicer error message when
+ tclConfig.sh was not found.
+
+2010-12-15 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * install-sh: Upgrade to newer install-sh and use it.
+ * tcl.m4:
+
+2010-12-14 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Better building on OpenBSD.
+
+2010-12-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: when using gcc, don't try to determine Win64 SDK
+
+2010-12-12 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Determine correctly a cross-compiler-windres
+
+2010-11-23 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: add some cross-compile support, borrowed from Tcl 8.6
+
+2010-09-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX LDFLAGS (only used when building big shell)
+
+2010-09-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add extra if check for .manifest file generation
+ Add notice about package name and version being built.
+
+2010-09-09 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [FREQ #3058486] TEA_LOAD_CONFIG doesn't set all BUILD_ vars
+ Slightly related: defining BUILD_$1 on all platforms - not only win -
+ allows the -fvisibility feature to be used in extensions as well, at
+ least if you compile against tcl >= 8.5.
+
+2010-08-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: ensure safe quoting for autoheader usage
+
+2010-08-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add TEA_ADD_CLEANFILES macro to make adding cleanfiles
+ easier, and add *.exp to CLEANFILES Windows default.
+ (TEA_MAKE_LIB): Enhanced to check for MSVC that requires manifests
+ and auto-embed it into proj DLL via MAKE_SHARED_LIB. Also define
+ VC_MANIFEST_EMBED_DLL and VC_MANIFEST_EMBED_EXE that do the same
+ magic in case it is needed for extended TEA projects.
+
+2010-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.9 ***
+ If upgrading from TEA_VERSION 3.8, copy over tcl.m4, change
+ TEA_INIT to use 3.9 and reconfigure (ac-2.59+).
+ BUILD_${PACKAGE_NAME} will be auto-defined on Windows for
+ correct setting of TCL_STORAGE_CLASS.
+ TEA_LOAD_CONFIG users should remove the SHLIB_LD_LIBS setting done
+ in configure.in (LIBS will be automagically populated by
+ TEA_LOAD_CONFIG).
+ TEA_EXPORT_CONFIG has been added for ${pkg}Config.sh creators
+ SHLIB_LD_FLAGS was deprecated a while ago, remove it if it is
+ still in your Makefile.in.
+
+ * tcl.m4: add /usr/lib64 to set of auto-search dirs. [Bug 1230554]
+ Auto-define BUILD_$PACKAGE_NAME so users don't need to. This
+ needs to correspond with $pkg.h define magic for TCL_STORAGE_CLASS.
+ Auto-define CLEANFILES. Users can expand it.
+ (SHLIB_LD_LIBS): define to '${LIBS}' default and change it only if
+ necessary. Platforms not using this may simply not work or have
+ very funky linkers.
+ (TEA_LOAD_CONFIG): When loading config for another extension,
+ auto-add stub libraries found with TEA_ADD_LIBS. Eases
+ configure.in for modules like itk and img::*.
+ (TEA_EXPORT_CONFIG): Add standardized function for exporting a
+ ${pkg}Config.sh. See use by img::* and itcl.
+
+2010-08-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.8 ***
+ If upgrading from TEA_VERSION 3.7, copy over tcl.m4, change
+ TEA_INIT to use 3.8 and reconfigure (ac-2.59+).
+ No other changes should be necessary.
+
+ * tcl.m4: remove more vestigial bits from removed platforms.
+ Add back SCO_SV-3.2*.
+ Remove use of DL_LIBS and DL_OBJS and related baggage - these are
+ only needed by the core to support 'load'.
+ Allow for macosx in TEA_ADD_SOURCES.
+ Correct check for found_xincludes=no in TEA_PATH_UNIX_X.
+
+2010-08-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove the following old platform configurations:
+ UNIX_SV*|UnixWare-5*, SunOS-4.*, SINIX*5.4*, SCO_SV-3.2*<readded>,
+ OSF1-1.*, NEXTSTEP-*, NetBSD-1.*|FreeBSD-[[1-2]].*, MP-RAS-*,
+ IRIX-5.*, HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*, dgux*,
+ BSD/OS-2.1*|BSD/OS-3*
+ (AIX): drop AIX-pre4 support and use of ldAix, use -bexpall/-brtl
+
+2010-07-05 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Patch #1055668] removal of exported internals from
+ tclInt.h (EXTERN macro)
+
+2010-04-14 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4 - Backport a lot of quoting fixes from tcl8.6/unix/tcl.m4
+ - Fix determination of CYGPATH for CYGWIN
+ With those fixes, itcl and tdbc compile fine with CYGWIN
+
+2010-04-06 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * install-sh [Bug 2982540] configure and install* script files
+ should always have LF
+
+2010-02-19 Stuart Cassoff <stwo@users.sourceforge.net>
+
+ * tcl.m4: Correct compiler/linker flags for threaded builds on
+ OpenBSD.
+
+2010-01-19 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: Detect CYGWIN variant: win32 or unix
+
+2010-01-03 Donal K. Fellows <dkf@users.sf.net>
+
+ * unix/tcl.m4 (TEA_CONFIG_CFLAGS): [Tcl Bug 1636685]: Use the
+ configuration for modern FreeBSD suggested by the FreeBSD porter.
+
+2009-10-22 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Tcl Patch #2883533] tcl.m4 support for Haiku OS
+
+2009-04-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): harden the check to add _r to CC on
+ AIX with threads.
+
+2009-04-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): check for 64-bit TkAqua.
+
+2009-03-26 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tclconfig/tcl.m4: Adapt LDFLAGS and LD_SEARCH_FLAGS
+ together with SHLIB_LD definition to unbreak building on HPUX.
+
+2009-03-20 Andreas Kupries <andreask@activestate.com>
+
+ * tclconfig/tcl.m4: Changed SHLIB_LD definition to unbreak
+ building on HPUX.
+
+2009-03-16 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4(TEA_PUBLIC_TK_HEADERS): Look at ${TK_INCLUDE_SPEC}
+ (found in tkConfig.sh) when trying to guess where tk.h might be
+ [Patch 1960628].
+
+2009-03-11 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Allow ${SHLIB_SUFFIX} to be overridden at
+ configure-time [Patch 1960628]. Also fix some comment typos,
+ and an uninitialized variable bug-waiting-to-happen.
+
+2008-12-21 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * tcl.m4: [Bug 2073255] Tcl_GetString(NULL) doesn't crash on HP-UX
+ (this bug report was for Tcl, but holds for TEA as well.)
+
+2008-12-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: sync with tdbc tcl.m4 changes
+ (SunOS-5.11): Sun cc SHLIB_LD: use LDFLAGS_DEFAULT instead of LDFLAGS
+
+2008-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.7 ***
+
+ * tcl.m4: in private header check, check for <plat>Port.h instead
+ of Int.h to ensure all private headers are available.
+
+2008-11-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): sync TEA_PRIVATE_TK_HEADERS handling of
+ Tk.framework PrivateHeaders with TEA_PRIVATE_TCL_HEADERS.
+
+2008-11-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG, TEA_PATH_TKCONFIG): exit with error
+ when tclConfig.sh cannot be found. [Bug #1997760]
+ (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): allow for
+ finding the headers installed in the public areas, e.g. a result of
+ make install-private-headers. [Bug #1631922]
+
+2008-08-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): link shlib with current and compatiblity version
+ flags; look for libX11.dylib when searching for X11 libraries.
+
+2008-06-12 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc.
+
+2008-03-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166]
+
+2008-02-01 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Updated to work at least in part with
+ more modern VC versions. Currently just made the linker flags more
+ flexible; more work may be needed.
+
+2007-10-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for 64-bit X11.
+
+2007-10-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Tagged tea-3-branch to start TEA 4 development on HEAD ***
+
+2007-09-17 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable'
+ to build shared libraries on current NetBSDs [Bug 1749251].
+
+2007-09-15 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: replace all direct references to compiler by ${CC} to
+ enable CC overriding at configure & make time.
+ (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by
+ 'cc' compiler driver.
+
+2007-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check Ttk dir for Tk private headers (8.5).
+ Add some comments to other bits.
+
+2007-06-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): move where / is added.
+
+2007-06-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: fix --with-tkinclude alignment. [Bug 1506111]
+
+2007-06-06 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fix 64bit arch removal in fat 32&64bit builds.
+
+2007-05-18 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * tcl.m4: Added quoting so that paths with spaces cause fewer
+ problems.
+
+2007-03-07 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in -mmacosx-version-min check.
+
+2007-02-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct private header check to search in generic subdir
+
+2007-02-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA_VERSION 3.6 ***
+
+ * tcl.m4: correct -d to -f
+ (TEA_CONFIG_CFLAGS): SHLIB_SUFFIX is .so on HP ia64 [Bug 1615058]
+
+2007-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): check
+ that the dirs actually have private headers. [Bug 1631922]
+
+2007-02-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching to -pipe check.
+
+2007-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and
+ move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to
+ avoid errors about multiple -isysroot flags from some older gcc builds.
+
+2006-01-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861]
+ (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when
+ present in CFLAGS to avoid discrepancies between what headers configure
+ sees during preprocessing tests and compiling tests.
+
+2006-12-19 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch flag
+ succeeds before enabling 64bit build.
+
+2006-12-16 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): fix previous change to use makefile variable
+ LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker
+ flags in sampleextension Makefile are picked up.
+
+2006-11-26 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558]
+
+2006-08-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for
+ universal builds including x86_64 and for use of -mmacosx-version-min
+ instead of MACOSX_DEPLOYMENT_TARGET. For Tk extensions, remove 64-bit
+ arch flags from CFLAGS like in the Tk configure, as neither TkAqua nor
+ TkX11 can be built for 64-bit at present.
+
+2006-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: []-quote AC_DEFUN functions.
+ (TEA_PATH_TKCONFIG): Fixed Windows-specific check for tkConfig.sh.
+ (TEA_MAKE_LIB): Prepend 'lib' for Windows-gcc configs.
+
+2006-03-07 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD,
+ as per the other *BSD variants [Bug 1334613].
+
+2006-01-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** Bump to TEA version 3.5 ***
+
+ * tcl.m4: keep LD_SEARCH_FLAGS and CC_SEARCH_FLAGS synchronous
+ with core tcl.m4 meaning.
+
+2006-01-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): use makefile variable LDFLAGS_DEFAULT instead of
+ LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile
+ are picked up. [Bug 1403343]
+
+2006-01-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add C:/Tcl/lib and C:/Progra~1/Tcl/lib dirs to check for
+ *Config.sh on Windows. [Bug 1407544]
+
+2006-01-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): for Tk extensions, remove -arch ppc64 from CFLAGS
+ like in the Tk configure, as neither TkAqua nor TkX11 can be built for
+ 64bit at present (no 64bit GUI libraries).
+
+2006-01-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: restore system=windows on Windows.
+ Remove error if 'ar' isn't found (it may not be on Windows).
+ Do not add -lxnet or define _XOPEN_SOURCE on HP-UX by default.
+ Ensure the C|LDFLAGS_DEFAULT gets the fully sub'd value at
+ configure time.
+
+2006-01-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: add caching, use AC_CACHE_CHECK instead of AC_CACHE_VAL
+ where possible, consistent message quoting, sync relevant
+ tcl/unix/tcl.m4 HEAD changes and gratuitous formatting differences
+ (notably sunc removal of support for for ancient BSD's, IRIX 4,
+ RISCos and Ultrix by kennykb), Darwin improvements to
+ TEA_LOAD_*CONFIG to make linking work against Tcl/Tk frameworks
+ installed in arbitrary location, change TEA_PROG_* search order
+ (look in *_BIN_DIR parents before *_PREFIX).
+
+2006-01-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add dkf's system config refactor
+
+2006-01-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove extraneous ' that causes bash 3.1 to choke
+
+2005-12-19 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_TCLCONFIG &c): Look for tclConfig.sh &c
+ in ${libdir}, where they are installed by default [Patch #1377407].
+
+2005-12-05 Don Porter <dgp@users.sf.net>
+
+ * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding
+ header files for uninstalled Tcl and Tk.
+
+2005-12-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correctly bump TEA_VERSION var to 3.4
+
+2005-12-01 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset
+
+2005-11-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Bump to TEA version 3.4 ***
+ Add Windows x64 build support.
+ Remove TEA_PATH_NOSPACE and handle the problem with ""s where
+ necessary - the macro relied on TCLSH_PROG which didn't work for
+ cross-compiles.
+
+2005-11-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to
+ support passing -isysroot in env(CFLAGS) to configure (flag can't
+ be present twice, so can't be in both CFLAGS and LDFLAGS during
+ configure), don't use -prebind when deploying on 10.4.
+ (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching.
+
+2005-10-30 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that
+ should have been for `uname -s` = "Darwin" instead; added some
+ missing quoting.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that
+ install location of tclConfig.sh/tkConfig.sh allows to determine
+ the tclsh/wish install dir via ../bin. Indeed tcl/tk can be
+ configured with arbitrary --libdir and --bindir (independent of
+ prefix) and such a configuration is in fact standard with Darwin
+ framework builds. At least now also check ${TCL_PREFIX}/bin
+ resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk
+ have been configured with arbitrary --bindir, this will still not
+ find them, for a general solution *Config.sh would need to contain
+ the values of bindir/libdir/includedir passed to configure).
+
+2005-10-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds.
+
+2005-10-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro
+ (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func
+
+2005-09-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: *** Update to TEA version 3.3 ***
+ define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG.
+ Make --enable-threads the default (users can --disable-threads).
+ Improve AIX ${CC}_r fix to better check existing ${CC} value.
+ Do the appropriate evals to not require the *TOP_DIR_NATIVE vars
+ be set for extensions that use private headers.
+ Make aqua check for Xlib compat headers the same as win32.
+
+2005-07-26 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH): Remove
+ TEA_BUILD_TCLSH and TEA_BUILD_WISH because
+ of complaints that it broke the build when
+ only an installed version of Tcl was available
+ at extension build time. The TEA_PROG_TCLSH and
+ TEA_PROG_WISH macros will no longer search the
+ path at all. The build tclsh or installed
+ tclsh shell will now be found by TEA_PROG_TCLSH.
+
+2005-07-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH,
+ TEA_PROG_WISH, TEA_BUILD_WISH):
+ Split confused search for tclsh on PATH and
+ build and install locations into two macros.
+ TEA_PROG_TCLSH and TEA_PROG_WISH search the
+ system PATH for an installed tclsh or wish.
+ The TEA_BUILD_TCLSH and TEA_BUILD_WISH
+ macros determine the name of tclsh or
+ wish in the Tcl or Tk build directory even
+ if tclsh or wish has not yet been built.
+ [Tcl bug 1160114]
+ [Tcl patch 1244153]
+
+2005-06-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to
+ TK_INCLUDES when building against TkAqua.
+
+ * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE
+
+ * tcl.m4: changes to better support framework builds of Tcl and Tk out
+ of the box: search framework install locations for *Config.sh, and if in
+ presence of a framework build, use the framework's Headers and
+ PrivateHeaders directories for public and private includes. [FR 947735]
+
+2005-06-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to
+ ensure we can always relocate binaries with install_name_tool.
+
+2005-06-04 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib
+ compat headers are available in tkheaders location, otherwise add xlib
+ sourcedir to TK_XINCLUDES.
+
+2005-04-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow
+ use with autoheader.
+ (Darwin): added configure checks for recently added linker flags
+ -single_module and -search_paths_first to allow building with older
+ tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD.
+ (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check.
+ (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4).
+
+2005-03-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide
+ int type only on Windows when __int64 is detected as valid.
+
+2005-03-24 Don Porter <dgp@users.sf.net>
+
+ * README.txt: Update reference to "SC_* macros" to "TEA_* macros".
+ * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG
+ and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG.
+ Corrected search path in TEA_PATH_CONFIG and added
+ AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load
+ the configuration of another package can know where they loaded
+ it from.
+
+2005-03-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have
+ variant LD_SEARCH_FLAGS for gcc and cc builds.
+
+ * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check.
+
+2005-03-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Correct gcc build and HP-UX-11.
+
+2005-02-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -.
+ (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build.
+ (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed).
+
+2005-02-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: redo of 2005-01-27 changes to correctly handle paths
+ with spaces. Win/CE and Win/64 builds now require a prebuilt
+ tclsh to handle conversion to short pathnames. This is done in
+ the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the
+ compiler and move the necessary includes to CFLAGS.
+ (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support.
+ (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to
+ be set in the env and prevent resetting.
+ (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib
+ args to -lfoo, for use with mingw.
+ *** POTENTIAL INCOMPATABILITY ***
+ (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box.
+ Bumped TEA to 3.2.
+
+2005-01-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: remove cygpath calls to support msys.
+ Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003".
+ Make STLIB_LD use $LINKBIN -lib.
+
+2005-01-25 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (Darwin): fixed bug with static build linking to dynamic
+ library in /usr/lib etc instead of linking to static library earlier
+ in search path. [Tcl Bug 956908]
+ Removed obsolete references to Rhapsody.
+
+2004-12-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS
+ options, using better default -O levels. [Bug 1092952, 1091967]
+
+2004-12-29 Joe English <jenglish@users.sourceforge.net>
+
+ * tcl.m4: Do not use ${DBGX} suffix when building
+ shared libraries [patch #1081595, TIP #34]
+
+2004-09-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds
+
+2004-08-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to
+ work around subdir configures since autoconf only propagates the
+ prefix (not exec_prefix).
+
+2004-07-23 Daniel Steffen <das@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with
+ Tcl 8.5 HEAD config, removed core specific & obsolete settings.
+
+2004-07-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if
+ we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that
+ reflects 'tk windowingsystem' value.
+
+2004-07-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when
+ building against a threaded core.
+ (CFLAGS_WARNING): Remove -Wconversion for gcc builds
+ (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build
+ configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058]
+ Update to latest Tcl 8.5 head config settings.
+ Call this TEA version 3.1.
+
+2004-04-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with
+ AC_TRY_COMPILE for the long vs. long long check. (kenny)
+
+2004-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to
+ define TCL_WIDE_INT_IS_LONG if 'using long'.
+
+2004-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB
+
+2004-02-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it
+ doesn't need the eval.
+
+2004-02-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the
+ DIR_NATIVE vars defined when using private headers on unix.
+ Allow $... to TEA_ADD_SOURCES for constructs like
+ TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to
+ place more in the Makefile.in.
+ tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+ CHECK on limits.h
+
+2003-12-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and
+ * configure: TEA_ADD_CFLAGS to configurable parameters with
+ * configure.in: PKG_* equivs in the Makefile. This allows the
+ * tclconfig/tcl.m4: user to worry less about actual magic VAR names.
+ Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires
+ exact file names.
+
+2003-12-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff)
+
+2003-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure:
+ * configure.in:
+ * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the
+ first part of VPATH can get chopped off.
+ Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes.
+ * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub
+ generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as
+ the way the user specifies library files.
+
+2003-12-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * configure: Update of TEA spec to (hopefully) simplify
+ * configure.in: some aspects of TEA by making use of more
+ * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead
+ * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of
+ * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA
+ package name and version.
+ Provide a version argument to TEA_INIT - starting with 3.0.
+ Drop all use of interior shell substs that older makefiles didn't
+ like. Use PKG_* naming convention instead.
+ Move specification of source files and public headers into
+ configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will
+ be munged during ./configure into the right obj file names (no
+ $(SOURCES:.c=.obj) needed).
+ There is almost nothing that should be touched in Makefile.in now
+ for the developer. May want to add a TEA_ADD_TCL_SOURCES for the
+ RUNTIME_SOURCES that remains.
+ Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does.
+ Only specify the user requested LDFLAGS/CFLAGS in the Makefile,
+ don't mention the _OPTIMIZE/_DEBUG variants.
+
+2003-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the
+ TEA_SETUP_COMPILER macro. They are split so the check for CC
+ occurs before any use of CC. Also add AC_PROG_CPP to the compiler
+ checks.
+
+2003-10-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Updated for autoconf 2.5x prereq.
+ Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks
+ in tcl.h, which also handles TCL_LL_MODIFIER* properly.
+
+2003-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct default setting of ARCH for WinCE builds.
+ Correct \ escaping for CE sed macros.
+
+2003-04-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: replace $(syscal) construct with older `syscall` for
+ systems where sh != bash.
+
+2003-04-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib
+ options for Windows/CE compilation support. Requires the
+ Microsoft eMbedded SDK and Keuchel's celib emulation layer.
+
+2003-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on
+ the link line when checking for the pthread_attr_setstacksize
+ symbol. (dejong)
+
+ * tcl.m4 (TEA_SETUP_COMPILER): added default calls to
+ TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS,
+ TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD.
+
+2003-02-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: correct HP-UX ia64 --enable-64bit build flags
+
+2003-01-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when
+ looking for tcl|tkConfig.sh, as this check is done before we would
+ set exec_prefix when the user does not define it.
+
+2003-01-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support
+ for mingw, the previous implementation would
+ use VC++ when compiling with mingw gcc. Don't
+ pass -fPIC since gcc always compiles pic code
+ under win32. Change some hard coded cases
+ of gcc to ${CC}.
+
+2002-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to
+ TEA_MAKE_LIB because setting too early confuses other AC_* macros.
+ Correct the HP-11 SHLIB_LD_LIBS setting.
+
+ * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and
+ make it pick up the env CFLAGS at configure time.
+
+2002-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG.
+ Improved AIX 64-bit build support, allow it on AIX-4 as well.
+ Enable 64-bit HP-11 compilation with gcc.
+ Enable 64-bit IRIX64-6 cc build support.
+ Correct FreeBSD thread library linkage.
+ Add OSF1 static build support.
+ Improve SunOS-5 shared build SHLIB_LD macro.
+
+2002-07-20 Zoran Vasiljevic <zoran@archiware.com>
+
+ * tcl.m4: Added MINGW32 to list of systems checked for Windows build.
+ Also, fixes some indentation issues with "--with-XXX" options.
+
+2002-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to
+ use new threaded allocatory by default on Unix for Tcl 8.4.
+ (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+.
+
+2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that
+ we can use autoconf 2.5x as well as 2.13. This prevents us from
+ being able to warn against the use of cygwin gcc at configure
+ time, but allows autoconf 2.5x, which is what is shipped with most
+ newer systems.
+
+2002-04-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: Enabled COFF as well as CV style debug info with
+ --enable-symbols to allow Dr. Watson users to see function info.
+ More info on debugging levels can be obtained at:
+ http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+
+2002-04-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for
+ Scriptics, which is no more. TEA represents a better, independent
+ prefix that won't need changing.
+ Added preliminary mingw gcc support. [Patch #538772]
+ Added TEA_PREFIX macro that handles defaulting the prefix and
+ exec_prefix vars to those used by Tcl if none were specified.
+ Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC
+ check and several other basic AC_PROG checks needed for making
+ executables. This greatly simplifies user's configure.in files.
+ Collapsed AIX-5 defines into AIX-* with extra checks for doing the
+ ELF stuff on AIX-5-ia64.
+ Updated TEA_ENABLE_THREADS to take an optional arg to allow
+ switching it on by default (for Thread) and add sanity checking to
+ warn the user if configuring threads incompatibly.
+
+2002-03-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT.
+ Removed --enable-64bit support for AIX-4 because it wasn't correct.
+ Added -MT or -MD Windows linker switches to properly support
+ symbols-enabled builds.
+
+2002-03-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first
+ instead of calling it as that inlines it each time in shell code.
+ Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti.
+ Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds.
+ A few changes to support itcl (and perhaps others):
+ Added support for making your own stub libraries to SC_MAKE_LIB.
+ New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg
+ and find that ${pkg}Config.sh file. itk uses this for itcl.
+
+2002-03-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk
+ build dir setup.
+ Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS.
+ Added XLIBSW onto LIBS when it is defined.
+ Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS
+ instead to not rely as much on tclConfig.sh cached info.
+ Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH.
+ These move towards making TEA much more independent of *Config.sh.
+
+2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and
+ SHLIB_SUFFIX defines for Win.
+ (SC_PATH_X): made this only do the check on unix platforms.
+
+2002-03-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README.txt: updated to reflect fewer files
+
+2002-03-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * config.guess (removed):
+ * config.sub (removed): removed unnecessary files
+
+ * installFile.tcl (removed):
+ * mkinstalldirs (removed): these aren't really necessary for
+ making TEA work
+
+ * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't
+ check /usr(/local)/include for includes on Windows when not using
+ gcc
+
+2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tcl.m4: added warnings on Windows, removed RELPATH define and
+ added TCL_LIBS to MAKE_LIB macro.
+
+ This import represents 2.0.0, or a new start at attempting to
+ make TEA much easier for C extension developers.
+
+ **** moved from tclpro project to core tcl project, ****
+ **** renamed to 'tclconfig' ****
+
+2001-03-15 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added updating of the modification time of
+ the target file whether we overwrote it or decided that it
+ hadn't changed. This was necessary for us to be able to
+ determine whether or not a module install touched the file.
+
+2001-03-08 Karl Lehenbauer <karl@procplace.com>
+
+ * installFile.tcl: Added support for converting new-style (1.1+)
+ Cygnus drive paths to Tcl-style.
+
+2001-01-15 <brent.welch@interwoven.com>
+
+ * tcl.m4: Added FreeBSD clause.
+
+2001-01-03 <brent.welch@interwoven.com>
+
+ * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking
+ for exec-prefix.
+
+2000-12-01 <brent.welch@interwoven.com>
+
+ * tcl.m4: Concatenated most of the Ajuba acsite.m4 file
+ so we don't need to modify the autoconf installation.
+ * config.guess:
+ * config.sub:
+ * installFile.tcl:
+ Added files from the itcl config subdirectory,
+ which should go away.
+
+2000-7-29 <welch@ajubasolutions.com>
+
+ * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within
+ TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent
+ change from $(srcdir) to $(srcdir)/..
diff --git a/ds9/win/tclconfig/README.txt b/ds9/win/tclconfig/README.txt
new file mode 100644
index 0000000..59b5a3e
--- /dev/null
+++ b/ds9/win/tclconfig/README.txt
@@ -0,0 +1,26 @@
+These files comprise the basic building blocks for a Tcl Extension
+Architecture (TEA) extension. For more information on TEA see:
+
+ http://www.tcl.tk/doc/tea/
+
+This package is part of the Tcl project at SourceForge, and latest
+sources should be available there:
+
+ http://tcl.sourceforge.net/
+
+This package is a freely available open source package. You can do
+virtually anything you like with it, such as modifying it, redistributing
+it, and selling it either in whole or in part.
+
+CONTENTS
+========
+The following is a short description of the files you will find in
+the sample extension.
+
+README.txt This file
+
+install-sh Program used for copying binaries and script files
+ to their install locations.
+
+tcl.m4 Collection of Tcl autoconf macros. Included by a package's
+ aclocal.m4 to define TEA_* macros.
diff --git a/ds9/win/tclconfig/install-sh b/ds9/win/tclconfig/install-sh
new file mode 100755
index 0000000..7c34c3f
--- /dev/null
+++ b/ds9/win/tclconfig/install-sh
@@ -0,0 +1,528 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-04-20.01; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -S $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -S) stripcmd="$stripprog $2"
+ shift;;
+
+ -t) dst_arg=$2
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ -*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ds9/win/tclconfig/tcl.m4 b/ds9/win/tclconfig/tcl.m4
new file mode 100644
index 0000000..8bc9c83
--- /dev/null
+++ b/ds9/win/tclconfig/tcl.m4
@@ -0,0 +1,4150 @@
+# tcl.m4 --
+#
+# This file provides a set of autoconf macros to help TEA-enable
+# a Tcl extension.
+#
+# Copyright (c) 1999-2000 Ajuba Solutions.
+# Copyright (c) 2002-2005 ActiveState Corporation.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+AC_PREREQ(2.57)
+
+dnl TEA extensions pass us the version of TEA they think they
+dnl are compatible with (must be set in TEA_INIT below)
+dnl TEA_VERSION="3.9"
+
+# Possible values for key variables defined:
+#
+# TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
+# TEA_PLATFORM - windows unix
+#
+
+#------------------------------------------------------------------------
+# TEA_PATH_TCLCONFIG --
+#
+# Locate the tclConfig.sh file and perform a sanity check on
+# the Tcl compile flags
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tcl=...
+#
+# Defines the following vars:
+# TCL_BIN_DIR Full path to the directory containing
+# the tclConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TCLCONFIG], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+ #
+ # Ok, lets find the tcl configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tcl
+ #
+
+ if test x"${no_tcl}" = x ; then
+ # we reset no_tcl in case something fails here
+ no_tcl=true
+ AC_ARG_WITH(tcl,
+ AC_HELP_STRING([--with-tcl],
+ [directory containing tcl configuration (tclConfig.sh)]),
+ with_tclconfig="${withval}")
+ AC_MSG_CHECKING([for Tcl configuration])
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
+
+ # First check to see if --with-tcl was specified.
+ if test x"${with_tclconfig}" != x ; then
+ case "${with_tclconfig}" in
+ */tclConfig.sh )
+ if test -f "${with_tclconfig}"; then
+ AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
+ with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tcl installation
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tclConfig.sh" ; then
+ ac_cv_c_tclconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tclconfig}" = x ; then
+ TCL_BIN_DIR="# no Tcl configs found"
+ AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh])
+ else
+ no_tcl=
+ TCL_BIN_DIR="${ac_cv_c_tclconfig}"
+ AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_TKCONFIG --
+#
+# Locate the tkConfig.sh file
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-tk=...
+#
+# Defines the following vars:
+# TK_BIN_DIR Full path to the directory containing
+# the tkConfig.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_TKCONFIG], [
+ #
+ # Ok, lets find the tk configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tk
+ #
+
+ if test x"${no_tk}" = x ; then
+ # we reset no_tk in case something fails here
+ no_tk=true
+ AC_ARG_WITH(tk,
+ AC_HELP_STRING([--with-tk],
+ [directory containing tk configuration (tkConfig.sh)]),
+ with_tkconfig="${withval}")
+ AC_MSG_CHECKING([for Tk configuration])
+ AC_CACHE_VAL(ac_cv_c_tkconfig,[
+
+ # First check to see if --with-tkconfig was specified.
+ if test x"${with_tkconfig}" != x ; then
+ case "${with_tkconfig}" in
+ */tkConfig.sh )
+ if test -f "${with_tkconfig}"; then
+ AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
+ with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`"
+ fi ;;
+ esac
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`"
+ else
+ AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
+ fi
+ fi
+
+ # then check for a private Tk library
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # on Darwin, check in Framework installation locations
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
+ `ls -d /Library/Frameworks 2>/dev/null` \
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
+ ; do
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # TEA specific: on Windows, check in common installation locations
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a x"${ac_cv_c_tkconfig}" = x ; then
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
+ ; do
+ if test -f "$i/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i; pwd)`"
+ break
+ fi
+ done
+ fi
+
+ # check in a few other private locations
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
+ if test "${TEA_PLATFORM}" = "windows" \
+ -a -f "$i/win/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/win; pwd)`"
+ break
+ fi
+ if test -f "$i/unix/tkConfig.sh" ; then
+ ac_cv_c_tkconfig="`(cd $i/unix; pwd)`"
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_tkconfig}" = x ; then
+ TK_BIN_DIR="# no Tk configs found"
+ AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh])
+ else
+ no_tk=
+ TK_BIN_DIR="${ac_cv_c_tkconfig}"
+ AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TCLCONFIG --
+#
+# Load the tclConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TCL_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_BIN_DIR
+# TCL_SRC_DIR
+# TCL_LIB_FILE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TCLCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
+
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TCL_BIN_DIR}/tclConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+ TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+ TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tcl.framework installed in an arbitrary location.
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
+ for i in "`cd "${TCL_BIN_DIR}"; pwd`" \
+ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
+ TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
+ TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}"
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TCL_DBGX substitution
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
+ AC_SUBST(TCL_PATCH_LEVEL)
+ AC_SUBST(TCL_BIN_DIR)
+ AC_SUBST(TCL_SRC_DIR)
+
+ AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
+
+ AC_MSG_CHECKING([platform])
+ hold_cc=$CC; CC="$TCL_CC"
+ AC_TRY_COMPILE(,[
+ #ifdef _WIN32
+ #error win32
+ #endif
+ ], TEA_PLATFORM="unix",
+ TEA_PLATFORM="windows"
+ )
+ CC=$hold_cc
+ AC_MSG_RESULT($TEA_PLATFORM)
+
+ # The BUILD_$pkg is to define the correct extern storage class
+ # handling when making this package
+ AC_DEFINE_UNQUOTED(BUILD_${PACKAGE_NAME}, [],
+ [Building extension source?])
+ # Do this here as we have fully defined TEA_PLATFORM now
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ EXEEXT=".exe"
+ CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp"
+ fi
+
+ # TEA specific:
+ AC_SUBST(CLEANFILES)
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(TCL_DEFS)
+ AC_SUBST(TCL_EXTRA_CFLAGS)
+ AC_SUBST(TCL_LD_FLAGS)
+ AC_SUBST(TCL_SHLIB_LD_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_TKCONFIG --
+#
+# Load the tkConfig.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# TK_BIN_DIR
+#
+# Results:
+#
+# Sets the following vars that should be in tkConfig.sh:
+# TK_BIN_DIR
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_TKCONFIG], [
+ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
+
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${TK_BIN_DIR}/tkConfig.sh"
+ else
+ AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
+
+ # If the TK_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TK_LIB_SPEC will be set to the value
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
+ TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
+ TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
+ elif test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use the libraries
+ # from the framework at the given location so that linking works
+ # against Tk.framework installed in an arbitrary location.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
+ for i in "`cd "${TK_BIN_DIR}"; pwd`" \
+ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
+ TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}"
+ break
+ fi
+ done
+ fi
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
+ TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}"
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
+ fi
+ ;;
+ esac
+ fi
+
+ # eval is required to do the TK_DBGX substitution
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
+
+ # TEA specific: Ensure windowingsystem is defined
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ case ${TK_DEFS} in
+ *MAC_OSX_TK*)
+ AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
+ TEA_WINDOWINGSYSTEM="aqua"
+ ;;
+ *)
+ TEA_WINDOWINGSYSTEM="x11"
+ ;;
+ esac
+ elif test "${TEA_PLATFORM}" = "windows" ; then
+ TEA_WINDOWINGSYSTEM="win32"
+ fi
+
+ AC_SUBST(TK_VERSION)
+ AC_SUBST(TK_BIN_DIR)
+ AC_SUBST(TK_SRC_DIR)
+
+ AC_SUBST(TK_LIB_FILE)
+ AC_SUBST(TK_LIB_FLAG)
+ AC_SUBST(TK_LIB_SPEC)
+
+ AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TK_STUB_LIB_FLAG)
+ AC_SUBST(TK_STUB_LIB_SPEC)
+
+ # TEA specific:
+ AC_SUBST(TK_LIBS)
+ AC_SUBST(TK_XINCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_TCLSH
+# Determine the fully qualified path name of the tclsh executable
+# in the Tcl build directory or the tclsh installed in a bin
+# directory. This macro will correctly determine the name
+# of the tclsh executable even if tclsh has not yet been
+# built in the build directory. The tclsh found is always
+# associated with a tclConfig.sh file. This tclsh should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# TCLSH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_TCLSH], [
+ AC_MSG_CHECKING([for tclsh])
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ # tclConfig.sh is in Tcl build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
+ fi
+ else
+ # tclConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
+ else
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
+ fi
+ list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${TCLSH_PROG}" ; then
+ REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
+ fi
+ AC_MSG_RESULT([${TCLSH_PROG}])
+ AC_SUBST(TCLSH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_PROG_WISH
+# Determine the fully qualified path name of the wish executable
+# in the Tk build directory or the wish installed in a bin
+# directory. This macro will correctly determine the name
+# of the wish executable even if wish has not yet been
+# built in the build directory. The wish found is always
+# associated with a tkConfig.sh file. This wish should be used
+# only for running extension test cases. It should never be
+# or generation of files (like pkgIndex.tcl) at build time.
+#
+# Arguments:
+# none
+#
+# Results:
+# Substitutes the following vars:
+# WISH_PROG
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PROG_WISH], [
+ AC_MSG_CHECKING([for wish])
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ # tkConfig.sh is in Tk build directory
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="${TK_BIN_DIR}/wish"
+ fi
+ else
+ # tkConfig.sh is in install location
+ if test "${TEA_PLATFORM}" = "windows"; then
+ WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
+ else
+ WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
+ fi
+ list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/bin 2>/dev/null`"
+ for i in $list ; do
+ if test -f "$i/${WISH_PROG}" ; then
+ REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
+ break
+ fi
+ done
+ WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
+ fi
+ AC_MSG_RESULT([${WISH_PROG}])
+ AC_SUBST(WISH_PROG)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SHARED --
+#
+# Allows the building of shared libraries
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-shared=yes|no
+#
+# Defines the following vars:
+# STATIC_BUILD Used for building import/export libraries
+# on Windows.
+#
+# Sets the following vars:
+# SHARED_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SHARED], [
+ AC_MSG_CHECKING([how to build libraries])
+ AC_ARG_ENABLE(shared,
+ AC_HELP_STRING([--enable-shared],
+ [build and link with shared libraries (default: on)]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([shared])
+ SHARED_BUILD=1
+ else
+ AC_MSG_RESULT([static])
+ SHARED_BUILD=0
+ AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
+ fi
+ AC_SUBST(SHARED_BUILD)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_THREADS --
+#
+# Specify if thread support should be enabled. If "yes" is specified
+# as an arg (optional), threads are enabled by default, "no" means
+# threads are disabled. "yes" is the default.
+#
+# TCL_THREADS is checked so that if you are compiling an extension
+# against a threaded core, your extension must be compiled threaded
+# as well.
+#
+# Note that it is legal to have a thread enabled extension run in a
+# threaded or non-threaded Tcl core, but a non-threaded extension may
+# only run in a non-threaded Tcl core.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-threads
+#
+# Sets the following vars:
+# THREADS_LIBS Thread library(s)
+#
+# Defines the following vars:
+# TCL_THREADS
+# _REENTRANT
+# _THREAD_SAFE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_THREADS], [
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads],
+ [build with threads]),
+ [tcl_ok=$enableval], [tcl_ok=yes])
+
+ if test "${enable_threads+set}" = set; then
+ enableval="$enable_threads"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
+ TCL_THREADS=1
+
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ # We are always OK on Windows, so check what this platform wants:
+
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC, 1,
+ [Do we want to use the threaded memory allocator?])
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ if test "`uname -s`" = "SunOS" ; then
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+ fi
+ AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ # Check a little harder for __pthread_mutex_init in the same
+ # library, as some systems hide it there until pthread.h is
+ # defined. We could alternatively do an AC_TRY_COMPILE with
+ # pthread.h, but that will work with libpthread really doesn't
+ # exist, like AIX 4.2. [Bug: 4359]
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthread"
+ else
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -lpthreads"
+ else
+ AC_CHECK_LIB(c, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "no"; then
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
+ tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
+ fi
+ fi
+ fi
+ fi
+ fi
+ else
+ TCL_THREADS=0
+ fi
+ # Do checking message here to not mess up interleaved configure output
+ AC_MSG_CHECKING([for building with threads])
+ if test "${TCL_THREADS}" = 1; then
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
+ AC_MSG_RESULT([yes (default)])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ # TCL_THREADS sanity checking. See if our request for building with
+ # threads is the same as the way Tcl was built. If not, warn the user.
+ case ${TCL_DEFS} in
+ *THREADS=1*)
+ if test "${TCL_THREADS}" = "0"; then
+ AC_MSG_WARN([
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
+ that IS thread-enabled. It is recommended to use --enable-threads.])
+ fi
+ ;;
+ *)
+ if test "${TCL_THREADS}" = "1"; then
+ AC_MSG_WARN([
+ --enable-threads requested, but building against a Tcl that is NOT
+ thread-enabled. This is an OK configuration that will also run in
+ a thread-enabled core.])
+ fi
+ ;;
+ esac
+ AC_SUBST(TCL_THREADS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_SYMBOLS --
+#
+# Specify if debugging symbols should be used.
+# Memory (TCL_MEM_DEBUG) debugging can also be enabled.
+#
+# Arguments:
+# none
+#
+# TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
+# the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
+# Requires the following vars to be set in the Makefile:
+# CFLAGS_DEFAULT
+# LDFLAGS_DEFAULT
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-symbols
+#
+# Defines the following vars:
+# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
+# Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false
+# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
+# Sets to $(LDFLAGS_OPTIMIZE) if false
+# DBGX Formerly used as debug library extension;
+# always blank now.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_SYMBOLS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_CONFIG_CFLAGS])
+ AC_MSG_CHECKING([for build with symbols])
+ AC_ARG_ENABLE(symbols,
+ AC_HELP_STRING([--enable-symbols],
+ [build with debugging symbols (default: off)]),
+ [tcl_ok=$enableval], [tcl_ok=no])
+ DBGX=""
+ if test "$tcl_ok" = "no"; then
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG"
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
+ AC_MSG_RESULT([no])
+ else
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
+ if test "$tcl_ok" = "yes"; then
+ AC_MSG_RESULT([yes (standard debugging)])
+ fi
+ fi
+ # TEA specific:
+ if test "${TEA_PLATFORM}" != "windows" ; then
+ LDFLAGS_DEFAULT="${LDFLAGS}"
+ fi
+ AC_SUBST(CFLAGS_DEFAULT)
+ AC_SUBST(LDFLAGS_DEFAULT)
+ AC_SUBST(TCL_DBGX)
+
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
+ AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
+ fi
+
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
+ if test "$tcl_ok" = "all"; then
+ AC_MSG_RESULT([enabled symbols mem debugging])
+ else
+ AC_MSG_RESULT([enabled $tcl_ok debugging])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_ENABLE_LANGINFO --
+#
+# Allows use of modern nl_langinfo check for better l10n.
+# This is only relevant for Unix.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-langinfo=yes|no (default is yes)
+#
+# Defines the following vars:
+# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_ENABLE_LANGINFO], [
+ AC_ARG_ENABLE(langinfo,
+ AC_HELP_STRING([--enable-langinfo],
+ [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
+
+ HAVE_LANGINFO=0
+ if test "$langinfo_ok" = "yes"; then
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
+ fi
+ AC_MSG_CHECKING([whether to use nl_langinfo])
+ if test "$langinfo_ok" = "yes"; then
+ AC_CACHE_VAL(tcl_cv_langinfo_h, [
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
+ AC_MSG_RESULT([$tcl_cv_langinfo_h])
+ if test $tcl_cv_langinfo_h = yes; then
+ AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
+ fi
+ else
+ AC_MSG_RESULT([$langinfo_ok])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_SYSTEM
+#
+# Determine what the system is (some things cannot be easily checked
+# on a feature-driven basis, alas). This can usually be done via the
+# "uname" command.
+#
+# Arguments:
+# none
+#
+# Results:
+# Defines the following var:
+#
+# system - System/platform/version identification code.
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_SYSTEM], [
+ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
+ # TEA specific:
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ tcl_cv_sys_version=windows
+ else
+ tcl_cv_sys_version=`uname -s`-`uname -r`
+ if test "$?" -ne 0 ; then
+ AC_MSG_WARN([can't find uname command])
+ tcl_cv_sys_version=unknown
+ else
+ if test "`uname -s`" = "AIX" ; then
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
+ fi
+ fi
+ fi
+ ])
+ system=$tcl_cv_sys_version
+])
+
+#--------------------------------------------------------------------
+# TEA_CONFIG_CFLAGS
+#
+# Try to determine the proper flags to pass to the compiler
+# for building shared libraries and other such nonsense.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substitutes the following vars:
+#
+# DL_OBJS, DL_LIBS - removed for TEA, only needed by core.
+# LDFLAGS - Flags to pass to the compiler when linking object
+# files into an executable application binary such
+# as tclsh.
+# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile. Could
+# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
+# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile.
+# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
+# of a shared library (may request position-independent
+# code, among other things).
+# SHLIB_LD - Base command to use for combining object files
+# into a shared library.
+# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
+# creating shared libraries. This symbol typically
+# goes at the end of the "ld" commands that build
+# shared libraries. The value of the symbol defaults to
+# "${LIBS}" if all of the dependent libraries should
+# be specified when creating a shared library. If
+# dependent libraries should not be specified (as on
+# SunOS 4.x, where they cause the link to fail, or in
+# general if Tcl and Tk aren't themselves shared
+# libraries), then this symbol has an empty string
+# as its value.
+# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
+# extensions. An empty string means we don't know how
+# to use shared libraries on this platform.
+# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
+# in a static or shared library name, using the $PACKAGE_VERSION variable
+# to put the version in the right place. This is used
+# by platforms that need non-standard library names.
+# Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs
+# to have a version after the .so, and ${PACKAGE_VERSION}.a
+# on AIX, since a shared library needs to have
+# a .a extension whereas shared objects for loadable
+# extensions have a .so extension. Defaults to
+# ${PACKAGE_VERSION}${SHLIB_SUFFIX}.
+# CFLAGS_DEBUG -
+# Flags used when running the compiler in debug mode
+# CFLAGS_OPTIMIZE -
+# Flags used when running the compiler in optimize mode
+# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_CONFIG_CFLAGS], [
+ dnl TEA specific: Make sure we are initialized
+ AC_REQUIRE([TEA_INIT])
+
+ # Step 0.a: Enable 64 bit support?
+
+ AC_MSG_CHECKING([if 64bit support is requested])
+ AC_ARG_ENABLE(64bit,
+ AC_HELP_STRING([--enable-64bit],
+ [enable 64bit support (default: off)]),
+ [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT([$do64bit])
+
+ # Step 0.b: Enable Solaris 64 bit VIS support?
+
+ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
+ AC_ARG_ENABLE(64bit-vis,
+ AC_HELP_STRING([--enable-64bit-vis],
+ [enable 64bit Sparc VIS support (default: off)]),
+ [do64bitVIS=$enableval], [do64bitVIS=no])
+ AC_MSG_RESULT([$do64bitVIS])
+ # Force 64bit on with VIS
+ AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
+
+ # Step 0.c: Check if visibility support is available. Do this here so
+ # that platform specific alternatives can be used below if this fails.
+
+ AC_CACHE_CHECK([if compiler supports visibility "hidden"],
+ tcl_cv_cc_visibility_hidden, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
+ AC_TRY_LINK([
+ extern __attribute__((__visibility__("hidden"))) void f(void);
+ void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
+ tcl_cv_cc_visibility_hidden=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
+ AC_DEFINE(MODULE_SCOPE,
+ [extern __attribute__((__visibility__("hidden")))],
+ [Compiler support for module scope symbols])
+ AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols])
+ ])
+
+ # Step 0.d: Disable -rpath support?
+
+ AC_MSG_CHECKING([if rpath support is requested])
+ AC_ARG_ENABLE(rpath,
+ AC_HELP_STRING([--disable-rpath],
+ [disable rpath support (default: on)]),
+ [doRpath=$enableval], [doRpath=yes])
+ AC_MSG_RESULT([$doRpath])
+
+ # TEA specific: Cross-compiling options for Windows/CE builds?
+
+ AS_IF([test "${TEA_PLATFORM}" = windows], [
+ AC_MSG_CHECKING([if Windows/CE build is requested])
+ AC_ARG_ENABLE(wince,
+ AC_HELP_STRING([--enable-wince],
+ [enable Win/CE support (where applicable)]),
+ [doWince=$enableval], [doWince=no])
+ AC_MSG_RESULT([$doWince])
+ ])
+
+ # Set the variable "system" to hold the name and version number
+ # for the system.
+
+ TEA_CONFIG_SYSTEM
+
+ # Require ranlib early so we can override it in special cases below.
+
+ AC_REQUIRE([AC_PROG_RANLIB])
+
+ # Set configuration options based on system name and version.
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
+ # "windows" case and removed some core-only vars.
+
+ do64bit_ok=no
+ # default to '{$LIBS}' and set to "" on per-platform necessary basis
+ SHLIB_LD_LIBS='${LIBS}'
+ # When ld needs options to work in 64-bit mode, put them in
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
+ # is disabled by the user. [Bug 1016796]
+ LDFLAGS_ARCH=""
+ UNSHARED_LIB_SUFFIX=""
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
+ TCL_LIB_VERSIONS_OK=ok
+ CFLAGS_DEBUG=-g
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS_OPTIMIZE=-O2
+ CFLAGS_WARNING="-Wall"
+ ], [
+ CFLAGS_OPTIMIZE=-O
+ CFLAGS_WARNING=""
+ ])
+ AC_CHECK_TOOL(AR, ar)
+ STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION="1.0"])
+ case $system in
+ # TEA specific:
+ windows)
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
+ # which requires x86|amd64|ia64.
+ MACHINE="X86"
+ if test "$do64bit" != "no" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
+ fi
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
+ PATH64=""
+ case "$do64bit" in
+ amd64|x64|yes)
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
+ ;;
+ ia64)
+ MACHINE="IA64"
+ PATH64="${MSSDK}/Bin/Win64"
+ ;;
+ esac
+ if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then
+ AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
+ AC_MSG_WARN([Ensure latest Platform SDK is installed])
+ do64bit="no"
+ else
+ AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
+ do64bit_ok="yes"
+ fi
+ fi
+
+ if test "$doWince" != "no" ; then
+ if test "$do64bit" != "no" ; then
+ AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
+ fi
+ if test "$GCC" = "yes" ; then
+ AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
+ fi
+ TEA_PATH_CELIB
+ # Set defaults for common evc4/PPC2003 setup
+ # Currently Tcl requires 300+, possibly 420+ for sockets
+ CEVERSION=420; # could be 211 300 301 400 420 ...
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
+ ARCH=ARM; # could be ARM MIPS X86EM ...
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
+ if test "$doWince" != "yes"; then
+ # If !yes then the user specified something
+ # Reset ARCH to allow user to skip specifying it
+ ARCH=
+ eval `echo $doWince | awk -F, '{ \
+ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
+ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
+ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
+ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
+ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
+ }'`
+ if test "x${ARCH}" = "x" ; then
+ ARCH=$TARGETCPU;
+ fi
+ fi
+ OSVERSION=WCE$CEVERSION;
+ if test "x${WCEROOT}" = "x" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
+ if test ! -d "${WCEROOT}" ; then
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
+ fi
+ fi
+ if test "x${SDKROOT}" = "x" ; then
+ SDKROOT="C:/Program Files/Windows CE Tools"
+ if test ! -d "${SDKROOT}" ; then
+ SDKROOT="C:/Windows CE Tools"
+ fi
+ fi
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
+ AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
+ doWince="no"
+ else
+ # We could PATH_NOSPACE these, but that's not important,
+ # as long as we quote them when used.
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
+ fi
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
+ fi
+ fi
+
+ if test "$GCC" != "yes" ; then
+ if test "${SHARED_BUILD}" = "0" ; then
+ runtime=-MT
+ else
+ runtime=-MD
+ fi
+
+ if test "$do64bit" != "no" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="\"${PATH64}/cl.exe\""
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
+ RC="\"${MSSDK}/bin/rc.exe\""
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
+ LINKBIN="\"${PATH64}/link.exe\""
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ # Avoid 'unresolved external symbol __security_cookie'
+ # errors, c.f. http://support.microsoft.com/?id=894573
+ TEA_ADD_LIBS([bufferoverflowU.lib])
+ elif test "$doWince" != "no" ; then
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
+ if test "${TARGETCPU}" = "X86"; then
+ CC="\"${CEBINROOT}/cl.exe\""
+ else
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
+ fi
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
+ arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
+ if test "${SHARED_BUILD}" = "1" ; then
+ # Static CE builds require static celib as well
+ defs="${defs} _DLL"
+ fi
+ for i in $defs ; do
+ AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
+ done
+ AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
+ AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
+ CFLAGS_DEBUG="-nologo -Zi -Od"
+ CFLAGS_OPTIMIZE="-nologo -Ox"
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
+ LINKBIN="\"${CEBINROOT}/link.exe\""
+ AC_SUBST(CELIB_DIR)
+ else
+ RC="rc"
+ lflags="-nologo"
+ LINKBIN="link"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
+ fi
+ fi
+
+ if test "$GCC" = "yes"; then
+ # mingw gcc mode
+ AC_CHECK_TOOL(RC, windres)
+ CFLAGS_DEBUG="-g"
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+ SHLIB_LD='${CC} -shared'
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
+
+ AC_CACHE_CHECK(for cross-compile version of gcc,
+ ac_cv_cross,
+ AC_TRY_COMPILE([
+ #ifdef __WIN32__
+ #error cross-compiler
+ #endif
+ ], [],
+ ac_cv_cross=yes,
+ ac_cv_cross=no)
+ )
+ if test "$ac_cv_cross" = "yes"; then
+ case "$do64bit" in
+ amd64|x64|yes)
+ CC="x86_64-w64-mingw32-gcc"
+ LD="x86_64-w64-mingw32-ld"
+ AR="x86_64-w64-mingw32-ar"
+ RANLIB="x86_64-w64-mingw32-ranlib"
+ RC="x86_64-w64-mingw32-windres"
+ ;;
+ *)
+ CC="i686-w64-mingw32-gcc"
+ LD="i686-w64-mingw32-ld"
+ AR="i686-w64-mingw32-ar"
+ RANLIB="i686-w64-mingw32-ranlib"
+ RC="i686-w64-mingw32-windres"
+ ;;
+ esac
+ fi
+
+ else
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
+ # link -lib only works when -lib is the first arg
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
+ PATHTYPE=-w
+ # For information on what debugtype is most useful, see:
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+ # and also
+ # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx
+ # This essentially turns it all on.
+ LDFLAGS_DEBUG="-debug -debugtype:cv"
+ LDFLAGS_OPTIMIZE="-release"
+ if test "$doWince" != "no" ; then
+ LDFLAGS_CONSOLE="-link ${lflags}"
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
+ else
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
+ fi
+ fi
+
+ SHLIB_SUFFIX=".dll"
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
+
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ AIX-*)
+ AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
+ # AIX requires the _r compiler when gcc isn't being used
+ case "${CC}" in
+ *_r|*_r\ *)
+ # ok ...
+ ;;
+ *)
+ # Make sure only first arg gets _r
+ CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'`
+ ;;
+ esac
+ AC_MSG_RESULT([Using $CC for compiling with threads])
+ ])
+ LIBS="$LIBS -lc"
+ SHLIB_CFLAGS=""
+ SHLIB_SUFFIX=".so"
+
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -q64"
+ LDFLAGS_ARCH="-q64"
+ RANLIB="${RANLIB} -X64"
+ AR="${AR} -X64"
+ SHLIB_LD_FLAGS="-b64"
+ ])
+ ])
+
+ AS_IF([test "`uname -m`" = ia64], [
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ AS_IF([test "$GCC" = yes], [
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ ], [
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
+ ])
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ], [
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared -Wl,-bexpall'
+ ], [
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry"
+ LDFLAGS="$LDFLAGS -brtl"
+ ])
+ SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}"
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ BeOS*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -nostart'
+ SHLIB_SUFFIX=".so"
+
+ #-----------------------------------------------------------
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
+ # -lsocket, even if the network functions are in -lnet which
+ # is always linked to, for compatibility.
+ #-----------------------------------------------------------
+ AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
+ ;;
+ BSD/OS-4.*)
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ CYGWIN_*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD='${CC} -shared'
+ SHLIB_SUFFIX=".dll"
+ EXEEXT=".exe"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ Haiku*)
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
+ ;;
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
+ # TEA specific: Needed by Tcl, but not most extensions
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
+
+ AS_IF([test "`uname -m`" = ia64], [
+ SHLIB_SUFFIX=".so"
+ # Use newer C++ library for C++ extensions
+ #if test "$GCC" != "yes" ; then
+ # CPPFLAGS="-AA"
+ #fi
+ ], [
+ SHLIB_SUFFIX=".sl"
+ ])
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ AS_IF([test "$tcl_ok" = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ ])
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ CFLAGS="$CFLAGS -z"
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #CFLAGS="$CFLAGS +DAportable"
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ ])
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = "yes"], [
+ AS_IF([test "$GCC" = yes], [
+ case `${CC} -dumpmachine` in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD='${CC} -shared'
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ;;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
+ ;;
+ esac
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS +DD64"
+ LDFLAGS_ARCH="+DD64"
+ ])
+ ]) ;;
+ IRIX-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [
+ CFLAGS="$CFLAGS -mabi=n32"
+ LDFLAGS="$LDFLAGS -mabi=n32"
+ ], [
+ case $system in
+ IRIX-6.3)
+ # Use to build 6.2 compatible binaries on 6.3.
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
+ ;;
+ *)
+ CFLAGS="$CFLAGS -n32"
+ ;;
+ esac
+ LDFLAGS="$LDFLAGS -n32"
+ ])
+ ;;
+ IRIX64-6.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ AS_IF([test "$do64bit" = yes], [
+ AS_IF([test "$GCC" = yes], [
+ AC_MSG_WARN([64bit mode not supported by gcc])
+ ], [
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ CFLAGS="$CFLAGS -64"
+ LDFLAGS_ARCH="-64"
+ ])
+ ])
+ ;;
+ Linux*|GNU*|NetBSD-Debian)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+
+ # TEA specific:
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
+
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
+ AS_IF([test $do64bit = yes], [
+ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -m64"
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_m64 = yes], [
+ CFLAGS="$CFLAGS -m64"
+ do64bit_ok=yes
+ ])
+ ])
+
+ # The combo of gcc + glibc has a bug related to inlining of
+ # functions like strtod(). The -fno-builtin flag should address
+ # this problem but it does not work. The -fno-inline flag is kind
+ # of overkill but it works. Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+
+ AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
+ ;;
+ Lynx*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_SUFFIX=".so"
+ CFLAGS_OPTIMIZE=-02
+ SHLIB_LD='${CC} -shared'
+ LD_FLAGS="-Wl,--export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ ;;
+ OpenBSD-*)
+ arch=`arch -s`
+ case "$arch" in
+ vax)
+ SHLIB_SUFFIX=""
+ SHARED_LIB_SUFFIX=""
+ LDFLAGS=""
+ ;;
+ *)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.${SHLIB_VERSION}'
+ LDFLAGS="-Wl,-export-dynamic"
+ ;;
+ esac
+ case "$arch" in
+ vax)
+ CFLAGS_OPTIMIZE="-O1"
+ ;;
+ *)
+ CFLAGS_OPTIMIZE="-O2"
+ ;;
+ esac
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # On OpenBSD: Compile with -pthread
+ # Don't link with -lpthread
+ LIBS=`echo $LIBS | sed s/-lpthread//`
+ CFLAGS="$CFLAGS -pthread"
+ ])
+ # OpenBSD doesn't do version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ NetBSD-*)
+ # NetBSD has ELF and can use 'cc -shared' to build shared libs
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
+ SHLIB_SUFFIX=".so"
+ LDFLAGS="$LDFLAGS -export-dynamic"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ;;
+ FreeBSD-*)
+ # This configuration from FreeBSD Ports.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="${CC} -shared"
+ TCL_SHLIB_LD_EXTRAS="-Wl,-soname=\$[@]"
+ SHLIB_SUFFIX=".so"
+ LDFLAGS=""
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
+ AS_IF([test "${TCL_THREADS}" = "1"], [
+ # The -pthread needs to go in the LDFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
+ # Version numbers are dot-stripped by system policy.
+ TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .`
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ Darwin-*)
+ CFLAGS_OPTIMIZE="-Os"
+ SHLIB_CFLAGS="-fno-common"
+ # To avoid discrepancies between what headers configure sees during
+ # preprocessing tests and compiling tests, move any -isysroot and
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
+ CFLAGS="`echo " ${CFLAGS}" | \
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
+ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
+ AS_IF([test $do64bit = yes], [
+ case `arch` in
+ ppc)
+ AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
+ tcl_cv_cc_arch_ppc64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+ tcl_cv_cc_arch_ppc64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+ do64bit_ok=yes
+ ]);;
+ i386)
+ AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
+ tcl_cv_cc_arch_x86_64, [
+ hold_cflags=$CFLAGS
+ CFLAGS="$CFLAGS -arch x86_64"
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+ tcl_cv_cc_arch_x86_64=no)
+ CFLAGS=$hold_cflags])
+ AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
+ CFLAGS="$CFLAGS -arch x86_64"
+ do64bit_ok=yes
+ ]);;
+ *)
+ AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
+ esac
+ ], [
+ # Check for combined 32-bit and 64-bit fat build
+ AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
+ fat_32_64=yes])
+ ])
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_single_module = yes], [
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+ ])
+ # TEA specific: link shlib with current and compatibility version flags
+ vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d`
+ SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}"
+ SHLIB_SUFFIX=".dylib"
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
+ AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
+ LDFLAGS="$LDFLAGS -prebind"])
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
+ AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
+ tcl_cv_ld_search_paths_first, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
+ tcl_cv_ld_search_paths_first=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+ ])
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [__private_extern__],
+ [Compiler support for module scope symbols])
+ tcl_cv_cc_visibility_hidden=yes
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
+ # extensions, verify that 64-bit build is possible.
+ AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
+ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
+ tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [
+ AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
+ done
+ CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}"
+ LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}"
+ AC_TRY_LINK([#include <tk.h>], [Tk_InitStubs(NULL, "", 0);],
+ tcl_cv_lib_tk_64=yes, tcl_cv_lib_tk_64=no)
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="$hold_'$v'"'
+ done])
+ ])
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
+ # does not support 64-bit.
+ AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [
+ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
+ done])
+ ])
+ ;;
+ OS/390-*)
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
+ AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
+ [Should OS/390 do the right thing with sockets?])
+ ;;
+ OSF1-V*)
+ # Digital OSF/1
+ SHLIB_CFLAGS=""
+ AS_IF([test "$SHARED_BUILD" = 1], [
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ ], [
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ ])
+ SHLIB_SUFFIX=".so"
+ AS_IF([test $doRpath = yes], [
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
+ AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
+ AS_IF([test "${TCL_THREADS}" = 1], [
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ AS_IF([test "$GCC" = yes], [
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ ], [
+ CFLAGS="$CFLAGS -pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ ])
+ ])
+ ;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SCO_SV-3.2*)
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_CFLAGS="-fPIC -melf"
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
+ ], [
+ SHLIB_CFLAGS="-Kpic -belf"
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
+ ])
+ SHLIB_LD="ld -G"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ SunOS-5.[[0-6]])
+ # Careful to not let 5.10+ fall into this case
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ], [
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ ])
+ ;;
+ SunOS-5*)
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
+ [Do we really want to follow the standard? Yes we do!])
+
+ SHLIB_CFLAGS="-KPIC"
+
+ # Check to enable 64-bit flags for compiler/linker
+ AS_IF([test "$do64bit" = yes], [
+ arch=`isainfo`
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ AS_IF([test "$GCC" = yes], [
+ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
+ ], [
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
+ SHLIB_CFLAGS="-fPIC"
+ ])
+ ], [
+ do64bit_ok=yes
+ AS_IF([test "$do64bitVIS" = yes], [
+ CFLAGS="$CFLAGS -xarch=v9a"
+ LDFLAGS_ARCH="-xarch=v9a"
+ ], [
+ CFLAGS="$CFLAGS -xarch=v9"
+ LDFLAGS_ARCH="-xarch=v9"
+ ])
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
+ ])
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ do64bit_ok=yes
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ AC_MSG_WARN([64bit mode not supported with GCC on $system]);;
+ esac
+ ], [
+ do64bit_ok=yes
+ case $system in
+ SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*)
+ CFLAGS="$CFLAGS -m64"
+ LDFLAGS="$LDFLAGS -m64";;
+ *)
+ CFLAGS="$CFLAGS -xarch=amd64"
+ LDFLAGS="$LDFLAGS -xarch=amd64";;
+ esac
+ ])
+ ], [AC_MSG_WARN([64bit mode not supported for $arch])])])
+ ])
+
+ SHLIB_SUFFIX=".so"
+ AS_IF([test "$GCC" = yes], [
+ SHLIB_LD='${CC} -shared'
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ AS_IF([test "$do64bit_ok" = yes], [
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
+ # We need to specify -static-libgcc or we need to
+ # add the path to the sparv9 libgcc.
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
+ # for finding sparcv9 libgcc, get the regular libgcc
+ # path, remove so name and append 'sparcv9'
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
+ # JH: static-libgcc is necessary for core Tcl, but may
+ # not be necessary for extensions.
+ SHLIB_LD="$SHLIB_LD -m64 -static-libgcc"
+ ])])
+ ])
+ ], [
+ case $system in
+ SunOS-5.[[1-9]][[0-9]]*)
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
+ SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';;
+ *)
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
+ esac
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ ])
+ ;;
+ UNIX_SV* | UnixWare-5*)
+ SHLIB_CFLAGS="-KPIC"
+ SHLIB_LD='${CC} -G'
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
+ # that don't grok the -Bexport option. Test that it does.
+ AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
+ hold_ldflags=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
+ LDFLAGS=$hold_ldflags])
+ AS_IF([test $tcl_cv_ld_Bexport = yes], [
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
+ ])
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
+ esac
+
+ AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
+ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
+ ])
+
+dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
+dnl # until the end of configure, as configure's compile and link tests use
+dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
+dnl # preprocessing tests use only CPPFLAGS.
+ AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
+
+ # Add in the arch flags late to ensure it wasn't removed.
+ # Not necessary in TEA, but this is aligned with core
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
+
+ # If we're running gcc, then change the C flags for compiling shared
+ # libraries to the right flags for gcc, instead of those for the
+ # standard manufacturer compiler.
+
+ AS_IF([test "$GCC" = yes], [
+ case $system in
+ AIX-*) ;;
+ BSD/OS*) ;;
+ CYGWIN_*|MINGW32_*) ;;
+ IRIX*) ;;
+ NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
+ Darwin-*) ;;
+ SCO_SV-3.2*) ;;
+ windows) ;;
+ *) SHLIB_CFLAGS="-fPIC" ;;
+ esac])
+
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
+ AC_DEFINE(MODULE_SCOPE, [extern],
+ [No Compiler support for module scope symbols])
+ ])
+
+ AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
+ AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
+
+ if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then
+ AC_CACHE_CHECK(for SEH support in compiler,
+ tcl_cv_seh,
+ AC_TRY_RUN([
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+
+ int main(int argc, char** argv) {
+ int a, b = 0;
+ __try {
+ a = 666 / b;
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER) {
+ return 0;
+ }
+ return 1;
+ }
+ ],
+ tcl_cv_seh=yes,
+ tcl_cv_seh=no,
+ tcl_cv_seh=no)
+ )
+ if test "$tcl_cv_seh" = "no" ; then
+ AC_DEFINE(HAVE_NO_SEH, 1,
+ [Defined when mingw does not support SEH])
+ fi
+
+ #
+ # Check to see if the excpt.h include file provided contains the
+ # definition for EXCEPTION_DISPOSITION; if not, which is the case
+ # with Cygwin's version as of 2002-04-10, define it to be int,
+ # sufficient for getting the current code to work.
+ #
+ AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
+ tcl_cv_eh_disposition,
+ AC_TRY_COMPILE([
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# undef WIN32_LEAN_AND_MEAN
+ ],[
+ EXCEPTION_DISPOSITION x;
+ ],
+ tcl_cv_eh_disposition=yes,
+ tcl_cv_eh_disposition=no)
+ )
+ if test "$tcl_cv_eh_disposition" = "no" ; then
+ AC_DEFINE(EXCEPTION_DISPOSITION, int,
+ [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
+ fi
+
+ # Check to see if winnt.h defines CHAR, SHORT, and LONG
+ # even if VOID has already been #defined. The win32api
+ # used by mingw and cygwin is known to do this.
+
+ AC_CACHE_CHECK(for winnt.h that ignores VOID define,
+ tcl_cv_winnt_ignore_void,
+ AC_TRY_COMPILE([
+#define VOID void
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
+ ], [
+ CHAR c;
+ SHORT s;
+ LONG l;
+ ],
+ tcl_cv_winnt_ignore_void=yes,
+ tcl_cv_winnt_ignore_void=no)
+ )
+ if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
+ AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
+ [Defined when cygwin/mingw ignores VOID define in winnt.h])
+ fi
+ fi
+
+ # See if the compiler supports casting to a union type.
+ # This is used to stop gcc from printing a compiler
+ # warning when initializing a union member.
+
+ AC_CACHE_CHECK(for cast to union support,
+ tcl_cv_cast_to_union,
+ AC_TRY_COMPILE([],
+ [
+ union foo { int i; double d; };
+ union foo f = (union foo) (int) 0;
+ ],
+ tcl_cv_cast_to_union=yes,
+ tcl_cv_cast_to_union=no)
+ )
+ if test "$tcl_cv_cast_to_union" = "yes"; then
+ AC_DEFINE(HAVE_CAST_TO_UNION, 1,
+ [Defined when compiler supports casting to union type.])
+ fi
+
+ AC_SUBST(CFLAGS_DEBUG)
+ AC_SUBST(CFLAGS_OPTIMIZE)
+ AC_SUBST(CFLAGS_WARNING)
+
+ AC_SUBST(STLIB_LD)
+ AC_SUBST(SHLIB_LD)
+
+ AC_SUBST(SHLIB_LD_LIBS)
+ AC_SUBST(SHLIB_CFLAGS)
+
+ AC_SUBST(LD_LIBRARY_PATH_VAR)
+
+ # These must be called after we do the basic CFLAGS checks and
+ # verify any possible 64-bit or similar switches are necessary
+ TEA_TCL_EARLY_FLAGS
+ TEA_TCL_64BIT_FLAGS
+])
+
+#--------------------------------------------------------------------
+# TEA_SERIAL_PORT
+#
+# Determine which interface to use to talk to the serial port.
+# Note that #include lines must begin in leftmost column for
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
+# USE_TERMIOS
+# USE_TERMIO
+# USE_SGTTY
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_SERIAL_PORT], [
+ AC_CHECK_HEADERS(sys/modem.h)
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
+ AC_TRY_RUN([
+#include <termios.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termio.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
+ termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
+ sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_MISSING_POSIX_HEADERS
+#
+# Supply substitutes for missing POSIX header files. Special
+# notes:
+# - stdlib.h doesn't define strtol, strtoul, or
+# strtod in some versions of SunOS
+# - some versions of string.h don't declare procedures such
+# as strstr
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# NO_DIRENT_H
+# NO_ERRNO_H
+# NO_VALUES_H
+# HAVE_LIMITS_H or NO_LIMITS_H
+# NO_STDLIB_H
+# NO_STRING_H
+# NO_SYS_WAIT_H
+# NO_DLFCN_H
+# HAVE_SYS_PARAM_H
+#
+# HAVE_STRING_H ?
+#
+# tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
+# CHECK on limits.h
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
+ AC_TRY_LINK([#include <sys/types.h>
+#include <dirent.h>], [
+#ifndef _POSIX_SOURCE
+# ifdef __Lynx__
+ /*
+ * Generate compilation error to make the test fail: Lynx headers
+ * are only valid if really in the POSIX environment.
+ */
+
+ missing_procedure();
+# endif
+#endif
+DIR *d;
+struct dirent *entryPtr;
+char *p;
+d = opendir("foobar");
+entryPtr = readdir(d);
+p = entryPtr->d_name;
+closedir(d);
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
+
+ if test $tcl_cv_dirent_h = no; then
+ AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
+ fi
+
+ # TEA specific:
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
+ AC_CHECK_HEADER(limits.h,
+ [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
+ [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
+ fi
+ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
+ AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
+ AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
+
+ # See also memmove check below for a place where NO_STRING_H can be
+ # set and why.
+
+ if test $tcl_ok = 0; then
+ AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
+ fi
+
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
+
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
+ AC_HAVE_HEADERS(sys/param.h)
+])
+
+#--------------------------------------------------------------------
+# TEA_PATH_X
+#
+# Locate the X11 header files and the X11 library archive. Try
+# the ac_path_x macro first, but if it doesn't find the X stuff
+# (e.g. because there's no xmkmf program) then check through
+# a list of possible directories. Under some conditions the
+# autoconf macro will return an include directory that contains
+# no include files, so double-check its result just to be safe.
+#
+# This should be called after TEA_CONFIG_CFLAGS as setting the
+# LIBS line can confuse some configure macro magic.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets the following vars:
+# XINCLUDES
+# XLIBSW
+# PKG_LIBS (appends to)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_X], [
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
+ TEA_PATH_UNIX_X
+ fi
+])
+
+AC_DEFUN([TEA_PATH_UNIX_X], [
+ AC_PATH_X
+ not_really_there=""
+ if test "$no_x" = ""; then
+ if test "$x_includes" = ""; then
+ AC_TRY_CPP([#include <X11/Xlib.h>], , not_really_there="yes")
+ else
+ if test ! -r $x_includes/X11/Xlib.h; then
+ not_really_there="yes"
+ fi
+ fi
+ fi
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
+ AC_MSG_CHECKING([for X11 header files])
+ found_xincludes="no"
+ AC_TRY_CPP([#include <X11/Xlib.h>], found_xincludes="yes", found_xincludes="no")
+ if test "$found_xincludes" = "no"; then
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
+ for i in $dirs ; do
+ if test -r $i/X11/Xlib.h; then
+ AC_MSG_RESULT([$i])
+ XINCLUDES=" -I$i"
+ found_xincludes="yes"
+ break
+ fi
+ done
+ fi
+ else
+ if test "$x_includes" != ""; then
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
+ fi
+ fi
+ if test "$found_xincludes" = "no"; then
+ AC_MSG_RESULT([couldn't find any!])
+ fi
+
+ if test "$no_x" = yes; then
+ AC_MSG_CHECKING([for X11 libraries])
+ XLIBSW=nope
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
+ for i in $dirs ; do
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then
+ AC_MSG_RESULT([$i])
+ XLIBSW="-L$i -lX11"
+ x_libraries="$i"
+ break
+ fi
+ done
+ else
+ if test "$x_libraries" = ""; then
+ XLIBSW=-lX11
+ else
+ XLIBSW="-L$x_libraries -lX11"
+ fi
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
+ fi
+ if test "$XLIBSW" = nope ; then
+ AC_MSG_RESULT([could not find any! Using -lX11.])
+ XLIBSW=-lX11
+ fi
+ # TEA specific:
+ if test x"${XLIBSW}" != x ; then
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BLOCKING_STYLE
+#
+# The statements below check for systems where POSIX-style
+# non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
+# On these systems (mostly older ones), use the old BSD-style
+# FIONBIO approach instead.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# HAVE_SYS_IOCTL_H
+# HAVE_SYS_FILIO_H
+# USE_FIONBIO
+# O_NONBLOCK
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BLOCKING_STYLE], [
+ AC_CHECK_HEADERS(sys/ioctl.h)
+ AC_CHECK_HEADERS(sys/filio.h)
+ TEA_CONFIG_SYSTEM
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
+ case $system in
+ OSF*)
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
+ AC_MSG_RESULT([FIONBIO])
+ ;;
+ *)
+ AC_MSG_RESULT([O_NONBLOCK])
+ ;;
+ esac
+])
+
+#--------------------------------------------------------------------
+# TEA_TIME_HANDLER
+#
+# Checks how the system deals with time.h, what time structures
+# are used on the system, and what fields the structures have.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines some of the following vars:
+# USE_DELTA_FOR_TZ
+# HAVE_TM_GMTOFF
+# HAVE_TM_TZADJ
+# HAVE_TIMEZONE_VAR
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TIME_HANDLER], [
+ AC_CHECK_HEADERS(sys/time.h)
+ AC_HEADER_TIME
+ AC_STRUCT_TIMEZONE
+
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
+
+ AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
+ if test $tcl_cv_member_tm_tzadj = yes ; then
+ AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
+ fi
+
+ AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
+ AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
+ fi
+
+ #
+ # Its important to include time.h in this check, as some systems
+ # (like convex) have timezone functions, etc.
+ #
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern long timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
+ if test $tcl_cv_timezone_long = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ else
+ #
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
+ if test $tcl_cv_timezone_time = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_BUGGY_STRTOD
+#
+# Under Solaris 2.4, strtod returns the wrong value for the
+# terminating character under some conditions. Check for this
+# and if the problem exists use a substitute procedure
+# "fixstrtod" (provided by Tcl) that corrects the error.
+# Also, on Compaq's Tru64 Unix 5.0,
+# strtod(" ") returns 0.0 instead of a failure to convert.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Might defines some of the following vars:
+# strtod (=fixstrtod)
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_BUGGY_STRTOD], [
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
+ if test "$tcl_strtod" = 1; then
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
+ tcl_cv_strtod_buggy=buggy)])
+ if test "$tcl_cv_strtod_buggy" = buggy; then
+ AC_LIBOBJ([fixstrtod])
+ USE_COMPAT=1
+ AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
+ fi
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_LINK_LIBS
+#
+# Search for the libraries needed to link the Tcl shell.
+# Things like the math library (-lm) and socket stuff (-lsocket vs.
+# -lnsl) are dealt with here.
+#
+# Arguments:
+# Requires the following vars to be set in the Makefile:
+# DL_LIBS (not in TEA, only needed in core)
+# LIBS
+# MATH_LIBS
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_LIBS
+# MATH_LIBS
+#
+# Might append to the following vars:
+# LIBS
+#
+# Might define the following vars:
+# HAVE_NET_ERRNO_H
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_LINK_LIBS], [
+ #--------------------------------------------------------------------
+ # On a few very rare systems, all of the libm.a stuff is
+ # already in libc.a. Set compiler flags accordingly.
+ # Also, Linux requires the "ieee" library for math to work
+ # right (and it must appear before "-lm").
+ #--------------------------------------------------------------------
+
+ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
+
+ #--------------------------------------------------------------------
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
+ # needs net/errno.h to define the socket-related error codes.
+ #--------------------------------------------------------------------
+
+ AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
+ AC_CHECK_HEADER(net/errno.h, [
+ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
+
+ #--------------------------------------------------------------------
+ # Check for the existence of the -lsocket and -lnsl libraries.
+ # The order here is important, so that they end up in the right
+ # order in the command line generated by make. Here are some
+ # special considerations:
+ # 1. Use "connect" and "accept" to check for -lsocket, and
+ # "gethostbyname" to check for -lnsl.
+ # 2. Use each function name only once: can't redo a check because
+ # autoconf caches the results of the last check and won't redo it.
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
+ # aren't already present in the normal libraries. This is because
+ # IRIX 5.2 has libraries, but they aren't needed and they're
+ # bogus: they goof up name resolution if used.
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
+ # To get around this problem, check for both libraries together
+ # if -lsocket doesn't work by itself.
+ #--------------------------------------------------------------------
+
+ tcl_checkBoth=0
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
+ if test "$tcl_checkSocket" = 1; then
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
+ fi
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
+ [LIBS="$LIBS -lnsl"])])
+
+ # TEA specific: Don't perform the eval of the libraries here because
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
+
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
+ AC_SUBST(TCL_LIBS)
+ AC_SUBST(MATH_LIBS)
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_EARLY_FLAGS
+#
+# Check for what flags are needed to be passed so the correct OS
+# features are available.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# _ISOC99_SOURCE
+# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_EARLY_FLAG],[
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
+ AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
+ tcl_flags="$tcl_flags $1"
+ fi
+])
+
+AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
+ AC_MSG_CHECKING([for required early compiler flags])
+ tcl_flags=""
+ TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
+ TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
+ [char *p = (char *)open64;])
+ if test "x${tcl_flags}" = "x" ; then
+ AC_MSG_RESULT([none])
+ else
+ AC_MSG_RESULT([${tcl_flags}])
+ fi
+])
+
+#--------------------------------------------------------------------
+# TEA_TCL_64BIT_FLAGS
+#
+# Check for what is defined in the way of 64-bit features.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# TCL_WIDE_INT_IS_LONG
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_STAT64
+# HAVE_TYPE_OFF64_T
+#--------------------------------------------------------------------
+
+AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
+ AC_MSG_CHECKING([for 64-bit integer type])
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
+ tcl_cv_type_64bit=none
+ # See if the compiler knows natively about __int64
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
+ # See if we should use long anyway Note that we substitute in the
+ # type that is our current guess for a 64-bit type inside this check
+ # program, so it should be modified only carefully...
+ AC_TRY_COMPILE(,[switch (0) {
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
+ if test "${tcl_cv_type_64bit}" = none ; then
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
+ AC_MSG_RESULT([using long])
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
+ -a "${TEA_PLATFORM}" = "windows" ; then
+ # TEA specific: We actually want to use the default tcl.h checks in
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
+ AC_MSG_RESULT([using Tcl header defaults])
+ else
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
+ [What type should be used to define wide integers?])
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
+
+ # Now check for auxiliary declarations
+ AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
+ fi
+
+ AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
+ fi
+
+ AC_CHECK_FUNCS(open64 lseek64)
+ AC_MSG_CHECKING([for off64_t])
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
+ dnl functions lseek64 and open64 are defined.
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
+ test "x${ac_cv_func_open64}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ fi
+])
+
+##
+## Here ends the standard Tcl configuration bits and starts the
+## TEA specific functions
+##
+
+#------------------------------------------------------------------------
+# TEA_INIT --
+#
+# Init various Tcl Extension Architecture (TEA) variables.
+# This should be the first called TEA_* macro.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Defines and substs the following vars:
+# CYGPATH
+# EXEEXT
+# Defines only:
+# TEA_VERSION
+# TEA_INITED
+# TEA_PLATFORM (windows or unix)
+#
+# "cygpath" is used on windows to generate native path names for include
+# files. These variables should only be used with the compiler and linker
+# since they generate native path names.
+#
+# EXEEXT
+# Select the executable extension based on the host type. This
+# is a lightweight replacement for AC_EXEEXT that doesn't require
+# a compiler.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_INIT], [
+ # TEA extensions pass this us the version of TEA they think they
+ # are compatible with.
+ TEA_VERSION="3.9"
+
+ AC_MSG_CHECKING([for correct TEA configuration])
+ if test x"${PACKAGE_NAME}" = x ; then
+ AC_MSG_ERROR([
+The PACKAGE_NAME variable must be defined by your TEA configure.in])
+ fi
+ if test x"$1" = x ; then
+ AC_MSG_ERROR([
+TEA version not specified.])
+ elif test "$1" != "${TEA_VERSION}" ; then
+ AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
+ else
+ AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
+ fi
+
+ # If the user did not set CFLAGS, set it now to keep macros
+ # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2".
+ if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+ fi
+
+ case "`uname -s`" in
+ *win32*|*WIN32*|*MINGW32_*)
+ AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *CYGWIN_*)
+ CYGPATH=echo
+ EXEEXT=".exe"
+ # TEA_PLATFORM is determined later in LOAD_TCLCONFIG
+ ;;
+ *)
+ CYGPATH=echo
+ # Maybe we are cross-compiling....
+ case ${host_alias} in
+ *mingw32*)
+ EXEEXT=".exe"
+ TEA_PLATFORM="windows"
+ ;;
+ *)
+ EXEEXT=""
+ TEA_PLATFORM="unix"
+ ;;
+ esac
+ ;;
+ esac
+
+ # Check if exec_prefix is set. If not use fall back to prefix.
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
+ # This is needed for recursive configures, since autoconf propagates
+ # $prefix, but not $exec_prefix (doh!).
+ if test x$exec_prefix = xNONE ; then
+ exec_prefix_default=yes
+ exec_prefix=$prefix
+ fi
+
+ AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}])
+
+ AC_SUBST(EXEEXT)
+ AC_SUBST(CYGPATH)
+
+ # This package name must be replaced statically for AC_SUBST to work
+ AC_SUBST(PKG_LIB_FILE)
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
+ AC_SUBST(PKG_STUB_LIB_FILE)
+
+ # We AC_SUBST these here to ensure they are subst'ed,
+ # in case the user doesn't call TEA_ADD_...
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+ AC_SUBST(PKG_TCL_SOURCES)
+ AC_SUBST(PKG_HEADERS)
+ AC_SUBST(PKG_INCLUDES)
+ AC_SUBST(PKG_LIBS)
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_SOURCES
+# PKG_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ case $i in
+ [\$]*)
+ # allow $-var names
+ PKG_SOURCES="$PKG_SOURCES $i"
+ PKG_OBJECTS="$PKG_OBJECTS $i"
+ ;;
+ *)
+ # check for existence - allows for generic/win/unix VPATH
+ # To add more dirs here (like 'src'), you have to update VPATH
+ # in Makefile.in as well
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find source file '$i'])
+ fi
+ PKG_SOURCES="$PKG_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_OBJECTS="$PKG_OBJECTS $j"
+ ;;
+ esac
+ done
+ AC_SUBST(PKG_SOURCES)
+ AC_SUBST(PKG_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_STUB_SOURCES --
+#
+# Specify one or more source files. Users should check for
+# the right platform before adding to their list.
+# It is not important to specify the directory, as long as it is
+# in the generic, win or unix subdirectory of $(srcdir).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_STUB_SOURCES
+# PKG_STUB_OBJECTS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_STUB_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence - allows for generic/win/unix VPATH
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
+ -a ! -f "${srcdir}/macosx/$i" \
+ ; then
+ AC_MSG_ERROR([could not find stub source file '$i'])
+ fi
+ PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
+ # this assumes it is in a VPATH dir
+ i=`basename $i`
+ # handle user calling this before or after TEA_SETUP_COMPILER
+ if test x"${OBJEXT}" != x ; then
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
+ else
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
+ fi
+ PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
+ done
+ AC_SUBST(PKG_STUB_SOURCES)
+ AC_SUBST(PKG_STUB_OBJECTS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_TCL_SOURCES --
+#
+# Specify one or more Tcl source files. These should be platform
+# independent runtime files.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_TCL_SOURCES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_TCL_SOURCES], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
+ fi
+ PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
+ done
+ AC_SUBST(PKG_TCL_SOURCES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_HEADERS --
+#
+# Specify one or more source headers. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_HEADERS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_HEADERS], [
+ vars="$@"
+ for i in $vars; do
+ # check for existence, be strict because it is installed
+ if test ! -f "${srcdir}/$i" ; then
+ AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
+ fi
+ PKG_HEADERS="$PKG_HEADERS $i"
+ done
+ AC_SUBST(PKG_HEADERS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_INCLUDES --
+#
+# Specify one or more include dirs. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_INCLUDES
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_INCLUDES], [
+ vars="$@"
+ for i in $vars; do
+ PKG_INCLUDES="$PKG_INCLUDES $i"
+ done
+ AC_SUBST(PKG_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_LIBS --
+#
+# Specify one or more libraries. Users should check for
+# the right platform before adding to their list. For Windows,
+# libraries provided in "foo.lib" format will be converted to
+# "-lfoo" when using GCC (mingw).
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_LIBS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_LIBS], [
+ vars="$@"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
+ i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+ AC_SUBST(PKG_LIBS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CFLAGS --
+#
+# Specify one or more CFLAGS. Users should check for
+# the right platform before adding to their list.
+#
+# Arguments:
+# one or more file names
+#
+# Results:
+#
+# Defines and substs the following vars:
+# PKG_CFLAGS
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CFLAGS], [
+ PKG_CFLAGS="$PKG_CFLAGS $@"
+ AC_SUBST(PKG_CFLAGS)
+])
+
+#------------------------------------------------------------------------
+# TEA_ADD_CLEANFILES --
+#
+# Specify one or more CLEANFILES.
+#
+# Arguments:
+# one or more file names to clean target
+#
+# Results:
+#
+# Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_ADD_CLEANFILES], [
+ CLEANFILES="$CLEANFILES $@"
+])
+
+#------------------------------------------------------------------------
+# TEA_PREFIX --
+#
+# Handle the --prefix=... option by defaulting to what Tcl gave
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# If --prefix or --exec-prefix was not specified, $prefix and
+# $exec_prefix will be set to the values given to Tcl when it was
+# configured.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_PREFIX], [
+ if test "${prefix}" = "NONE"; then
+ prefix_default=yes
+ if test x"${TCL_PREFIX}" != x; then
+ AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
+ prefix=${TCL_PREFIX}
+ else
+ AC_MSG_NOTICE([--prefix defaulting to /usr/local])
+ prefix=/usr/local
+ fi
+ fi
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
+ -o x"${exec_prefix_default}" = x"yes" ; then
+ if test x"${TCL_EXEC_PREFIX}" != x; then
+ AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
+ exec_prefix=${TCL_EXEC_PREFIX}
+ else
+ AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
+ exec_prefix=$prefix
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER_CC --
+#
+# Do compiler checks the way we want. This is just a replacement
+# for AC_PROG_CC in TEA configure.in files to make them cleaner.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER_CC], [
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
+
+ AC_PROG_CC
+ AC_PROG_CPP
+
+ INSTALL="\$(SHELL) \$(srcdir)/tclconfig/install-sh -c"
+ AC_SUBST(INSTALL)
+
+ #--------------------------------------------------------------------
+ # Checks to see if the make program sets the $MAKE variable.
+ #--------------------------------------------------------------------
+
+ AC_PROG_MAKE_SET
+
+ #--------------------------------------------------------------------
+ # Find ranlib
+ #--------------------------------------------------------------------
+
+ AC_CHECK_TOOL(RANLIB, ranlib)
+
+ #--------------------------------------------------------------------
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
+ #--------------------------------------------------------------------
+
+ AC_OBJEXT
+ AC_EXEEXT
+])
+
+#------------------------------------------------------------------------
+# TEA_SETUP_COMPILER --
+#
+# Do compiler checks that use the compiler. This must go after
+# TEA_SETUP_COMPILER_CC, which does the actual compiler check.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Sets up CC var and other standard bits we need to make executables.
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_SETUP_COMPILER], [
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
+ AC_REQUIRE([TEA_SETUP_COMPILER_CC])
+
+ #------------------------------------------------------------------------
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
+ # It makes compiling go faster. (This is only a performance feature.)
+ #------------------------------------------------------------------------
+
+ if test -z "$no_pipe" -a -n "$GCC"; then
+ AC_CACHE_CHECK([if the compiler understands -pipe],
+ tcl_cv_cc_pipe, [
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
+ AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
+ CFLAGS=$hold_cflags])
+ if test $tcl_cv_cc_pipe = yes; then
+ CFLAGS="$CFLAGS -pipe"
+ fi
+ fi
+
+ #--------------------------------------------------------------------
+ # Common compiler flag setup
+ #--------------------------------------------------------------------
+
+ AC_C_BIGENDIAN
+ if test "${TEA_PLATFORM}" = "unix" ; then
+ TEA_TCL_LINK_LIBS
+ TEA_MISSING_POSIX_HEADERS
+ # Let the user call this, because if it triggers, they will
+ # need a compat/strtod.c that is correct. Users can also
+ # use Tcl_GetDouble(FromObj) instead.
+ #TEA_BUGGY_STRTOD
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_MAKE_LIB --
+#
+# Generate a line that can be used to build a shared/unshared library
+# in a platform independent manner.
+#
+# Arguments:
+# none
+#
+# Requires:
+#
+# Results:
+#
+# Defines the following vars:
+# CFLAGS - Done late here to note disturb other AC macros
+# MAKE_LIB - Command to execute to build the Tcl library;
+# differs depending on whether or not Tcl is being
+# compiled as a shared library.
+# MAKE_SHARED_LIB Makefile rule for building a shared library
+# MAKE_STATIC_LIB Makefile rule for building a static library
+# MAKE_STUB_LIB Makefile rule for building a stub library
+# VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL
+# VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_MAKE_LIB], [
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
+ AC_EGREP_CPP([manifest needed], [
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+print("manifest needed")
+#endif
+ ], [
+ # Could do a CHECK_PROG for mt, but should always be with MSVC8+
+ VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi"
+ VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi"
+ MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}"
+ TEA_ADD_CLEANFILES([*.manifest])
+ ])
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
+ else
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
+ MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
+ fi
+
+ if test "${SHARED_BUILD}" = "1" ; then
+ MAKE_LIB="${MAKE_SHARED_LIB} "
+ else
+ MAKE_LIB="${MAKE_STATIC_LIB} "
+ fi
+
+ #--------------------------------------------------------------------
+ # Shared libraries and static libraries have different names.
+ # Use the double eval to make sure any variables in the suffix is
+ # substituted. (@@@ Might not be necessary anymore)
+ #--------------------------------------------------------------------
+
+ if test "${TEA_PLATFORM}" = "windows" ; then
+ if test "${SHARED_BUILD}" = "1" ; then
+ # We force the unresolved linking of symbols that are really in
+ # the private libraries of Tcl and Tk.
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
+ fi
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ else
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ if test "$GCC" = "yes"; then
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+ fi
+ # These aren't needed on Windows (either MSVC or gcc)
+ RANLIB=:
+ RANLIB_STUB=:
+ else
+ RANLIB_STUB="${RANLIB}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
+ if test x"${TK_BIN_DIR}" != x ; then
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
+ fi
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
+ RANLIB=:
+ else
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
+ fi
+ # Some packages build their own stubs libraries
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+ fi
+
+ # These are escaped so that only CFLAGS is picked up at configure time.
+ # The other values will be substituted at make time.
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
+ if test "${SHARED_BUILD}" = "1" ; then
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
+ fi
+
+ AC_SUBST(MAKE_LIB)
+ AC_SUBST(MAKE_SHARED_LIB)
+ AC_SUBST(MAKE_STATIC_LIB)
+ AC_SUBST(MAKE_STUB_LIB)
+ AC_SUBST(RANLIB_STUB)
+ AC_SUBST(VC_MANIFEST_EMBED_DLL)
+ AC_SUBST(VC_MANIFEST_EMBED_EXE)
+])
+
+#------------------------------------------------------------------------
+# TEA_LIB_SPEC --
+#
+# Compute the name of an existing object library located in libdir
+# from the given base name and produce the appropriate linker flags.
+#
+# Arguments:
+# basename The base name of the library without version
+# numbers, extensions, or "lib" prefixes.
+# extra_dir Extra directory in which to search for the
+# library. This location is used first, then
+# $prefix/$exec-prefix, then some defaults.
+#
+# Requires:
+# TEA_INIT and TEA_PREFIX must be called first.
+#
+# Results:
+#
+# Defines the following vars:
+# ${basename}_LIB_NAME The computed library name.
+# ${basename}_LIB_SPEC The computed linker flags.
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LIB_SPEC], [
+ AC_MSG_CHECKING([for $1 library])
+
+ # Look in exec-prefix for the library (defined by TEA_PREFIX).
+
+ tea_lib_name_dir="${exec_prefix}/lib"
+
+ # Or in a user-specified location.
+
+ if test x"$2" != x ; then
+ tea_extra_lib_dir=$2
+ else
+ tea_extra_lib_dir=NONE
+ fi
+
+ for i in \
+ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \
+ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
+ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
+ if test -f "$i" ; then
+ tea_lib_name_dir=`dirname $i`
+ $1_LIB_NAME=`basename $i`
+ $1_LIB_PATH_NAME=$i
+ break
+ fi
+ done
+
+ if test "${TEA_PLATFORM}" = "windows"; then
+ $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
+ else
+ # Strip off the leading "lib" and trailing ".a" or ".so"
+
+ tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
+ $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
+ fi
+
+ if test "x${$1_LIB_NAME}" = x ; then
+ AC_MSG_ERROR([not found])
+ else
+ AC_MSG_RESULT([${$1_LIB_SPEC}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TCL_HEADERS --
+#
+# Locate the private Tcl include files
+#
+# Arguments:
+#
+# Requires:
+# TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TCL_TOP_DIR_NATIVE
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
+ # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh}
+ AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS])
+ AC_MSG_CHECKING([for Tcl private include files])
+
+ TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
+ TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
+
+ # Check to see if tcl<Plat>Port.h isn't already with the public headers
+ # Don't look for tclInt.h because that resides with tcl.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tclh}/tclWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tclh}/tclUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
+ else
+ TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TCL_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ if test -d "${TCL_BIN_DIR}/Headers" -a \
+ -d "${TCL_BIN_DIR}/PrivateHeaders"; then
+ TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"
+ else
+ TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TCL_INCLUDES}"
+ else
+ if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
+ fi
+ result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TCL_TOP_DIR_NATIVE)
+
+ AC_SUBST(TCL_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TCL_HEADERS --
+#
+# Locate the installed public Tcl header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tclinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TCL_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
+ AC_MSG_CHECKING([for Tcl public headers])
+
+ AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tclh, [
+ # Use the value from --with-tclinclude, if it was given
+
+ if test x"${with_tclinclude}" != x ; then
+ if test -f "${with_tclinclude}/tcl.h" ; then
+ ac_cv_c_tclh=${with_tclinclude}
+ else
+ AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tcl was built as a framework, attempt to use
+ # the framework's Headers directory
+ case ${TCL_DEFS} in
+ *TCL_FRAMEWORK*)
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tcl is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tcl.h" ; then
+ ac_cv_c_tclh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tclh}" = x ; then
+ AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tclh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
+
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TCL_INCLUDES)
+])
+
+#------------------------------------------------------------------------
+# TEA_PRIVATE_TK_HEADERS --
+#
+# Locate the private Tk include files
+#
+# Arguments:
+#
+# Requires:
+# TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
+# already been called.
+#
+# Results:
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
+ # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh}
+ AC_REQUIRE([TEA_PUBLIC_TK_HEADERS])
+ AC_MSG_CHECKING([for Tk private include files])
+
+ TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
+ TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
+
+ # Check to see if tk<Plat>Port.h isn't already with the public headers
+ # Don't look for tkInt.h because that resides with tk.h in the core
+ # sources, but the <plat>Port headers are in a different directory
+ if test "${TEA_PLATFORM}" = "windows" -a \
+ -f "${ac_cv_c_tkh}/tkWinPort.h"; then
+ result="private headers found with public headers"
+ elif test "${TEA_PLATFORM}" = "unix" -a \
+ -f "${ac_cv_c_tkh}/tkUnixPort.h"; then
+ result="private headers found with public headers"
+ else
+ TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
+ TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
+ if test "${TEA_PLATFORM}" = "windows"; then
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
+ else
+ TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
+ fi
+ # Overwrite the previous TK_INCLUDES as this should capture both
+ # public and private headers in the same set.
+ # We want to ensure these are substituted so as not to require
+ # any *_NATIVE vars be defined in the Makefile
+ TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
+ # Detect and add ttk subdir
+ if test -d "${TK_SRC_DIR}/generic/ttk"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\""
+ fi
+ if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\""
+ fi
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers and PrivateHeaders directories
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ if test -d "${TK_BIN_DIR}/Headers" -a \
+ -d "${TK_BIN_DIR}/PrivateHeaders"; then
+ TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"
+ else
+ TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
+ fi
+ ;;
+ esac
+ result="Using ${TK_INCLUDES}"
+ else
+ if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
+ AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
+ fi
+ result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}"
+ fi
+ fi
+
+ AC_SUBST(TK_TOP_DIR_NATIVE)
+ AC_SUBST(TK_XLIB_DIR_NATIVE)
+
+ AC_SUBST(TK_INCLUDES)
+ AC_MSG_RESULT([${result}])
+])
+
+#------------------------------------------------------------------------
+# TEA_PUBLIC_TK_HEADERS --
+#
+# Locate the installed public Tk header files
+#
+# Arguments:
+# None.
+#
+# Requires:
+# CYGPATH must be set
+#
+# Results:
+#
+# Adds a --with-tkinclude switch to configure.
+# Result is cached.
+#
+# Substitutes the following vars:
+# TK_INCLUDES
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
+ AC_MSG_CHECKING([for Tk public headers])
+
+ AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval})
+
+ AC_CACHE_VAL(ac_cv_c_tkh, [
+ # Use the value from --with-tkinclude, if it was given
+
+ if test x"${with_tkinclude}" != x ; then
+ if test -f "${with_tkinclude}/tk.h" ; then
+ ac_cv_c_tkh=${with_tkinclude}
+ else
+ AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
+ fi
+ else
+ list=""
+ if test "`uname -s`" = "Darwin"; then
+ # If Tk was built as a framework, attempt to use
+ # the framework's Headers directory.
+ case ${TK_DEFS} in
+ *TK_FRAMEWORK*)
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
+ ;;
+ esac
+ fi
+
+ # Look in the source dir only if Tk is not installed,
+ # and in that situation, look there before installed locations.
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
+ fi
+
+ # Check order: pkg --prefix location, Tk's --prefix location,
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
+ # relative to directory of tclConfig.sh.
+
+ eval "temp_includedir=${includedir}"
+ list="$list \
+ `ls -d ${temp_includedir} 2>/dev/null` \
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
+ list="$list /usr/local/include /usr/include"
+ if test x"${TK_INCLUDE_SPEC}" != x ; then
+ d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'`
+ list="$list `ls -d ${d} 2>/dev/null`"
+ fi
+ fi
+ for i in $list ; do
+ if test -f "$i/tk.h" ; then
+ ac_cv_c_tkh=$i
+ break
+ fi
+ done
+ fi
+ ])
+
+ # Print a message based on how we determined the include path
+
+ if test x"${ac_cv_c_tkh}" = x ; then
+ AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
+ else
+ AC_MSG_RESULT([${ac_cv_c_tkh}])
+ fi
+
+ # Convert to a native path and substitute into the output files.
+
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
+
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+
+ AC_SUBST(TK_INCLUDES)
+
+ if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then
+ # On Windows and Aqua, we need the X compat headers
+ AC_MSG_CHECKING([for X11 header files])
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
+ AC_SUBST(TK_XINCLUDES)
+ fi
+ AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_PATH_CONFIG --
+#
+# Locate the ${1}Config.sh file and perform a sanity check on
+# the ${1} compile flags. These are used by packages like
+# [incr Tk] that load *Config.sh files from more than Tcl and Tk.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-$1=...
+#
+# Defines the following vars:
+# $1_BIN_DIR Full path to the directory containing
+# the $1Config.sh file
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CONFIG], [
+ #
+ # Ok, lets find the $1 configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-$1
+ #
+
+ if test x"${no_$1}" = x ; then
+ # we reset no_$1 in case something fails here
+ no_$1=true
+ AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
+ AC_MSG_CHECKING([for $1 configuration])
+ AC_CACHE_VAL(ac_cv_c_$1config,[
+
+ # First check to see if --with-$1 was specified.
+ if test x"${with_$1config}" != x ; then
+ case ${with_$1config} in
+ */$1Config.sh )
+ if test -f ${with_$1config}; then
+ AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
+ with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
+ fi;;
+ esac
+ if test -f "${with_$1config}/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
+ else
+ AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
+ fi
+ fi
+
+ # then check for a private $1 installation
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in \
+ ../$1 \
+ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../$1 \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ../../../$1 \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../$1 \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ if test -f "$i/unix/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_$1config}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/$1Config.sh" ; then
+ ac_cv_c_$1config=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+
+ if test x"${ac_cv_c_$1config}" = x ; then
+ $1_BIN_DIR="# no $1 configs found"
+ AC_MSG_WARN([Cannot find $1 configuration definitions])
+ exit 0
+ else
+ no_$1=
+ $1_BIN_DIR=${ac_cv_c_$1config}
+ AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
+ fi
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG --
+#
+# Load the $1Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1_BIN_DIR
+#
+# Results:
+#
+# Substitutes the following vars:
+# $1_SRC_DIR
+# $1_LIB_FILE
+# $1_LIB_SPEC
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_LOAD_CONFIG], [
+ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
+
+ if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
+ AC_MSG_RESULT([loading])
+ . "${$1_BIN_DIR}/$1Config.sh"
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+
+ #
+ # If the $1_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable $1_LIB_SPEC will be set to the value
+ # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
+ # instead of $1_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f "${$1_BIN_DIR}/Makefile" ; then
+ AC_MSG_WARN([Found Makefile - using build library specs for $1])
+ $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
+ $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
+ $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
+ $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
+ $1_LIBRARY_PATH=${$1_LIBRARY_PATH}
+ fi
+
+ AC_SUBST($1_VERSION)
+ AC_SUBST($1_BIN_DIR)
+ AC_SUBST($1_SRC_DIR)
+
+ AC_SUBST($1_LIB_FILE)
+ AC_SUBST($1_LIB_SPEC)
+
+ AC_SUBST($1_STUB_LIB_FILE)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ # Allow the caller to prevent this auto-check by specifying any 2nd arg
+ AS_IF([test "x$2" = x], [
+ # Check both upper and lower-case variants
+ # If a dev wanted non-stubs libs, this function could take an option
+ # to not use _STUB in the paths below
+ AS_IF([test "x${$1_STUB_LIB_SPEC}" = x],
+ [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)],
+ [TEA_LOAD_CONFIG_LIB($1_STUB)])
+ ])
+])
+
+#------------------------------------------------------------------------
+# TEA_LOAD_CONFIG_LIB --
+#
+# Helper function to load correct library from another extension's
+# ${PACKAGE}Config.sh.
+#
+# Results:
+# Adds to LIBS the appropriate extension library
+#------------------------------------------------------------------------
+AC_DEFUN([TEA_LOAD_CONFIG_LIB], [
+ AC_MSG_CHECKING([For $1 library for LIBS])
+ # This simplifies the use of stub libraries by automatically adding
+ # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
+ # but this is called before CONFIG_CFLAGS. More importantly, this adds
+ # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
+ if test "x${$1_LIB_SPEC}" != "x" ; then
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
+ TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"])
+ AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}])
+ else
+ TEA_ADD_LIBS([${$1_LIB_SPEC}])
+ AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}])
+ fi
+ else
+ AC_MSG_RESULT([file not found])
+ fi
+])
+
+#------------------------------------------------------------------------
+# TEA_EXPORT_CONFIG --
+#
+# Define the data to insert into the ${PACKAGE}Config.sh file
+#
+# Arguments:
+#
+# Requires the following vars to be set:
+# $1
+#
+# Results:
+# Substitutes the following vars:
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_EXPORT_CONFIG], [
+ #--------------------------------------------------------------------
+ # These are for $1Config.sh
+ #--------------------------------------------------------------------
+
+ # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
+ eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}"
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}"
+ else
+ eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
+ fi
+ $1_BUILD_LIB_SPEC="-L`pwd` ${$1_LIB_FLAG}"
+ $1_LIB_SPEC="-L${pkglibdir} ${$1_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_SPEC="-L`pwd` [$]{$1_STUB_LIB_FLAG}"
+ $1_STUB_LIB_SPEC="-L${pkglibdir} [$]{$1_STUB_LIB_FLAG}"
+ $1_BUILD_STUB_LIB_PATH="`pwd`/[$]{PKG_STUB_LIB_FILE}"
+ $1_STUB_LIB_PATH="${pkglibdir}/[$]{PKG_STUB_LIB_FILE}"
+
+ AC_SUBST($1_BUILD_LIB_SPEC)
+ AC_SUBST($1_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_SPEC)
+ AC_SUBST($1_STUB_LIB_SPEC)
+ AC_SUBST($1_BUILD_STUB_LIB_PATH)
+ AC_SUBST($1_STUB_LIB_PATH)
+
+ AC_SUBST(MAJOR_VERSION)
+ AC_SUBST(MINOR_VERSION)
+ AC_SUBST(PATCHLEVEL)
+])
+
+
+#------------------------------------------------------------------------
+# TEA_PATH_CELIB --
+#
+# Locate Keuchel's celib emulation layer for targeting Win/CE
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --with-celib=...
+#
+# Defines the following vars:
+# CELIB_DIR Full path to the directory containing
+# the include and platform lib files
+#------------------------------------------------------------------------
+
+AC_DEFUN([TEA_PATH_CELIB], [
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-celib
+
+ if test x"${no_celib}" = x ; then
+ # we reset no_celib in case something fails here
+ no_celib=true
+ AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
+ AC_MSG_CHECKING([for Windows/CE celib directory])
+ AC_CACHE_VAL(ac_cv_c_celibconfig,[
+ # First check to see if --with-celibconfig was specified.
+ if test x"${with_celibconfig}" != x ; then
+ if test -d "${with_celibconfig}/inc" ; then
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
+ else
+ AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
+ fi
+ fi
+
+ # then check for a celib library
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ for i in \
+ ../celib-palm-3.0 \
+ ../celib \
+ ../../celib-palm-3.0 \
+ ../../celib \
+ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../celib-palm-3.0 \
+ ${srcdir}/../celib \
+ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
+ ; do
+ if test -d "$i/inc" ; then
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+ ])
+ if test x"${ac_cv_c_celibconfig}" = x ; then
+ AC_MSG_ERROR([Cannot find celib support library directory])
+ else
+ no_celib=
+ CELIB_DIR=${ac_cv_c_celibconfig}
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
+ AC_MSG_RESULT([found $CELIB_DIR])
+ fi
+ fi
+])
+
+
+# Local Variables:
+# mode: autoconf
+# End: