/usr/share/saods9/src/stdfbox.tcl is in saods9-data 7.2+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | # Copyright (C) 1999-2012
# 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
switch $ds9(wm) {
x11 {}
win32 {set ds9(dialog,dir) [GetEnvHome]}
aqua {
switch -- $pds9(dialog) {
native {}
motif -
windows {
# try to determine if invoked from
# command line or double click
if {![info exists env(TERM)]} {
set ds9(dialog,dir) [GetEnvHome]
}
}
}
}
}
global fitsurl
set fitsurl {}
global fitsfbox
set fitsfbox(file) {ds9.fits}
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(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(types) [list \
[list {EPS} {*.eps}] \
]
global arrayfbox
set arrayfbox(file) {ds9.arr}
set arrayfbox(types) [list \
[list [::msgcat::mc {Array}] {*.arr}] \
]
global rgbarrayfbox
set rgbarrayfbox(file) {ds9.rgb}
set rgbarrayfbox(types) [list \
[list [::msgcat::mc {RGB Array}] {*.rgb}] \
]
global nrrdfbox
set nrrdfbox(file) {ds9.nrrd}
set nrrdfbox(types) [list \
[list {NRRD} {*.nrrd}] \
]
global giffbox
set giffbox(file) {ds9.gif}
set giffbox(types) [list \
[list {GIF} {*.gif}] \
]
global jpegfbox
set jpegfbox(file) {ds9.jpeg}
set jpegfbox(types) [list \
[list {JPEG} {*.jpeg}] \
[list {JPEG} {*.jpg}] \
]
global tifffbox
set tifffbox(file) {ds9.tiff}
set tifffbox(types) [list \
[list {TIFF} {*.tiff}] \
[list {TIFF} {*.tif}] \
]
global pngfbox
set pngfbox(file) {ds9.png}
set pngfbox(types) [list \
[list {PNG} {*.png}] \
]
global mpegfbox
set mpegfbox(file) {ds9.mpeg}
set mpegfbox(types) [list \
[list {MPEG} {*.mpeg}] \
[list {MPEG} {*.mpg}] \
]
global pixelfbox
set pixelfbox(file) {ds9.pix}
set pixelfbox(types) [list \
[list {PIX} {*.pix}] \
]
global markerfbox
set markerfbox(file) {ds9.reg}
set markerfbox(types) [list \
[list {REG} {*.reg}] \
[list {FITS} {*.fits}] \
[list {XML} {*.xml}] \
]
global templatefbox
set templatefbox(file) {ds9.tpl}
set templatefbox(types) \
[list [list {TPL} {*.tpl}] [list [::msgcat::mc {All}] {*}] ]
global colorbarfbox
set colorbarfbox(file) {ds9.sao}
set colorbarfbox(types) [list \
[list [::msgcat::mc {Colormap}] {*.sao}] \
[list [::msgcat::mc {Colormap}] {*.lut}] \
]
global contrastbiasfbox
set contrastbiasfbox(file) {ds9.cb}
set contrastbiasfbox(types) [list \
[list {CB} {*.cb}] \
]
global colortagfbox
set colortagfbox(file) {ds9.tag}
set colortagfbox(types) [list \
[list {Colortag} {*.tag}] \
]
global pssavfbox
set pssavfbox(file) {ds9.ps}
set pssavfbox(types) [list \
[list {PS} {*.ps}] \
]
global prsavfbox
set prsavfbox(file) {ds9.txt}
set prsavfbox(types) [list \
[list {TXT} {*.txt}] \
]
global contourfbox
set contourfbox(file) {ds9.con}
set contourfbox(types) [list \
[list {CON} {*.con}] \
]
global contourlevfbox
set contourlevfbox(file) {ds9.lev}
set contourlevfbox(types) [list \
[list {LEV} {*.lev}] \
]
global gridfbox
set gridfbox(file) {ds9.grd}
set gridfbox(types) [list \
[list {GRD} {*.grd}] \
]
global catfbox
set catfbox(file) {ds9.cat}
set catfbox(types) [list \
[list [::msgcat::mc {Catalog}] {*.cat}] \
[list [::msgcat::mc {Catalog}] {*.rdb}] \
]
global cattsvfbox
set cattsvfbox(file) {ds9.tsv}
set cattsvfbox(types) [list \
[list [::msgcat::mc {Catalog}] {*.tsv}] \
[list [::msgcat::mc {Catalog}] {*.csv}] \
]
global catvotfbox
set catvotfbox(file) {ds9.xml}
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(types) [list \
[list {FLT} {*.flt}] \
]
global catsymfbox
set catsymfbox(file) {ds9.sym}
set catsymfbox(types) [list \
[list {SYM} {*.sym}] \
]
global catcdssrchfbox
set catcdssrchfbox(file) {ds9.cds}
set catcdssrchfbox(types) [list \
[list {CDS} {*.cds}] \
]
global analysisfbox
set analysisfbox(file) {ds9.ans}
set analysisfbox(types) [list \
[list [::msgcat::mc {Analysis}] {*.ans}] \
[list [::msgcat::mc {Analysis}] {*.ds9}] \
]
global analysisparamfbox
set analysisparamfbox(file) {}
set analysisparamfbox(types) [list \
]
global apsavfbox
set apsavfbox(file) {ds9.ps}
set apsavfbox(types) [list \
[list {PS} {*.ps}] \
]
global apdatafbox
set apdatafbox(file) {ds9.dat}
set apdatafbox(types) [list \
[list {DAT} {*.dat}] \
]
global apconfigfbox
set apconfigfbox(file) {ds9.plt}
set apconfigfbox(types) [list \
[list {PLT} {*.plt}] \
]
global textfbox
set textfbox(file) {ds9.txt}
set textfbox(types) [list \
[list {TXT} {*.txt}] \
]
global tclfbox
set tclfbox(file) {ds9.tcl}
set tclfbox(types) [list \
[list {TCL} {*.tcl}] \
]
global hvhtmlfbox
set hvhtmlfbox(file) {ds9.html}
set hvhtmlfbox(types) [list \
[list {HTML} {*.html}] \
[list {HTML} {*.htm}] \
]
global wcsfbox
set wcsfbox(file) {ds9.wcs}
set wcsfbox(types) [list \
[list {WCS} {*.wcs}] \
]
global backupfbox
set backupfbox(file) {ds9.bck}
set backupfbox(types) [list \
[list {BCK} {*.bck}] \
]
}
proc SetFileLast {format item} {
global fitsfbox
global epsfbox
global arrayfbox
global rgbarrayfbox
global nrrdfbox
global giffbox
global tifffbox
global jpegfbox
global pngfbox
global mpegfbox
switch $format {
fits {FileLast fitsfbox $item}
eps {FileLast epsfbox $item}
rgbarray {FileLast rgbarrayfbox $item}
nrrd {FileLast nrrdfbox $item}
gif {FileLast giffbox $item}
tiff {FileLast tifffbox $item}
jpeg {FileLast jpegfbox $item}
png {FileLast pngfbox $item}
mpeg {FileLast mpegfbox $item}
}
}
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}
}
}
# 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 $ds9(dialog,dir) \
-initialfile $var(file) \
-parent $ds9(top)]
if {$result != {}} {
set var(file) [file tail $result]
set ds9(dialog,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 $ds9(dialog,dir) \
-initialfile $var(file) \
-parent $ds9(top)]
if {$result != {}} {
set var(file) [file tail $result]
set ds9(dialog,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 $ds9(dialog,dir) \
-initialfile $var(file) \
-parent $ds9(top)} result] {
# must have a bad file name, just clear and try again
set var(file) {}
set ds9(dialog,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 ds9(dialog,dir) [file dirname $result]
}
return $result
}
proc FileLast {varname fn} {
upvar #0 $varname var
set var(file) [file tail $fn]
}
proc FileLastFull {varname fn} {
upvar #0 $varname var
global ds9
set var(file) [file tail $fn]
set ds9(dialog,dir) [file dirname $fn]
}
|